diff --git a/xserver/ChangeLog b/xserver/ChangeLog index cf67c422e..f87054c58 100644 --- a/xserver/ChangeLog +++ b/xserver/ChangeLog @@ -1,36 +1,6880 @@ -commit 937391523eef6459d1f8b1ae25fe7e1f77b8a12a -Author: Kevin Brace -Date: Sat Mar 2 14:13:20 2019 -0800 +commit fbbdd5613122f0f7d74471f240c28e4c3b796065 +Author: Adam Jackson +Date: Thu May 30 14:07:06 2019 -0400 - xserver 1.19.7 + xserver 1.20.5 - Signed-off-by: Kevin Brace + Signed-off-by: Adam Jackson -commit a93f8f74b54accfb94a8c56357e566db76c24b22 -Author: Kevin Brace -Date: Sat Mar 2 14:10:41 2019 -0800 +commit 240868527bb11beb9a03ad0d3f24506f1b983729 +Author: Peter Hutterer +Date: Mon Mar 25 13:19:41 2019 +1000 + + dix: leave last.valuators alone on slave switch + + Terms: + dev->last.valuator[] is the last value given to us by the driver + dev->valuator.axisVal[] is the last value sent to the client + dev->last.scroll[] is the abs value of the scroll axis as given by the driver, + used for button emulation calculation (and the remainder) + + This function updates the device's last.valuator state based on the current + master axis state. This way, relative motion continues fluidly when switching + between devices. Before mouse 2 comes into effect, it's valuator state is + updated to wherever the pointer currently is so the relative event applies on + top of that. + + This can only work for x/y axes, all other axes aren't guaranteed to have the + same meaning and/or may not be present: + - xtest device: no valuator 2 + - mouse: valuator 2 is horizontal scroll axis + - tablet: valuator 2 is pressure + + Scaling the current value from the pressure range into the range for + horizontal scrolling makes no sense. And it causes scroll jumps: + + - scroll down, last.valuator == axisVal == 20 + - xdotool click 1, the XTest device doesn't have that valuator + - scroll up + - updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20) + - DeviceClassesChangedEvent includes value 20 for the axis + - event is processed, last.value changes from 0 to -1 + - axisVal is updated to -1, causing a jump of -21 + + The same applies when we switch from tablet to mouse wheel if the pressure + value is 0 on proximity out (basically guaranteed). So let's drop this code + altogether and only leave the scaling for the relative x/y motion. + + Signed-off-by: Peter Hutterer + (cherry picked from commit d7b1753d446ecde3ff58e3de39a634c3137473c8) + +commit 5bc29a67b8ab251048e0737eedcceb29bba25f5f +Author: Olivier Fourdan +Date: Fri Mar 8 18:19:16 2019 +0100 + + glamor: pixmap FBO may not be allocated + + If `_glamor_create_tex()` fails to allocate the FBO because of + GL_OUT_OF_MEMORY error, the `pixmap_priv->fbo` is NULL. + + However, `glamor_get_pixmap_texture()` doesn't actually check whether + the `pixmap_priv->fbo` is NULL and will segfault with a NULL pointer + dereference trying to access the `pixmap_priv->fbo->tex`. + + Signed-off-by: Olivier Fourdan + Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/647 + (Cherry picked from commit 74479a99ecf18fdfdafd033b5efd8d785dd12c28) + +commit d0c7483b3edadf3ff9c12b4b024abd7b11b34ef1 +Author: Peter Hutterer +Date: Fri Apr 5 12:39:00 2019 +0200 + + xwayland: fix a realloc OOM error case + + Found by coverity + + Signed-off-by: Peter Hutterer + (Cherry picked from commit 7c25439f0db4c20a4eab4ed44262eb396305f58a) + +commit bb74db6b38f7ff75ed52a900fa62a995e77aede4 +Author: Olivier Fourdan +Date: Fri Apr 5 12:33:28 2019 +0200 + + xwayland: search for a render node to use + + wl_drm's protocol "device" event provides the path to the DRM device, + which may not be a render node, thus causing Xwayland to fall back to + DRM authentication which may fail if the user has switched to another + VT while Xwayland is starting. + + Search for a render node corresponding to the given DRM device and try + to use it instead, as render nodes do not need DRM authentication and + Xwayland can make use of them if it can find one. + + Closes: https://bugs.freedesktop.org/108038 + Signed-off-by: Olivier Fourdan + (Cherry picked from commit 361894497c6802b62c2da4a3dc7e98939fb24404) + +commit 87491ced98705a14be2bb5a3ce7e41cb5ffc11d0 +Author: Michel Dänzer +Date: Mon Mar 25 12:32:48 2019 +0100 + + present/scmd: Check that the flip and screen pixmap pitches match + + If they don't, flipping will result in corrupted display. + + Test case: + + * Run Xorg at 1920x1080 with no window manager + * glxgears -geometry 2048x1080 + (Cherry picked from commit ef91da2757050652c724f6e674e8b1acf5d0cb31) + +commit 578156337176bf759dace40fb5a81919f65562f1 +Author: Michel Dänzer +Date: Mon Mar 25 12:32:04 2019 +0100 + + xwayland/present: Destroy sync_callback in xwl_present_cleanup + + xwl_present_cleanup frees the struct xwl_present_window memory, + so if there's a pending callback, we have to destroy it to prevent + use-after-free in xwl_present_sync_callback. + + Should fix issue #645. + + Reviewed-by: Olivier Fourdan + (Cherry picked from commit 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3) + +commit 8e2f5410cec5b052fb4da9d1b774a5858903dc35 +Author: Michel Dänzer +Date: Mon Mar 25 12:29:23 2019 +0100 + + Revert "gitlab-ci: Only run docker-image stage if relevant source files change" + + This reverts commit 8694395fcfd407190db74f31064960e484747377. + + Some scenarios have come to light where this failed to ensure the docker + image exists: + + * If the master branch of a forked repository is used for an MR which + doesn't modify .gitlab-ci.yml, the docker-image job may not run. + * If the docker-image job of the first pipeline in a forked repository + is cancelled or fails for any reason, and .gitlab-ci.yml isn't + modified for the next pipeline run. + (Cherry picked from commit 0ec9a13c2a207e98e2dd6b352552c0e069af0727) + +commit 34553f502650641aec4f20ab43180804f17032c6 +Author: Ray Strode +Date: Fri Nov 16 14:36:55 2018 -0500 + + dix: ensure work queues are cleared on reset + + If the server resets, most client workqueues are cleaned up as the + clients are killed. + + The one exception is the server's client, which is exempt from + the killing spree. + + If that client has a queued work procedure active, it won't get + cleared on reset. + + This commit ensures it gets cleared too. + + (cherry picked from commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508) + + Fixes: xorg/xserver#670 + +commit 94f036d412f4f426abe950b57b9ec99b78068c39 +Author: Adam Jackson +Date: Mon Feb 25 13:31:13 2019 -0500 + + xserver 1.20.4 + + Signed-off-by: Adam Jackson + +commit 9850d20c2aa2d8380f2e9c4521ef3c46a6c8fb00 +Author: Michel Dänzer +Date: Fri Feb 22 10:22:49 2019 +0100 + + gitlab-ci: Run make distcheck in autotools build & test job + + We don't set the PIGLIT_DIR and XTS_DIR environment variables for make + distcheck for now, otherwise it complains about files left behind by + piglit. + + (cherry picked from commit 432fad04e7aaad1f10d732a51665ecbe934246c6) + +commit fcac9b10c90c8a06c60f563f5ad8da1d4e49b7fc +Author: Michel Dänzer +Date: Fri Feb 22 10:21:27 2019 +0100 + + glx,xquartz: Fix make distcheck + + Guard BUILT_SOURCES and CLEANFILES by XWIN_GLX_WINDOWS/XQUARTZ. + + (cherry picked from commit f9bbc9d5ead5cf298f0e3e0b7ac5229af830f6e7) + +commit 01a03a476a5f963846fdb7702217be17ac1ecd6c +Author: Michel Dänzer +Date: Fri Feb 22 11:16:36 2019 +0100 + + present/wnmd: Allow flipping if the window pixmap matches the toplevel's + + Instead of testing window->redirectDraw. + + With Xwayland, the toplevel window is always redirected, so this would + unnecessarily preclude flipping there in some cases, e.g. with wlroots + based Wayland compositors or with fullscreen X11 windows in weston. + + Fixes issue #631. + (Cherry picked from commit a093a88531599832811a1ba5cb85101af91a545e) + +commit e5984241ab8d7ca75eb3e5e893d63adb017ed0f5 +Author: Michel Dänzer +Date: Fri Feb 22 11:56:23 2019 +0100 + + gitlab-ci: Add autotools build & test job + (Cherry picked from commit 2f12c8017508f23195db92503435fc3ef183da4b) + +commit de6d87b61959cd3997feed3efe25fb2a36e543fb +Author: Michel Dänzer +Date: Fri Feb 22 11:56:01 2019 +0100 + + gitlab-ci: Use ccache + + Meson picks it up automatically. + + Based on: + + * https://gitlab.freedesktop.org/mesa/mesa/merge_requests/240 + * https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/ + * https://stackoverflow.com/questions/53659419/ccache-no-hits-in-gitlab-ci + + v2 based on the corresponding Mesa change: + * Quote CCACHE_(BASE)DIR environment variables. + * Clear ccache stats in before_script. + * Move cache stanza to the build-and-test job, the cache isn't used in + the docker-image job. + + Reviewed-by: Adam Jackson # v1 + (Cherry picked from commit b577df77451d34e28cfef3bda5031a43caeba90a) + +commit 37ad8dd978e8d35233e489e771f7dcf3e09c3b7a +Author: Michel Dänzer +Date: Fri Feb 22 11:55:31 2019 +0100 + + gitlab-ci: Add ccache to docker image, and leave in autotools + + We're going to make use of these in build & test jobs. + (Cherry picked from commit 537f06e21ee2c4c88ee062c26555338257e043ef) + +commit 61eccbcec930efeb1a124cc8edff70e6f65c927e +Author: Michel Dänzer +Date: Fri Feb 22 11:54:57 2019 +0100 + + gitlab-ci: Don't rely on $CI_PROJECT_NAME + + The name of a forked repository can be changed later, in which case this + would fail to refer to the main repository. + + Pointed out by Eric Engestrom in + https://gitlab.freedesktop.org/mesa/mesa/merge_requests/224 . + (Cherry picked from commit fede384962edd175b1a2ce6edd8d2ef9b0fd74f0) + +commit e10cfd8fcc395360ce9acd93bfd7503da8e35381 +Author: Michel Dänzer +Date: Fri Feb 22 11:54:41 2019 +0100 + + gitlab-ci: Only run docker-image stage if relevant source files change + + Otherwise there's normally no need to run it. It will also run when a + new branch is created, which ensures that the docker image always exists + (e.g. in a newly forked repository). + + Inspired by https://gitlab.freedesktop.org/mesa/mesa/merge_requests/143 + (Cherry picked from commit 8694395fcfd407190db74f31064960e484747377) + +commit 7246730edfb4f9079eb0ef1c41c43c47854a7432 +Author: Michel Dänzer +Date: Fri Feb 22 11:53:55 2019 +0100 + + gitlab-ci: Set LC_ALL=C.UTF-8 + + Although piglit could now handle non-ASCII characters in the + environment, meson was still failing without this (even though it's + using Python 3). + + Reviewed-by: Eric Anholt + (Cherry picked from commit bc6998b728749015bfd93a85fbae48af777c9a34) + +commit 8db5a711da6a0b8f28c885b968b1e6bf2d45ce62 +Author: Michel Dänzer +Date: Fri Feb 22 11:53:37 2019 +0100 + + test: Use .../piglit instead of .../piglit-*.py + + The latter use Python 2 and break with any non-ASCII characters in the + environment, the former uses Python 3 and works fine in that case. + + Reviewed-by: Eric Anholt + (Cherry picked from commit 4aaaf69229be574d6d11084225ecd91446a15170) + +commit 3314af2d15085118f2ca0d4ce65ae6ec1f38fbad +Author: Michel Dänzer +Date: Fri Feb 22 11:53:12 2019 +0100 + + gitlab-ci: Docker image can be generated as part of pipeline + + This removes the dependency on an externally generated docker image, and + should make it easier to update the docker image or make other changes + related to it. + + This is based on Debian testing, because I'm most familiar with Debian. + But it should be easy to base it on another distro. + + v2: + * Use kaniko instead of docker-in-docker for image generation, so it can + also work in unprivileged runners. + * Drop piglit.conf & tetexec.cfg overrides, just make sure the files in + the image work. + (Cherry picked from commit f56d8e2282a3d1344aa1300c78faede0071a3bfa) + +commit e8b4e94d5192f72be3f768ac11a5e27890e6bc8d +Author: Michel Dänzer +Date: Fri Feb 22 11:52:42 2019 +0100 + + Drop Travis Linux build in favour of GitLab CI + + Fold build-travis-deps.sh into .gitlab-ci.yml. + + Preparation for the next change, which would break the Travis Linux + build. + + Reviewed-by: Eric Anholt + (Cherry picked from commit ed44f9cd6a4ccf6de7dda70432764b4da10f3f44) + +commit 4925f38dc0559a8cbe01ec947edeb5eeb78a4df6 +Author: Michel Daenzer +Date: Fri Feb 22 11:51:57 2019 +0100 + + Make artifacts of piglit results if job fails + + Can be useful for figuring out what caused the failure. + (Cherry picked from commit a7472da94136ef977b8d6af956a15767736236ea) + +commit b6ef90d83b4fd9230ca334116c61fd52f1d68209 +Author: Michel Daenzer +Date: Fri Feb 22 11:51:35 2019 +0100 + + travis: Use a single meson invocation + + The prefix setting didn't take for some reason. + (Cherry picked from commit c1bb392b1df4023e9dec489facfa221a53499ddc) + +commit 7753fd9989e280783daeee1994d019155735dee5 +Author: Adam Jackson +Date: Fri Feb 22 11:50:05 2019 +0100 + + gitlab: Skip the docker-in-docker step + + No idea which cult's cargo I was looking at there. Cuts about a minute + off the build time. + + Signed-off-by: Adam Jackson + (Cherry picked from commit a41ccaa0857146e986f11360d4f2aeb3913af9a6) + +commit 524104e15c7169114e4fa3dd832990c58ee563a4 +Author: Peter Hutterer +Date: Fri Feb 8 13:29:14 2019 +1000 + + Xi: lock the input thread for any pointer barrier list manipulation + + The input thread checks the barriers for pointer positioning, swapping the + list out from underneath is considered impolite. + + Reported-by: Michel Dänzer + Signed-off-by: Peter Hutterer + Reviewed-by: Michel Dänzer + (cherry picked from commit 678d64aa2e929368b6d6f2b83bbf5540c4fa292d) + +commit ae9dda1e2620f402b434f10df581b0fdf0495ee8 +Author: Peter Harris +Date: Wed Jan 30 14:51:07 2019 -0500 + + os: Fix GetTimeInMicros resolution + + GetTimeInMillis is called first, which sets clockid to + CLOCK_MONOTONIC_COARSE, which is typically much lower resolution than + the callers of GetTimeInMicros want. + + Prior to a779fda224bee0c4d27636503367e55ae93b33c2, GetTimeInMillis and + GetTimeInMicros did not share a clockid. + + Restore the clockid split to fix the granularity of GetTimeInMicros. + + Signed-off-by: Peter Harris + (cherry picked from commit 937a5b78a2f6ea771132ff0f9ece708a23c1bdad) + +commit 013c28a122a61beaf3a4ee7cc92b7ca2c92de7ab +Author: A. Wilcox +Date: Sat Jan 26 15:37:56 2019 -0600 + + DRI2: Add another Coffeelake PCI ID + + A user of Adélie Linux reported that modesetting wasn't working properly on + their Intel i7-9700K-integrated UHD 630 GPU. Xorg.0.log showed: + + [ 131.902] (EE) modeset(0): [DRI2] No driver mapping found for PCI device 0x8086 / 0x3e98 + [ 131.902] (EE) modeset(0): Failed to initialize the DRI2 extension. + + Indeed, that PCI ID is missing from i965_pci_ids. Adding it fixed the issue + and allowed the system to work with i965_dri under modesetting. + + (cherry picked from commit d3a26bbf618507e1ca05b2bc99a880075b77db77) + +commit a51d7a730cfd82ab44ea5510eafdbe9d7043e706 +Author: Adam Jackson +Date: Tue Oct 16 12:58:25 2018 -0400 + + vnd: Fix a silly memory leak + + 'disp' was already allocated by LookupVendorPrivDispatch above, + clobbering it will do no good. + + Signed-off-by: Adam Jackson + (cherry picked from commit 709c6562975c3bea10dd0571527a4aac79a6bf6f) + +commit 544d0e961cfa96043ed3e5a718a768444c4a4c4d +Author: Adam Jackson +Date: Wed Jan 16 14:20:17 2019 -0500 + + mi: When {en,dis}abling extensions, match names case-insensitively + + Both because extension names are inconsistently capitalized on the wire, + and because the table we're walking spells it COMPOSITE not Composite. + The latter is certainly also a bug, but there's no reason for us to be + that strict. + + Signed-off-by: Adam Jackson + (cherry picked from commit bf991a5f989c5e6e726a3731f468b7b7d65d9f4a) + +commit 2215e8c7cf06f46f9995c8a7817c7ede9774a551 +Author: Adam Jackson +Date: Mon Jan 14 12:42:00 2019 -0500 + + dri3: Fix XACE access mode for open and get_supported_modifiers + + Neither opening a screen nor querying its modifiers confers the right to + attach the buffer for any particular pixmap. GetAttr seems more correct. + + Fixes: xorg/xserver#550 + (cherry picked from commit 086c2e3de55bbf0cbc1d97f7dc2db70a7f5e69e3) + +commit 59e0b5f041eee92d0a51303082005ad8f053d8ca +Author: Michel Dänzer +Date: Wed Dec 5 18:31:27 2018 +0100 + + xfree86/modes: Don't clobber gamma LUT of compatibility output's CRTC + + If the driver calls xf86HandleColormaps, CMapChangeGamma updates the HW + gamma LUT of all CRTCs via xf86RandR12LoadPalette. However, + xf86RandR12ChangeGamma was then clobbering the gamma LUT of the RandR + 1.2 compatibility output's CRTC with the gamma curves computed from the + screen's global gamma values. + + Fix this by bailing if xf86RandR12LoadPalette is installed. + + Fixes: 02ff0a5d7e32 "xf86RandR12: Fix XF86VidModeSetGamma triggering a + BadImplementation error" + (cherry picked from commit 30044b2253c2dd51e1aedb2f897159c657ca8f0d) + +commit 712d0e86aaee96ffe1ad6a708b9134889e47d1c6 +Author: Maya Rashish +Date: Thu Jan 10 14:55:17 2019 +0200 + + xfree86: Try nouveau on NetBSD as well. + + (cherry picked from commit e3fb178617a579c98877a3baae14c4dfe4d55db8) + +commit ff1d1692e73b1729a6ced84bf58bcbe17f1c9d94 +Author: Maya Rashish +Date: Thu Jan 10 18:39:33 2019 +0200 + + Fix typo in error message + + (cherry picked from commit bf2a7bb4ffbd199882fe4bd183561469833a9e6b) + +commit c091ea5e38b5c41eaf3b10c43dc043401e8251c5 +Author: Alan Coopersmith +Date: Tue Jan 1 16:49:32 2019 -0800 + + os: Report errors opening authorization file (#469) + + Fixes: xorg/xserver#469 + + Signed-off-by: Alan Coopersmith + (cherry picked from commit 7fb6338c68e158053295cb448faa5c559aa9990c) + +commit 7b0f6102df3b18a048b791fe2304679b1eb2c9e7 +Author: Michel Dänzer +Date: Wed Dec 19 10:06:23 2018 +0100 + + glamor: Check that storage format is compatible with RENDER format + + Fixes x2r10g10b10 related rendercheck failures. + + Reviewed-by: Eric Anholt + (cherry picked from commit 7e6faa5b3c05e0b7149ee840403885b0b40b5827) + +commit 356cf07b8a8fe6faedf701ae259f8f077a234dd5 +Author: Peter Hutterer +Date: Wed Nov 28 10:05:49 2018 +1000 + + test: fix failing tests + + Broken since 69d8ea4a49793a94f821d1a328856901a1c02a5a because our fake screen + didn't have a root window and writing the XKB rules prop would happily + segfault. Fix this by setting up the required bits. + + Signed-off-by: Peter Hutterer + Tested-by: Michel Dänzer michel.daenzer@amd.com + (cherry picked from commit fde27b9b4814b18aca6ec587bd3cfe9ab04b0c72) + +commit c44eee243e6f4e488b586ad02e4fd00f587ebb49 +Author: Ilia Mirkin +Date: Mon Dec 10 23:34:11 2018 -0500 + + modesetting: fix conn_id termination and potential overrun by 1 byte + + Noticed when porting this logic to xf86-video-nouveau, and valgrind + complained about conditional jump based on uninitialized data. + + Signed-off-by: Ilia Mirkin + Reviewed-by: Pekka Paalanen + (cherry picked from commit 48b1af2718ab81c66f565438553415c05f1faa5c) + +commit 10609630e753b475566be27b186af4b2e290fdc6 +Author: Adam Jackson +Date: Thu Nov 29 14:48:11 2018 -0500 + + automake: Distribute meson's configure header templates + + Fixes: xorg/xserver#17 + (cherry picked from commit 82ed89c0f8b18d8214430580dc80c8d3e37bef33) + +commit f5a77233b983eb06eb727d25148b68d1bc410022 +Author: Lionel Landwerlin +Date: Fri Nov 9 12:34:59 2018 +0000 + + present: fix compile warning with debug traces + + Signed-off-by: Lionel Landwerlin + (cherry picked from commit a425eee6dce3b0cfd18b591907e8302a91b648c6) + +commit 4e12cba65682e97b056d8a8207189d4cf9c31862 +Author: Lyude Paul +Date: Tue Nov 13 20:14:10 2018 -0500 + + modesetting: Actually disable CRTCs in legacy mode + + Believe it or not, somehow we've never done this in legacy mode! We + currently simply change the DPMS property on the CRTC's output's + respective DRM connector, but this means that we're just setting the + CRTC as inactive-not disabled. From the perspective of the kernel, this + means that any shared resources used by the CRTC are still in use. + + This can cause problems for drivers that are not yet fully atomic, + despite using the atomic helpers internally. For instance: if CRTC-1 and + CRTC-2 are still enabled and use shared resources within the kernel (an + MST topology, for example), and then userspace tries to go enable CRTC-3 + on the same topology this might suddenly fail if CRTC-3 needs the shared + resources CRTC-1 and CRTC-2 are using. While I don't know of any + situations in the mainline kernel that actually trigger this, future + plans for reworking the atomic check of MST drivers are absolutely + going to make this into a real issue (they already are in my WIP + branches for the kernel). + + So: actually do the right thing here and disable CRTCs when they're not + going to be used anymore, even in legacy mode. + + Signed-off-by: Lyude Paul + (cherry picked from commit 7a44e8d4007b9c3ca55a5cc3f5e98601565311c7) + +commit 652918e736bcc577e221184415dcf61c05ac7bfb +Author: Alan Coopersmith +Date: Sun Nov 25 12:56:29 2018 -0800 Update configure.ac bug URL for gitlab migration - It is based on Alan Coopersmith's commit for various fd.o projects. - - Signed-off-by: Kevin Brace + Signed-off-by: Alan Coopersmith + (cherry picked from commit 17a22ad948009badbc79bbcd9a067004c98f5744) -commit af63efe470417cde8a64068b1e6965b2677d92d9 -Author: Kevin Brace -Date: Thu Dec 13 22:32:27 2018 -0600 +commit 40b22a0571d422473a7a324daa65f6a768181644 +Author: Alan Coopersmith +Date: Sun Nov 18 15:49:27 2018 -0800 - Add 24-bit color support to exaGetPixmapFirstPixel + Update README for gitlab migration - It appears that people who developed EXA forgot that there used to be - graphics devices that used 24-bits (3 bytes) instead of 32-bits (4 bytes) - in order to display one pixel. The lack of 24-bit color support inside - exaGetPixmapFirstPixel causes SiS 6326 to crash when running Xfce since - SiS 6326 does not support 32-bit color. - - Signed-off-by: Kevin Brace + Signed-off-by: Alan Coopersmith + (cherry picked from commit 5d097c2a20fce44cdb9d5c302d46bc7fa16edfec) -commit 56547b196660e246e37132960723819972b99c8c +commit a352f979545723054b0a74862a56dc53b1be93fb +Author: Olivier Fourdan +Date: Tue Jan 8 12:48:53 2019 +0100 + + xwayland: handle case without any crtc + + Xwayland creates and destroys the CRTC along with the Wayland outputs, + so there is possibly a case where the number of CRTC drops to 0. + + However, `xwl_present_get_crtc()` always return `crtcs[0]` which is + invalid when `numCrtcs` is 0. + + That leads to crash if a client queries the Present capabilities when + there is no CRTC, the backtrace looks like: + + #0 raise() from libc.so + #1 abort() from libc.so + #2 OsAbort() at utils.c:1350 + #3 AbortServer() at log.c:879 + #4 FatalError() at log.c:1017 + #5 OsSigHandler() at osinit.c:156 + #6 OsSigHandler() at osinit.c:110 + #7 + #8 main_arena() from libc.so + #9 proc_present_query_capabilities() at present_request.c:236 + #10 Dispatch() at dispatch.c:478 + #11 dix_main() at main.c:276 + + To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply + check for `numCrtcs` being 0 and return `NULL` in that case. + + Thanks to Michel Dänzer for pointing this as a + possible cause of the crash. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + Bugzilla: https://bugzilla.redhat.com/1609181 + (cherry picked from commit e8295c50209f2963fa2823e8de7e8363a38cd2d1) + +commit 210cd529064348de7d4f9a9050b0cf68f8fd326c +Author: Michel Dänzer +Date: Thu Nov 15 17:16:59 2018 +0100 + + xwayland: Don't take buffer release queue into account for frame timer + + The buffer release queue has two kinds of entries: + + * Pending async flips. + * Completed flips waiting for their buffer to be released by the Wayland + compositor. + + xwl_present_timer_callback neither completes async flips nor releases + buffers, so the timer isn't needed for the buffer release queue. + + (cherry picked from commit e6cd1c9bdefe83e7d99b703a68d26eebb451f889) + +commit 7c28b0e34ecbe9842193733dfd86097c06921406 +Author: Michel Dänzer +Date: Fri Nov 9 17:18:53 2018 +0100 + + xwayland: Don't need xwl_window anymore in xwl_present_queue_vblank + + Fixes issue #12. Presumably the problem was that Present operations on + unmapped windows were executed immediately instead of only when reaching + the target MSC. + + (cherry picked from commit f541615342ce6bfb0e6d4e68deb3a924a87e8ba9) + +commit 46135957095ec954e21107d1001452e9533ef2ee +Author: Michel Dänzer +Date: Thu Nov 1 18:24:28 2018 +0100 + + xwayland: Add xwl_present_unrealize_window + + When a window is unrealized, a pending frame callback may never be + called, which could result in repeatedly freezing until the frame timer + fires after a second. + + Fixes these symptoms when switching from fullscreen to windowed mode in + sauerbraten. + + (cherry picked from commit 8c9538573cb9a342897eb3fb4b0c1e4ed917bd0e) + +commit 98f41563e6599eb762e6a3ec12f99ba6b5388039 +Author: Michel Dänzer +Date: Thu Nov 1 18:44:24 2018 +0100 + + xwayland: Replace xwl_window::present_window with ::present_flipped + + There's no need to keep track of the window which last performed a + Present flip. This fixes crashes due to the assertion in + xwl_present_flips_stop failing. Fixes issue #10. + + The damage generated by a flip only needs to be ignored once, then + xwl_window::present_flipped can be cleared. This may fix freezing in + the (hypothetical) scenario where Present flips are performed on a + window, followed by other drawing requests using the window as the + destination, but nothing triggering xwl_present_flips_stop. The damage + from the latter drawing requests would continue being ignored. + + (cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317) + +commit f393801dbbe89bce716a8ceeb2b5c8440b9021ce +Author: Michel Dänzer +Date: Thu Oct 18 17:42:01 2018 +0200 + + xwayland: Complete "synchronous" Present flips from xwl_present_msc_bump + + Completing them from xwl_present_sync_callback had at least two issues: + + * It was before the MSC was incremented in xwl_present_frame_callback, + so the MSC value in the completion event could be lower than the + target specified by the client. This could cause hangs with the Mesa + Vulkan drivers. + * It allowed clients to run at a frame-rate higher than the Wayland + compositor's frame-rate, wasting energy on generating frames which + were never displayed. This isn't expected to happen unless the client + specified PresentOptionAsync (in which case flips are still completed + from xwl_present_sync_callback, allowing higher frame-rates). + + v2: + * Make xwl_present_has_events return true when there's a pending + "synchronous" flip, so those complete after at most ~1 second even if + the Wayland server doesn't send a frame event. + + Bugzilla: https://bugs.freedesktop.org/106713 + (cherry picked from commit ace551d8a2603e37b18237a52f62d627c75d9e2a) + +commit e646e3054a3e1dbe8ff3906a546897246bcc78f0 +Author: Michel Dänzer +Date: Thu Oct 18 17:36:24 2018 +0200 + + xwayland: Rename xwl_present_events_notify to xwl_present_msc_bump + + And consolidate more code from xwl_present_timer_callback and + xwl_present_frame_callback in it. + + (cherry picked from commit 2bfc46d4147dc0bec4cdbb80431a0f4cc1d3b030) + +commit 47aed554b7c12c0c7f496c86a435dddaa51ae9bf +Author: Michel Dänzer +Date: Wed Oct 24 11:23:05 2018 +0200 + + xwayland: Use xwl_present_reset_timer in xwl_present_timer_callback + + Apart from simplifying the code, this should also prevent a condition + (which might only be possible with the following fix) reported in + https://gitlab.freedesktop.org/wayland/weston/issues/115#note_52467: + + 1. xwl_present_timer_callback indirectly calls xwl_present_reset_timer + -> xwl_present_free_timer + 2. xwl_present_timer_callback then returns a non-0 value, so DoTimer + calls TimerSet with the old xwl_present_window->frame_timer pointer + which was freed in step 1 => use after free + + Calling xwl_present_reset_timer explicitly passes NULL to TimerSet if + step 1 freed xwl_present_window->frame_timer, and it will allocate a new + one. + + (cherry picked from commit 5e8b9a3a563047e3998d45e761f7a50e4b0f6cb3) + +commit cf8e064ec0bed45b8cda9ae390c7af78d8ede50f +Author: Olivier Fourdan +Date: Fri Oct 19 16:04:32 2018 +0200 + + xwayland: do not crash if `gbm_bo_create()` fails + + The function `xwl_glamor_gbm_create_pixmap()` first creates a buffer + objects and then creates the xwl_pixmap from it. + + However, `xwl_glamor_gbm_create_pixmap_for_bo()` is not called if the + buffer object creation fails, and `xwl_glamor_gbm_create_pixmap()` + simply returns `glamor_create_pixmap()`. + + The problem with this is that if `xwl_glamor_gbm_create_pixmap_for_bo()` + is not called then neither is `xwl_pixmap_set_private()` and further + calls to `xwl_pixmap_get()` will return NULL and cause a NULL pointer + dereference if the return value is not checked: + + #0 xwl_glamor_gbm_get_wl_buffer_for_pixmap () + at hw/xwayland/xwayland-glamor-gbm.c:248 + #1 xwl_window_post_damage () at hw/xwayland/xwayland.c:697 + #2 xwl_display_post_damage () at hw/xwayland/xwayland.c:759 + #3 block_handler () at hw/xwayland/xwayland.c:890 + #4 BlockHandler () at dix/dixutils.c:388 + #5 WaitForSomething () at os/WaitFor.c:201 + #6 Dispatch () at dix/dispatch.c:421 + #7 dix_main () at dix/main.c:276 + #8 __libc_start_main () at ../csu/libc-start.c:308 + #9 _start () + + (gdb) print xwl_pixmap + $1 = (struct xwl_pixmap *) 0x0 + + Make sure we check for `xwl_pixmap_get()` returned value where relevant + and fail gracefully if this is the case. + + See also: https://gitlab.gnome.org/GNOME/mutter/issues/340 + + Signed-off-by: Olivier Fourdan + Reviewed-by: Marco Trevisan + Reviewed-by: Peter Hutterer + (cherry picked from commit 036794bebce72a3fa2f95996d2e537ff568e0ff1) + +commit f89518e17f7d507734af212785e0b3e47954f603 +Author: Olivier Fourdan +Date: Mon Oct 22 11:48:25 2018 +0200 + + present/wnmd: Fix use after free on CRTC removal + + Xwayland will add and remove CRTCs as Wayland outputs are added or + removed. + + If there is a pending flip when this occurs, the + `xwl_present_sync_callback()` will be triggered after the Xwayland + output's RRCtrcPtr has been destroyed, hence causing a crash in Xwayland + while trying to use freed memory: + + #1 abort () + #2 OsAbort () at utils.c:1350 + #3 AbortServer () at log.c:877 + #4 FatalError () at log.c:1015 + #5 OsSigHandler () at osinit.c:156 + #6 + #7 dixGetPrivate () at ../include/privates.h:122 + #8 dixLookupPrivate () at ../include/privates.h:166 + #9 present_screen_priv () at present_priv.h:198 + #10 present_wnmd_flip () at present_wnmd.c:358 + #11 present_wnmd_execute () at present_wnmd.c:466 + #12 present_wnmd_re_execute () at present_wnmd.c:80 + #13 xwl_present_sync_callback () at xwayland-present.c:287 + #14 ffi_call_unix64 () from /lib64/libffi.so.6 + #15 ffi_call () from /lib64/libffi.so.6 + #16 wl_closure_invoke () at src/connection.c:1006 + #17 dispatch_event () at src/wayland-client.c:1427 + #18 dispatch_queue () at src/wayland-client.c:1573 + #19 wl_display_dispatch_queue_pending () at src/wayland-client.c:1815 + #20 wl_display_dispatch_pending () at src/wayland-client.c:1878 + #21 xwl_read_events () at xwayland.c:814 + #22 ospoll_wait () at ospoll.c:651 + #23 WaitForSomething () at WaitFor.c:208 + #24 Dispatch () at ../include/list.h:220 + #25 dix_main () at main.c:276 + + To avoid the issue, get the `ScreenPtr` from the window instead of the + CRTC that might have been just freed, `xwl_present_flip()` has no use + for the CRTC anyway. + + Bugzilla: https://bugs.freedesktop.org/108249 + Suggested-by: Michel Daenzer + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Daenzer + Reviewed-by: Peter Hutterer + (cherry picked from commit b768b7d6cec41b8b320c468ec41aab5a8b49b27b) + +commit 64f5e6ec2d297f90e9b9785a1cb7285d609a1877 +Author: Michel Dänzer +Date: Fri Oct 19 18:27:37 2018 +0200 + + xwayland: Plug leaks in xwl_present_sync_callback + + xwl_present_window->sync_callback was leaked. + + The event memory was leaked if the corresponding buffer had already been + released. + + (cherry picked from commit cb0de153bf0c486da7e968ab0f258c9c0c9ed34a) + +commit 971d418113740cae2d7d393850bad4926d1a7e86 +Author: Adam Jackson +Date: Thu Oct 25 09:03:18 2018 -0400 + + xserver 1.20.3 + + Signed-off-by: Adam Jackson + +commit da15c7413916f754708c62c2089265528cd661e2 +Author: Matthieu Herrb +Date: Tue Oct 23 21:29:09 2018 +0200 + + LogFilePrep: add a comment to the unsafe format string. + + CVE-2018-14665 also made it possible to exploit this to access + memory. With -logfile forbidden when running with elevated privileges + this is no longer an issue. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Adam Jackson + (cherry picked from commit 248d164eae27f1f310266d78e52f13f64362f81e) + +commit 8a59e3b7dbb30532a7c3769c555e00d7c4301170 +Author: Matthieu Herrb +Date: Tue Oct 23 21:29:08 2018 +0200 + + Disable -logfile and -modulepath when running with elevated privileges + + Could cause privilege elevation and/or arbitrary files overwrite, when + the X server is running with elevated privileges (ie when Xorg is + installed with the setuid bit set and started by a non-root user). + + CVE-2018-14665 + + Issue reported by Narendra Shinde and Red Hat. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Reviewed-by: Adam Jackson + (cherry picked from commit 50c0cf885a6e91c0ea71fb49fa8f1b7c86fe330e) + +commit cfc3dec09e1a56bb050ba31bde0bbf499596063a +Author: Peter Hutterer +Date: Tue Oct 16 09:42:51 2018 +1000 + + xfree86: fix readlink call + + Misplaced parenthesis caused us to compare the sizeof, not the readlink return + value. + + Signed-off-by: Peter Hutterer + (cherry picked from commit bd5fe7593fd0df236f3b2be1f062166ddba7d67c) + +commit 2a0c6c15c35cd262e7cdb86dcc43cb1aeb714c8e +Author: Adam Jackson +Date: Mon Oct 15 11:17:35 2018 -0400 + + xserver 1.20.2 + + Signed-off-by: Adam Jackson + +commit f5dc787fc9bb102e4eea477d1817e35370084ea2 +Author: Adam Jackson +Date: Wed Oct 10 14:09:11 2018 -0400 + + fbdevhw: Refuse to touch PCI devices on the fallback probe path + + Fixes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/issues/9 + Signed-off-by: Adam Jackson + (cherry picked from commit fc78bcca21e767697de6ad4d8e03b6728856f613) + +commit 4795c069a503144ea31f01de0c039f32d9880292 +Author: Adam Jackson +Date: Fri Oct 5 14:50:20 2018 -0400 + + glamor/egl: Avoid crashing on broken configurations + + 0a9415cf apparently can tickle bugs in the GL stack where glGetString + returns NULL, presumably because the eglMakeCurrent() didn't manage to + actually install a dispatch table and you're hitting a stub function. + That's clearly not our bug, but if it happens we should at least not + crash. Notice this case and fail gently. + + Signed-off-by: Adam Jackson + (cherry picked from commit af151895f3cb1755a7a5631f2398a3d3b219cbef) + +commit 1e3c5d614ee33d9eac1d2cf6366feeb8341fc0f4 +Author: Adam Jackson +Date: Fri Sep 14 11:33:43 2018 -0400 + + glamor_egl: Don't initialize on llvmpipe + + Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this + commit: + + commit bbdeddd5fd0b797e1e281f058338b3da4d98029d + Author: Gurchetan Singh + Date: Tue Aug 1 14:49:33 2017 -0700 + + st/dri: add drisw image extension + + That's pretty cool, but it means glamor now thinks it can initialize on + llvmpipe. This is almost certainly not what anyone wants, as glamor on + llvmpipe is pretty much uniformly slower than fb. + + This fixes both Xorg and Xwayland to refuse glamor in such a setup. + Xephyr is left alone, both because glamor is not the default there and + because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to + exercise glamor. + + The (very small) downside of this change is that you lose DRI3 support. + This wouldn't have helped you very much (since an lp glamor blit is + slower than a pixman blit), but it would eliminate the PutImage overhead + for llvmpipe's glXSwapBuffers. A future change should add DRI3 support + for the fb-only case. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + (cherry picked from commit 0a9415cf793babed1f28c61f8047d51de04f1528) + +commit b58aa8ed9b0a052d615d34b103aa54ce357df12e +Author: Alexander Volkov +Date: Mon Feb 26 19:41:18 2018 +0300 + + os/xdmcp: Don't create a new socket in XdmcpReset() + + xdmcpSocket survives during the reset, there is no + need to create a new one. + + This commit restores logic that was broken by + 49c0f2413d32fdfe36e45861fcb32aaeab633094 in Xorg 1.19. + + Signed-off-by: Alexander Volkov + (cherry picked from commit 32677ce03d793a1f2aa8871112eb3d19b3cb762f) + +commit b1215fb075b0166d5742c72041f58d512273bb50 +Author: Pierre Ossman +Date: Wed Oct 3 10:28:52 2018 +0200 + + Switch automatic composite update to WorkQueue + + It is currently (ab)using the screen BlockHandler callback to do + this. But this can cause problems with other extension as their + block handlers might have executed before Composite's. And the + operations Composite does might result in them wanting to change + timeouts. + + Practically this caused problems for TigerVNC's VNC extension which + failed to send out updates for Composite's screen updates. + + (cherry picked from commit 1bd5d0a53c5ff4169c5a6704c1c4b276f998b938) + +commit a41b6ef2244f1a0003dada0962a9d785e74d7981 +Author: Adam Jackson +Date: Mon Oct 1 11:42:37 2018 -0400 + + modesetting: Don't free(dst) in drmmode_prop_info_copy + + The destination is always either on the stack or in the middle of some + struct. + + Signed-off-by: Adam Jackson + (cherry picked from commit 43a0f9a5dbb469f4f403a8530f33be67618933b8) + +commit 9403335910f4e6b862af5c5ef835074be2c52edb +Author: Cedric Roux +Date: Wed Sep 12 19:14:18 2018 +0200 + + miext/damage: take care of the coordinate mode in damagePolyPoint + + The mode (CoordModeOrigin or CoordModePrevious) was not taken into + account when computing the box. The result was a bad drawing of + points in some situations (on my hardware/software configuration, + calling XDrawString followed by XDrawPoints in the mode + CoordModePrevious). + + Signed-off-by: Cedric Roux + Signed-off-by: Eric Anholt + (cherry picked from commit bc36594e0eb8bfa5a673bcfd8c8168f70994a1df) + +commit c26a47b4f2e170e283ca1683d5b6ca2d04823e80 +Author: Olivier Fourdan +Date: Thu Sep 20 16:32:29 2018 +0200 + + xwayland: Use `double` for `xwl_tablet_tool` + + So we do not lose subpixel precision in Xwayland. + + Suggested-by: Peter Hutterer + Signed-off-by: Olivier Fourdan + Closes: https://gitlab.freedesktop.org/libinput/libinput/issues/138 + (cherry picked from commit 734b2d6907f730571a2805cbc53fe7056190f19e) + +commit fb01b238c610e1955457dd9878d75b2c34c9a0c6 +Author: Adam Jackson +Date: Wed Aug 29 15:42:20 2018 -0400 + + xfree86: Fix Option "MaxClients" validation + + The old code would not in fact validate the option value, though it + might complain about it in the log. It also didn't let you set some + legal values that the -maxclients command line option would. + + Signed-off-by: Adam Jackson + (cherry picked from commit 7d689f049c3cc16b8e0cb0103a384a2ceb84ea33) + +commit cc4051ad6a3712c4407ffb608c8d23f2b66952d6 +Author: Dave Airlie +Date: Wed Sep 12 11:39:32 2018 +1000 + + devices: break after finding and removing device from lists + + Coverity complains about a use after free in here after the + freeing, I can't follow the linked list so well, but whot + says the device can only be on one list once, so break should + fix it. + + Signed-off-by: Dave Airlie + (cherry picked from commit ba0f5d854f4db52974ab5cd09191303b01b075ff) + +commit 64a7aac257ddbb000759d37386454866d8810545 +Author: Dave Airlie +Date: Wed Sep 12 11:12:51 2018 +1000 + + mibltblt: free prgnSrcClip on error path. + + Pointed out by coverity. + + Signed-off-by: Dave Airlie + (cherry picked from commit c4591ea17110b5c318a5ef4b0f17a4eea306ea71) + +commit fcbdb7c8b0d7bcc6a85e0beb2ce1dba76803486b +Author: Dave Airlie +Date: Wed Sep 12 11:09:40 2018 +1000 + + xkb: fix what looks to be a copy-paste error with first vs firstMM + + Pointed out by coverity. + + Signed-off-by: Dave Airlie + (cherry picked from commit 758393951233d1b2520cf4cefd33ec4288a3880a) + +commit 83ef02839ce8982c2e841bc400abddbeb620481d +Author: Dave Airlie +Date: Wed Sep 12 11:05:45 2018 +1000 + + posix_tty: free leak of xf86SetStrOption return value. + + Pointed out by coverity. + + Signed-off-by: Dave Airlie + (cherry picked from commit cad3a1a82da3c8421b5cc98af27a779a38b5c709) + +commit 66d36010a324480ac656e702e53f9c1f6fb60d5c +Author: Dave Airlie +Date: Wed Sep 12 10:56:40 2018 +1000 + + modesetting: get pEnt after error checks + + This saves us having to make sure we clean it up. + + Pointed out by coverity. + + Signed-off-by: Dave Airlie + (cherry picked from commit b6c29a881eb49300fddfd0187cb10891f5257d3b) + +commit 795c58a1febb3deb9066d981b178d9cf14fdad03 +Author: Dave Airlie +Date: Wed Sep 12 10:52:25 2018 +1000 + + glamor: fix leak of fs_getcolor_source. + + This is created using XNFstrdup, so it needs to be freed. + + Pointed out by coverity. + Signed-off-by: Dave Airlie + (cherry picked from commit f0a5c0d1fdaeee3cd701215f4f57b7eacaf783c2) + +commit bb384d0b110a99f2d935ed73d6589af46f818823 +Author: Dave Airlie +Date: Wed Sep 12 10:50:21 2018 +1000 + + fboverlay: move bpp checks above malloc + + Avoids having to free the malloced object. + + Pointed out by coverity. + + Signed-off-by: Dave Airlie + (cherry picked from commit c7fa6a0a0d4ad28ee21b8dd9ad4fbe33f462bc71) + +commit 26a83f9833054f5cf7c7d73b0f5aa080d400c26b +Author: Dave Airlie +Date: Wed Sep 12 10:33:04 2018 +1000 + + xi: free modifiers_failed on error path. (v2) + + Pointed out by coverity. + + v2: set modifies_failed to NULL at start (whot) + + Signed-off-by: Dave Airlie + (cherry picked from commit 51ae6126dcf3e234d0f678f02934bc9515abb8ae) + +commit bdeab7863eb7abe2d9d05eed259542695935559c +Author: Dave Airlie +Date: Wed Sep 12 10:30:13 2018 +1000 + + shm: move shmsize verify before allocating the drawable. + + Otherwise if the VERIFY_SHMSIZE macro fails we leak the drawables + we allocated earlier. + + Noticed by coverity scan. + + Signed-off-by: Dave Airlie + (cherry picked from commit 3439929c510501929c6ef1d90477c33bf8838632) + +commit 8e646ca9850c071994354b503b5d2b62f99ef2a8 +Author: Adam Jackson +Date: Wed Aug 29 16:07:59 2018 -0400 + + modesetting: Document Option "DoubleShadow" in the man page + + Signed-off-by: Adam Jackson + (cherry picked from commit c4f3e42fe316c90a73908a838ce64abbb28fe0a2) + +commit fdb80a327cfe213a206bc76d3cb43cbb33855547 +Author: Adam Jackson +Date: Wed Aug 29 15:57:46 2018 -0400 + + modesetting: Lie less in the man page + + We don't support 8bpp, and we do have acceleration. + + Signed-off-by: Adam Jackson + (cherry picked from commit 0dc2c419e11cf28b8fa1e607d4cf2d15f2eb2306) + +commit cffac815b957fd1296d61cc5c20ba3709a77ee4e +Author: Olivier Fourdan +Date: Wed Sep 5 10:49:27 2018 +0200 + + xwayland: Remove xwl_present_window from privates on cleanup + + Xwayland's `xwl_destroy_window()` invokes `xwl_present_cleanup()` + before the common `DestroyWindow()`. + + But then `DestroyWindow()` calls `present_destroy_window()` which will + possibly end up in `xwl_present_abort_vblank()` which will try to access + data that was previously freed by `xwl_present_cleanup()`: + + Invalid read of size 8 + at 0x434184: xwl_present_abort_vblank (xwayland-present.c:378) + by 0x53785B: present_wnmd_abort_vblank (present_wnmd.c:651) + by 0x53695A: present_free_window_vblank (present_screen.c:87) + by 0x53695A: present_destroy_window (present_screen.c:152) + by 0x42A90D: xwl_destroy_window (xwayland.c:653) + by 0x584298: compDestroyWindow (compwindow.c:613) + by 0x53CEE3: damageDestroyWindow (damage.c:1570) + by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) + by 0x46F7F6: FreeWindowResources (window.c:1031) + by 0x472847: DeleteWindow (window.c:1099) + by 0x46B54C: doFreeResource (resource.c:880) + by 0x46C706: FreeClientResources (resource.c:1146) + by 0x446ADE: CloseDownClient (dispatch.c:3473) + Address 0x182abde0 is 80 bytes inside a block of size 112 free'd + at 0x4C2FDAC: free (vg_replace_malloc.c:530) + by 0x42A937: xwl_destroy_window (xwayland.c:647) + by 0x584298: compDestroyWindow (compwindow.c:613) + by 0x53CEE3: damageDestroyWindow (damage.c:1570) + by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326) + by 0x46F7F6: FreeWindowResources (window.c:1031) + by 0x472847: DeleteWindow (window.c:1099) + by 0x46B54C: doFreeResource (resource.c:880) + by 0x46C706: FreeClientResources (resource.c:1146) + by 0x446ADE: CloseDownClient (dispatch.c:3473) + by 0x446DA5: ProcKillClient (dispatch.c:3279) + by 0x4476AF: Dispatch (dispatch.c:479) + Block was alloc'd at + at 0x4C30B06: calloc (vg_replace_malloc.c:711) + by 0x433F46: xwl_present_window_get_priv (xwayland-present.c:54) + by 0x434228: xwl_present_get_crtc (xwayland-present.c:302) + by 0x539728: proc_present_query_capabilities (present_request.c:227) + by 0x4476AF: Dispatch (dispatch.c:479) + by 0x44B5B5: dix_main (main.c:276) + by 0x75F611A: (below main) (libc-start.c:308) + + This is because `xwl_present_cleanup()` frees the memory but does not + remove it from the window's privates, and `xwl_present_abort_vblank()` + will still find it and hence try to access that freed memory... + + Remove `xwl_present_window` from window's privates on cleanup so that no + other function can find and reuse that data once it's freed. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1616269 + Signed-off-by: Olivier Fourdan + (cherry picked from commit 3f31f56929e80001970e3821ed8b10c6075df8e6) + +commit 8dd7173eeba08f1ecfb414915625c609ad4b3297 +Author: Lionel Landwerlin +Date: Tue Aug 28 21:30:05 2018 +0100 + + xwayland: fix access to invalid pointer + + xwl_output->randr_crtc is used in the update_screen_size() function : + + ==5331== Invalid read of size 4 + ==5331== at 0x15263D: update_screen_size (xwayland-output.c:190) + ==5331== by 0x152C48: xwl_output_remove (xwayland-output.c:413) + ==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) + ==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) + ==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) + ==5331== by 0x27574B: Dispatch (dispatch.c:421) + ==5331== by 0x279945: dix_main (main.c:276) + ==5331== Address 0x1aacb5f4 is 36 bytes inside a block of size 154 free'd + ==5331== at 0x48369EB: free (vg_replace_malloc.c:530) + ==5331== by 0x1F8AE8: RROutputDestroyResource (rroutput.c:421) + ==5331== by 0x29A2AC: doFreeResource (resource.c:880) + ==5331== by 0x29AE5B: FreeResource (resource.c:910) + ==5331== by 0x152BE0: xwl_output_remove (xwayland-output.c:408) + ==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) + ==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) + ==5331== Block was alloc'd at + ==5331== at 0x48357BF: malloc (vg_replace_malloc.c:299) + ==5331== by 0x1F93E0: RROutputCreate (rroutput.c:83) + ==5331== by 0x152A75: xwl_output_create (xwayland-output.c:361) + ==5331== by 0x14BE59: registry_global (xwayland.c:764) + ==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) + ==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) + ==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Daniel Stone + (cherry picked from commit 53ce2ba0a19af9c549f47a4cc678afcebeb6087e) + +commit 1191b23f942cace785234f5d7fac972251c8f1db +Author: Olivier Fourdan +Date: Wed Sep 5 15:20:17 2018 +0200 + + glx: check for indirect context in CreateContextAttribsARB() + + Commit 99f0365b "Add a command line argument for disabling indirect GLX" + added a test to check if indirect context are enabled in + `DoCreateContext()` but `__glXDisp_CreateContextAttribsARB()` doesn't + use `DoCreateContext()` and doesn't check if indirect context is + enabled. + + As a result, clients can still manage to create indirect contexts using + `glXCreateContextAttribsARB()` even if indirect contexts are disabled, + which can possibly crash Xservers such as Xwayland or Xephyr when the + context is destroyed. + + To avoid the issue, check for `enableIndirectGLX` in + `__glXDisp_CreateContextAttribsARB()` as well. + + Fixes: 99f0365b "Add a command line argument for disabling indirect GLX" + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107508 + Signed-off-by: Olivier Fourdan + (cherry picked from commit 75448671abe2c6ae3745eb5d2ed2e76df2de9c41) + +commit 1b0db2c74258d20e3f99bd69c2914fd445abe920 +Author: Lionel Landwerlin +Date: Mon Aug 27 01:04:45 2018 +0100 + + present: fix freed pointer access + + When a vblank has been marked as aborted, it's going to be free in the + flip_notify function when stopped. We can't notify it after it's + stopped because the pointer is invalid. + + Valgrind backtrace: + + ==5331== Invalid read of size 8 + ==5331== at 0x212B4D: present_vblank_notify (present_vblank.c:34) + ==5331== by 0x21439B: present_wnmd_flip_notify (present_wnmd.c:194) + ==5331== by 0x21439B: present_wnmd_event_notify (present_wnmd.c:228) + ==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) + ==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) + ==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) + ==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) + ==5331== by 0x27574B: Dispatch (dispatch.c:421) + ==5331== Address 0x1b44dc98 is 40 bytes inside a block of size 184 free'd + ==5331== at 0x48369EB: free (vg_replace_malloc.c:530) + ==5331== by 0x213B0A: present_wnmd_free_idle_vblanks (present_wnmd.c:118) + ==5331== by 0x213B0A: present_wnmd_flips_stop (present_wnmd.c:161) + ==5331== by 0x2143EF: present_wnmd_flip_notify (present_wnmd.c:192) + ==5331== by 0x2143EF: present_wnmd_event_notify (present_wnmd.c:228) + ==5331== by 0x156216: xwl_present_sync_callback (xwayland-present.c:282) + ==5331== by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4) + ==5331== by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0) + ==5331== by 0x14BCCA: xwl_read_events (xwayland.c:814) + ==5331== by 0x2AC0D0: ospoll_wait (ospoll.c:651) + ==5331== by 0x2A5322: WaitForSomething (WaitFor.c:208) + ==5331== Block was alloc'd at + ==5331== at 0x48377D5: calloc (vg_replace_malloc.c:711) + ==5331== by 0x212D9F: present_vblank_create (present_vblank.c:69) + ==5331== by 0x214014: present_wnmd_pixmap (present_wnmd.c:610) + ==5331== by 0x21576C: proc_present_pixmap (present_request.c:150) + ==5331== by 0x27599D: Dispatch (dispatch.c:479) + ==5331== by 0x279945: dix_main (main.c:276) + ==5331== by 0x633AB16: (below main) (libc-start.c:310) + + v2: Still notify aborted flips (Roman) + + Signed-off-by: Lionel Landwerlin + Reviewed-by: Daniel Stone + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107314 + Reviewed-by: Roman Gilg + Tested-by: Roman Gilg + (cherry picked from commit ce271535adb6974e0a43bb64c8ed7a5dcaff67a2) + +commit 48300a7775b4ff3200de200e8c5502d99bd99104 +Author: Scott Anderson +Date: Mon Aug 6 18:09:26 2018 +1200 + + xwayland: use wayland axis_discrete event + + This prevents multiple scroll events happening for wayland compositors + which send axis values other than 10. For example, libinput will + typically return 15 for each scroll wheel step, and if a wayland + compositor sends those to xwayland without normalising them, 2 scroll + wheel steps will end up as 3 xorg scroll events. By listening for the + discrete_axis event, this will now correctly send only 2 xorg scroll + events. + + The wayland protocol gurantees that there will always be an axis event + following an axis_discrete event. However, it does not gurantee that + other events (including other axis_discrete+axis pairs) will not happen + in between them. So we must keep a list of outstanding axis_discrete + events. + + Signed-off-by: Scott Anderson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit cd285922cdec966825e47220b1182a57abc1ff90) + +commit cd19a752f8bbc6caae7bf2457c53c850121fe9b7 +Author: Jim Qu +Date: Mon Aug 27 13:37:38 2018 +0800 + + modesetting: code refactor for PRIME sync + + The X will be crashed on the system with other DDX driver, + such as amdgpu. + + show the log like: + + randr: falling back to unsynchronized pixmap sharing + (EE) + (EE) Backtrace: + (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4e) + (EE) 1: /usr/lib/xorg/Xorg (0x55cb0151a000+0x1b5ce9) + (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f1587a1d000+0x11390) + (EE) + (EE) Segmentation fault at address 0x0 + (EE) + + The issue is that modesetting as the master, and amdgpu as the slave. + Thus, when the master attempts to access pSlavePixPriv in ms_dirty_update(), + problems result due to the fact that it's accessing AMD's 'ppriv' using the + modesetting structure definition. + + Apart from fixing crash issue, the patch fix other issue in master interface + in which driver should refer to master pixmap. + + Signed-off-by: Jim Qu + Reviewed-by: Alex Goins + (cherry picked from commit f79e5368512b72bb463925983d265b070261b7aa) + +commit 5396a4aa084853805a73a2cfbbce156c47573916 +Author: Alex Goins +Date: Tue Aug 14 15:05:46 2018 -0500 + + randr: rrCheckPixmapBounding should only increase screen size + + The purpose of rrCheckPixmapBounding() is to make sure that the fb is large + enough to accommodate the region scanned out by a GPU screen. Currently, however, + it will actually shrink the fb if it's larger than it needs to be. + + This is a problem when combining PRIME output slaving with arbitrary transforms + with xrandr. + + Although arbitrary transforms are not supposed to constrain the size of the fb + (https://lists.freedesktop.org/archives/xorg-devel/2018-January/055563.html), + xrandr will use RRSetScreenSize to resize the desktop to accommodate scaling + transforms, e.g. scaling a 1920x1080 display to 3840x2160 will result in a + desktop size of 3840x2160. + + In the case of PRIME, rrCheckPixmapBounding() will be called after + RRSetScreenSize() and it will resize the fb back down to what it would be + without the scaling transform, e.g. 1920x1080. This represents divergence in + behavior between PRIME and non-PRIME outputs. + + I had originally made rrCheckPixmapBounding() account for arbitrary transforms, + but realized that the fb being large enough to accommodate arbitrary transforms + is not a hard requirement enforced in the server. Instead, this change simply + makes it so that rrCheckPixmapBounding() will only resize the fb to be larger + than it already is, preventing it from stepping on prior requests to increase + the size of the fb. + + Signed-off-by: Alex Goins + Reviewed-by: Keith Packard + Reviewed-by: Michel Dänzer + (cherry picked from commit a90f33721eba7f2dbde4a7278f1a213d696c85e9) + +commit 051a0efc5c28fb4be1199d73d59e0e4d329b1144 +Author: Peter Hutterer +Date: Wed Aug 8 15:22:41 2018 +1000 + + dix: check_modmap_change() returns Success, not true + + Not sure what if anything calls XSetDeviceModifierMapping() but this would've + failed all the time. check_modmap_change() returns Success but we were + treating it like a boolean. Fix this. + + Reported-by: Adam Jackson + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + (cherry picked from commit 4fe02b8da3ca58500f7e6e017e388907cf4a8b73) + +commit 1508ea68065b7976dbf56039f9b20dcaf0394431 +Author: Adam Jackson +Date: Tue Aug 7 12:26:05 2018 -0400 + + xserver 1.20.1 + + Signed-off-by: Adam Jackson + +commit 101d15c7634b26eafb3c5f2edb7cafde102ce208 +Author: Keith Packard +Date: Tue Jun 26 09:20:00 2018 -0700 + + During reset/shutdown, clean up leases in DIX instead of each driver + + Instead of having every video driver loop over any pending leases to + free them during CloseScreen, do this up in the DIX layer by + terminating leases when a leased CRTC or Output is destroyed and + (just to make sure), also terminating leases in RRCloseScreen. The + latter should "never" get invoked as any lease should be associated + with a resource which was destroyed. + + This is required as by the time the driver's CloseScreen function is + invoked, we've already freed all of the DIX randr structures and no + longer have any way to reference the leases + + Signed-off-by: Keith Packard + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106960 + Cc: Thomas Hellstrom + (cherry picked from commit 1ef7aed3e2bb2af32330f19b1e7560000512ddfe) + +commit 9347326d28fffc7534cad0b084539e936aacfd45 +Author: Peter Hutterer +Date: Wed Jul 18 13:22:43 2018 +1000 + + Xext: dynamically allocate the PanoramiXDepths[j].vids array + + Control flow is: + PanoramiXMaybeAddDepth() allocates an array size 240 (pDepth->numVisuals) + PanoramiXMaybeAddVisual() finds up to 270 matches (pScreen->numVisuals) + and writes those into the previously allocated array. + + This caused invalid reads/writes followed by eventually a double-free abort. + + Reproduced with xorg-integration-tests server test + XineramaTest.ScreenCrossing/* (and a bunch of others). + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + (cherry picked from commit 93cafb0828d2e24bd14616df1aa9883fb843dd6c) + +commit cbf1ca2dba7bc3561cf1a8023e5e18706adbdba6 +Author: emersion +Date: Fri Jul 13 15:51:26 2018 -0400 + + xwayland: rotate logical size for RRMode + + The logical size is the size of the output in the global compositor + space. The mode width/height should be scaled as in the logical + size, but shouldn't be transformed. Thus we need to rotate back + the logical size to be able to use it as the mode width/height. + + This fixes issues with pointer input on transformed outputs. + + Signed-Off-By: Simon Ser + Reviewed-by: Olivier Fourdan + (cherry picked from commit ce2dde9ed0243a18ae18af0879134f7c1afbd700) + +commit 18a52a8e16046d8cabea6cf45913bf0b5be07709 +Author: Olivier Fourdan +Date: Wed Jul 25 16:33:23 2018 +0200 + + xwayland: Enable DRI3 for glamor + + glamor_fds_from_pixmap() will bail out early if DRI3 is not enabled, + unfortunately Xwayland's glamor code would not set it as enabled which + would lead to blank pixmaps when using texture from pixmap. + + Make sure to mark DRI3 as enabled from glamor_egl_screen_init() in + Xwayland. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107287 + Fixes: c8c276c956 ("glamor: Implement PixmapFromBuffers and BuffersFromPixmap") + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + (cherry picked from commit cdec2b3c195d1d080207ef01c55ff14b45370010) + +commit c256e31a9eba20da259f31ee70d1c8e1870993f1 +Author: Takashi Iwai +Date: Thu Jul 19 14:38:19 2018 +0200 + + modesetting: Fix cirrus 24bpp breakage + + The recent rewrite of modesetting driver broke the 24bpp support. + As typically found on cirrus KMS, it leads to a blank screen, spewing + the error like: + failed to add fb -22 + (EE) modeset(0): failed to set mode: Invalid argument + + The culript is that the wrong bpp value of the front buffer is passed + to drmModeAddFB(). Fix it by replacing with the back buffer bpp, + drmmode->kbpp. + + Signed-off-by: Takashi Iwai + Tested-by: Stefan Dirsch + Reviewed-by: Adam Jackson + (cherry picked from commit d625e16918ef9104863709eb108346464767c444) + +commit 2da0bde4498cf4ee422e5a2cb2c53cbbb73df937 +Author: Matt Turner +Date: Tue May 22 21:10:55 2018 -0700 + + xfree86: Inline xf86{Read,Write}Mmio{8,16,32} on alpha + + In commit 9db2af6f757e (xfree86: Remove xf86{Map,Unmap}VidMem) we + somehow stopped exporting xf86{Read,Write}Mmio{8,16,32}. Since the + function pointer indirection was intended to support dense vs sparse and + sparse support is now gone, we can just make the functions static inline + in compiler.h and avoid all of this. + + Bugzilla: https://bugs.gentoo.org/548906 + Tested-by: Christopher May-Townsend + Reviewed-by: Adam Jackson + Signed-off-by: Matt Turner + (cherry picked from commit 166ac294aefe21a6cfcc0e7a4c9525eef49c2f0c) + +commit b9e9eda08bd9198a6d089acd5d50677cd8713b33 +Author: Stefan Agner +Date: Thu Dec 22 15:41:06 2016 +0100 + + modesetting: Fix 16 bit depth/bpp mode + + When setting DefaultDepth to 16 in the Screen section, the current + code requests a 32 bpp framebuffer, however the X-Server seems to + assumes 16 bpp. + + Fixes commit 21217d02168d ("modesetting: Implement 32->24 bpp + conversion in shadow update") + + Reviewed-by: Adam Jackson + Signed-off-by: Stefan Agner + (cherry picked from commit 1c7f34e99ff9750979a03ae20c6be1f2b42c284c) + +commit 5c0662d44852363fe258c045250710ed881e56b7 +Author: Lyude Paul +Date: Fri Jun 22 12:49:47 2018 -0400 + + meson: ensure the libc has RPC functions when secure-rpc is enabled + + Currently our meson.build just makes the assumption that the libc is + going to provide RPC functions. This doesn't actually seem to be the + case on Fedora, which causes compilation to fail unexpectedly: + + ../../Projects/xserver/os/rpcauth.c:47:10: fatal error: rpc/rpc.h: No such file or directory + #include + ^~~~~~~~~~~ + compilation terminated. + + So, in the event that we can't use libtirpc ensure that we actually + check whether or not the libc provides rpc/rpc.h. If it doesn't, raise + an error. + + Reviewed-by: Adam Jackson + Signed-off-by: Lyude Paul + (cherry picked from commit d95a1310ef8e08a93a28f9766d1b4093f7891404) + +commit 10285bc36b411edd923ee5d369244647ba2b714b +Author: Keith Packard +Date: Tue Jun 26 16:34:29 2018 -0700 + + xf86-video-modesetting: Lease planes as well if using atomic + + If we're using atomic modesetting, then we're also using universal + planes, and so the lease we create needs to include the plane. + + Signed-off-by: Keith Packard + Reviewed-by: Daniel Stone + (cherry picked from commit d83efc47b7a524b4f8d4a993c27a3e402a98fa7c) + +commit a530198ac0ffdc4c268d13e59079f7583930a284 +Author: Keith Packard +Date: Tue Jun 26 14:05:31 2018 -0700 + + xf86-video-modesetting: Don't enable UNIVERSAL_PLANES separately + + We don't want universal_planes unless we're using atomic APIs for + modesetting, and the kernel already enables universal_planes + automatically when atomic is enabled. + + If we enable universal_planes when we're not using atomic, then we + won't have selected a plane for each crtc, and this will break lease + creation which requires planes for each output when universal_planes + is enabled. + + Signed-off-by: Keith Packard + Reviewed-by: Daniel Stone + (cherry picked from commit 4a11f66e4690f9e94dc61cb264f5ef78dbdb255a) + +commit cd7680adccdf8f6905a83ae08cbde7ac76693fe5 +Author: Keith Packard +Date: Thu Jun 28 11:45:16 2018 -0700 + + xfree86: Wrap RRCrtcIsLeased and RROutputIsLeased to check for DIX structures + + Before DIX structures are allocated for crtcs and outputs, we don't + want to call DIX randr code with NULL pointers. This can happen if the + driver sets video modes early in server initialization, which Nouveau + does in zaphod mode. + + Cc: thellstrom@vmware.com + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106772 + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106960 + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + (cherry picked from commit 2faf4cef8bcf9bb2034a27219a656ea7221afc6c) + +commit ebd4cd71f49151fb699cf45e835f3719e6b31bf5 +Author: Keith Packard +Date: Thu Jun 28 11:45:15 2018 -0700 + + xfree86: Reset randr_crtc and randr_output early in xf86CrtcCloseScreen + + The DIX crtc and output structures are freed when their resources are + destroyed, which happens before CloseScreen is called. As a result, we + know these pointers are invalid and referencing them during any of the + remaining CloseScreen sequence will be bad. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + Cc: thellstrom@vmware.com + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106960 + (cherry picked from commit c55a44a9a86aaece17c1a2e73c77e3e665c4888e) + +commit 1f169d5b38d93d725029d5f7dc237b558e8bb137 +Author: Jon Turney +Date: Sat Jun 30 12:53:35 2018 +0100 + + meson: use absolute paths in manpage substitutions + + paths returned by get_option('foodir') are potentially relative to prefix + + Noticed when comparing manpages generated by a meson build with those + generated by an autotools build + + Signed-off-by: Jon Turney + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 49283e238a0ba6051034ae635e5970891f17f9df) + +commit bc1882aa23a129c4b72b0bfc132cfd04db801a90 +Author: Keith Packard +Date: Thu Jan 18 18:07:29 2018 -0800 + + modesetting: Allow a DRM fd to be passed on command line with -masterfd [v2] + + This lets an application open a suitable DRM device and pass the file + descriptor to the mode setting driver through an X server command line + option, '-masterfd'. + + There's a companion application, xlease, which creates a DRM master by + leasing an output from another X server. That is available at + + git clone git://people.freedesktop.org/~keithp/xlease + + v2: + Always print usage, but note that it can't be used if + setuid/gid + + Suggested-by: Lyude Paul + + Signed-off-by: Keith Packard + Reviewed-by: Lyude Paul + (cherry picked from commit 38ff29ec8ead0a293f50ac52146199babe4205ca) + +commit d60ce5b01f5988abc9957473d7175872c8845b08 +Author: Laurent Carlier +Date: Sat Jun 16 13:00:01 2018 +0200 + + meson: Add configuration of listening on tcp, unix and local + + bugzilla: https://bugs.kde.org/show_bug.cgi?id=395419 + bugzilla: https://bugs.archlinux.org/task/59025 + + Signed-off-by: Laurent Carlier + Reviewed-by: Aaron Plattner + Signed-off-by: Peter Hutterer + (cherry picked from commit 2f39b2a07805194fdd7def30d941666963d6e670) + +commit 79795bf9df395001c8d659ac8d28090ea9cefc8d +Author: Lyude Paul +Date: Wed Jun 27 20:29:42 2018 -0400 + + modesetting: Fix uninitialized memory usage in drmmode_crtc_get_fb_id() + + This really sucked to find out :( + + Signed-off-by: Lyude Paul + Reviewed-by: Karol Herbst + (cherry picked from commit c41d4ff48f72aa964afd131b59e1538295d062dc) + +commit 820ce7cb8bb07018de89e13aa50ae6090f2d84eb +Author: Thomas Hellstrom +Date: Wed Jun 20 19:23:48 2018 +0200 + + glamor: Work around GEM usage v2 + + KMS drivers are not required to support GEM. In particular, vmwgfx + doesn't support flink and handles and names are identical. + Getting a bo name should really be part of a lower level API, if needed, + but in the mean time work around this by setting the name identical to + the handle if GEM isn't supported. + + This fixes modesetting driver dri2 on vmwgfx. + + Reviewed-by: Deepak Rawat + Signed-off-by: Thomas Hellstrom + (cherry picked from commit 9f02855e7a1b7a3c1e2ee7bfbc73e87c29126920) + +commit ba6a9283817254dca90fd8f9ee695504e7c20908 +Author: Lyude Paul +Date: Wed Jun 20 19:12:32 2018 -0400 + + randr: Scream when creating a shared pixmap fails + + This seems like a problem worth screaming about. + + Signed-off-by: Lyude Paul + Reviewed-by: Dave Airlie + (cherry picked from commit dc90b1c3c328f1d0b022a234b69ef32bda7ccb01) + +commit 91ec6245d6269a88a3f3ecd10fa7a7b326b0a616 +Author: Lyude Paul +Date: Wed Jun 20 19:12:31 2018 -0400 + + glamor: Unbreak glamor_fd_from_pixmap() + + When support for allocating GBM BOs with modifiers was added, + glamor_fd_from_pixmap() was changed so that it would return an error if + it got a bo with modifiers set from glamor_fds_from_pixmap(). The + problem is that on systems that support BOs with modifiers, + glamor_fds_from_pixmap() will always return BOs with modifiers. + + This means that glamor_fd_from_pixmap() was broken entirely, which broke + a number of other things including glamor_shareable_fd_from_pixmap(), + which meant that modesetting using multiple GPUs with the modesetting + DDX was also broken. Easy reproducer: + + - Find a laptop with DRI prime that has outputs connected to the + dedicated GPU and integrated GPU + - Try to enable one display on each using the modesetting DDX + - Fail + + Since there isn't a way to ask for no modifiers from + glamor_fds_from_pixmap, we create a shared _glamor_fds_from_pixmap() + function used by both glamor_fds_from_pixmap() and + glamor_fd_from_pixmap() that calls down to the appropriate + glamor_egl_fd*_from_pixmap() function. + + Signed-off-by: Lyude Paul + Reviewed-by: Dave Airlie + Cc: Louis-Francis Ratté-Boulianne + Fixes: c8c276c956 ("glamor: Implement PixmapFromBuffers and BuffersFromPixmap") + (cherry picked from commit 186a21c4bac744ffe645c8d1a6dda2d41c6d33d8) + +commit 821f38fa56087fcb11d2d2483366307fc88bf365 +Author: Lyude Paul +Date: Thu Jun 7 20:30:34 2018 -0400 + + modesetting: Also disable CRTC in drmmode_output_disable() + + So, this did actually work on older kernels at one point in time, + however it seems that this working was a result of some of the Linux + kernel's atomic modesetting helpers not preserving the CRTC's enabled + state in the right spots. This was fixed in: + + 846c7dfc1193 ("drm/atomic: Try to preserve the crtc enabled state in drm_atomic_remove_fb, v2") + + As a result, atomic commits which simply disassociate a DRM connector + with it's CRTC while leaving the CRTC in an enabled state aren't enough + to disable the CRTC, and result in the atomic commit failing. This + currently can cause issues with MST hotplugging where X will end up + failing to disable the MST outputs after they've left the system. A + simple reproducer: + + - Start up Xorg + - Connect an MST hub with displays connected to it + - Remove the hub + - Now there should be CRTCs stuck on the orphaned MST connectors, and X + won't be able to reclaim them. + + Signed-off-by: Lyude Paul + Cc: Louis-Francis Ratté-Boulianne + Reviewed-by: Dave Airlie + (cherry picked from commit c12f1bd4b76088ea66e3bec9ab9721a52b20cdf2) + +commit 2f4d0d84266b82d8838b8b9b7972f45d66f0e2d1 +Author: Olivier Fourdan +Date: Fri Jun 15 08:57:12 2018 +0200 + + modesetting: use drmmode_bo_import() for rotate_fb + + drmmode_shadow_allocate() still uses drmModeAddFB() which may fail if + the format is not as expected, preventing from using a rotated output. + + Change it to use the new function drmmode_bo_import() which takes care + of calling the drmModeAddFB2() API. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106715 + Signed-off-by: Olivier Fourdan + Tested-by: Tomas Pelka + Reviewed-by: Lyude Paul + (cherry picked from commit a85e94a50c94b07574c8701a3ff3c1243f4257f4) + +commit 394ed02f8761c7599fa08628a4d28d34337028f6 +Author: John Lumby +Date: Tue Jun 26 17:14:34 2018 -0700 + + Change the DPMS initialization to be conditional on not set from config + + Any DPMS timeout values set in ServerFlags section of the xorg.conf + are being overwritten by DPMS extension initialization. Therefore + change the DPMS initialization of timeout values to be conditional on + not set from config. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106963 + Signed-off-by: John Lumby + Reviewed-by: Emil Velikov + Signed-off-by: Keith Packard + (cherry picked from commit f5aace7a27d6d61068dcae46c9756b669ab51d50) + +commit 8c2f0f8cbdba04f3d2eb65e3ea98f809545f8e87 +Author: Damien Leone +Date: Mon Jun 18 16:24:28 2018 -0700 + + os: Recompute whether any clients are ready after check_timers() + + If a driver calls AttendClient() from within a timer callback we + need to re-compute the local 'are_ready' to prevent the attended + client from waiting until WaitForSomething() times out. + + This is a fix similar to commit 9ed5b263. + + Signed-off-by: Damien Leone + Reviewed-by: Keith Packard + (cherry picked from commit f33cb4264387ed14a586ba080885b4d21e4aa48b) + +commit 180ab06d4564579cf05cb44c2533ac914b68be77 +Author: Olivier Fourdan +Date: Mon Jun 11 09:21:08 2018 +0200 + + xwayland: mandatory EGL backend API + + The API init_wl_registry() and has_wl_interfaces() are marked as being + optional, but both GBM And EGLStream backends implement them so there is + point in keeping those optional. + + Suggested-by: Emil Velikov + Signed-off-by: Olivier Fourdan + (cherry picked from commit 92daeb31fa3235dc791e0444b072ec4bbc6e35ab) + +commit c641d10ef04475f2898cc40536bd5a03371f2761 +Author: Olivier Fourdan +Date: Mon Jun 11 09:13:30 2018 +0200 + + xwayland: simplify xwl_glamor_pixmap_get_wl_buffer() + + When retrieving the Wayland buffer from a pixmap, if the buffer already + exists, the GBM backend will return that existing buffer. + + However, as seen with the Present issues, if the call had previously + passed a wrong size, that buffer will remain at the wrong size for as + long as the buffer exists, which is error prone. + + Considering that the width/height passed to get_wl_buffer() is always the + actual pixmap drawable size, and considering that the EGLStream backend + makes no use of the size either, there is really no point in passing the + width/height around. + + Simplify the xwl_glamor_pixmap_get_wl_buffer() and EGL backends API by + removing the pixmap size, and use the drawable size instead. + + Signed-off-by: Olivier Fourdan + (cherry picked from commit 792359057bd54548555674d2d309c0cfeebac12d) + +commit 79ebd7f689492314067fc863510ad44683b67e64 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:45 2018 +0200 + + xwayland: EGL_IMG_context_priority required by EGLStream + + xwl_glamor_eglstream_init_egl() uses "EGL_IMG_context_priority" + extension, make sure it's actually available before using it. + + Suggested-by: Emil Velikov + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit bdadaa25f5c1f62d30d8e76b4ebfcef414ed9c90) + +commit 81969ab773ddf7bae04eb7d1cca3fe01344dcae9 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:44 2018 +0200 + + xwayland: check for EGLStream backend explicitly + + Now that we have separate backends for EGLStream and GBM, we can + explicitly check for the EGLStream backend to disable present support + in that case. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit 5d843f6947538dabde258584a5795e0b25ea8779) + +commit 60020989b9759a05153f832a160e6f573d53e266 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:43 2018 +0200 + + xwayland: refactor EGL backends for wayland registry + + To be able to check for availability of the Wayland interfaces required + to run a given EGL backend (either GBM or EGLStream for now), we need + to have each backend structures and vfuncs in place before we enter the + Wayland registry dance. + + That basically means that we should init all backends at first, connect + to the Wayland compositor and query the available interfaces and then + decide which backend is available and should be used (or none if either + the Wayland interfaces or the EGL extensions are not available). + + For this purpose, hold an egl_backend struct for each backend we are to + consider prior to connect to the Wayland display so that, when we get to + query the Wayland interfaces, everything is in place for each backend to + handle the various Wayland interfaces. + + Eventually, when we need to chose which EGL backend to use for glamor, + the available Wayland interfaces and EGL extensions available are all + known to Xwayland. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit d7185a84b60ed03aaa84eb522dcff365218e7211) + +commit cb698ec2ba11b827c4e6785693a83a27eec3c635 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:42 2018 +0200 + + xwayland: move EGL backend init to glamor + + Move EGL backends initialization to its own function in + xwayland-glamor.c + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit 48f037a27c45b571c9750ac812977ac0a33ab12b) + +commit 8ffee3a6bd8901b4c87890087b8bd2ccb4a30a5c +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:41 2018 +0200 + + xwayland: Add Wayland interfaces check + + Introduces a new egl_backend function to let the EGL backend check for + the presence of the required Wayland interfaces. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit f2fcb4877e976d078b0eb4755177170467341484) + +commit aad1525180c0352ab9ea22c35405226b3afa69cc +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:40 2018 +0200 + + xwayland: move egl_backend to its own struct + + EGL backend availability requires both EGL extensions and Wayland + interfaces to be present, so we will need to consider multiple backends + during initialization. + + As a preliminary work, move the egl_backend to its own struct so that we + can have more than one backend at any given time. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit b74b0f18b8d3032317e38453ee63ae9efd33a098) + +commit 831f7194b7006da14424da219661373e7d49114a +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:39 2018 +0200 + + xwayland: skip drm authentication with render node + + If using a render node, we can skip DRM authentication. + + Suggested-by: Emil Velikov + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit de004eefc60ec595f5d6d81658468e082f8df930) + +commit 60eda2af0acd54e05ab794947f106f8f2d421e90 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:38 2018 +0200 + + xwayland: GBM should fail w/out "GL_OES_EGL_image" + + Surely, we should fail to init GBM backend if "GL_OES_EGL_image" is + missing. + + This seems to have been lost with commit 1545e2dba ("xwayland: Decouple + GBM from glamor"). + + Suggested-by: Emil Velikov + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit b823b43dca143810146f563d09e8996058b9d09e) + +commit f8e96b22bfac0733328fb9902c151003db5cc724 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:37 2018 +0200 + + xwayland: swap "name" and "id" in init_wl_registry() + + Both xwl_glamor_init_wl_registry() and the Wayland global registry + handler use the interface id/name in that order, using name/id in the + egl_backend vfunc makes things confusing and error prone. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit 78ce4aa979ff3f5870fbc12a7e5c53547084a61a) + +commit 443e3348bb3c561160a2542365507179bd8dd825 +Author: Olivier Fourdan +Date: Tue Jun 5 19:38:36 2018 +0200 + + xwayland: move glamor specific routines + + Functions such as: + + xwl_glamor_egl_supports_device_probing() + xwl_glamor_egl_get_devices() + xwl_glamor_egl_device_has_egl_extensions() + + Are of no use outside of EGLStream support, move them to the relevant + source file. + + Similarly, the other glamor functions such as: + + xwl_glamor_init() + xwl_screen_set_drm_interface() + xwl_screen_set_dmabuf_interface() + xwl_glamor_pixmap_get_wl_buffer() + xwl_glamor_init_wl_registry() + xwl_glamor_post_damage() + xwl_glamor_allow_commits() + xwl_glamor_egl_make_current() + + Are useless without glamor support enabled, move those within a + a "#ifdef XWL_HAS_GLAMOR" in xwayland.h + + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + (cherry picked from commit f6b2109c1b49484af772df518314ec8e8432febe) + +commit dea40be93577dff80cf25e9b39c2aaea030b9c9e +Author: Olivier Fourdan +Date: Tue Jun 5 19:37:58 2018 +0200 + + xwayland: make xwl_output_get_xdg_output() static + + Make xwl_output_get_xdg_output() private, it doesn't need to be + available elsewhere. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Lyude Paul + Reviewed-by: Emil Velikov + (cherry picked from commit d31a7be15e259275599a9f67e0d921471ae64913) + +commit 04a19291c93aaa4feeaf7a87663eaf1ef7c1f4b8 +Author: Olivier Fourdan +Date: Tue Jun 5 19:37:57 2018 +0200 + + xwayland: do not disable glamor if EGLStream failed + + EGLStream requires glamor, but the opposite is not true. So if someone + passes "-eglstream" with a GPU which does not support EGLStream, we + could maybe still try GBM and be lucky. + + That allows Wayland compositors to pass "-eglstream" regardless of the + actual hardware, if they want to enable EGLStream on GPU which support + it. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Lyude Paul + Reviewed-by: Emil Velikov + (cherry picked from commit e16a6da79dea793a335be70ba07d5e1c1295b5eb) + +commit de40a55235614d6114e97bd8c6f687bb555bdba8 +Author: Olivier Fourdan +Date: Tue Jun 5 19:37:56 2018 +0200 + + xwayland: process Wayland events after adding screen + + When we're done adding a new screen, we need to process any pending + Wayland events again. + + Hence we don't end up processing xdg_output events unexpectedly when + glamor is disabled. Be that because "-shm" was passed or "-eglstream" + has failed. + + Failing to do that could lead to a crash at startup: + + Xwayland: dixGetPrivateAddr: Assertion `key->initialized' failed. + (EE) + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler) + (EE) 1: libpthread.so.0 (funlockfile) + (EE) 2: libc.so.6 (gsignal) + (EE) 3: libc.so.6 (abort) + (EE) 4: libc.so.6 (?+0x0) + (EE) 5: libc.so.6 (__assert_fail) + (EE) 6: Xwayland (dixGetPrivateAddr) + (EE) 7: Xwayland (_fbGetWindowPixmap) + (EE) 8: Xwayland (getDrawableDamageRef) + (EE) 9: Xwayland (damageRegionProcessPending) + (EE) 10: Xwayland (damagePolyFillRect) + (EE) 11: Xwayland (miPaintWindow) + (EE) 12: Xwayland (miWindowExposures) + (EE) 13: Xwayland (miHandleValidateExposures) + (EE) 14: Xwayland (SetRootClip) + (EE) 15: Xwayland (update_screen_size) + (EE) 16: Xwayland (apply_output_change) + (EE) 17: libffi.so.6 (ffi_call_unix64) + (EE) 18: libffi.so.6 (ffi_call) + (EE) 19: libwayland-client.so.0 (wl_log_set_handler_client) + (EE) 20: libwayland-client.so.0 (_init) + (EE) 21: libwayland-client.so.0 (wl_display_dispatch_queue_pending) + (EE) 22: libwayland-client.so.0 (wl_display_roundtrip_queue) + (EE) 23: Xwayland (InitInput) + (EE) 24: Xwayland (dix_main) + (EE) 25: libc.so.6 (__libc_start_main) + (EE) 26: Xwayland (_start) + (EE) + (EE) + Fatal server error: + (EE) Caught signal 6 (Aborted). Server aborting + (EE) + Aborted (core dumped) + + Signed-off-by: Olivier Fourdan + Reviewed-by: Lyude Paul + Reviewed-by: Emil Velikov + (cherry picked from commit 44560af02823239e1b5b236e8cb365b5bdf24b6a) + +commit 2d31a40db5ab3dc93863dc5ed9d9865490508575 +Author: Olivier Fourdan +Date: Tue Jun 5 19:37:55 2018 +0200 + + xwayland: "EGL_EXT_device_base" required for EGLStream + + eglQueryDevicesEXT() would abort if the required extensions are not + available, meaning that enabling “-eglstream” on a non-EGLStream + capable hardware would lead to an abort(). + + Check that "EGL_EXT_device_base" extension is available and bail out + early if not, so we don't abort() later in eglQueryDevicesEXT(). + + Signed-off-by: Olivier Fourdan + Reviewed-by: Lyude Paul + Reviewed-by: Emil Velikov + (cherry picked from commit dbde3fec32641ae23389cffa12a04d3608936795) + +commit 65d46b2dfd638f6f6c6e52f3494c64716fc6687e +Author: Olivier Fourdan +Date: Tue Jun 5 19:37:54 2018 +0200 + + xwayland: allow "-eglstream" option + + The command line option "-eglstream" used to enable EGLStream support + for NVidia GPU was made available only when Xwayland was built with + EGLStream support enabled. + + Wayland compositors who spawn Xwayland have no easy way to tell whether + or not Xwayland was built with EGLStream support enabled, and adding + "-eglstream" command line option to Xwayland when it wasn't built with + EGLStream support would prevent Xwayland from starting (“Unrecognized + option” error). + + Make sure we support the command line option "-eglstream" regardless of + EGLStream support in Xwayland. Obviously, if Xwayland was built without + EGLStream support, this has no effect. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Lyude Paul + Reviewed-by: Emil Velikov + (cherry picked from commit 06c31e782e360363238cf20e7afd3e4990a2c304) + +commit 38835d1d8f613c3553149fc05e61a8bb9b0aef48 +Author: Vladimir Panteleev +Date: Wed Jun 20 13:37:45 2018 +0000 + + glx/vndcmds: Fix vendor hash table key size + + The keySize parameter of the hashing/comparison functions was + incorrectly specified to be sizeof(void*), even though the keys of + this hashtable are CARD32. + + Fixes address sanitizer failure on 64-bit builds. + + Reviewed-by: Adam Jackson + (cherry picked from commit 707d0f912b916e7546c4f7e7a5f7023a53e74615) + +commit d7220428daee26acecb6ae9771e255c801c83572 +Author: Alexander Volkov +Date: Tue Jun 5 13:05:39 2018 +0300 + + Xext/shm: Refuse to work for remote clients + + Avoid access to System V shared memory segment on the X server side + for clients forwarded via SSH. Also prevent them from hanging while + waiting for the reply from the ShmCreateSegment request. + + v2: Allow ShmQueryVersion request even for remote clients + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=11080 + Signed-off-by: Alexander Volkov + Reviewed-by: Adam Jackson + (cherry picked from commit ec7e2b54c5b4a34b2a077082967bc3ead30e227e) + +commit 9e417072bcde15f32dbf083327b6fe0202bb4cf4 +Author: Michał Górny +Date: Mon Jun 11 17:17:31 2018 -0400 + + xfree86: Makefile shouldn't rely on superuser being named 'root' + + Change the 'chown' statement in Makefile.am to use the numeric UID + of superuser instead of relying on the name 'root'. + + Bugzilla: https://bugs.freedesktop.org/27726 + Signed-off-by: Adam Jackson + Signed-off-by: Michał Górny + Reviewed-by: Peter Hutterer + (cherry picked from commit 5c95be38e5af28108d8c6c08dfe08d1dfcb7ed42) + +commit 2e66ed066e4a9b52bcebf2ca3762f7e1ad141cf0 +Author: Olivier Fourdan +Date: Fri Jun 8 16:23:44 2018 +0200 + + xwayland: use pixmap size on present flip + + If the pixmap size does not match the present box size, flickering + occurs. + + This can happen when the client changes its size (e.g. switching to + fullscreen), and since the buffer is kept as long as the pixmap is + valid, once the buffer is created, it remains at the wrong (old) size + and causes continuous flickering. + + Use the actual pixmap's drawable size instead of the present box to + create the buffer so that it's sized appropriately. + + Bugzilla: https://bugs.freedesktop.org/106841 + Fixes: 0fb2cca193e6 "xwayland: Preliminary support for Present's new + window flip mode" + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + Reviewed-by: Roman Gilg + (cherry picked from commit 1993f147d08170f07a72e43f0a0f27687e16967b) + +commit 883d4d00b46f18902ad402a156d56b1bfcc06ebe +Author: Michel Dänzer +Date: Thu Jun 7 17:55:21 2018 +0200 + + present/wnmd: Preserve window pixmap's screen_x/y on flip + + The incorrect values could result in the new pixmap's contents + getting corrupted down the line. + + v2: + * Guard screen_x/y lines by #ifdef COMPOSITE + + Bugzilla: https://bugs.freedesktop.org/106841 + Fixes: 029608dd8020 "present: Add window flip mode" + Reviewed-by: Adam Jackson # v1 + Reviewed-by: Keith Packard # v1 + Reviewed-by: Roman Gilg + Tested-by: Olivier Fourdan # v1 + (cherry picked from commit 10eec2ccb11701fe29ab246acd6c0bdc2991b775) + +commit 55171d738a0c2dd8a37ba2c880ea4658fd8001a2 +Author: Dave Airlie +Date: Tue May 29 10:39:22 2018 +1000 + + xwayland: fix typo in non-modifier fallback path + + Pointed out on irc by q66. + Reviewed-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + + (cherry picked from commit 6300049a9a4b84789a2e8141f5cad17adf22185c) + +commit 64bf28572946da1db84f6e61b02b5e6432f13d10 +Author: Roman Kapl +Date: Thu Jun 7 03:31:42 2018 +0200 + + Xi: add forgotten byte-swaps for Valuator fields + + This has caused nonsensical values in xinput output. + + Signed-off-by: Roman Kapl + Signed-off-by: Peter Hutterer + (cherry picked from commit 40586cc4f8faa271d62fd84fe98c41debb878984) + +commit 273115a01285ff2ce4837687f9bfc9d745a519a3 +Author: Roman Kapl +Date: Thu Jun 7 03:31:41 2018 +0200 + + Xi: fix byte-swapping of button labels + + The byte-swapping code forgot that the xXIButtonInfo is followed by a + button mask, not directly by the button labels. This resulted in client + crashes in cross-endian setups, for example in `xinput list --long`, + since the client got an invalid atom. + + A new function was introduced to get the right positions for the label + and mask data. + + Signed-off-by: Roman Kapl + Signed-off-by: Peter Hutterer + (cherry picked from commit cefbc6a9356e5c6cf935b61557efa897762defae) + +commit 69980e4e5a0d8ff3b36acf09e3c1e8eb76710726 +Author: Michel Dänzer +Date: Fri Jun 1 11:57:15 2018 +0200 + + exa: Use PictureMatchFormat for source-only picture format description + + Their pFormat member is NULL, which resulted in a crash in + miRenderColorToPixel. + + Fixes: 8171d4c2d67b "render: Store and use all 16bpc of precision for + solid pixels (v2.1)" + Reviewed-by: Adam Jackson + (cherry picked from commit 3ebef6ab850675e1091df2125ebdfbb147436e6c) + +commit 33f20c38fc15e6664635ad22a581d7860e4b185d +Author: Michel Dänzer +Date: Wed May 23 11:18:02 2018 +0200 + + glamor: Propagate glamor_fds_from_pixmap error in glamor_fd_from_pixmap + + glamor_fds_from_pixmap returns 0 on error, but we were treating that as + success, continuing with uninitialized stride and fd values. + + Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap. + + v2: + * Reduce to a simple one-liner fix (Emil Velikov) + + Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and + BuffersFromPixmap" + Reviewed-by: Emil Velikov + (cherry picked from commit 4d5950ce14676f970d9de97380929a93948b98f2) + +commit 544caffae1b0dc786383b117c036284feb579a66 +Author: Michel Dänzer +Date: Wed May 23 11:38:13 2018 +0200 + + glamor: Always return 0 from glamor_fds_from_pixmap on error + + This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do + and what proc_dri3_buffers_from_pixmap expects. + + Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and + BuffersFromPixmap" + Reviewed-by: Emil Velikov + (cherry picked from commit 3da999a0390407d512bf784e4faf01482bfff9ea) + +commit a9a17581ce73a49f0a8d3b9dbb2db083fa44cb69 +Author: Michel Dänzer +Date: Fri May 18 11:23:01 2018 +0200 + + modesetting: Pass O_CLOEXEC when opening a DRM device + + We don't want DRM file descriptors to leak to child processes. + + Reviewed-by: Keith Packard + Signed-off-by: Michel Dänzer + (cherry picked from commit 315c63c41d833700c505e4f21ffac4c59e1e3b2c) + +commit c3a06e330b7e55e1daeefbb5c16a075c80233bb0 +Author: Michel Dänzer +Date: Fri May 18 11:23:00 2018 +0200 + + xfree86: Fix O_CLOEXEC usage in lnx_platform + + It was passing O_CLOEXEC as permission bits instead of as a flag. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + (cherry picked from commit ab53e2859facecc0486344679dc01ea31fb427e9) + +commit 662273397c537d031e1aee7c607c925ec6bb2d10 +Author: Lukas F. Hartmann +Date: Tue May 15 21:51:56 2018 +0200 + + glamor_init: clamp GLSL to 120 if platform doesn't have instanced arrays + + Hi, + + I upgraded Xwayland and the assorted libraries from git masters today, + and noticed that glamor wouldn't work anymore on i.MX6/etnaviv. The + error was: + + No provider of glVertexAttribDivisor found. Requires one of: + Desktop OpenGL 3.3 + OpenGL ES 3.0 + GL extension "GL_ANGLE_instanced_arrays" + GL extension "GL_ARB_instanced_arrays" + GL extension "GL_EXT_instanced_arrays" + GL extension "GL_NV_instanced_arrays" + + The problem is that etnaviv offers GLSL 140 on GL 2.1 and glamor + rendering assumes that glVertexAttribDivisor() is always available on + GLSL>=130, which is not the case here. Forcing GLSL 120 makes glamor + work fine again on this platform. After chatting with ajax in + #xorg-devel, the following solution was proposed. + + This is my first time of submitting a patch, so please excuse me and + advise if I'm doing it wrong ;) + + Cheers + Lukas (mntmn) + Reviewed-by: Eric Anholt + + (cherry picked from commit 7437b6dbdee050f8ebb3a79b9077d051c91880c3) + +commit 590374bd9213091b51679887d473d1a3067c99b5 +Author: Bas Nieuwenhuizen +Date: Sun May 13 15:31:37 2018 +0200 + + DRI2: Sync radeonsi_pci_ids.h from Mesa + + Fixes DRI2 client driver name mapping for newer AMD GPUs with the + modesetting driver, allowing the DRI2 extension to initialize. + + Fixes using GL with the modesetting driver for me. + + Seems we were way behind on this one, time to look into something + more scalable? + + Signed-off-by: Bas Nieuwenhuizen + Reviewed-by: Alex Deucher + (cherry picked from commit 3ab32a537840c6e6d6228b4ba62f98fbf5224f8a) + +commit 5407be2c516fa23c505e7ba254367b5739399960 +Author: Jon Turney +Date: Sun May 13 19:36:05 2018 +0100 + + meson: don't put literal 'PACKAGE_STRING' and 'XORG_MAN_PAGE' in man pages + + Instead, substitute the same values as autotools does + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + (cherry picked from commit 27eff10bfa1a02da7338a82e2312d2080e3e5876) + +commit acd881e271419a2fc08cfc34ed9845346cee9e84 +Author: Jon Turney +Date: Sun May 13 19:36:04 2018 +0100 + + meson: don't install xorg wrapper manpages if suid-wrapper isn't being used + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + (cherry picked from commit 47321bb455b1226c04711241496e62667eea34ea) + +commit c09c78298cdb4cdd8383e252d8fe68adae1f3c54 +Author: Jon Turney +Date: Sun May 13 19:36:03 2018 +0100 + + meson: install xwinclip and Xwinrc man pages + + Omitted from a1e8dc05 + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + (cherry picked from commit 08a3583b5b2f812cc7f039aebd74ff9b1cb0dbcd) + +commit 82f8fc5ffc0065537896ec43ae60d67d9a164c75 +Author: Adam Jackson +Date: Thu May 10 12:24:11 2018 -0400 + + xserver 1.20 + + Signed-off-by: Adam Jackson + +commit b6bf68b8416ec4b717eb78703fb63789c68e509a +Author: Aaron Plattner +Date: Wed May 2 12:54:26 2018 -0700 + + meson: Fix module_dir configuration (v2) + + meson.build has code to set the module_dir variable to + ${libdir}/xorg/modules if the module_dir option string is empty. + However, this has several problems: + + 1. The variable is only used for an unused @moduledir@ substitution in + the man page. The rule for xorg-server.pc uses option('module_dir') + directly instead. + 2. The 'module_dir' option has a default value of 'xorg/modules' so the + above rule doesn't do anything by default. + 3. The xorg-server.pc rule uses ${exec_prefix}/option('module_dir'), so + the effect of #2 is that the default moduledir is different between + autoconf and meson. E.g. if ${prefix} is /X, then you get + + autoconf: moduledir=/X/lib/xorg/modules + meson: moduledir=/X/xorg/modules + + Fix this by using the module_dir variable when generating xorg-server.pc, and by + using join_paths() to assign module_dir unconditionally. + + v2: Keep the 'xorg/modules' default path, but use join_paths() unconditionally (Thierry Reding) + + Signed-off-by: Aaron Plattner + Reviewed-by: Peter Hutterer + +commit 9d628ee5facf6318368d5b8ca181e083adcffe8c +Author: Roman Gilg +Date: Wed May 2 21:32:48 2018 +0200 + + modesetting: set gbm as dependency in meson build + + Modifiers support needs gbm as a dependency. Without setting the dependency + included headers are not found reliably and the build might fail if the + headers are not placed in the default system include paths. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 0445705a8bbf76a5532997823ea8110daff26c6d +Author: Adam Jackson +Date: Mon May 7 17:21:20 2018 -0400 + + man: Fix automake seddery + + Because this is an automakefile, things inside @@ get expanded, which + means your sed ends up saying s|/var/log|/var/log| and your manual pages + still have @logdir@ in them. Fix this by hiding the @s inside a trivial + character range, which keeps the pattern preserved all the way into the + Makefile. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 9f21872ad8591c1f6f8ea1e466f212c3582d3c33 +Author: Adam Jackson +Date: Mon May 7 17:21:19 2018 -0400 + + glx: Be sure to set an error for ghost contexts + + Otherwise the caller is going to return garbage memory for the error + value. + + Signed-off-by: Adam Jackson + +commit b9f415cbad47412bfb218cf7375d0c2856a27d1b +Author: Adam Jackson +Date: Mon May 7 17:21:18 2018 -0400 + + present: Fix swapping of PresentCompleteNotify events + + The code would fall through to the PresentIdleNotify case, and nothing + good would come of it. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit cc66777d85f3509b0f9dfc9210d0a0415a2a388d +Author: Adam Jackson +Date: Mon May 7 17:21:17 2018 -0400 + + xwayland: Don't create a "fake" crtc for Present + + We probably don't want a fake crtc to be visible to clients, and we + definitely don't want to generate events every time we create such a + fake (which would happen as a side effect from RRCrtcCreate hitting + RRTellChanged). As it happens we're not actually using that crtc for + anything because xwayland doesn't store any state on the crtc object, + so it suffices to use the real crtc for the screen. + + Signed-off-by: Adam Jackson + Tested-by: Roman Gilg + Reviewed-by: Roman Gilg + +commit b23a0e4ded62500f2c248f23962ff5ac718467e6 +Author: Eric Anholt +Date: Mon May 7 16:46:20 2018 -0700 + + xwayland: Fix a 32-bit build warning. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit ef95331603ff31d3643360c399b3865db5b0b97d +Author: Eric Anholt +Date: Mon May 7 16:46:19 2018 -0700 + + dri3: Switch fds_from_pixmap to stdint types. + + Again, this was causing 32-bit build warnings due to mixing CARD* and + stdint. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 4c754b01fafc4b042d9918c05a71157f6fa6392a +Author: Eric Anholt +Date: Mon May 7 16:46:18 2018 -0700 + + dri3: Switch get_modifiers to using stdint. + + We were mixing stdint and CARD* types, causing compiler warnings on + 32-bit. Just switch over to stdint, which is what we'd like the server + to be using long term, anyway. + + Reviewed-by: Adam Jackson + +commit 5e86484a183f051d7a8a67ea13c23a3d6e69e76b +Author: Eric Anholt +Date: Mon May 7 16:46:17 2018 -0700 + + dri3: Switch get_drawable_modifiers to using stdint. + + We were mixing stdint and CARD* types, causing compiler warnings on + 32-bit. Just switch over to stdint, which is what we'd like the server + to be using long term, anyway. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 4ec02b573ef2424965d7ce2d33d150ddb92ec544 +Author: Eric Anholt +Date: Mon May 7 16:46:16 2018 -0700 + + randr: Fix a compiler warning on 32-bit. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit e1ccd0fa0e1081edf8a2c69ce6e8e3f67a4aecba +Author: Eric Anholt +Date: Mon May 7 16:46:15 2018 -0700 + + dix: Fix a warning about GetTimeInMillis return value in XFont2. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit cf838f5ca81e0c967902b74fb1971bc6fac5c601 +Author: Roman Gilg +Date: Fri May 4 03:07:31 2018 +0200 + + xwayland: persistent window struct on present + + Instead of reusing xwl_window introduce a persistent window struct for every + window, that asks for Present flips. + + This struct saves all relevant data and is only freed on window destroy. + + Signed-off-by: Roman Gilg + Tested-by: Olivier Fourdan + +commit c9afd8cb5ec975b189ab7b678e1f997d6a2ba5ee +Author: Mario Kleiner +Date: Sun May 6 07:34:31 2018 +0200 + + modesetting: Fix and improve ms_kernel_msc_to_crtc_msc() + + The old 32-Bit wraparound handling didn't actually work, due to some + integer casting bug, and the mapping was ill equipped to deal with input + from the new true 64-bit GetCrtcSequence/QueueCrtcSequence api's + introduced in Linux 4.15. + + For 32-Bit truncated input from pageflip events and old vblank events + and old drmWaitVblank ioctl, implement new wraparound handling, which + also allows to deal with wraparound in the other direction, e.g., if a + 32-Bit truncated sequence value is passed in, whose true 64-Bit + in-kernel hw value is within 2^30 counts of the previous processed + value, but whose 32-bit truncated sequence value happens to lie just + above or below a 2^32 boundary, iow. one of the two values 'sequence' + vs. 'msc_prev' lies above a 2^32 border, the other one below it. + + The method is directly translated from Mesa's proven implementation of + the INTEL_swap_events extension, where a true underlying 64-Bit wide + swapbuffers count (SBC) needs to get reconstructed from a 32-Bit LSB + truncated SBC transported over the X11 protocol wire. Same conditions + apply, ie. successive true 64-Bit SBC values are close to each other, + but don't always get received in strictly monotonically increasing + order. See Mesa commit cc5ddd584d17abd422ae4d8e83805969485740d9 ("glx: + Handle out-of-sequence swap completion events correctly. (v2)") for + explanation. + + Additionally add a separate path for true 64-bit msc input originating + from Linux 4.15+ drmCrtcGetSequence/QueueSequence ioctl's and + corresponding 64-bit vblank events. True 64-bit msc's don't need + remapping and must be passed through. + + As a reliability bonus, they are also used here to update the tracking + values msc_prev and ms_high with perfect 64-Bit ground truth as baseline + for mapping msc from pageflip completion events, because pageflip events + are always 32-bit wide, even when the new kernel api's are used. Because + each pageflip(-event) is always preceeded close in time (and vblank + count) by a drmCrtcQueueSequence queued event or drmCrtcGetSequence + query as part of DRI2 or DRI3+Present swap scheduling, we can be certain + that each pageflip event will get its truncated 32-bit msc remapped + reliably to the true 64-bit msc of flip completion whenever the sequence + api is available, ie. on Linux 4.15 or later. + + Note: In principle at least the 32-bit mapping path could also be + backported to earlier server branches, as this seems to be broken for at + least server 1.16 to 1.19. + + Signed-off-by: Mario Kleiner + Reviewed-by: Adam Jackson + Cc: Keith Packard + Cc: Michel Dänzer + +commit 73f0ed2d928afc692ed057eb3d7627328a6e5b12 +Author: Mario Kleiner +Date: Fri May 4 14:14:10 2018 +0200 + + modesetting: Remove ms_crtc_msc_to_kernel_msc(). + + The function is ported from intel-ddx uxa backend around 2013, where its + stated purpose was to apply a vblank_offset to msc values to correct for + problems with those kernel provided msc values. Some (somewhat magic and + puzzling to myself) heuristic tried to guess if provided values were + unreasonable and tried to adapt the corrective vblank_offset to account + for that. + + Except: It wasn't applied to kernel provided msc values, but the values + delivered by clients via DRI2 or Present, so valid client targetmsc + values, e.g., requesting a vblank event > 1000 vblanks in the future, + triggered the offset correction in arbitrarily wrong ways, leading to + wrong msc values being returned and thereby vblank events queued to the + kernel for the wrong time. This causes glXSwapBuffersMscOML and + glXWaitForMscOML to swap / return immediately whenever a swap/wait in > + 1000 vblanks is requested. + + The original code was also written to only deal with 32 bit mscs, but + server 1.20 modesetting ddx can now use new Linux 4.15+ kernel vblank + api to process true 64 bit msc's, which may confuse the heuristic even + more due to 32 bit integer truncation/wrapping. + + This code caused various problems in the intel-ddx in the past since + year 2013, and was removed there in 2015 by Chris Wilson in commit + 42ebe2ef9646be5c4586868cf332b4cd79bb4618: + + " uxa: Remove the filtering of bogus Present MSC values + + If the intention was to filter the return values from the kernel, the + filtering would have been applied to the kernel values and not to the + incoming values from Present. This filtering introduces crazy integer + promotion and truncation bugs all because Present feeds garbage into its + vblank requests. + + " + + Indeed, i found a Mesa bug yesterday which can cause Mesa's + PresentPixmap request to spuriously feed garbage targetMSC's into the + driver under some conditions. However, while other video drivers seem to + cope relatively well with that, modesetting ddx causes KDE-5's + plasmashell to lock up badly quite frequently, and my suspicion is that + the code removed in this commit is one major source of the extra + fragility. + + Also my own tests fail for any swap scheduled more than 1000 vblanks + into the future, which is not uncommon for some scientific applications. + + Iow. modesetting's swap scheduling seems to be more robust without this + function afaics. + + Signed-off-by: Mario Kleiner + Reviewed-by: Adam Jackson + Cc: Chris Wilson + Cc: Keith Packard + Tested-by: Mike Lothian + +commit f5ded22e14e2e15390eff8e01ce32de496ae0e86 +Author: Aaron Plattner +Date: Fri May 4 10:48:17 2018 -0700 + + meson: Set XCONFIGFILE to 'xorg.conf' instead of '/etc/xorg.conf' + + The autoconf build hard-codes XCONFIGFILE to just 'xorg.conf': + + XF86CONFIGFILE="xorg.conf" + AC_DEFINE_DIR(XCONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) + + Later, the X server passes that into DoSubstitution() which expands the path: + + DoSubstitution(template="/etc/X11/%X", ..., XConfigFile="xorg.conf") + + This returns "/etc/X11/xorg.conf". + + The Meson build, on the other hand, sets XCONFIGFILE to + join_paths(get_option('sysconfdir'), 'xorg.conf'). If sysconfdir is /etc, this + results in '/etc/xorg.conf', resulting in DoSubstitution returning + '/etc/X11/etc/xorg.conf'. + + Fix this by just hard-coding XCONFIGFILE to 'xorg.conf'. + + Signed-off-by: Aaron Plattner + Reviewed-by: Thierry Reding + +commit 1a3e4a2f6722048c5c7c4c1a9d6748e68a895a3e +Author: Aaron Plattner +Date: Fri May 4 15:09:22 2018 -0700 + + meson: Define DEFAULT_LIBRARY_PATH as join_paths(get_option('prefix'), get_option('libdir')) + + 'libdir' defaults to 'lib', so running X -showDefaultLibPath just prints 'lib' + instead of '/usr/lib' or '/usr/local/lib'. Use joint_paths() to get the correct + full path. + + Signed-off-by: Aaron Plattner + Reviewed-by: Thierry Reding + +commit 1dcd784a677c58e77c368a676fd9dbd3159db94f +Author: Anuj Phogat +Date: Thu May 3 11:29:11 2018 -0700 + + dri2: Sync i965_pci_ids.h from mesa + + Copied from Mesa with no modifications. + + Gives us Cofeelake platform names updates and sync on Kaby Lake, + Ice Lake PCI IDs. + + Acked-by: Kenneth Graunke + Signed-off-by: Anuj Phogat + +commit 4191b59bd5458ea3a8b0d5272bdcd250fee1e129 +Author: Adam Jackson +Date: Wed May 2 15:09:52 2018 -0400 + + meson: Fix build with three-component version numbers + + Otherwise: + + include/meson.build:5:0: ERROR: Index 3 out of bounds of array of size 3. + + Signed-off-by: Adam Jackson + +commit 531e1648fc0da03816ecc57481479e6fc6a45ac3 +Author: Adam Jackson +Date: Wed Apr 25 13:39:18 2018 -0400 + + gitlab-ci: Add for gitlab.freedesktop.org + + Looks quite a bit like the travis path, doesn't it? Still, nice to not + rely on an external service if we don't have to. + + Signed-off-by: Adam Jackson + +commit 22285a6f1c5fa6ba22f4214c4ccc09e27d1925f6 +Author: Roman Gilg +Date: Fri Apr 20 17:10:06 2018 +0200 + + present: fix msc offset calculation in window mode + + Instead of getting the current msc value from the window, which might be + different to old one directly take the last saved msc value saved in + the window_priv struct. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit d7297b00444b0e2cd936fbfb08206a575ab8c29d +Author: Chris Wilson +Date: Mon Apr 30 15:19:53 2018 -0700 + + randr: Account for panning and transforms when constraining the cursor + + commit 56c90e29f04727c903bd0f084d23bf44eb1a0a11 [1.10.99.901] + Author: Adam Jackson + Date: Mon Nov 15 14:29:14 2010 -0500 + + randr: Add RRConstrainCursorHarder + + introduced a regression as it ignored the effect of panning and + transforms upon the crtc bounds. The result was that the cursor would be + constrained to the visible area even though the panning arena was much + bigger, or the cursor was constrained to a region that did not even + match the visible area when the output was transformed or reflected. + + This supercedes the hack introduced by + commit 1bf81af4a6be1113bcc3b940ab264d5c9e0f0c5d [1.12.99.904] + Author: Rui Matos + Date: Mon Jul 30 14:32:12 2012 -0400 + + xf86RandR12: Don't call ConstrainCursorHarder() if panning is enabled + which disabled the cursor constraints if a panning mode was active, but + did not fix the regression with arbitrary output transforms. + + Signed-off-by: Chris Wilson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39949 + Reviewed-by: Adam Jackson + Cc: Rui Matos + +commit a843c61456b2046fb1780415f17162b503243af7 +Author: Roman Gilg +Date: Fri Apr 20 17:07:42 2018 +0200 + + xwayland: restrict present cleanup to presenting and top parent window + + Clean up only if the request points to the presenting window or its top + parent window. + + Since in this case all events are removed unconditionally, always stop + the timer. + + Reviewed-by: Adam Jackson + Signed-off-by: Roman Gilg + +commit 975d3a509667579b81d88616b91491472059354d +Author: Adam Jackson +Date: Mon Apr 30 14:10:26 2018 -0400 + + xwayland: Avoid using epoxy_has_egl() + + There's no real point - if we don't have EGL then the extension check is + also going to fail - and the entrypoint is new in 1.5.0, which we don't + need to require yet. + + Signed-off-by: Adam Jackson + Reviewed-by: Mario Kleiner + +commit d6f2272f44ce1a7a96ae04fdbde8708514c60771 +Author: Adam Jackson +Date: Mon Apr 30 14:07:44 2018 -0400 + + meson: Bump version number here too + + Signed-off-by: Adam Jackson + +commit 6cace4990abc2386b6ea68536b321994d264c295 +Author: Louis-Francis Ratté-Boulianne +Date: Thu Apr 26 11:04:15 2018 -0400 + + modesetting: Fix GBM objects leak when checking for flip + + GBM objects were never destroyed after looking for format and + modifier compatibility when deciding whether flipping or copying + a presented pixmap. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106106 + Signed-off-by: Louis-Francis Ratté-Boulianne + +commit e00ada9fbbddf4570fe38c3ceeb922af7afcfd1a +Author: Mario Kleiner +Date: Mon Apr 30 09:06:09 2018 +0200 + + glamor: Don't fail in glamor_get_formats if not dmabuf_capable. + + If dmabuf_capable is false, because the server "dmabuf_capable" + debug flag isn't set, treat it as successfull query with zero + returned formats, instead of failure. + + This allows the servers cache_formats_and_modifiers() function + to cache the fact that formats are not supported during the + current server generation, instead of pointless retesting at + every invocation. + + Signed-off-by: Mario Kleiner + Reviewed-by: Adam Jackson + +commit 55db3c9cfc1bc92a53b75b99e8fa49a32d7efe63 +Author: Mario Kleiner +Date: Mon Apr 30 09:06:08 2018 +0200 + + dri3: Robustly clamp to 1.0 if not all screens support 1.2 + + Checking for dri3_screen_info_rec.version >= 2 is insufficient, + as some shipping drivers, e.g., intel-ddx, nouveau-ddx, set the + version to DRI3_SCREEN_INFO_VERSION, ie. to whatever version the + installed servers headers define. On server 1.20 that would + be version 2, but the drivers still don't support the v1.2 + hooks. Make sure all hooks are defined before reporting v1.2. + + Also make clamping of reported version to minimum of client + or server robust against possible future clients with possible + majorVersion >= 2.0. + + Signed-off-by: Mario Kleiner + Reviewed-by: Adam Jackson + Cc: Daniel Stone + +commit fbc5c5cd532962d2df96a04e5c8cc0d21b47b08a +Author: Mario Kleiner +Date: Mon Apr 30 09:06:07 2018 +0200 + + dri3: Fix error handling in dri3_buffer_from_pixmap request. + + The old info->fd_from_pixmap() driver hook, which is + preferentially used in dri3_fd_from_pixmap(), can return + error codes other than -1, e.g., -EINVAL (-22) on nouveau-ddx. + + Not handling the error causes a broken/corrupted X-Connection + resulting from a failed request. + + This fixes failure of sddm-greeter to start up under nouveau-ddx + with DRI3 enabled and DRI3 protocol version properly clamped + to 1.0 by the server (see followup patch). + + Fixes: 75bba3aedcb0 ("dri3: Use single-FD screen call for single-FD request") + Signed-off-by: Mario Kleiner + Reviewed-by: Adam Jackson + Cc: Daniel Stone + +commit 19d006ee3db4b4635ef9ef5c92562f3ffeddb305 +Author: Adam Jackson +Date: Tue Apr 24 16:08:26 2018 -0400 + + dri3: Clamp to 1.0 if not all screens support 1.2 + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 352a5ac87fd344936b759a5766eb74271e7d295d +Author: Mario Kleiner +Date: Tue Apr 24 10:17:26 2018 +0200 + + dri3: Fix DRI3.2 support for drivers other than modesetting-ddx. + + Both xf86-video-intel and xf86-video-nouveau cause OpenGL clients to + fail when used with DRI3 on server 1.20 with Mesa 18.1. + + Reason is that the servers DRI3 version is now unconditionally reported + as DRI3 1.2 to 1.2 capable clients. This causes clients using Mesa 18.1 + to use the new DRI 3.2 requests DRI3GetSupportedModifiers, + DRI3PixmapFromBuffers, etc. Drivers other than modesetting-ddx do not + support the needed hooks like info->pixmap_from_fds or + info->get_formats, info->get_modifiers. Unfortunately we can't simply + report the servers DRI3 version as 1.0 in this case, as the reported + version can not be specific to a X-Screen, and different screens may + have drivers with different capabilities. + + Luckily the server has fallbacks to ->pixmap_from_fd, ->fd_from_pixmap, + and simply reporting an empty set of supported modifiers for the + DRI3GetSupportedModifiers request if the ddx doesn't support DRI 3.2. + + Clients like Mesa 18.1's dri3 loader respond to the empty set of + reported modifiers by falling back to a dri driver selected buffer + format (image->createImageWithModifiers responds to a NULL modifier_list + by acting like ->createImage()). This works, but Mesa 18.1 will still + try to use the DRI3PixmapFromBuffers request to create the corresponding + pixmap, just passing in a modifier that corresponds to whatever tiling + the dri driver selected by default. To prevent this request - and + thereby the client - from failing with a BadImplementation error, remove + the check for modifier == DRM_MOD_FORMAT_INVALID in the pixmap_from_fd + fallback path of dri3_pixmap_from_fds() and trust that if we hit the + fallback path then the client will have passed a buffer with some driver + specific default tiling that can be handled by pixmap_from_fd. + + Another approach would be for Mesa's dri3 loader to keep track how a + buffer was created (with explicit modifiers or not), and then call + DRI3PixmapFromBuffers or DRI3PixmapFromBuffer, but then any future DRI3 + client implementation would need to be fixed, so the server side is + probably the better place for this. + + Tested on Intel Ivybridge and NVidia Pascal. + + Fixes: 6e7c40f62db6 ("dri3: Add multi-planar/modifier buffer requests") + Signed-off-by: Mario Kleiner + Cc: Daniel Stone + Cc: Louis-Francis Ratté-Boulianne + Tested-by: Mike Lothian + Reviewed-by: Adam Jackson + +commit c6ab21022ce876f9c1409db4bb1967134f9f6dbe +Author: Adam Jackson +Date: Tue Apr 24 17:03:07 2018 -0400 + + xserver 1.20 RC5 + + Signed-off-by: Adam Jackson + +commit c593d843f6305dd8bc5fa7762273d319a223abc4 +Author: Daniel Stone +Date: Tue Apr 24 21:27:47 2018 +0100 + + dri3: Don't call vfuncs on old DRI3 screens + + Only call the get_supported_modifiers vfunc if the DRI3 screen struct is + sufficiently new. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit 54ac09717cd8c49259f53a4a227d903ebe8e0a32 +Author: Lyude Paul +Date: Fri Apr 20 14:38:05 2018 -0400 + + xwayland: Add glamor egl_backend for EGLStreams + + This adds initial support for displaying Xwayland applications through + the use of EGLStreams and nvidia's custom wayland protocol by adding + another egl_backend driver. This also adds some additional egl_backend + hooks that are required to make things work properly. + + EGLStreams work a lot differently then the traditional way of handling + buffers with wayland. Unfortunately, there are also a LOT of various + pitfalls baked into it's design that need to be explained. + + This has a very large and unfortunate implication: direct rendering is, + for the time being at least, impossible to do through EGLStreams. The + main reason being that the EGLStream spec mandates that we lose the + entire color buffer contents with each eglSwapBuffers(), which goes + against X's requirement of not losing data with pixmaps. no way to use + an allocated EGLSurface as the storage for glamor rendering like we do + with GBM, we have to rely on blitting each pixmap to it's respective + EGLSurface producer each frame. In order to pull this off, we add two + different additional egl_backend hooks that GBM opts out of + implementing: + + - egl_backend.allow_commits for holding off displaying any EGLStream + backed pixmaps until the point where it's stream is completely + initialized and ready for use + - egl_backend.post_damage for blitting the content of the EGLStream + surface producer before Xwayland actually damages and commits the + wl_surface to the screen. + + The other big pitfall here is that using nvidia's wayland-eglstreams + helper library is also not possible for the most part. All of it's API + for creating and destroying streams rely on being able to perform a + roundtrip in order to bring each stream to completion since the wayland + compositor must perform it's job of connecting a consumer to each + EGLstream. Because Xwayland has to potentially handle both responding to + the wayland compositor and it's own X clients, the situation of the + wayland compositor being one of our X clients must be considered. If we + perform a roundtrip with the Wayland compositor, it's possible that the + wayland compositor might currently be connected to us as an X client and + thus hang while both Xwayland and the wayland compositor await responses + from eachother. To avoid this, we work directly with the wayland + protocol and use wl_display_sync() events along with release() events to + set up and destroy EGLStreams asynchronously alongside handling X + clients. + + Additionally, since setting up EGLStreams is not an atomic operation we + have to take into consideration the fact that an EGLStream can + potentially be created in response to a window resize, then immediately + deleted due to another pending window resize in the same X client's + pending reqests before Xwayland hits the part of it's event loop where + we read from the wayland compositor. To make this even more painful, we + also have to take into consideration that since EGLStreams are not + atomic that it's possible we could delete wayland resources for an + EGLStream before the compositor even finishes using them and thus run + into errors. So, we use quite a bit of tracking logic to keep EGLStream + objects alive until we know the compositor isn't using them (even if + this means the stream outlives the pixmap it backed). + + While the default backend for glamor remains GBM, this patch exists for + users who have had to deal with the reprecussion of their GPU + manufacturers ignoring the advice of upstream and the standardization of + GBM across most major GPU manufacturers. It is not intended to be a + final solution to the GBM debate, but merely a baindaid so our users + don't have to suffer from the consequences of companies avoiding working + upstream. New drivers are strongly encouraged not to use this as a + backend, and use GBM like everyone else. We even spit this out as an + error from Xwayland when using the eglstream backend. + + Signed-off-by: Lyude Paul + Acked-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit 994f781007079176e0247ee64af5696d34debcde +Author: Lyude Paul +Date: Fri Apr 20 14:38:04 2018 -0400 + + xwayland: Add xwayland-config.h + + Just a small autogenerated header that will soon contain more then just + one macro. + + Signed-off-by: Lyude Paul + Reviewed-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit 1545e2dbadcb147d7d52b546d053149de866a031 +Author: Lyude Paul +Date: Fri Apr 20 14:38:03 2018 -0400 + + xwayland: Decouple GBM from glamor + + This takes all of the gbm related code in wayland-glamor.c and moves it + into it's own EGL backend for Xwayland, xwayland-glamor-gbm.c. + Additionally, we add the egl_backend struct into xwl_screen in order to + provide hooks for alternative EGL backends such as nvidia's EGLStreams. + + Signed-off-by: Lyude Paul + Reviewed-by: Lyude Paul + Reviewed-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit d2d664df974ac5a55d5819f0379fcdac05d22fa3 +Author: Adam Jackson +Date: Mon Apr 23 17:21:09 2018 -0400 + + vfb: Fix man page in re depth + + 32 is not a valid depth, and the default is now 24 not 8. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 79a7137557d33d4e92713ae8cabe838c44fea488 +Author: Adam Jackson +Date: Mon Apr 23 16:19:15 2018 -0400 + + glx: Require depth > 12 for GLX visuals + + fb is happy to do TrueColor to 8bpp drawables, but mesa is not. Depth 12 + is the biggest pseudocolor anyone ever really did, and 15 is the least + truecolor. + + Without this Xvfb at depth 8 would "have" GLX, but no vendors + would actually back any of the screens. libGL will attempt to call + GLXQueryServerString to figure out the GLX version, and vnd will throw + an error because there's no vendor to dispatch that to, and then clients + crash. + + Signed-off-by: Adam Jackson + +commit 818885e6198cf2883155cb3d2e22c8c7bc4239fb +Author: Adam Jackson +Date: Mon Apr 23 16:19:14 2018 -0400 + + vnd: Disable GLX if no vendors successfully initialized + + Signed-off-by: Adam Jackson + +commit fc25bceb515e5c18eecdebf5933c3e05cdac1a5a +Author: Adam Jackson +Date: Mon Apr 23 16:19:13 2018 -0400 + + dix: Allow an extension to disable itself + + GLX registers an extension before we know if there are any screens that + can actually do it. It's inconvenient to shrink the extension list, so + instead allow the extension to simply zero out its base opcode to + indicate that it needed to panic and disable itself. + + Signed-off-by: Adam Jackson + +commit 73a1cb9c92c936c2c1ae3d69fed743e21916d687 +Author: Adam Jackson +Date: Mon Apr 23 16:19:12 2018 -0400 + + dix: Factor out extension availability check + + Signed-off-by: Adam Jackson + +commit 9d5af632fde0373babfa32e66a59cfbf26ed7e5d +Author: Adam Jackson +Date: Mon Apr 23 15:21:14 2018 -0400 + + animcur: Fix crash when removing a master device + + Reproducer: + + $ Xvfb -ac -noreset :1 & + $ DISPLAY=:1 xinput create-master touch1 + $ DISPLAY=:1 xinput remove-master "touch1 pointer" + + Bugzilla: https://bugs.freedesktop.org/105761 + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit 8275903956d7876519fa55fb805669dc301bf243 +Author: Thomas Klausner +Date: Mon Apr 23 14:56:17 2018 -0400 + + sdksyms: Cope with __pid_t and __uint32_t + + Kludge sdksyms.c generator to not fail on GetClientPid. + It returns pid_t which on NetBSD is #define pid_t __pid_t + This slightly alters the GCC preprocessor output which this fragile + code could not deal with when using GCC 5+ + + Signed-off-by: Adam Jackson + +commit e29d783278608544a208f211231a6a3ad2f8fa09 +Author: Mario Kleiner +Date: Fri Apr 20 19:59:40 2018 +0200 + + modesetting: Only use modifiers on kms drivers which do support them. + + Use the DRM_CAP_ADDFB2_MODIFIERS query to make sure the kms + driver supports modifiers in the addfb2 ioctl, and fall back + to addfb ioctl without modifiers if modifiers are unsupported. + + E.g., as of Linux 4.17, nouveau-kms so far does not suppport + modifiers and gets angry if drmModeAddFB2WithModifiers() is + called (-> failure to set a video mode -> blank screen), but + Mesa's nvc0+ gallium driver causes gbm_bo_get_modifier() to + return a valid modifier by translating the default tiling of + bo's created via gbm_bo_create() into a modifier other than + DRM_FORMAT_MOD_INVALID (see Mesa's nvc0_miptree_get_modifier()). + + Testing for != DRM_FORMAT_MOD_INVALID is apparently not + sufficient for safe use of drmModeAddFB2WithModifiers. + + Bonus: Handle potential failure of populate_format_modifiers(). + + The required DRM_CAP is defined since libdrm v2.4.65, and we + require v2.4.89+ for the server, so we can use it unconditionally. + + Tested on intel-kms, radeon-kms, nouveau-kms. Fixes failure on + NVidia Pascal. + + Fixes: 2f807c2324b4 ("modesetting: Add support for multi-plane pixmaps when page-flipping") + Signed-off-by: Mario Kleiner + Cc: Daniel Stone + Cc: Louis-Francis Ratté-Boulianne + Reviewed-by: Louis-Francis Ratté-Boulianne + +commit fe4d1876b4f01c0b0e1916d548c398789f196164 +Author: Lyude Paul +Date: Wed Apr 18 17:57:54 2018 -0400 + + meson: Fix indenting in glx/meson.build + + No functional changes, just fixing a tabs vs. space error I noticed + + Signed-off-by: Lyude Paul + Reviewed-by: Adam Jackson + +commit 4e28a6a223c4f9d0f5defe0313a94e22e0416787 +Author: Lyude Paul +Date: Wed Apr 18 18:09:15 2018 -0400 + + meson: Ensure we always build Xext/hashtable.c for glx + + Seems that while glxvnd relies on some of the hashtable functions in + Xext, we only build hashtable support for Xext if we're also building + the res extension. This leads to some errors if you try to build glx + without res enabled: + + glx/liblibglxvnd.a(vndcmds.c.o): In function `LookupVendorPrivDispatch': + /home/lyudess/Projects/xserver/glx/vndcmds.c:65: undefined reference to `ht_find' + /home/lyudess/Projects/xserver/glx/vndcmds.c:67: undefined reference to `ht_add' + glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchInit': + /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_compare' + /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_hash' + /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_create' + glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchReset': + /home/lyudess/Projects/xserver/glx/vndcmds.c:468: undefined reference to `ht_destroy' + collect2: error: ld returned 1 exit status + ninja: build stopped: subcommand failed. + + So, make sure that hashtable.c gets both for both glx and res + + Reviewed-by: Adam Jackson + Signed-off-by: Lyude Paul + +commit 3b4671f9e9c85f23e7593652e1482b11dc3ad4af +Author: Olivier Fourdan +Date: Thu Apr 19 09:13:23 2018 +0200 + + xwayland: Clean up all frame callbacks + + Regardless of the order we un-realize windows. + + Suggested-by: Roman Gilg + Signed-off-by: Olivier Fourdan + Reviewed-by: Roman Gilg + +commit 8b8f9007cc56fdcee5479876e88e06b7f8b6de35 +Author: Olivier Fourdan +Date: Wed Apr 18 16:02:02 2018 +0200 + + xwayland: avoid using freed xwl_window on unrealize + + xwl_unrealize_window() would use freed xwl_window which can lead to + various memory corruption and crashes, as reported by valgrind: + + Invalid read of size 8 + at 0x42C802: xwl_present_cleanup (xwayland-present.c:84) + by 0x42BA67: xwl_unrealize_window (xwayland.c:601) + by 0x541EE9: compUnrealizeWindow (compwindow.c:285) + by 0x57E1FA: UnrealizeTree (window.c:2816) + by 0x581189: UnmapWindow (window.c:2874) + by 0x54EB26: ProcUnmapWindow (dispatch.c:879) + by 0x554B7D: Dispatch (dispatch.c:479) + by 0x558BE5: dix_main (main.c:276) + by 0x7C4B1BA: (below main) (libc-start.c:308) + Address 0xf520f60 is 96 bytes inside a block of size 184 free'd + at 0x4C2EDAC: free (vg_replace_malloc.c:530) + by 0x42B9FB: xwl_unrealize_window (xwayland.c:624) + by 0x541EE9: compUnrealizeWindow (compwindow.c:285) + by 0x57E1FA: UnrealizeTree (window.c:2816) + by 0x581189: UnmapWindow (window.c:2874) + by 0x54EB26: ProcUnmapWindow (dispatch.c:879) + by 0x554B7D: Dispatch (dispatch.c:479) + by 0x558BE5: dix_main (main.c:276) + by 0x7C4B1BA: (below main) (libc-start.c:308) + Block was alloc'd at + at 0x4C2FB06: calloc (vg_replace_malloc.c:711) + by 0x42B307: xwl_realize_window (xwayland.c:488) + by 0x541E59: compRealizeWindow (compwindow.c:268) + by 0x57DA40: RealizeTree (window.c:2617) + by 0x580B28: MapWindow (window.c:2694) + by 0x54EA2A: ProcMapWindow (dispatch.c:845) + by 0x554B7D: Dispatch (dispatch.c:479) + by 0x558BE5: dix_main (main.c:276) + by 0x7C4B1BA: (below main) (libc-start.c:308) + + This is because UnrealizeTree() traverses the tree from top to bottom, + which invalidates the assumption that if the Window doesn't feature an + xwl_window on its own, it's the xwl_window of its first ancestor with + one. + + This reverts commit 82df2ce3 + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 12a6b189fb17894d2c3851b70a396bbf41f444c6 +Author: David Woodhouse +Date: Tue Apr 17 22:22:21 2018 +0100 + + glamor: fix glamor_xv_query_image_attributes() for odd-width images + + Images which are one pixel wider than a multiple of 8 are being handled + incorrectly. Other drivers round up the width to a multiple of two + before they start calculating. Do the same. + + https://bugzilla.gnome.org/show_bug.cgi?id=795235 + + Reviewed-by: Adam Jackson + Signed-off-by: David Woodhouse + +commit ac7a4bf44c68c5f323375974b208d4530fb5b60f +Author: Chris Wilson +Date: Sun Apr 15 15:40:03 2018 +0100 + + os/WaitFor: Check timers on every iteration + + Currently we only check timer expiry if there are no client fd (or + other input) waiting to be serviced. This makes it very easy to starve + the timers with long request queues, and so miss critical timestamps. + + The timer subsystem is just another input waiting to be serviced, so + evaluate it on every loop like all the others, at the cost of calling + GetTimeInMillis() slightly more frequently. (A more invasive and likely + OS specific alternative would be to move the timer wheel to the local + equivalent of timerfd, and treat it as an input fd to the event loop + exactly equivalent to all the others, and so also serviced on every + pass. The trade-off being that the kernel timer wheel is likely more + efficiently integrated with epoll, but individual updates to each timer + would then require syscalls.) + + Reviewed-by: Peter Harris + Signed-off-by: Chris Wilson + +commit 78b6f940217c127f0f345b7710aa5994c6ded99c +Author: Adam Jackson +Date: Mon Apr 16 14:08:27 2018 -0400 + + modesetting: Fix inverted check in dri2 WaitMSC + + ms_queue_vblank() returns false on failure. + + Reported-by: Chris Wilson + Signed-off-by: Adam Jackson + Reviewed-by: Frank Binns + Tested-by: Mike Lothian + +commit 4e92c51ce4d6ab50c1507a23a01c6be0d1954d79 +Author: Mario Kleiner +Date: Mon Apr 16 08:14:47 2018 +0200 + + dri3: Fix dri3_buffers_from_pixmap request. + + Sending pixmap depth and bpp was omitted, so the Mesa + X11 + EGL + DRI3 side of things always failed to + dri3_create_image_khr_pixmap_from_buffers(), which led + to failure of X11 + EGL compositing under DRI3 under, + e.g., KDE Plasma 5. + + Fixes: 6e7c40f62db6 ("dri3: Add multi-planar/modifier buffer requests") + Signed-off-by: Mario Kleiner + Cc: Daniel Stone + Cc: Louis-Francis Ratté-Boulianne + Reviewed-by: Louis-Francis Ratté-Boulianne + Tested-by: Mike Lothian + +commit a98a95b798a0062783ae6fd2135ad488af5efcfd +Author: Matt Turner +Date: Sun Apr 15 23:37:45 2018 -0700 + + modesetting: Move GBM code inside #ifdef GLAMOR_HAS_GBM + + Fixes a compilation error without Glamor. + + Bugzilla: https://bugs.gentoo.org/653288 + Signed-off-by: Matt Turner + Reviewed-by: Olivier Fourdan + +commit c3ae963a7b19e05b8296aae8b6354587756d48fa +Author: Olivier Fourdan +Date: Mon Apr 16 09:39:09 2018 +0200 + + xwayland: Fix build without glamor + + Present support in Xwayland relies on glamor, make sure Xwayland can + be built without glamor by moving references to Present code inside + the conditional GLAMOR_HAS_GBM. + + Reported-by: Matt Turner + Signed-off-by: Olivier Fourdan + Reviewed-by: Matt Turner + Reviewed-by: Roman Gilg + +commit bf147f67b2b7170fcc5cca07192f6b195dce85e5 +Author: Adam Jackson +Date: Thu Apr 12 17:24:08 2018 -0400 + + xwayland: Don't crash on WarpPointer(dest_w = None) + + Turns out that's legal, and xts exercises it, and we crash: + + Thread 1 "Xwayland" received signal SIGSEGV, Segmentation fault. + dixGetPrivate (key=0x813660 , privates=0x20) at ../../include/privates.h:122 + 122 return (char *) (*privates) + key->offset; + (gdb) bt + #0 dixGetPrivate (key=0x813660 , privates=0x20) at ../../include/privates.h:122 + #1 dixLookupPrivate (key=0x813660 , privates=0x20) at ../../include/privates.h:166 + #2 xwl_window_of_top (window=0x0) at xwayland.c:128 + #3 xwl_cursor_warped_to (device=, screen=0x268b6e0, client=, window=0x0, sprite=0x300bb30, + x=2400, y=1350) at xwayland.c:292 + #4 0x00000000005622ec in ProcWarpPointer (client=0x32755d0) at events.c:3618 + + In this case, x/y are the screen-space coordinates where the pointer + ends up, and we need to look up the (X) window there. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit d7269b49c3408f93a6cb8e28ddc3dda88224620a +Author: Emil Velikov +Date: Wed Apr 11 18:51:16 2018 +0100 + + configure.ac: make use of wayland-scanner.pc + + Replace the current (incorrect) assumption that wayland-scanner is + located in the wayland-client prefix. Make use of the wayland_scanner + variable in wayland-scanner.pc + + It was introduced back in 2013 and we already require newer wayland bits + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 0031bbad8400d35699664d18c0d8fc2e9e82d8a7 +Author: Adam Jackson +Date: Wed Apr 11 15:39:33 2018 -0400 + + sdksyms: Skip empty symbols + + Apparently on NetBSD we can hit failures like this: + + sdksyms.c:1773:15: error: expected expression before ',' token + (void *) &, /* ../../dri3/dri3.h:110 */ + + I've been unable to reproduce that locally (even in a NetBSD vm), but + an obvious workaround might be to just notice empty symbol names and + ignore them rather than emit invalid C code. + + Tested-by: Thomas Klausner + Signed-off-by: Adam Jackson + +commit d61e516c847b9ff7e89e6be269050032070c1ad3 +Author: Adam Jackson +Date: Tue Apr 10 15:45:02 2018 -0400 + + xserver 1.20 RC4 + + Signed-off-by: Adam Jackson + +commit a42992a4cca49cedd3930f5694c7a16e4f614b36 +Author: Emil Velikov +Date: Mon Apr 2 16:41:24 2018 +0100 + + dri3: rework format/modifier caching + + Cut down the unnecessary malloc/memcpy/free by utilising the explicit + copy provided by the client. + + But above all: do so, after ensuring we get valid data from the + implementation. + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 71a069fd7fbe815d386fc1b3c44cda732cff7af0 +Author: Emil Velikov +Date: Mon Apr 2 16:41:23 2018 +0100 + + glamor: zero num_formats from the start + + The caller may ignore the return value (will be addressed with later + commit) so simply zero the count from the get-go. We're pretty much do + so, in all cases but one :-\ + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit ac48724639e0a6a9e421b3b4e545d8506fd6bf5d +Author: Emil Velikov +Date: Mon Apr 2 16:41:22 2018 +0100 + + xwayland: zero num_formats from the start + + The caller may ignore the return value (will be addressed with later + commit) so simply zero the count from the get-go. We're pretty much do + so, in all cases but one :-\ + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit e2f45002fc3c53c6196935447b8fe77d0850175b +Author: Emil Velikov +Date: Mon Apr 2 16:41:20 2018 +0100 + + dri3: check for ::get_drawable_modifiers failure + + Currently if the function fails, we'll fall into two false assumptions: + - the the count is zero + - that the storage pointer is safe for free() + + I've just fixed the former (in glamor + xwayland) and have no + plans on adding yet another workaround for the latter. + + Simply zero both variables. Regardless if the implementation is missing + the callback or it foobars with output variables (normally a bad idea). + + Bonus points - this fixes a bug where we feed garbage to free() further + down ;-) + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 150e4b12ad160b093899107ed586aa0cb258879e +Author: Emil Velikov +Date: Mon Apr 2 16:41:19 2018 +0100 + + glamor: zero num_modifiers from the start + + The caller may ignore the return value (will be addressed with later + commit) so simply zero the count from the get-go. We're pretty much do + so, in all cases but one :-\ + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit b36a14c0b0e7e38406622eb5ff0666a8b8bc50f4 +Author: Emil Velikov +Date: Mon Apr 2 16:41:18 2018 +0100 + + xwayland: zero num_modifiers from the start + + The caller may ignore the return value (will be addressed with later + commit) so simply zero the count from the get-go. We're pretty much do + so, in all cases but one :-\ + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit a83ceec868a6d544bc7775a753b67aa40d0d0efc +Author: Emil Velikov +Date: Mon Apr 2 16:41:15 2018 +0100 + + dri3: simplify dri3_open() implementation + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 9a159f37e00ed47ec8cbff7c57d8787b8f5685f5 +Author: Emil Velikov +Date: Mon Apr 2 16:41:14 2018 +0100 + + dri3: annotate fds/strides/offsets arrays as const + + It makes it perfectly clear that we should not be modifying them. + Should help highlight issues like the one fixed with previous commit. + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 877fa0c66469628748dbd01506f15ddc4f11b849 +Author: Emil Velikov +Date: Mon Apr 2 16:41:13 2018 +0100 + + xwayland: don't close() fds we don't own + + The glamor_pixmap_from_fds error path erroneously closes the fds. + We don't own them, plus the caller closes them after the function in + called. + + Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") + Cc: Louis-Francis Ratté-Boulianne + Cc: Daniel Stone + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 66b632bb068672f507212b00bd313b5040bf1a39 +Author: Emil Velikov +Date: Mon Apr 2 16:41:12 2018 +0100 + + dri3: annotate the dri3_screen_info data as const + + dri3_screen_info is the user provide dispatch. Something that we do + not and should not change. + + When using the _ptr typecast + const the compiler barfs at us + (rightfully so), so use the _rec one. + + [Silence a new const mismatch warning too - ajax] + + Fixes: 56313829886 ("dri3: Add DRI3 extension") + Cc: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit c67f2eac56518163981af59f5accb7c79bc00f6a +Author: Samuel Thibault +Date: Mon Apr 9 14:35:30 2018 +0200 + + dix: always send focus event on grab change + + Focus events are useless when 'from' and 'to' are the same. But when + this is the result of a (Un)GrabKeyboard request, we should always send + them, including when the window manager had previously used XSetInputFocus + to specify the focus on a window which happens to be now taking a grab. + + This is notably needed for window manager using XI to always get keyboard + events even during grabs, so they can determine exactly when grabbing is + active. + + Signed-off-by: Samuel Thibault + Reviewed-by: Peter Hutterer + +commit 14be894b3f7976c133fc186e0e3c475606bab241 +Author: Michal Srb +Date: Tue Aug 1 10:29:03 2017 +0200 + + Xext: Fix memory leaks in hashtable. + + Do not forget to delete key and value of every item and the hashtable itself. + +commit 1326ee0bc5eb858c3c00847b3ba65134e4ca2e2d +Author: Michal Srb +Date: Tue Feb 13 10:33:30 2018 +0100 + + glx: Do not call into Composite if it is disabled. + + Otherwise X server crashes if GLX is enabled and Composite disabled. For + example the compIsAlternateVisual function will try to lookup CompScreenPtr + using the CompScreenPrivateKey, but that was never initialized if Composite is + disabled. + + Fixes: f84e59a4f4. ("glx: Duplicate relevant fbconfigs for compositing visuals") + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104993 + Signed-off-by: Michal Srb + +commit b9764b8489cabd15b50c360cfbd799fdab0883fd +Author: Jon Turney +Date: Tue Apr 3 16:54:00 2018 +0100 + + hw/xwin/glx: Allocate fbconfigs correctly + + 4b0a3cba fixed leaking of GLX fbconfigs, so now xwin needs to allocate them + correctly (individually, rather than all at once), so they can be freed + successfully. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit e0a137ce5d653063604fa8d16c8498b8ac3ab3a7 +Author: Kyle Brenneman +Date: Fri Apr 6 12:42:33 2018 -0600 + + GLX: Fix a use after free error with the GLVND vendor handle. + + The GLVND layer will destroy all of the vendor handles at the end of each + server generation, but the GLX module then tries to re-use the same (now-freed) + handle in xorgGlxServerInit at the start of the next generation. + + In xorgGlxCloseExtension, explicitly destroy the vendor handle and set it to + NULL so that the next call to xorgGlxServerInit will recreate it. + + Reviewed-by: Adam Jackson + +commit 31c1489eeb8c5391cd978303989de167819f0041 +Author: Peter Hutterer +Date: Fri Apr 6 12:28:56 2018 +1000 + + xfree86: drop KDSKBMUTE handling + + This was never merged upstream. It was a Fedora kernel patch but dropped from + Fedora in 2013 with kernel 3.12. + + The reason for the KDSKBMUTE proposal has been fixed in systemd in Feb 2013, + systemd 198. + https://lists.freedesktop.org/archives/systemd-devel/2013-February/008795.html + + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit 74aef564a7faea4410e92fa606216ab877b0d452 +Author: Adam Jackson +Date: Thu Apr 5 13:24:13 2018 -0400 + + xwayland: Silence a build warning if we can + + [735/786] Generating 'hw/xwayland/Xwayland@exe/relative-pointer-unstable-v1-protocol.c'. + Using "code" is deprecated - use private-code or public-code. + See the help page for details. + + Use private-code if wayland-scanner is new enough. + + Signed-off-by: Adam Jackson + +commit 6f0903ddc905f44272b85942323a467d82fef644 +Author: Adam Jackson +Date: Thu Apr 5 13:09:38 2018 -0400 + + dix: Hush an almost certainly bogus warning + + ../dix/getevents.c: In function ‘transformAbsolute’: + ../dix/getevents.c:1195:28: warning: ‘oy’ may be used uninitialized in this function [-Wmaybe-uninitialized] + struct pixman_f_vector p = {.v = {*x, *y, 1} }; + ^ + ../dix/getevents.c:1234:22: note: ‘oy’ was declared here + double x, y, ox, oy; + ^~ + + This one is truly special. Even though both ox and oy are set and read + along the same paths, only oy is marked for this warning! Initializing + just oy = 0.0 fixes it entirely, but let's not make a weird thing + weirder. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 57e872301f5e836be2efb8f952f9c9711650b447 +Author: Adam Jackson +Date: Thu Apr 5 13:07:09 2018 -0400 + + mi: Hush an almost certainly bogus warning + + In file included from ../mi/miexpose.c:83: + ../mi/miexpose.c: In function ‘miHandleExposures’: + ../include/regionstr.h:174:22: warning: ‘expBox.y2’ may be used uninitialized in this function [-Wmaybe-uninitialized] + (_pReg)->extents = *(_pBox); + ~~~~~~~~~~~~~~~~~^~~~~~~~~~ + ../mi/miexpose.c:139:12: note: ‘expBox.y2’ was declared here + BoxRec expBox; + ^~~~~~ + + etc. It's initialized if (extents), and then only read if (extents), + but gcc doesn't seem to figure that out. Whatever, bzero it to be + explicit. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 83913de25d35709b3ab7b0ab124b73924145d2dd +Author: Adam Jackson +Date: Thu Apr 5 12:59:11 2018 -0400 + + xkb: Silence some compiler warnings + + Of the form: + + ../xkb/XKBGAlloc.c: In function ‘SrvXkbAddGeomKeyAlias’: + ../xkb/XKBGAlloc.c:591:13: warning: ‘strncpy’ specified bound 4 equals destination size [-Wstringop-truncation] + strncpy(alias->real, realStr, XkbKeyNameLength); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This is intentional; the code that reads from these fields never reads + more than 4 bytes anyway. Rephrase things in terms of memcpy so that's + clear. Obviously this is awful but in XKB awful is par. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit d13cd3862e9ccd35c91a06680d02f2fc8fd03420 +Author: Adam Jackson +Date: Thu Apr 5 12:48:26 2018 -0400 + + dmx: Silence a string truncation warning. + + ../hw/dmx/config/dmxparse.c: In function ‘dmxConfigCreateOption’: + ../hw/dmx/config/dmxparse.c:385:13: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] + strncpy(option->string + offset, p->string, len); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ../hw/dmx/config/dmxparse.c:383:23: note: length computed here + int len = strlen(p->string); + ^~~~~~~~~~~~~~~~~ + + The thing it's warning about is intentional, the surrounding code does + its own nul-termination. Make that obvious by using memcpy instead. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 176f26e96ab9958c84c98c88f31729d0240c420e +Author: Adam Jackson +Date: Thu Apr 5 12:45:51 2018 -0400 + + dmx: Clean up some argument parsing code + + This threw: + + ../hw/dmx/input/dmxarg.c: In function ‘dmxArgParse’: + ../hw/dmx/input/dmxarg.c:128:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=] + strncpy(tmp, string, len); + ^~~~~~~~~~~~~~~~~~~~~~~~~ + ../hw/dmx/input/dmxarg.c:126:11: note: length computed here + len = strlen(string) + 2; + ^~~~~~~~~~~~~~ + + This code predates xstrtokenize, but that's no excuse. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit be99072a1a20af44d2457b8c86bd9041f61efa79 +Author: Adam Jackson +Date: Thu Apr 5 12:35:59 2018 -0400 + + dmx: Fix a read-from-uninitialized warning + + ../hw/dmx/dmxpixmap.c: In function ‘dmxBitmapToRegion’: + ../include/regionstr.h:174:22: warning: ‘Box.x1’ may be used uninitialized in this function [-Wmaybe-uninitialized] + (_pReg)->extents = *(_pBox); + ~~~~~~~~~~~~~~~~~^~~~~~~~~~ + ../hw/dmx/dmxpixmap.c:208:12: note: ‘Box.x1’ was declared here + BoxRec Box; + ^~~ + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit c3b190f9da3a8cd6f98c127220683dd20aed0f9b +Author: Adam Jackson +Date: Thu Apr 5 12:31:04 2018 -0400 + + dmx: Fix some snprintf warnings. + + snprintf doesn't terminate the string if it truncates, so things like + this are lurking crashers: + + ../hw/dmx/dmxprop.c: In function ‘dmxPropertyIdentifier.part.0’: + ../hw/dmx/dmxprop.c:94:36: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 123 [-Wformat-truncation=] + snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display); + ^~ ~~~~~~~~ + ../hw/dmx/dmxprop.c:94:5: note: ‘snprintf’ output 7 or more bytes (assuming 262) into a destination of size 128 + snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ../hw/dmx/dmxprop.c: In function ‘dmxPropertyWindow’: + ../hw/dmx/dmxprop.c:372:36: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 127 [-Wformat-truncation=] + snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index); + ^~ + ../hw/dmx/dmxprop.c:372:5: note: ‘snprintf’ output between 3 and 140 bytes into a destination of size 128 + snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + We could be more precise about termination, but meh. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 4c1453393feaebd688571ed1ba16c21703119ced +Author: Adam Jackson +Date: Thu Apr 5 12:21:53 2018 -0400 + + gtf: Warning fix + + ../hw/xfree86/utils/gtf/gtf.c: In function ‘print_fb_mode’: + ../hw/xfree86/utils/gtf/gtf.c:241:50: warning: cast from function call of type ‘double’ to non-matching type ‘int’ [-Wbad-function-cast] + printf(" timings %d %d %d %d %d %d %d\n", (int) rint(1000000.0 / m->pclk), /* pixclock in picoseconds */ + + That's pretty nitpicky of you, gcc, but at least it's easy to fix. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 99f9b077c62e14ba955b9c1f7afda47f7799d317 +Author: Daniel Stone +Date: Thu Apr 5 16:47:39 2018 +0100 + + modesetting: Actually get framebuffer ID + + We would fail to get the FB ID if it wasn't already imported, since we + were checking to see if the pointer was NULL (it never was) rather than + if the content of the pointer was 0. + + Signed-off-by: Daniel Stone + Reported-by: Olivier Fourdan + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + +commit 8ff1cdb2bff72a37e75004f562737dd0af6daf14 +Author: Daniel Stone +Date: Thu Apr 5 15:00:38 2018 +0100 + + dri3: Set stride and size for old clients + + For old clients using the fd_from_pixmap entrypoint, make sure we set + stride and size correctly. + + Noticed by inspection. + + Signed-off-by: Daniel Stone + +commit 78574a66b5b286e26839877640592980de089d64 +Author: Daniel Stone +Date: Thu Apr 5 14:58:40 2018 +0100 + + modesetting: Don't reuse iterator in nested loop + + drmmode_crtc_set_mode has a loop nested inside another loop, where both + of them were using 'i' as the loop iterator. Rename it to avoid an + infinite loop. + + Signed-off-by: Daniel Stone + Reported-by: Michel Dänzer + Reviewed-and-Tested-by: Michel Dänzer + Reviewed-by: Adam Jackson + +commit ce2a4313dd31084f7766af59b8477cabe029bf44 +Author: Mario Kleiner +Date: Wed Apr 4 03:49:02 2018 +0200 + + modesetting: Fix page flipping harder under DRI 3.2. + + Non-atomic kms drivers like radeon-kms (or nouveau-kms with + default setting of "atomic ioctl disabled") don't export + any formats, so num_formats == 0. + + Some atomic drivers (nouveau-kms with boot param nouveau.atomic=1, + or intel-kms on, e.g., Linux 4.13) expose num_formats == 0, or + don't expose any modifiers, so num_modifiers == 0. + + Let the drmmode_is_format_supported() check pass in these cases + to allow page flipping, as it works just fine. + + Tested on NV-96 for nouveau, HD-5770 for radeon, Intel Ivybridge + with Linux 4.13 and drm-next to fix page flipping. + + Fixes: 9d147305b404 ("modesetting: Check if buffer format is supported when flipping") + Signed-off-by: Mario Kleiner + Reviewed-by: Daniel Stone + +commit 44e7098367b87c79470d6760753e42014be7ca01 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Apr 4 00:01:15 2018 -0400 + + modesetting: Have consistent state when using atomic modesetting + + We need to make sure that the atomic commit are consistent + or else the kernel will reject it. For example, when moving + a CRTC from one output to another one, the first output CRTC_ID + property needs to be reset. Also if the second output was using + another CRTC beforehands, it needs to be disabled to avoid an + inconsistent state. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Tested-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit bc4d278132956ec3c43695f1bd34083ef5fe7f22 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Apr 4 00:01:14 2018 -0400 + + modesetting: Use atomic modesetting to set DPMS mode + + CRTCs and outputs needs to be enabled/disabled when the current + DPMS mode is changed. We also try to do it in an atomic commit + when possible. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Tested-by: Daniel Stone + Reviewed-by: Adam Jackson + +commit 23c67987a337beb91292f8e318d566941453baa3 +Author: Daniel Stone +Date: Wed Apr 4 16:16:38 2018 +0100 + + glamor: Add fd_from_pixmap hook + + Add a fd_from_pixmap (singular) hook to go with fds_from_pixmap, which + will ensure that the pixmap is allocated without modifiers and is thus + exportable to non-modifier-aware clients. + + This makes it possible to run a compositing manager on an old GLX/EGL + stack on top of an X server which allocates internal buffer storage + using exotic modifiers from modifier-aware GBM/EGL/KMS. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 9c407f0a1b40128fc65b19b6a499f1d4dae6f702 +Author: Daniel Stone +Date: Wed Apr 4 16:16:37 2018 +0100 + + glamor: Fall back to non-modifier allocations + + If we try to allocate with particular modifiers but it fails, try to + fall back to non-modifier allocations. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 86b2d8740a330deafe8a9bbf0402705a43efbb42 +Author: Daniel Stone +Date: Wed Apr 4 16:16:36 2018 +0100 + + glamor: Reallocate pixmap storage without modifiers if necessary + + If we need a pixmap's storage to be exported to a context in which we + aren't aware of modifiers, reallocate the buffer again without + modifiers. + + This makes it possible to run a compositing manager on an old GLX/EGL + stack on top of an X server which allocates internal buffer storage + using exotic modifiers from modifier-aware GBM/EGL/KMS. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit aab5c46ccbe769830cae383330fd62c074a0d2f7 +Author: Daniel Stone +Date: Wed Apr 4 16:16:35 2018 +0100 + + glamor: Push make_exportable into callers + + Rather than calling make_exportable from the get_bo entrypoint, make + sure that someone has already explicitly requested the pixmap be + exportable. + + This is technically an ABI break in that it changes observable + behaviour, but no driver other than modesetting has ever used get_bo. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 1b9fa3b64ca420eb54b5e5f28074c326e1fbe825 +Author: Daniel Stone +Date: Wed Apr 4 16:16:34 2018 +0100 + + glamor: Track if BO allocation used modifiers + + Keep track of whether or not we fed modifiers into GBM when we allocated + a BO. We'll use this later inside Glamor, to reallocate buffer storage + if we allocate buffer storage using modifiers, and a non-modifier-aware + client requests an export of that pixmap. + + This makes it possible to run a compositing manager on an old GLX/EGL + stack on top of an X server which allocates internal buffer storage + using exotic modifiers from modifier-aware GBM/EGL/KMS. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 0e9504e10c4363e24a83f1a82e6a4b9f5fd8f846 +Author: Daniel Stone +Date: Wed Apr 4 16:16:33 2018 +0100 + + drmmode: Track if BO allocation used modifiers + + Keep track of whether or not we fed modifiers into GBM when we allocated + a BO. We'll use this later inside Glamor, to reallocate buffer storage + if we allocate buffer storage using modifiers, and a non-modifier-aware + client requests an export of that pixmap. + + This makes it possible to run a compositing manager on an old GLX/EGL + stack on top of an X server which allocates internal buffer storage + using exotic modifiers from modifier-aware GBM/EGL/KMS. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 75bba3aedcb04132a4fe2806680cd38a8f2bd206 +Author: Daniel Stone +Date: Wed Apr 4 16:16:32 2018 +0100 + + dri3: Use single-FD screen call for single-FD request + + When importing client buffers into Pixmaps, we can use the fds_to_pixmap + hook for both single-FD and multi-FD client requests without any harm. + + For the other direction of exporting Pixmap buffers to client FDs, + create a new helper which calls the old pixmap_to_fd hook if available. + This allows the implementation to ensure that the Pixmap storage is + accessible to clients not aware of multiple planes or modifiers, e.g. by + reallocating and copying. + + This makes it possible to run a compositing manager on an old GLX/EGL + stack on top of an X server which allocates internal buffer storage + using exotic modifiers from modifier-aware GBM/EGL/KMS. + + Signed-off-by: Daniel Stone + Reported-by: Adam Jackson + Reviewed-by: Adam Jackson + +commit 574069c2912893a9b9fd3d701eb3ad4784e31553 +Author: Aaron Plattner +Date: Mon Apr 2 15:04:08 2018 -0700 + + xfree86: Restore newline before "X Protocol Version" string + + The newline before the protocl version got lost in commit + 6cbefc3e0a33b380c147c533914437c7798d9b93. Prior to that commit, the + release date printed a newline at the end: + + X.Org X Server 1.19.6 + Release Date: 2017-12-20 + X Protocol Version 11, Revision 0 + Build Operating System: Linux 4.14.12-1-ARCH x86_64 + + Now, that string gets run together with the version: + + X.Org X Server 1.19.99.903 (1.20.0 RC 3)X Protocol Version 11, Revision 0 + Build Operating System: Linux + + Since the version string printing has a variety of #ifdefs in it, just + add the newline to the begining of the protocol version string. + + Signed-off-by: Aaron Plattner + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit df6cbf7a2b3b45be6910afb34459d30ca7783c16 +Author: Adam Jackson +Date: Mon Apr 2 15:44:50 2018 -0400 + + xserver 1.20 RC3 + + Signed-off-by: Adam Jackson + +commit f580116f3c89b3c086655cbd441f84e50115ea78 +Author: Louis-Francis Ratté-Boulianne +Date: Thu Mar 29 01:07:26 2018 -0400 + + modesetting: Fix reported size when using atomic modesetting + + The framebuffer can include multiple CRTCs in multi-monitors + setup. So we shouldn't use the buffer size but the CRTC size + instead. Rotated displays are shadowed, so we don't need to + worry about it there. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit ce7d5087cfe1d2df756d93b7f567b3c0b0a7f6a8 +Author: Louis-Francis Ratté-Boulianne +Date: Thu Mar 29 01:07:25 2018 -0400 + + modesetting: Ignore alpha channel when importing BOs for modesetting + + Fixes a regression caused by modifiers support. For some hw to + continue working even if not supporting ARGB8888 and ARGB2101010 + formats, we assume that all imported BOs are opaque. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 85b3fc18606e56d01734defb0e9fa04182f9fc1c +Author: Olivier Fourdan +Date: Thu Mar 29 09:42:08 2018 +0200 + + modesetting: Use actual crtc position for pageflip + + Otherwise the same content is shown on all outputs. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit a10f1c9e08b982029186028b144d9243a2ebdde3 +Author: Emil Velikov +Date: Mon Apr 2 18:51:21 2018 +0100 + + docs: remove resource management references + + The code referenced was removed back in 2009. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 32c07e6b83fdb5b0ed99fc6b1eaa18064f6c3527 +Author: Emil Velikov +Date: Mon Apr 2 18:51:20 2018 +0100 + + docs: purge some ISA references + + The respective ISA functions were dropped back in 2008 + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 80d4098411ad96b662e830db06e59a7ab7f5c9d3 +Author: Thierry Reding +Date: Thu Mar 29 13:07:56 2018 +0200 + + meson: Add pixman-1 to required modules in xorg-server.pc + + pixman headers will be included for builds of external modules against + the xorg-server SDK. Make sure pixman is listed as a required module so + that the correct CFLAGS will be added. + + Note that the xorg-server.pc generated by the autotools-based build has + many more modules listed, but this seems to be enough to build at least + some of the external drivers against an X server built with Meson (I've + tested with xf86-input-libinput, xf86-video-nouveau and xf86-video-ati). + + Reviewed-by: Adam Jackson + Signed-off-by: Thierry Reding + +commit 88c7b8bf4bae080ecb879fe7e3f8be2bede6f0a6 +Author: Thierry Reding +Date: Thu Mar 29 13:07:55 2018 +0200 + + meson: Distribute more SDK headers + + Install missing headers to the SDK directory to allow external modules + to properly build against the SDK. After this commit, the list of files + installed in the SDK include directory is the same as the list of files + installed by the autotools-based build. + + Reviewed-by: Adam Jackson + Signed-off-by: Thierry Reding + +commit f3b0a2aee21f12f3332bf598d3ba0fcbd2832f95 +Author: Thierry Reding +Date: Thu Mar 29 13:07:54 2018 +0200 + + meson: Remove usage of pkg-config --variable=includedir + + Querying a pkg-config variable using the --variable option produces the + value of the given variable as stored in the pkg-config file and should + not be used to add directories to the include search path. + + The reason for this is that it breaks cross-compilation, because header + files are installed relative to the host sysroot. pkg-config supports a + PKG_CONFIG_SYSROOT_DIR environment variable that points to this sysroot + and will prepend that to the path of directories in -I or -L options in + pkg-config's Cflags, Libs or Libs.private keywords. However, because no + context can be inferred from variable names, as opposed to the keywords + with fixed meaning, the sysroot path will not be prepended to them. The + build system is responsible for doing so if necessary since it is aware + of the context in which the variable is used. + + Adding the include directory returned by pkg-config to the include path + leaks build system information into the cross-build and break with very + confusing errors such as this: + + In file included from include/misc.h:82:0, + from dix/atom.c:55: + /usr/include/pthread.h:682:6: warning: '__regparm__' attribute directive ignored [-Wattributes] + __cleanup_fct_attribute; + ^~~~~~~~~~~~~~~~~~~~~~~ + + or this: + + In file included from include/misc.h:139:0, + from dix/atom.c:55: + /usr/include/stdlib.h:133:8: error: '_Float128' is not supported on this target + extern _Float128 strtof128 (const char *__restrict __nptr, + ^~~~~~~~~ + + Fix this by replacing the include directory with the appropriate xproto + dependency required to add the correct include directory to the compile + command for subdirectories that are missing the dependency. As detailed + above, this gives pkg-config the opportunity to prepend the sysroot for + all paths in -I compiler options. + + Reviewed-by: Adam Jackson + Signed-off-by: Thierry Reding + +commit 1c002bc43472063cf8599abb0d6d7367e30456e2 +Author: Tobias Klausmann +Date: Fri Mar 30 22:32:13 2018 +0200 + + modesetting/drmmode: add NULL pointer check in drmmode_output_dpms + + drmmode_output_dpms is called especially with !output->crtc found in + xf86DisableUnusedFunctions so we have to guard for it, else the server + segfaults: + + 0 0x00007fdc1706054b in drmmode_output_dpms (output=0x55e15243c210, mode=3) at + drmmode_display.c:2243 + 1 0x000055e1500b6873 in xf86DisableUnusedFunctions (pScrn=0x55e152133f00) at + xf86Crtc.c:3021 + 2 0x000055e1500be940 in xf86RandR12CrtcSet (pScreen=, + randr_crtc=0x55e1524b2b90, randr_mode=0x0, x=0, y=0, rotation=, + num_randr_outputs=0, randr_outputs=0x0) at xf86RandR12.c:1244 + 3 0x000055e1500fa1c2 in RRCrtcSet (crtc=, mode=0x0, x=0, y=0, + rotation=rotation@entry=1, numOutputs=numOutputs@entry=0, outputs=0x0) at + rrcrtc.c:763 + 4 0x000055e1500fba9e in ProcRRSetCrtcConfig (client=0x55e152bfae50) at + rrcrtc.c:1390 + 5 0x000055e150044008 in Dispatch () at dispatch.c:478 + 6 0x000055e150047ff8 in dix_main (argc=13, argv=0x7ffc68561038, + envp=) at main.c:276 + 7 0x00007fdc1a0c6a87 in __libc_start_main () at /lib64/libc.so.6 + 8 0x000055e150031d0a in _start () at ../sysdeps/x86_64/start.S:120 + + Fixes: ba0c75177 ("modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*") + Signed-off-by: Tobias Klausmann + Reviewed-by: Adam Jackson + +commit 258081759fa70202a2e6134eeee4fe25ca54bedb +Author: Tobias Klausmann +Date: Fri Mar 30 22:31:46 2018 +0200 + + glamor: sanitze handling of "Debug" Option for "dmabuf_capable" + + With the appearance of the this new Option the X Server would crash if the + option is not set. + + Default dmabuf_capable to off/FALSE for now - a user without knowledge about + this option does not want to enable it until its save. + + Fixes: d11d5bb80 ("glamor: Hide new DRI behind Option "Debug" "dmabuf_capable") + Signed-off-by: Tobias Klausmann + Reviewed-by: Adam Jackson + +commit debf75bd0b0ddfec82dad9580efa7d19479b55df +Author: Adam Jackson +Date: Wed Mar 28 15:47:33 2018 -0400 + + xserver 1.20 RC2 + + Signed-off-by: Adam Jackson + +commit 726839459cb887a60361cb4779f9871c03f372b1 +Author: Adam Jackson +Date: Wed Mar 28 16:11:18 2018 -0400 + + autotools: Derive xkb configuration from xkbcomp.pc + + ... if available, falling back to the current heuristics otherwise. This + _finally_ gets me to being able to run util/modular/release.sh without + overriding $prefix. + + Signed-off-by: Adam Jackson + +commit d11d5bb80d21f2aaa54ddf2f26a50aa6ef31d2fa +Author: Adam Jackson +Date: Wed Mar 28 12:46:01 2018 -0400 + + glamor: Hide new DRI behind Option "Debug" "dmabuf_capable" + + ... for xfree86, at least for now. Things appear to work for Xwayland + but not yet for modesetting. Hopefully we can fix that before 1.20 but + in the meantime this makes testing both paths easier than a rebuild. + + Signed-off-by: Adam Jackson + +commit df13ea7da9174d2e1c732985d9b7a9a35a6916bc +Author: Adam Jackson +Date: Wed Mar 28 12:46:00 2018 -0400 + + xfree86: Add Option "Debug" to ServerFlags + + This provides a generic way to control obscure runtime behavior knobs + without making interface promises. + + Signed-off-by: Adam Jackson + +commit c95361465ee98dd97a99778d8a31be88fe9e4c4f +Author: Antoine Martin +Date: Wed Mar 28 15:16:02 2018 -0400 + + os: Fix -logfile when used with -displayfd + + Trivial way to reproduce the bug: + + $ Xorg -logfile /tmp/mylog -config /etc/xpra/xorg.conf -displayfd 2 + + The server then moans: + + Failed to rename log file "/tmp/mylog" to "/tmp/mylog": No such file or directory + + And the log file is created but immediately renamed to "/tmp/mylog.old". + This is caused by the changes to the log file handling introduced by + this commit: + + https://cgit.freedesktop.org/xorg/xserver/commit/?id=edcb6426f20c3be5dd5f50b76a686754aef2f64e + + To fix this, only rename the logfile if the log filename contains the + magic substitution string "%s". + + Signed-off-by: Antoine Martin + Reviewed-by: Alan Coopersmith + +commit b355e55f500c18d55d0ac241e5f7e826ed62f555 +Author: Olivier Fourdan +Date: Wed Mar 28 12:17:48 2018 +0200 + + automake: Fix 'make dist' + + Automake would skip a few meson files that would prevent to build with + meson a dist file previously generated by automake. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Thierry Reding + +commit 16639ab77d14cecb7d03fd2d5c796c2fb1714c18 +Author: Kyle Brenneman +Date: Fri Mar 2 17:58:07 2018 -0700 + + Don't delete GLX's extensionInitCallback list during a reset. + + When a callback list is initialized using CreateCallbackList via AddCallback, + the list gets added to the listsToCleanup array, and as a result the list gets + deleted at the end of the server generation. + + But, vendor libraries add themselves to that callback list only once, not once + per generation, so if you delete the list, then no vendor will register itself + on the next generation, and GLX breaks. + + Instead, use a static CallbackListRec for the extensionInitCallback list. That + way, it doesn't get added to listsToCleanup, and doesn't get deleted during a + reset. + + Reviewed-by: Adam Jackson + +commit 7004a7c3c983b4453756b92341bf22790b1eb98d +Author: Daniel Stone +Date: Fri Mar 23 13:50:23 2018 +0000 + + modesetting/drmmode: Remove unused flink call + + We don't use flink in the GetFB import path anymore, as we do an + FD-based import instead. + + Signed-off-by: Daniel Stone + Reviewed-by: Emil Velikov + +commit be087778a0eae3093ffdbba3ff7c9f3863d8e1d4 +Author: Roman Gilg +Date: Tue Mar 13 16:00:57 2018 +0100 + + xwayland: Activate Present flips in rootless mode with Glamor + + Link the newly introduced support for Present flips. For now flips can only + be used in rootless mode together with Glamor. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 07750ff3c084c6549a5612d1f935a9a3ab3df67c +Author: Roman Gilg +Date: Tue Mar 13 16:00:55 2018 +0100 + + xwayland: Implement queuing present vblanks + + Queue present events to msc values. Fake msc events with a refresh rate of + about 60fps when flips are not possible. When flips are executed rely on + frame callbacks with a slow updating timer as fallback. + + This is important for applications, that want to limit their framerate. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 86df366973de1c10da5fbdc57d1ff12b681c321f +Author: Roman Gilg +Date: Tue Mar 13 16:00:54 2018 +0100 + + xwayland: Add fallback timer for msc counting + + When the compositor is not sending frame callbacks while we still wait + on buffer release events fake a continuous msc counter with a timer. + + Having this timer is a prerequisite for queuing events. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 0fb2cca193e60b731c8e75a2a7e795477fb5fd8f +Author: Roman Gilg +Date: Tue Mar 13 16:00:53 2018 +0100 + + xwayland: Preliminary support for Present's new window flip mode + + Introduce support for Present's window flip mode. The support is not yet + complete, but works reasonable well for the most important use case, that + is fullscreen applications. + + We take a Present flip and if the xwl_window->window has the same dimensions + as the presenting window, the flip is represented by a wl_buffer and attached + to the main wl_surface of the xwl_window. + + After commit we are listening for the sync callback in order to tell Present, + that the pixmap flip is not longer pending, for the frame callback in order + to update the msc counter and for the buffer release callback in order to tell + Present that the pixmap is idle again. + + The following functionality is missing from this patch: + * (slowed down) flips in case the compositor is not sending frame callbacks, + * queuing events to MSC times, + * per window flips for child windows with smaller size than the xwl_window. + + To make use of this functionality Xwayland must run rootless and with + Glamor/GBM. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 8fba2a03f1410f3bc7504e218ac1e5c964279ea2 +Author: Roman Gilg +Date: Tue Mar 13 16:00:52 2018 +0100 + + xwayland: Add arguments to glamor_pixmap_get_wl_buffer + + Add arguments to give the caller more information and control + over the creation of a wl_buffer with GBM, in particular let + the caller determine the size of the buffer. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 902429f077325b98e30ede2710bd7a88440d2937 +Author: Roman Gilg +Date: Tue Mar 13 16:00:51 2018 +0100 + + present: Add exported init function of window flip mode + + Allow drivers now to initialize window flip mode. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit a337949f99bc473ea0ae0af64736eae3d5b39399 +Author: Roman Gilg +Date: Tue Mar 13 16:00:50 2018 +0100 + + present: Add cleanups for window flip mode + + Make sure that vblanks and windows get cleaned up correctly + in window flip mode. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 66a5c0bccb222ad8b9b57b10490c3041e1b3f05e +Author: Roman Gilg +Date: Tue Mar 13 16:00:49 2018 +0100 + + present: In window flip mode report damage on flip to driver + + Calculate damage before trying to flip and report it to the driver. + This allows drivers to optimize their rendering. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 029608dd80204ac96423ef79ec46c1a18bbdd5ff +Author: Roman Gilg +Date: Tue Mar 13 16:00:48 2018 +0100 + + present: Add window flip mode + + In contrast to screen flip mode this mode: + * supports flips per windows (these windows currently need to have the same + size as their parent windows with the same pixmap), + * sends pixmap idle signals to the client only after the driver has given + an additional event notify. + + This patch only introduces the new mode as a stub. It additionally needs a + driver hook, such that it can get initialized and appropriate cleanup + functions. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 8d370fcdcaed210d9f4afc1650aa8b161c7fbb44 +Author: Roman Gilg +Date: Tue Mar 13 16:00:47 2018 +0100 + + present: Add driver facing window flip mode hooks + + To enable special functionality of window flips introduce for window flips + a separate set of driver facing function hooks. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 7b071b4e440313254398f06eb59b1596a6d3e8fe +Author: Roman Gilg +Date: Tue Mar 13 16:00:46 2018 +0100 + + present: Adapt flip mode API hooks for window flip mode + + Flipping pixmaps per window needs additional arguments in the + flip mode API. Add these as preperation for window flip mode. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 92b91b8cf34a38de39281044d8441b6cabe87a85 +Author: Roman Gilg +Date: Tue Mar 13 16:00:45 2018 +0100 + + present: Add flip_idler vblank property + + Introduce vblank property for flip modes, that demand explicite + allowance by the driver for vblanks to become idle. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 84e47f3fe68f05f7b0b762e96acd4c95fa8000ca +Author: Roman Gilg +Date: Tue Mar 13 16:00:44 2018 +0100 + + present: Add present_window_priv properties for window flip mode + + For window flip mode data about flips needs to be stored per window. + Add properties to 'present_window_priv' and initialize them on creation. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 3aaaac0be573fb09a206966075d81ebe0510ca23 +Author: Roman Gilg +Date: Tue Mar 13 16:00:43 2018 +0100 + + present: Refactor present_screen_init + + To initialize easily different flip modes, refactor + 'present_screen_init'. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 6d813bbd5ea0fc38a8114c08368a7954eeb2ef37 +Author: Roman Gilg +Date: Tue Mar 13 16:00:42 2018 +0100 + + present: Add more hooks to internal flip mode API + + Add hooks to query caps, get crtcs, abort vblanks and destroy + a flip. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 6a338b5959ca5a9e5260d71b6a739a5c672d77e7 +Author: Roman Gilg +Date: Tue Mar 13 16:00:41 2018 +0100 + + present: Move timings adjustment in common part of flip mode API + + To reduce future code duplication refactor timings adjustment out + as a separate function. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 84112a1d0b221c00d7d3c23fd5b97687e6e3749a +Author: Roman Gilg +Date: Tue Mar 13 16:00:40 2018 +0100 + + present: Add flip mode API hook for present_can_window_flip + + Flip modes can now have different implementations of + present_can_window_flip. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 1db7cf0429eabf33f8e2b55a15db4d1f87e1fb95 +Author: Roman Gilg +Date: Tue Mar 13 16:00:39 2018 +0100 + + present: Add flip mode API hook for present_pixmap + + Make present_pixmap a common function callable by any + flip mode. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 679ffbf5f39822ea508e50f1b7c92a2a9e79f7bb +Author: Roman Gilg +Date: Tue Mar 13 16:00:38 2018 +0100 + + present: Refactor execute in separate file + + To be shared by multiple flip modes, refactor execute functionality, + such that logical chunks can go in new separate file. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 1e7d8902bfe7cfb79c41b14fc6b50bcbe4f7c800 +Author: Roman Gilg +Date: Tue Mar 13 16:00:37 2018 +0100 + + present: Add flip mode API hooks for several functions + + Add 'queue_vblank', 'flush' and 're_execute' hooks, that + are supposed to be shared with other flip modes. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 5365ece70a75a05df3d6351767d19c3edcf0305d +Author: Roman Gilg +Date: Tue Mar 13 16:00:36 2018 +0100 + + present: Move vblank functionality in seperate file + + With the new internal flip mode API move vblank creation + and so on into a seperate file, such that it can be shared + between flip modes. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit c5c50c6db1e71e976596750277b1a618704c04aa +Author: Roman Gilg +Date: Tue Mar 13 16:00:35 2018 +0100 + + present: Preliminary internal flip mode API + + Add some basic function hooks to our future present-internal flip mode API, + that will allow us to share functionality in between modes and move more code + in separate files. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit dda7efec36b495e100e670e057d7ef5022ef3976 +Author: Roman Gilg +Date: Tue Mar 13 16:00:34 2018 +0100 + + present: Move screen flip functionality in separate file + + As a preperation for future flip mode alternatives move most of the + functionality from 'present.c' into a separate file. + + Leave some functions needed by future other flip modes in 'present.c'. + + Signed-off-by: Roman Gilg + Reviewed-by: Adam Jackson + +commit 4303deae78c4e2a60856be87bf87cd1643c268f5 +Author: Thierry Reding +Date: Wed Mar 28 14:04:38 2018 +0200 + + meson: Properly extract ABI versions for xorg-server.pc + + The newline in the middle of the awk expression confuses Meson and + causes it to pass only the string before the newline to awk, which will + subsequently fail because it encounters an unterminated string. + + One fix would be to escape the newlines ('\\n'), but that causes the + newline to end up in the pkg-config file and separate the ABI version + lines by blank lines. + + Instead, simply drop the newlines to make the generated pkg-config file + look more like the one generated as part of the autotools-based build. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit 465b38cadd573ce50eca959f4b56bf4a6a638d91 +Author: Thierry Reding +Date: Wed Mar 28 14:04:37 2018 +0200 + + meson: Fix generation of xorg-server.pc + + Meson stores relative paths for includedir, libdir and friends. These + have to be concatenated with the ${prefix} or ${exec_prefix} variables + to create a working pkg-config file. + + While at it, set a default value for the module_dir option so that it + points to the same location as used in the autotools-based build. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit d905e3330fd4f9b15a0277b22d608705787cb8bc +Author: Thierry Reding +Date: Wed Mar 28 14:04:36 2018 +0200 + + meson: Fill in missing data for xorg-server.h + + Provide more values for the definitions in xorg-server.h for Meson + builds. The only missing defines left after this are _BSD_SOURCE, + _POSIX_SOURCE and _XOPEN_SOURCE, but Meson seems to already define + these via the command-line if necessary. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit 0babe78ed5afec8a06a517346f39b5ebd003773c +Author: Thierry Reding +Date: Wed Mar 28 14:04:35 2018 +0200 + + meson: Generate xorg-server.h + + Some drivers (such as xf86-input-libinput) require the xorg-server.h to + build. Generate it and install it so that it can be used by users. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit b04ff31b9d471822fe96ed63eda93fc4cd8c22d0 +Author: Thierry Reding +Date: Wed Mar 28 14:04:34 2018 +0200 + + dix: Remove unused definitions from dix-config.h.in + + There is no code around that will ever define values for the + WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end + up commented out and are therefore completely useless. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit c62a8b60b9a07092ebebf9aeb67a0c39c583aabe +Author: Thierry Reding +Date: Wed Mar 28 14:04:33 2018 +0200 + + xorg: Remove unused definitions from xorg-server.h.in + + There is no code around that will ever define values for the XLOADABLE, + WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end + up commented out and are therefore completely useless. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit 66402fcd8280b393d3992121c0bcff9c646c97ed +Author: Thierry Reding +Date: Wed Mar 28 14:04:32 2018 +0200 + + meson: Fix build if Xdmcp is missing + + Xdmcp is an optional dependency, so make sure the build succeeds if it + is missing. + + Signed-off-by: Thierry Reding + Reviewed-by: Adam Jackson + +commit 0a7dabc86c1a7b8d91a5d22ad12fbf03d859f43e +Author: Adam Jackson +Date: Mon Mar 26 14:57:07 2018 -0400 + + meson: Add option to set default font path (v2) + + The autotools build gets this from some macros in fontutil, but they're + just wrappers around pkgconfig. + + v2: Use same default as autotools (Keith Packard) + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit a26195d5c1eba86ada8f43e775c4190683e0f874 +Author: Adam Jackson +Date: Tue Mar 27 12:58:15 2018 -0400 + + Revert "suid touchup" + + Pushed the wrong thing, sigh. + + This reverts commit 73a0562615aa1adfb934b953e23b1e69b126db4f. + +commit 73a0562615aa1adfb934b953e23b1e69b126db4f +Author: Adam Jackson +Date: Tue Mar 27 12:06:38 2018 -0400 + + suid touchup + +commit 64b3227374f7f161e610df735f376fcc5bb0fd58 +Author: Adam Jackson +Date: Tue Mar 27 10:47:05 2018 -0400 + + autotools: Fix excessive \-escaping that broke the build + + Signed-off-by: Adam Jackson + +commit d3e8af99dc1139fac3307bbcb0046500b3feff11 +Author: Adam Jackson +Date: Mon Mar 26 18:43:02 2018 -0400 + + meson: Fix install path for 10-quirks.conf + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 84507507ea03db2f6197b94c160bbee9768c4baa +Author: Adam Jackson +Date: Mon Mar 26 18:43:01 2018 -0400 + + meson: Install xorg-server.m4 + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 8c684f59d517db0812fbad5fc6bcd90c7c810493 +Author: Adam Jackson +Date: Mon Mar 26 18:43:00 2018 -0400 + + meson: Generate xorg-server.pc + + Otherwise external drivers can't build against us. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 9b67303a52f5380bc96862624778b101f6379527 +Author: Adam Jackson +Date: Mon Mar 26 18:42:59 2018 -0400 + + meson: Install the dmx utilities + + And add the forgotten dmxrminput to the list. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit f9ef293cf612e50830ff316d67066ea544905dc9 +Author: Adam Jackson +Date: Mon Mar 26 18:42:58 2018 -0400 + + meson: Build cvt and gtf + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit a1e8dc05163956de9ab73e567f86b91cb8790c0f +Author: Adam Jackson +Date: Mon Mar 26 18:42:57 2018 -0400 + + meson: Install man pages + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 1e0df64738d6924151adbbd4b040df80178cfa6b +Author: Adam Jackson +Date: Mon Mar 26 18:42:55 2018 -0400 + + meson: Build Xorg suid wrapper + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit ab063cf96779c521618c022d4f669f69e3d9cc8f +Author: Adam Jackson +Date: Mon Mar 26 18:42:54 2018 -0400 + + meson: Fix installing protocol.txt + + One fix the constructed path, two actually install it. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit e3baacacda29afe524b3e4cab78ca057241c0551 +Author: Adam Jackson +Date: Mon Mar 26 18:42:53 2018 -0400 + + meson: Add libdrm to hw/xfree86/common's dependencies + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 2e497bf887aca832dc0dd30d071c5288ab5c1e15 +Author: Adam Jackson +Date: Mon Mar 26 18:42:52 2018 -0400 + + man: s/__/@/g + + A cosmetic change for automake (though we have to replicate some of + xorg-macros.m4 in manpages.am now), but meson's configure_file() wants + @-delimited strings. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 6cbefc3e0a33b380c147c533914437c7798d9b93 +Author: Adam Jackson +Date: Mon Mar 26 18:42:51 2018 -0400 + + autotools: Stop caring about XORG_DATE + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit ba0c75177239ced7037d74cf61590377f6d075bb +Author: Adam Jackson +Date: Thu Mar 22 14:47:21 2018 -0400 + + modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_* + + Signed-off-by: Adam Jackson + Reviewed-by: Emil Velikov + +commit 757e0ee1884f2a34a287d632462e3bc689eccb3d +Author: Mario Kleiner +Date: Mon Mar 12 17:57:50 2018 +0100 + + modesetting: Fix page flipping under DRI 3.2. + + The check for "no modifier specified" in drmmode_is_format_supported() + should check for DRM_FORMAT_MOD_INVALID, not for zero, as zero actually + means DRM_FORMAT_MOD_LINEAR. + + This allows page-flipping again when appropriate, as + tested under nouveau and ati drivers. + + Fixes: 9d147305b404 ("modesetting: Check if buffer format is supported when flipping") + Signed-off-by: Mario Kleiner + Reviewed-by: Daniel Stone + +commit 136b45e0c0f5b96b5ce014681d77756dc47f0768 +Author: Adam Jackson +Date: Fri Mar 16 18:03:18 2018 -0400 + + travis: Drop Xcode 8.2 + + Travis has only so many OSX builders, presumably due to the EULA + requiring that it be run on Apple-branded hardware. They're also really + slow to provision, presumably because they're virtual machines and not + containers. In any case it's not something I'm willing to be punished + for. + + Signed-off-by: Adam Jackson + +commit 243a34e170c4a7cc5d38b78f7409704adf703e9b +Author: Adam Jackson +Date: Fri Mar 16 18:28:19 2018 -0400 + + travis: Bump rawhide image + + The image now has enough mojo to run xts, hooray! + + Note there's a couple of ugly bits in here. The piglit config fragment + and stock tetexec.cfg reflect missing features from the test suites + (using an installed copy of xts, figuring out the xserver test matrix at + runtime, etc.), I'll be happy to remove them once the tests are fixed. + + Signed-off-by: Adam Jackson + +commit 610055809f4030bd0e7312c6b0c561fdfe6e0183 +Author: Eric Engestrom +Date: Tue Mar 13 10:55:22 2018 +0000 + + exa: promise not to touch the data when swapping pointers + + exa/exa.c:525:10: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] + swap(pExaGC, pGC, funcs); + ^ + + Signed-off-by: Eric Engestrom + Reviewed-by: Emil Velikov + +commit d36128a72acac4d54813c52c93efefad2dc9af41 +Author: Alexander Volkov +Date: Mon Mar 12 15:12:10 2018 +0300 + + Xext/shm: Downgrade from error to debug log output about success + + Signed-off-by: Alexander Volkov + Reviewed-by: Adam Jackson + +commit 319af6f471912160ab3eb6395ef50f9950063d43 +Author: Nicolai Hähnle +Date: Tue Mar 13 17:46:37 2018 -0400 + + glx: honor LIBGL_DRIVERS_PATH when loading DRI drivers + + Allow switching to another driver build without a full installation. + + Glamor already takes LIBGL_DRIVERS_PATH into account, so this change + makes sure that the same driver is used in both parts of the server. + + Signed-off-by: Nicolai Hähnle + Reviewed-by: Ben Crocker + Reviewed-by: Antoine Martin + Tested-by: Ben Crocker + +commit 75a869a4e7c06072380931b714ac83b1037d3bbe +Author: Nicolai Hähnle +Date: Tue Mar 13 17:46:36 2018 -0400 + + xfree86: replace all uses of xf86PrivsElevated with PrivsElevated + + [... but leave it defined and exported, since we're ABI-frozen - ajax] + + Signed-off-by: Nicolai Hähnle + Reviewed-by: Ben Crocker + Reviewed-by: Antoine Martin + Tested-by: Ben Crocker + + restore abi + +commit 1b6910af12cfefcc293be2f4144986fe3b56a36b +Author: Nicolai Hähnle +Date: Tue Mar 13 17:46:35 2018 -0400 + + os: use PrivsElevated instead of a manual check + + Signed-off-by: Nicolai Hähnle + Reviewed-by: Ben Crocker + Reviewed-by: Antoine Martin + Tested-by: Ben Crocker + +commit 9ef602de46de2beae1d6231dc72a1a783a26122f +Author: Nicolai Hähnle +Date: Tue Mar 13 17:46:34 2018 -0400 + + os: move xf86PrivsElevated here + + Having different types of code all trying to check for elevated privileges + is a bad idea. This implementation is the most thorough one. + + Signed-off-by: Nicolai Hähnle + Reviewed-by: Ben Crocker + Reviewed-by: Antoine Martin + Tested-by: Ben Crocker + Reviewed-by: Emil Velikov + +commit 1519475a4382066707276d7463c7c6e52c382caa +Author: Adam Jackson +Date: Wed Mar 14 15:29:15 2018 -0400 + + appveyor: use meson + + i686 cygwin build time with autotools: 16:22 + i686 cygwin build time with meson: 6:56 + + Signed-off-by: Adam Jackson + +commit 2415ef5b228f5a235377decde95cb146c6642ea9 +Author: Adam Jackson +Date: Tue Mar 20 14:00:33 2018 -0400 + + meson: Add the x(org)proto headers to the include path + + Without this meson won't properly use headers installed into a + non-default location. + + Signed-off-by: Adam Jackson + +commit 21e8a4a1b993a9b1abd4a7510cd3d8a152be998b +Author: Emil Velikov +Date: Wed Mar 7 18:45:33 2018 +0000 + + modesetting: remove fallback DRM_CAP_* defines + + All the macros are available in the libdrm that we depend on. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit d2568c058745ea66353fefa8f7296a6f37795905 +Author: Emil Velikov +Date: Wed Mar 7 18:45:32 2018 +0000 + + modesetting: remove always true DRM_IOCTL_CRTC_QUEUE_SEQUENCE guard + + We already require libdrm 2.4.89 which provides the definition plus + guarding kernel UABI like that is generally a bad idea. + + See previous commit for details why :-) + + Cc: Keith Packard + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit f368428ab84c14f32f52e50b880d9353fbb87181 +Author: Emil Velikov +Date: Wed Mar 7 18:45:31 2018 +0000 + + modesetting: remove always true defined(DRM_CAP_PRIME) guards + + The macro was available in libdrm for ages. Furthermore having a guard + like this is a very bad idea. + + Building on an old server will result in a missing run-time functionality. + Since it's UABI one can use a local fallback, old kernels will return + -EINVAL and the fallback path will kick in. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 22b489d27365d2513bf1cab6da92254e3bdbcf41 +Author: Emil Velikov +Date: Wed Mar 7 18:45:30 2018 +0000 + + Remove always true GLAMOR_HAS_DRM_* guards + + With earlier commit the required version was bumped to 2.4.89, thus the + guards always evaluate to true. + + Fixes: e4e3447603b ("Add RandR leases with modesetting driver support + [v6]") + Cc: Keith Packard + Cc: Daniel Stone + Cc: Louis-Francis Ratté-Boulianne + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit e0748b10a8621066b404d713a76826907da777b9 +Author: Emil Velikov +Date: Wed Mar 7 18:45:29 2018 +0000 + + configure: remove libdrm version check + + We already require said version. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 8718d46157b9317554aba3e01b9919a1c0c28026 +Author: Adam Jackson +Date: Wed Mar 14 16:43:09 2018 -0400 + + ci: Ignore builds for branches aimed at other CI services + + Make appveyor ignore builds for /travis.*/ and vice versa. If you're + only testing a Windows change, building for OSX and Linux too is a bit + rude. + + Signed-off-by: Adam Jackson + +commit ae5c0dd199a5fbfbdf7a2d6b8c1b28c410289106 +Author: Emil Velikov +Date: Tue Mar 13 18:38:49 2018 +0000 + + dri3: cap the version returned to the client + + As per the protocol, the server should not return version greater than + the one supported by the client. + + Add a spec quote and tweak the numbers accordingly. + + Fixes: 563138298868 ("dri3: Add DRI3 extension") + Cc: Daniel Stone + Cc: Keith Packard + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 6a5d51e0823b43280e3646b7a0c919a3b76146ea +Author: Emil Velikov +Date: Mon Mar 19 16:04:43 2018 +0000 + + present: cap the version returned to the client + + As per the protocol, the server should not return version greater than + the one supported by the client. + + Add a spec quote and tweak the numbers accordingly. + + Fixes: 5c5c1b77982 ("present: Add Present extension") + Cc: Thierry Reding + Cc: Daniel Stone + Cc: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit abb9b58d1af9a0286162e52ef9db390d0c950fc1 +Author: Thierry Reding +Date: Fri Mar 16 14:24:21 2018 +0100 + + present: Advertise protocol version 1.2 + + Everything is implemented to support protocol version 1.2. Make it + official. + + Reviewed-by: Daniel Stone + Signed-off-by: Thierry Reding + Reviewed-by: Emil Velikov + +commit 7fc89251ef5e7363dfbf6d831ed448bbcd8519b8 +Author: Alan Coopersmith +Date: Sun Mar 4 13:00:05 2018 -0800 + + Revert "modesetting: Remove #ifdefs XF86_PDEV_SERVER_FD" + + This reverts commit 8c455db0ebb6e5313ca81428bb6dd75ef12aaa15. + + Since xf86platformBus.h is only included when XSERVER_PLATFORM_BUS is + defined, and configure.ac only defines that on systems with udev, this + commit breaks the build on non-udev systems like Solaris. + + Signed-off-by: Alan Coopersmith + +commit edf08bd654dcdf31da9a592513b218bbd9f64cc6 +Author: Adam Jackson +Date: Wed Mar 14 12:10:27 2018 -0400 + + appveyor: Switch to xorgproto + + Also build with -j2, the builder VM has two cores. + + Signed-off-by: Adam Jackson + +commit 8f628033bed408c4de215ca117fa2fa2d9f9d5cd +Author: Adam Jackson +Date: Wed Mar 14 12:54:16 2018 -0400 + + travis: Update OSX build + + Install and use xorgproto, and build with optimization as clang has + warnings that only work above -O0. Also expand the build matrix for both + Xcode 8.3 and 9.2. Both images are OSX 10.12 at the moment so this is + really just a way to test with clang 8 vs 9. + + Signed-off-by: Adam Jackson + +commit 1ca092f990e67c7dccf5790a72c41e84711c28a8 +Author: Adam Jackson +Date: Wed Mar 14 13:13:54 2018 -0400 + + travis: Switch linux build from stretch to rawhide + + Stretch's Mesa is too far behind, and building Mesa to build xserver is + not the sort of problem we're trying to solve here. But our Travis + scripts run inside a docker image, and that image can be whatever, so + since I have to keep rawhide building anyway let's switch to that for + now. The dockerfile can be found at: + + https://github.com/nwnk/xserver-travis + + The $DISTRO part of the change is foreshadowing for the day we readd a + (probably sid-based) debian image; patches for other environments are + welcome. + + Signed-off-by: Adam Jackson + +commit 17d30369f4445e1693a1b75dc6620bbc21ec8e61 +Author: Michel Dänzer +Date: Wed Mar 14 16:48:23 2018 +0100 + + randr: Initialize RROuptutRec::nonDesktop + + Flagged by valgrind: + + ==13695== Conditional jump or move depends on uninitialised value(s) + ==13695== at 0x22461C: RRNoticePropertyChange (rrproperty.c:150) + ==13695== by 0x22461C: RRChangeOutputProperty (rrproperty.c:263) + ==13695== by 0x222FC4: RROutputSetNonDesktop (rroutput.c:333) + ==13695== by 0x22319C: RROutputCreate (rroutput.c:122) + ==13695== by 0x1E1CE9: xf86RandR12CreateObjects12 (xf86RandR12.c:1734) + ==13695== by 0x1E1CE9: xf86RandR12Init12 (xf86RandR12.c:2375) + ==13695== by 0x1E1CE9: xf86RandR12Init (xf86RandR12.c:895) + ==13695== by 0x1D469B: xf86CrtcScreenInit (xf86Crtc.c:778) + ==13695== by 0xC095A54: RADEONScreenInit_KMS (radeon_kms.c:2436) + ==13695== by 0x161444: AddGPUScreen (dispatch.c:3966) + ==13695== by 0x1A3E46: InitOutput (xf86Init.c:763) + ==13695== by 0x1654A7: dix_main (main.c:193) + ==13695== by 0x7041A86: (below main) (libc-start.c:310) + ==13695== Uninitialised value was created by a heap allocation + ==13695== at 0x4C2CB8F: malloc (vg_replace_malloc.c:299) + ==13695== by 0x223083: RROutputCreate (rroutput.c:83) + ==13695== by 0x1E1CE9: xf86RandR12CreateObjects12 (xf86RandR12.c:1734) + ==13695== by 0x1E1CE9: xf86RandR12Init12 (xf86RandR12.c:2375) + ==13695== by 0x1E1CE9: xf86RandR12Init (xf86RandR12.c:895) + ==13695== by 0x1D469B: xf86CrtcScreenInit (xf86Crtc.c:778) + ==13695== by 0xC095A54: RADEONScreenInit_KMS (radeon_kms.c:2436) + ==13695== by 0x161444: AddGPUScreen (dispatch.c:3966) + ==13695== by 0x1A3E46: InitOutput (xf86Init.c:763) + ==13695== by 0x1654A7: dix_main (main.c:193) + ==13695== by 0x7041A86: (below main) (libc-start.c:310) + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 52048ce29f872192478fece3887b7bc1c8aace7d +Author: Keith Packard +Date: Mon Mar 12 12:14:44 2018 -0700 + + Xext/saver: Swap ScreenSaverSuspend 'suspend' field. Handle old XCB clients. + + This field was defined as a Bool in the protocol headers and BOOL in + xcb. Bool is not a valid type for protocol fields. It is defined as + 'int' by Xdefs.h, which we expect to be 32-bits on all machines. + + The protocol headers and xcb have patches posted to switch to CARD32, + which is at least well defined. + + This change adds the necessary byte swapping to handle other-endian + clients with this 32-bit field, and then changes the request + processing to compare all 32-bits against zero so that it works with + both new and old clients. + + On MSB machines, Xlib will continue to work properly, but old XCB will + not interoperate with the X server (either before or after this patch). + + Signed-off-by: Keith Packard + Reviewed-by: Mihai Moldovan + Reviewed-by: Adam Jackson + +commit beda6afb3c33adbf77637141f05631081894e93a +Author: Mario Kleiner +Date: Fri Mar 9 04:58:20 2018 +0100 + + glamor/xwayland: Add depth 30 format mapping for DRI 3.2 as well. + + Signed-off-by: Mario Kleiner + Reviewed-by: Daniel Stone + +commit 07c369e05ac116901dacc20f4742622bdca2784f +Author: Jon Turney +Date: Thu Mar 8 12:34:26 2018 +0000 + + meson: Require libdrm for dri1/2/3 when configured 'auto' as well as 'true' + + If dri1/2/3 are configured for auto-detection, libdrm is required, as well + as the corresponding proto. (Practically we will always have the + corresponding protos now, as they are part of xorgproto). + + Signed-off-by: Jon Turney + Reviewed-by: Emil Velikov + +commit f69cd2024ef25e7fd2bd2d7012e33ce16eeb79ff +Author: Adam Jackson +Date: Thu Mar 8 11:13:16 2018 -0500 + + os: Define {ReadFdFrom,WriteFdTo}Client unconditionally + + Otherwise this is broken on cygwin: + + rrlease.c: In function ‘ProcRRCreateLease’: + rrlease.c:305:9: error: implicit declaration of function ‘WriteFdToClient’ [-Werror=implicit-function-declaration] + if (WriteFdToClient(client, fd, TRUE) < 0) { + + Signed-off-by: Adam Jackson + +commit 90e0cdd42dfda2accfadffa5c550712696902e14 +Author: Rodrigo Vivi +Date: Wed Mar 7 07:46:20 2018 -0800 + + dri2: Sync i965_pci_ids.h from Mesa. + + Copied from Mesa with no modifications. + + Gives us Geminilake and Kaby Lake platform names updates and + sync on Coffee Lake PCI IDs. + + Cc: Timo Aaltonen + Signed-off-by: Rodrigo Vivi + Reviewed-by: Adam Jackson + +commit 43576b901151a1f32209f476249a4de6980b654f +Author: Michel Dänzer +Date: Tue Mar 6 10:53:19 2018 +0100 + + glamor: Restore glamor_fd_from_pixmap and glamor_pixmap_from_fd + + They're part of the 1.20 RC1 ABI, and actually used by external drivers. + Also, requiring drivers which don't support the new functionality in + DRI3 1.2 to switch to the new interfaces seems unreasonable. + + Signed-off-by: Michel Dänzer + Reviewed-by: Daniel Stone + +commit 5d3fd3856b718cfbc87d17f1de698ced94923c78 +Author: Samir Benmendil +Date: Sat Mar 3 01:41:12 2018 +0000 + + xkb: XkbSetMap on the lastSlave needs to change the master + + The layout needs to be set on the master too if the layout is changed on + the device that was last used by the master. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85256 + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91571 + + Signed-off-by: Samir Benmendil + Acked-by: Daniel Stone + +commit ce8da936464cc78ec31de6e970e1353ffecf2547 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:46 2018 +0000 + + dri3: Enable DRI3 version 1.2 + + Enable DRI3 v1.2 now that all functions have been implemented and + that there is at least one backend implementing the driver hooks + (modesetting/glamor). + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 8d0d89715984e321315631dd6667e05813d26e03 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:45 2018 +0000 + + glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation + + Using modifier might allow the driver to use a more optimal format + (e.g. tiled/compressed). Let's try to use those if possible. + + v2: Don't filter out multi-plane modifiers + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit cef12efc15ca1444d6d8cd839116b318a4668692 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:44 2018 +0000 + + glamor: Implement GetSupportedModifiers + + Implement function added in DRI3 v1.1. + + A newest version of libepoxy (>= 1.4.4) is required as earlier + versions use a problematic version of Khronos + EXT_image_dma_buf_import_modifiers spec. + + v4: Only send scanout-supported modifiers if flipping is possible + v5: Fix memory corruption in XWayland (uninitialized pointer) + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit c8c276c9569b3ca1e695682a5443f1b615c606bd +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:43 2018 +0000 + + glamor: Implement PixmapFromBuffers and BuffersFromPixmap + + It relies on GBM >= 17.1.0 where we can import BO with multiple + planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER). + + v2: Properly free fds in Xwayland + + [Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax] + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 9d147305b4048dcec7ea4eda3eeea83f843f7788 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:42 2018 +0000 + + modesetting: Check if buffer format is supported when flipping + + Add support for 'check_flip2' so that the present core can know + why it is impossible to flip in that scenario. The core can then + let know the client that the buffer format/modifier is suboptimal. + + v2: No longer need to implement 'check_flip' + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e375f29662ad7589cc6d8d179846da9b8a897122 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:41 2018 +0000 + + modesetting: Create scanout buffers using supported modifiers + + Use most optimal buffer format (e.g. tiled/compressed) available + for scanout. + + v2: Don't use multi-plane modifier to create scanout buffer + + v3: Add flag to retrieve modifiers set from enabled CRTCs only + + v4: Fix uses when GBM/EGL driver doesn't support modifiers + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit ca1c390ec7bf617c0147d69cf874dadce28e903b +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:40 2018 +0000 + + modesetting: Get supported formats/modifiers for scanout + + Retrieve IN_FORMATS property from the plane. It gives the + allowed formats and modifiers for BO allocation. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 9817c14f6a2ea5db44459659131c13f403716df1 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:39 2018 +0000 + + modesetting: Use atomic modesetting to configure output/CRTCs + + To make sure we also use the same primary plane and to avoid + mixing uses of two APIs, it is better to always use the atomic + modesetting API when possible. + + v2: Don't use mode_output->connector_id + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 2f807c2324b46fbd9a557e7a4f177a392d5851b3 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:38 2018 +0000 + + modesetting: Add support for multi-plane pixmaps when page-flipping + + This allows the uses of CCS compressed or tiled pixmaps as BOs when + page-flipping. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 4023d537341b9c36b9bb248c206e40694e4b08d2 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:37 2018 +0000 + + modesetting: Use atomic modesetting API for pageflip if available + + In order to flip between compressed and uncompressed buffers - + something drmModePageFlip explicitly bans us from doing - we need + to port use the atomic modesetting API. It's only 'fake' atomic + though given we still commit for each CRTC separately and + CRTC and connector properties are not set with the atomic API. + + The helper functions to retrieve DRM properties have been borrowed + from Weston. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e2ef3b44fa697f2ed453767e98da72ea56d4046f +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:36 2018 +0000 + + present: Send PresentCompleteModeSuboptimalCopy appropriately + + Add 'check_flip2' hook for driver to let know the core + about why flipping is not possible ('reason'). + If it is because of unsupported buffer format/modifier, + a PresentCompleteNotify event is sent to the client with + the PresentCompleteModeSuboptimalCopy mode. + + v2: Check for PresentOptionSuboptimal and check driver version + before using 'check_flip2'. + + v3: Only require one of 'check_flip' or 'check_flip2' to be + implemented by the driver. + Refactor reasons list to enum + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Daniel Stone + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 6e7c40f62db66f5b59b2cf59f1e6a26e4fd21bda +Author: Louis-Francis Ratté-Boulianne +Date: Wed Feb 28 01:19:35 2018 +0000 + + dri3: Add multi-planar/modifier buffer requests + + Initial implementation for DRI3 v1.1. Only the DRI3 implementation + is there, backends need to implement the proper hooks. + + Version is still set to 1.0 so clients shouldn't use the new + requests yet. + + v2: Use depth/bpp instead of DRM formats in requests + + v3: Remove DMA fence requests from v1.1 + Add screen/drawable modifier sets + + v4: Free array returned by 'get_drawable_modifiers()' + + v5: Fix FD leak + + Signed-off-by: Daniel Stone + Signed-off-by: Louis-Francis Ratté-Boulianne + Acked-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 0ff4074224ea370e021d79526c63cef91356730d +Author: Keith Packard +Date: Fri Mar 2 17:05:04 2018 -0800 + + Require libdrm 2.4.89 or newer + + Both autotools and meson build systems had complicated logic around + what version of libdrm to require for various options. Remove that and + just check for a new enough version to support all of the options + which need libdrm. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 43ffd572592d26bb78decfdf55e643bdfb011d3f +Author: Laurent Carlier +Date: Thu Mar 1 12:58:16 2018 +0100 + + meson: Make SHM extension optional + + v2: check for header 'sys/shm.h' + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit de4565727a0bb199365d33e3c98d9ddd3e0de6f2 +Author: Laurent Carlier +Date: Thu Mar 1 12:57:27 2018 +0100 + + meson: get rid of useless HAVE_SYSV_IPC + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit e02afb94783a25c21b07e44a7b615acdd86fa3f7 +Author: Laurent Carlier +Date: Thu Mar 1 12:56:28 2018 +0100 + + meson: Make ACPI support optional + + v2: Define HAVE_ACPI in dix-config.h + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit 238219e7312e2b5d972a8620b02379009686a005 +Author: Laurent Carlier +Date: Thu Mar 1 12:55:11 2018 +0100 + + meson: Make APM support optional + + v2: Define HAVE_APM in dix-config.h + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit 2af0a50a4bb9be9f58681d417ceb9a7029caaf3b +Author: Adam Jackson +Date: Wed Feb 28 11:23:41 2018 -0500 + + randr: Fix a crash on initialization with GPU screens + + RRSetChanged (immediately above) was immune to screens with no master, + but RRTellChanged was not: + + Thread 1 "X" received signal SIGSEGV, Segmentation fault. + RRTellChanged (pScreen=) at ../../randr/randr.c:576 + 576 mastersp = rrGetScrPriv(master); + (gdb) bt + #0 RRTellChanged (pScreen=) at ../../randr/randr.c:576 + #1 0x000055555566f1e9 in RRNoticePropertyChange (value=0x555555bfbf28, property=70, output=0x555555bfef10) at ../../randr/rrproperty.c:153 + #2 RRChangeOutputProperty (output=output@entry=0x555555bfef10, property=, type=type@entry=19, format=format@entry=32, mode=, mode@entry=0, len=len@entry=1, value=0x7fffffffe77c, sendevent=1, pending=0) + at ../../randr/rrproperty.c:263 + #3 0x000055555566dba5 in RROutputSetNonDesktop (output=output@entry=0x555555bfef10, nonDesktop=nonDesktop@entry=0) at ../../randr/rroutput.c:333 + ... + + Reported-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit cf485c659d93c92b26c4390402575f061eb175f6 +Author: Adam Jackson +Date: Wed Feb 28 12:18:28 2018 -0500 + + xserver 1.20 RC 1 + + Signed-off-by: Adam Jackson + +commit afccb266edc8b2ca014aec5b2a67bb1627f29fe9 +Author: Adam Jackson +Date: Wed Feb 28 12:26:26 2018 -0500 + + glx: Add vndserver.h to the SDK + + Also unbreak 'make distcheck', sigh autotools. + + Signed-off-by: Adam Jackson + +commit 85ff1cdbd3286838e512fe7c70af149a8743b6fe +Author: Emil Velikov +Date: Tue Feb 27 17:05:50 2018 +0000 + + protocol.txt: add GLX req. 35 - SetClientInfo2ARB + + Noticed while skimming for the typo'd version ;-) + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit e4e3447603b5fd3a38a92c3f972396d1f81168ad +Author: Keith Packard +Date: Mon Feb 12 13:51:56 2018 -0800 + + Add RandR leases with modesetting driver support [v6] + + This adds support for RandR CRTC/Output leases through the modesetting + driver, creating a lease using new kernel infrastructure and returning + that to a client through an fd which will have access to only those + resources. + + v2: Restore CRTC mode when leases terminate + + When a lease terminates for a crtc we have saved data for, go + ahead and restore the saved mode. + + v3: Report RR_Rotate_0 rotations for leased crtcs. + + Ignore leased CRTCs when selecting screen size. + + Stop leasing encoders, the kernel doesn't do that anymore. + + Turn off crtc->enabled while leased so that modesetting + ignores them. + + Check lease status before calling any driver mode functions + + When starting a lease, mark leased CRTCs as disabled and hide + their cursors. Also, check to see if there are other + non-leased CRTCs which are driving leased Outputs and mark + them as disabled as well. Sometimes an application will lease + an idle crtc instead of the one already associated with the + leased output. + + When terminating a lease, reset any CRTCs which are driving + outputs that are no longer leased so that they start working + again. + + This required splitting the DIX level lease termination code + into two pieces, one to remove the lease from the system + (RRLeaseTerminated) and a new function that frees the lease + data structure (RRLeaseFree). + + v4: Report RR_Rotate_0 rotation for leased crtcs. + + v5: Terminate all leases on server reset. + + Leases hang around after the associated client exits so that + the client doesn't need to occupy an X server client slot and + consume a file descriptor once it has gotten the output + resources necessary. + + Any leases still hanging around when the X server resets or + shuts down need to be cleaned up by calling the kernel to + terminate the lease and freeing any DIX structures. + + Note that we cannot simply use the existing + drmmode_terminate_lease function on each lease as that wants + to also reset the video mode, and during server shut down that + + modesetting: Validate leases on VT enter + + The kernel doesn't allow any master ioctls to run when another + VT is active, including simple things like listing the active + leases. To deal with that, we check the list of leases + whenever the X server VT is activated. + + xfree86: hide disabled cursors when resetting after lease termination + + The lessee may well have played with cursors and left one + active on our screen. Just tell the kernel to turn it off. + + v6: Add meson build infrastructure + + [Also bumped libdrm requirement - ajax] + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 023d4aba8d45e9e3630b944ecfb650c081799b96 +Author: Keith Packard +Date: Mon Feb 12 13:51:55 2018 -0800 + + xf86-video-modesetting: Create CONNECTOR_ID properties for outputs [v2] + + This lets a DRM client map between X outputs and kernel connectors. + + v2: + Change CONNECTOR_ID to enum -- Adam Jackson + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 39573605050f6253d14a4786bb79ce2b48537039 +Author: Keith Packard +Date: Mon Feb 12 13:51:54 2018 -0800 + + randr: Support "non-desktop" property + + Tracks changes to the non-desktop property so that when non-zero, + outputs will always appear to be disconnected. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit b91c787c4cd2d20685db69426c539938c556128a +Author: Keith Packard +Date: Mon Feb 12 13:51:53 2018 -0800 + + xf86-video-modesetting: Record non-desktop kernel property at PreInit time + + Save any value of the kernel non-desktop property in the xf86Output + structure to avoid non-desktop outputs in the default configuration. + + [Also bump randrproto requirement to a version that defines + RR_PROPERTY_NON_DESKTOP - ajax] + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit fabbaa8d6260da14fe5b7ca0f3f8748af16253a2 +Author: Keith Packard +Date: Mon Feb 12 13:51:52 2018 -0800 + + xfree86/modes: Check for non-desktop monitors during PreInit [v2] + + At startup, we want to ignore non-desktop monitors unless we don't + find any desktop monitors. Because there are no DIX RandR resources + allocated, let the driver store this information in a new field in the + xf86Output structure and then use that value to help decide whether to + include an output as part of the default configuration. + + v2: + Suggested-by: Michel Dänzer + + Bump XF86_CRTC_VERSION from 7 to 8. This will let out-of-tree + drivers know whether this field is available. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 80d4f4b6c20288aa3e0c9908d5d845fc0088a662 +Author: Mario Kleiner +Date: Tue Feb 27 03:05:32 2018 +0100 + + modesetting: Enable screen color depth 30 support. + + glamor now supports depth 30, so allow use of it. + + Signed-off-by: Mario Kleiner + Reviewed-by: Eric Anholt + Reviewed-by: Antoine Martin + +commit 7bc86c7d2346eadb3aafe1550ec55e63f2a3b3e5 +Author: Mario Kleiner +Date: Tue Feb 27 03:05:31 2018 +0100 + + modesetting: Adapt xf86HandleColorMaps() for > 24 color depth. (v2) + + This retains old behavior for depths <= 24, but allows gamma + table and colormap updates to work properly at depth 30. + + This needs the xf86Randr12CrtcComputeGamma() fix for depth 30 + from a previous commit to work. Otherwise the server will work, + but gamma table updates will silently fail, iow. the server + would always run with a default identity gamma lut. + + v2: Simplify as proposed by Michel. + + Signed-off-by: Mario Kleiner + Reviewed-by: Antoine Martin (v1) + +commit b5f9fcd50a999a00128c0cc3f6e7d1f66182c9d5 +Author: Mario Kleiner +Date: Tue Feb 27 03:05:30 2018 +0100 + + xfree86/modes: Adapt xf86Randr12CrtcComputeGamma() for depth 30. (v2) + + At screen depths > 24 bit, the color palettes passed into + xf86Randr12CrtcComputeGamma() can have a larger number of slots + than the crtc's hardware lut. E.g., at depth 30, 1024 palette + slots vs. 256 hw lut slots. This palette size > crtc gamma size + case is not handled yet and leads to silent failure, so gamma + table updates do not happen. + + Add a new subsampling path for this case. + + This makes lut updates work again, as tested with the xgamma + utility (uses XF86VidMode extension) and some RandR based + gamma ramp animation. + + v2: Better resampling when subsampling the palette, as + proposed by Ville. Now reaches the max index of the + palette and deals with non-power-of-two sizes. Thanks. + + Signed-off-by: Mario Kleiner + Reviewed-by: Antoine Martin (v1) + Cc: + +commit 125201408ddd51ca8ea961a7338a6ad299e5816c +Author: Mario Kleiner +Date: Tue Feb 27 03:05:29 2018 +0100 + + glamor: Bump version to 1.0.1 to signal depth 30 support. + + Signed-off-by: Mario Kleiner + Reviewed-by: Antoine Martin + +commit 7a687da24c9d3c9e40ffa426631bf355322d470e +Author: Mario Kleiner +Date: Tue Feb 27 03:05:28 2018 +0100 + + glamor: Enable composite acceleration for rgb10 formats. (v2) + + Specifically for xrgb2101010 format. + + Tested on KDE Plasma-5 with XRender based composite + acceleration backend. Much smoother and faster. + + (v2) Dropped argb2101010, because of depth 32 confusion with + argb8888, as pointed out by Eric. Thanks! + Signed-off-by: Mario Kleiner + Reviewed-by: Antoine Martin + +commit c326c717c8dbf4a3f0c64a031fbe6030e73ff355 +Author: Mario Kleiner +Date: Tue Feb 27 03:05:27 2018 +0100 + + glamor: Fix loose ends in color depth 30 support. + + This makes it work properly with OpenGL based desktop + compositing, as tested with EGL and GLX based compositing + under OpenGL-2/3, and also artifact free with XRender + based 2D compositing. + + Signed-off-by: Mario Kleiner + Reviewed-by: Eric Anholt + Reviewed-by: Antoine Martin + +commit 9ab5d91c6c228e8f5b34e4b30c5104aed6c41958 +Author: Mario Kleiner +Date: Tue Feb 27 03:05:26 2018 +0100 + + glamor: Make Xv extension initialize at depth 30. + + Support x-screens of depth 30, so init doesn't fail. + + Signed-off-by: Mario Kleiner + Reviewed-by: Eric Anholt + Reviewed-by: Antoine Martin + +commit efe9e3e9ff96a06f50d94dc93ad2c19085fa3d09 +Author: Mario Kleiner +Date: Tue Feb 27 06:51:59 2018 +0100 + + modesetting: Fix fallback for lack of new vblank kernel API. + + Turns out that the kernel DRM ioctl handling returns EINVAL + instead of ENOTTY if one tries to call the new drmCrtcGetSequence() + or drmCrtcQueueSequence() ioctl's introduced in Linux 4.15 on an + older kernel where they are missing. This causes the fallback code + not to fall back to the old drmWaitVblank() ioctl and thereby + failure of vblank stuff. + + E.g., on Linux 4.13, glxgears -info runs unthrottled at 10000 fps + instead of 60 fps. Also breakage of OML_sync_control extension. + + Check for errno != EINVAL before setting has_queue_sequence = TRUE. + + Additionally in case of supported drmCrtcQueueSequence(), set + has_queue_sequence = TRUE on success, or we might get at + least a temporary failure in ms_queue_vblank(). + + One slight ambiguity is that we can also get EINVAL if + drm_crtc_vblank_get() fails in the kernel, so if that + happened at first invocation of the new api, we'd fall + back to drmWaitVblank() and then fail there, instead of + failing in the new api, but the end result would be the + same. + + Fixes: 44d5f2eb8a2f ("xf86-video-modesetting: Support new vblank kernel API [v2]") + Signed-off-by: Mario Kleiner + Cc: Keith Packard + Reviewed-by: Keith Packard + +commit 8171d4c2d67b2990a278dc018ac32534c3afe606 +Author: Adam Jackson +Date: Fri Feb 23 16:08:10 2018 -0500 + + render: Store and use all 16bpc of precision for solid pixels (v2.1) + + This plumbs the full width color for solid pictures through to fb, exa, + and glamor. External drivers and acceleration code may wish to make a + similar change for sufficiently new servers. + + v2: Don't break ABI (Michel Dänzer) + v2.1: Use the (correct) full color in fb too (Michel Dänzer) + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 92272378064a878ce7a62852b877d674bcad89cd +Author: Jeffrey Smith +Date: Thu Feb 15 06:46:55 2018 -0600 + + modesetting: Do not close uninitialized dri2 screen + + If a dri2 screen is not successfully initialized, attempting to close it + results in a null dereference. + + Maintain a flag indicating whether the dri2 screen was successfully + initialized, and check it before attempting to close the dri2 screen. + + https://bugzilla.redhat.com/show_bug.cgi?id=1485811 + https://bugzilla.redhat.com/show_bug.cgi?id=1493805 + https://bugzilla.redhat.com/show_bug.cgi?id=1534459 + https://bugzilla.redhat.com/show_bug.cgi?id=1541745 + https://bugs.freedesktop.org/show_bug.cgi?id=101282 + + Signed-off-by: Jeff Smith + +commit aa29298416a6323fad1681a019dbcd54867b66c4 +Author: Adam Jackson +Date: Mon Feb 26 15:26:35 2018 -0500 + + glamor: unifdef XORG_VERSION_CURRENT + + This is always true now that glamor is in-tree. + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + +commit 059879b3edb104014959426f953e1faf103d99ff +Author: Adam Jackson +Date: Mon Feb 26 13:58:26 2018 -0500 + + xquartz: Fix linking with glxvnd + + Signed-off-by: Adam Jackson + +commit 22a3ffe68c9c498e0b6b74ebcf1404becda8e2b1 +Author: Michel Dänzer +Date: Mon Feb 26 17:30:57 2018 +0100 + + glx: Don't pass NULL to glxGetClient + + These guards were dropped by the commit below, but it turns out they're + needed. Fixes crash on VT switch. + + Fixes: d8ec33fe0542 ("glx: Use vnd layer for dispatch (v4)") + Bugzilla: https://bugs.freedesktop.org/105233 + Signed-off-by: Michel Dänzer + Reviewed-by: Adam Jackson + +commit 528c94c6501db936882cd06338e2250a0b884b36 +Author: Adam Jackson +Date: Tue Feb 20 11:03:46 2018 -0500 + + glx: Fix indirect no-config contexts + + We would throw BadValue here for the GLX_SCREEN attribute. The upper + dispatch layer already checks this, we can ignore it here. + + Signed-off-by: Adam Jackson + +commit a63ab81f6be7ad46b7e2d98a50aef4da5e664847 +Author: Adam Jackson +Date: Tue Feb 20 11:03:45 2018 -0500 + + glx: Enable GLX_ARB_create_context_no_error (v2) + + This is mostly for the client library's convenience, if this extension + is listed then it can know the attribute won't be rejected. Note that we + don't honor this attribute for indirect contexts. That's fine, we don't + want to introduce undefined behavior into a potentially privileged + process. + + v2: Remember to ignore the attribute (Eric Anholt) + + Signed-off-by: Adam Jackson + +commit 701f3a206d6f71c4754f457e95e2b954cf0b80c7 +Author: Adam Jackson +Date: Fri Feb 23 16:08:11 2018 -0500 + + render: Simplify miCompositeRects + + Make a solid-fill picture for this instead of a 1x1 pixmap. In principle + the backend can accelerate this directly, and we also get to preserve + all the bits of the fill color. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 9339fa87d03204b29d47eb8c9406f701517b3514 +Author: Adam Jackson +Date: Thu Feb 22 16:53:22 2018 -0500 + + render: Cosmetic cleanup to default format creation + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit ddf752eafe951bb9723aabf2579c4725a6ffc9de +Author: Adam Jackson +Date: Thu Feb 22 16:53:21 2018 -0500 + + render: Remove some 24bpp handling + + This can't happen anymore. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit efd84bff238f8e12bf652525990d36baada8785b +Author: Peter Harris +Date: Thu Feb 22 18:07:38 2018 -0500 + + composite: Fix use-after-free in compReparentWindow + + If an implicitly redirected window is unredirected by the reparent + operation, cw will be a stale pointer. + + Signed-off-by: Peter Harris + Reviewed-by: Keith Packard + +commit ac13d740bf14ba8799d4dfbee1f6f99a297dbc7e +Author: Emil Velikov +Date: Wed Feb 21 17:12:15 2018 +0000 + + mi: Mention extension loading in verbose logs + + Listing the extensions is useful, despite being annoying for normal + usecases. Print it only when extra (lvl 3) vebose is requested. + + v2: Move the logging to InitExtensions(), as requested by Adam. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 9237c5e2878c088a6cd26ea380763465a9e67012 +Author: Emil Velikov +Date: Mon Feb 19 15:18:11 2018 +0000 + + docs: correct LoadExtensionList() documentation + + Add the missing arguments to the function signature. + + Fixes: e46820fb897 ("miinitext: introduce LoadExtensionList() to replace + over LoadExtension()") + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 089a1b0f9fa2e80457dc3d5f05c84565c9113a21 +Author: Emil Velikov +Date: Mon Feb 19 15:18:10 2018 +0000 + + glx: set the version we implement in GlxServerExports + + Set the major/minor version it's currently implemented, not the one + provided by the GLXSERVER_VENDOR_ABI_{MAJOR,MINOR}_VERSION macros. + + Those are identical for now, but can change in the future. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit edc00e020310d8f53ebc16295c373fe84ec6ec87 +Author: Emil Velikov +Date: Mon Feb 19 15:18:09 2018 +0000 + + glx: use C99 initializers for GlxServerExports + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 7fc757986947ad89d76fc0fd3d69f5fdeefc9055 +Author: Emil Velikov +Date: Mon Feb 19 15:18:08 2018 +0000 + + glx: NULL check the correct argument in dispatch_GLXVendorPriv + + malloc can return NULL, unlike GetVendorDispatchFunc. The latter + provides DispatchBadRequest. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 1310241e8d606687811c7394811fe337c3e4de11 +Author: Emil Velikov +Date: Mon Feb 19 15:18:07 2018 +0000 + + glx: keep glvnd_vendor a private [static] variable + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit a054532668cbbb152d0d7acfcce1e03e884bb491 +Author: Jason Ekstrand +Date: Tue Feb 20 09:41:39 2018 -0800 + + xwayland: Fix backwards need_rotate logic (v2) + + When xdg_output support was added to Xwayland, need_rotate parameter was + added to output_get_new_size where true gave you the old pre-xdg_output + behavior and false gave the new behavior. Unfortunately, the two places + where this is called, need_rotate was set backwards. This caused input + get clampped to the wrong dimensions. Also, the logic for deciding + whether or not to flip was wrong because, if need_rotate was false, it + would always flip which is not what you want. + + v2 (Daniel Stone): + - Fix output_get_new_size so that it doesn't flip the dimensions when + need_rotate is false. + + Signed-off-by: Jason Ekstrand + Reviewed-by: Daniel Stone + Reviewed-by: Olivier Fourdan + +commit 343ee7d07565a75b90e6489c5c29f772dca79c43 +Author: Alexander Volkov +Date: Tue Feb 20 18:07:18 2018 +0300 + + Xephyr: Avoid calling xcb_shm_detach() twice + + This call was forgotten to be removed in + 90996f5909aab4bc9aa4011a6a6d0555a7aa3adf in which + hostx_destroy_shm_segment() was introduced, which + itself does it. + + Signed-off-by: Alexander Volkov + Reviewed-by: Adam Jackson + +commit 5ba0ba93e127a8c460b013e3c6851dd186377c27 +Author: Laurent Carlier +Date: Sun Feb 18 10:58:35 2018 +0100 + + meson: Make DGA extension optional + + Signed-off-by: Laurent Carlier + +commit e790bc621b8f55489e35b1de260c649d8d105d63 +Author: Laurent Carlier +Date: Sun Feb 18 10:58:34 2018 +0100 + + dga: #if XFreeXDGA → #ifdef XFreeXDGA + + ../include/events.h:32:14: error: #if with no expression + + Signed-off-by: Laurent Carlier + +commit ce4e20f80ff64a5a8b9f344e2507128f379e0715 +Author: Laurent Carlier +Date: Sun Feb 18 10:58:33 2018 +0100 + + meson: Make Xv and XvMC extensions optional + + Just mimic autoconf file, XvMC can't be enabled without Xv + + Signed-off-by: Laurent Carlier + +commit 82d9e99bf99660537a11d9475369c43814cad664 +Author: Laurent Carlier +Date: Sun Feb 18 10:58:32 2018 +0100 + + meson: Xephyr Requires xcb-shm version 1.9.3 or newer + + Sync with commit 8510f542e5474b719f7d7edba7ef0cc05af0271e + + Signed-off-by: Laurent Carlier + +commit 272fa1817091117d078a22252a03d3161dfc7b0f +Author: Jeffrey Smith +Date: Thu Feb 15 23:47:46 2018 -0600 + + os: avoid uninitialized offsets in backtrace + + When xorg_backtrace calls unw_get_proc_name and an error occurs, offset + might not be set for the current frame. + + Initialize offset for each frame so that the offset from another frame + cannot be used inadvertently. + + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit 6f9d29040cd9f4723a2e6c1e5d2ec8104efc0710 +Author: Jon Turney +Date: Fri Feb 16 16:44:37 2018 +0000 + + hw/xwin: Update for glxvnd + + - Link with libglxvnd in meson.build + - Call xorgGlxCreateVendor() like all other DDX + + Signed-off-by: Jon Turney + +commit 500cc4a029efce9b962ab8fbb10da9f87d83372e +Author: Adam Jackson +Date: Wed Feb 14 17:21:43 2018 -0500 + + dmx: warning fix + + /home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c: In function ‘dmxInputInit’: + /home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c:1019:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] + int found; + + Signed-off-by: Adam Jackson + +commit 9bcddaf9619d01cdbf965cedb9f86a08ed6dc524 +Author: Adam Jackson +Date: Wed Feb 14 17:20:16 2018 -0500 + + dri2: warning fix + + /home/ajax/git/xserver/at/../glx/glxdri2.c: In function ‘create_driver_context’: + /home/ajax/git/xserver/at/../glx/glxdri2.c:444:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] + const __DRIconfig *driConfig = config ? config->driConfig : NULL; + + I don't know why autotools has decided not to be C99 but at least it's + trivial to fix. + + Signed-off-by: Adam Jackson + +commit 133bd4443be6b76a36afadfae0905b832e998165 +Author: Adam Jackson +Date: Wed Jan 10 13:05:48 2018 -0500 + + glx: Large commands are context state, not client state + + There's no reason a multithreaded client shouldn't be allowed to + interleave other requests (for other contexts) with a RenderLarge. Move + the check into __glXForceCurrent, and store the state in the context not + the client. + + Signed-off-by: Adam Jackson + +commit 5d87e4f71355272c8da38c83f493b826623301cc +Author: Adam Jackson +Date: Wed Jan 10 13:05:47 2018 -0500 + + miinitext: Remove separate extension toggle list + + This was only separate because GLX was loadable. The frontend is now + linked statically, so we can use the static extension list directly. + + Signed-off-by: Adam Jackson + +commit 67c303fff303f94b62f03a76de97116c6ebcfda9 +Author: Adam Jackson +Date: Wed Jan 10 13:05:46 2018 -0500 + + miinitext: Load GLX on the mi path + + Add a stub for Xnest so it continues to link, but otherwise we support + GLX on every server so there's no need to make every DDX add it. + + Signed-off-by: Adam Jackson + +commit d8ec33fe0542141aed1d9016d2ecaf52da944b4b +Author: Adam Jackson +Date: Wed Jan 10 13:05:45 2018 -0500 + + glx: Use vnd layer for dispatch (v4) + + The big change here is MakeCurrent and context tag tracking. We now + delegate context tags entirely to the vnd layer, and simply store a + pointer to the context state as the tag data. If a context is deleted + while it's current, we allocate a fake ID for the context and move the + context state there, so the tag data still points to a real context. As + a result we can stop trying so hard to detach the client from contexts + at disconnect time and just let resource destruction handle it. + + Since vnd handles all the MakeCurrent protocol now, our request handlers + for it can just be return BadImplementation. We also remove a bunch of + LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already + allocated its tracking resource on that XID. + + v2: Update to match v2 of the vnd import, and remove more redundant work + like request length checks. + + v3: Add/remove the XID map from the vendor private thunk, not the + backend. (Kyle Brenneman) + + v4: Fix deletion of ghost contexts (Kyle Brenneman) + + Signed-off-by: Adam Jackson + +commit 8753218beae641e5c5ac2c2ba598cfb99a893cf4 +Author: Kyle Brenneman +Date: Wed Jan 10 13:05:44 2018 -0500 + + glx: Import glxvnd server module (v2) + + This is based on an out-of-tree module written by Kyle: + + https://github.com/kbrenneman/libglvnd/tree/server-libglx + + I (ajax) did a bunch of cosmetic fixes, ported it off xfree86 API, + added request length checks, and fixed a minor bug or two. + + v2: Use separate functions to set/get a context tag's private data, and + call the backend's MakeCurrent when a client disconnects to unbind the + context. (Kyle Brenneman) + + Signed-off-by: Adam Jackson + +commit d1fdddeb76328ab84d9a181a5c72b90013f0f0a6 +Author: Laurent Carlier +Date: Tue Feb 13 22:33:51 2018 +0100 + + meson: Make Security extension optional + + Just mimic autoconf file, Security extension needs X-ACE extension + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit 43ef94068e072228446484bf58c0624b9b9649ac +Author: Laurent Carlier +Date: Tue Feb 13 22:33:50 2018 +0100 + + meson: Make more extensions optional + + Just mimic autoconf file for xf86bigfont, screensaver, + xres, xace and xinerama extensions + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit 3203dd175bd71ef4d154578165d930eec29afddb +Author: Laurent Carlier +Date: Tue Feb 13 22:33:49 2018 +0100 + + meson: Make DPMS extension optional + + Just mimic autoconf file, DPMS is disabled with Xquartz + + Signed-off-by: Laurent Carlier + Reviewed-by: Adam Jackson + +commit 2c3e137b786dab4a8002a4934fbcf4ef0742f473 +Author: Adam Jackson +Date: Wed Feb 14 14:10:44 2018 -0500 + + dmx: #if PANORAMIX → #ifdef PANORAMIX + + Signed-off-by: Adam Jackson + +commit ceaf4277447407a7430b9bc3205462fbdbae0e39 +Author: Adam Jackson +Date: Mon Feb 12 15:35:05 2018 -0500 + + xfixes: Restore monitoring of animated cursors + + This was broken by: + + commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf + Author: Adam Jackson + Date: Thu Jun 8 16:23:12 2017 -0400 + + xfixes: Remove the CursorCurrent array + + As of that change we look up the current cursor dynamically instead of + trying to track every time it's set through ->DisplayCursor. That would + work, except the 'bits' of an animated cursor is a transparent 1x1 + pixel. So now, look up whether there's an animated cursor, and use its + current frame if so. + + Signed-off-by: Adam Jackson + +commit 0b7a5700ad3d65e408a2fae00bdee867a8d2e1a8 +Author: Adam Jackson +Date: Mon Feb 12 15:35:04 2018 -0500 + + animcur: Change which CursorPtr we save in external state + + Formerly spriteInfo->anim.pCursor would point to the animated cursor (or + NULL if not animated). That value would also be available in + spriteInfo->sprite->current, so instead lets use anim.pCursor to point + to the current animation element. + + Signed-off-by: Adam Jackson + +commit 8510f542e5474b719f7d7edba7ef0cc05af0271e +Author: Alexander Volkov +Date: Wed Feb 7 14:08:50 2018 +0300 + + Xephyr: Require xcb-shm version 1.9.3 or newer + + It's needed for FD-passing. + + Signed-off-by: Alexander Volkov + Reviewed-by: Adam Jackson + +commit 2ff6eaad85fd702e3cc597c44ccf2210570004ea +Author: Roman Gilg +Date: Fri Feb 9 23:40:42 2018 +0100 + + Correct xorg_list_is_empty return value description + + The helper xorg_list_is_empty returns True when the list is empty and not when + it contains one or more elements. + + Signed-off-by: Roman Gilg + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit bebcc8477c8070ade9dd4be7299c718baeab3d7a Author: Mario Kleiner Date: Mon Feb 5 11:20:41 2018 +0100 @@ -55,9 +6899,8 @@ Date: Mon Feb 5 11:20:41 2018 +0100 Signed-off-by: Mario Kleiner Reviewed-by: Thomas Hellstrom Reviewed-by: Adam Jackson - (cherry picked from commit bebcc8477c8070ade9dd4be7299c718baeab3d7a) -commit e96bd477395af3c2c3157ebda0f55ea4b672a114 +commit 98edb9a35e2cdd61355656b82975d7f2b6a9f0e6 Author: Lyude Paul Date: Tue Feb 6 12:41:47 2018 -0500 @@ -114,9 +6957,119 @@ Date: Tue Feb 6 12:41:47 2018 -0500 Signed-off-by: Lyude Paul Reviewed-by: Adam Jackson - (cherry picked from commit 98edb9a35e2cdd61355656b82975d7f2b6a9f0e6) -commit 61d3f56877b23241757490efcdb759b905caca1d +commit fd21b282dc88936043a23baa4ec053a2811319a7 +Author: Jeff Smith +Date: Sun Feb 4 23:17:54 2018 -0600 + + xfree86: Only call PreInit handler if it exists for device + + DoConfigure() attempts to call the PreInit handler on a device without + checking that the handler exists. + + Check that the PreInit handler exists for a device before attempting to + call it. + + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit e81031f3fda0f8b4237224b13c016759eaa52449 +Author: Jeff Smith +Date: Sun Feb 4 23:17:53 2018 -0600 + + xfree86: Allocate sufficienct space for dev2screen array + + When the dev2screen is sized to xf86NumDrivers in DoConfigure(), + subsequent code may attempt to write past the end of the array. + + Size the dev2screen array to nDevToConfig instead. + + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit 1a24a0ae7b1a7400735530a21ac8c0247723223d +Author: Jeff Smith +Date: Sun Feb 4 23:17:52 2018 -0600 + + xfree86: Do not use uninitialized pointer during probe + + Commits b5dffbb and d75ffcd introduce code in xf86platformProbe() that + references a member of xf86configptr. However, when using the + "-configure" option, xf86configptr may not be initialized when + xf86platformProbe() is called. + + Avoid referencing a member of xf86configptr if uninitialized. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100405 + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit 1e23f03dd5fb6c981ef6d64c084f72fc6820ed71 +Author: Jan Beich +Date: Fri Jul 7 16:31:48 2017 +0200 + + shm, xwayland: prefer atomic close-on-exec without O_TMPFILE + + Signed-off-by: Jan Beich + Reviewed-by: Adam Jackson + +commit 3e3b8a40fee77d1af6ca0c2946ff276d555ddea8 +Author: Michal Srb +Date: Mon Mar 27 15:03:38 2017 +0300 + + modesetting: Check for -1 before converting to unsigned int. + + dri2.c:516:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] + if (front->name < 0) + + Prevents a failure from being ignored. + +commit a9f68688f313752b1c6dfcbf6bf54f8c41fd811d +Author: Michal Srb +Date: Mon Mar 27 15:03:37 2017 +0300 + + xfree86: Silence always true condition warning. + + xf86pciBus.c:1464:21: warning: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare] + if (pVideo->bus < 256) + + The code used to be in xf86FormatPciBusNumber and compared parameter which was int, but since b967bf2a it was inlined now it works with uint8_t. + +commit b75835a4358065378142691bf4a20140981a410f +Author: Raimonds Cicans +Date: Mon Nov 6 15:26:33 2017 +0200 + + Xdmx: fix input driver initialization code paths + + Problem: Xdmx exit with error "(Fatal Error) dmx: Unknown input argument: " + if local input driver is specified (example: -input local,usb-kbd,usb-mou). + + Cause: code block for remote input drivers is placed in code path common + for all drivers. + + Fix: affected code block moved to remote input driver code path part. + + Signed-off-by: Raimonds Cicans + Reviewed-by: Adam Jackson + +commit cbf09619f2355d14c103eff69aaf191cca614c06 +Author: Adam Jackson +Date: Mon Nov 6 12:56:05 2017 -0500 + + meson: Get more xkb configuration from xkbcomp.pc + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 93c16b0524711cd3cd8e32f151c53b5d6522e967 +Author: Alexander Volkov +Date: Fri Feb 2 15:17:15 2018 +0300 + + Xephyr: Call forgotten XShmDetach if can't mmap SHM segment + + Reviewed-by: Adam Jackson + +commit 6b26a7bda9efa93440734ede0382a3e9a6761365 Author: Alex Goins Date: Mon Jan 8 18:44:25 2018 -0800 @@ -138,9 +7091,56 @@ Date: Mon Jan 8 18:44:25 2018 -0800 Signed-off-by: Alex Goins Reviewed-by: Michel Dänzer - (cherry picked from commit 6b26a7bda9efa93440734ede0382a3e9a6761365) -commit cb908a7840487e4b81aa16c5b3a4b609ff1153fc +commit 90996f5909aab4bc9aa4011a6a6d0555a7aa3adf +Author: Alexander Volkov +Date: Wed Jan 31 15:36:36 2018 +0300 + + Xephyr: Prefer using MIT-SHM FD-passing when possible + + This makes the shared memory visible only for the Xephyr + and the X server to which it is connected. + + Signed-off-by: Alexander Volkov + Reviewed-by: Keith Packard + +commit 8a220bd83c3e23de7e07d3976bfc1248c38558d4 +Author: Alexander Volkov +Date: Wed Jan 31 15:36:35 2018 +0300 + + Xephyr: Extract functions to create/delete shared memory segments + + Signed-off-by: Alexander Volkov + Reviewed-by: Keith Packard + +commit 510e7d0d869dcc008b1e11e21961f2c1c3cb9cd3 +Author: Jeff Smith +Date: Tue Dec 26 22:10:52 2017 -0600 + + os: Always return microseconds from GetTimeInMicros() + + When a monotonic clock is not available, GetTimeInMicros() returns the + time in nanoseconds. Instead, return the time in microseconds, as the + name indicates. + + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit 94e7ca6a5667eeb13c078496a07d3e6cf1ec95cc +Author: Giuseppe Bilotta +Date: Wed Jan 31 17:33:48 2018 +0100 + + rrmonitor: allocate using the correct type + + Monitor outputs are of type RROutput, not RRCrtc. + + (Which are both XID, so this makes no difference in practice, other than + being technically correct.) + + Signed-off-by: Giuseppe Bilotta + Reviewed-by: Adam Jackson + +commit ff410c56bfd6dcdf5d252ef0ba3f4c6fde91774b Author: Jeff Smith Date: Fri Jan 26 06:25:22 2018 -0600 @@ -154,9 +7154,8 @@ Date: Fri Jan 26 06:25:22 2018 -0600 Signed-off-by: Jeff Smith Reviewed-by: Adam Jackson - (cherry picked from commit ff410c56bfd6dcdf5d252ef0ba3f4c6fde91774b) -commit b41bb8147e706cb8e615842e08a548b7e8afd279 +commit 3bd17dff1ac5a4685a5da92a9982f621effee658 Author: Jeff Smith Date: Fri Jan 26 06:25:21 2018 -0600 @@ -164,9 +7163,8 @@ Date: Fri Jan 26 06:25:21 2018 -0600 Signed-off-by: Jeff Smith Reviewed-by: Adam Jackson - (cherry picked from commit 3bd17dff1ac5a4685a5da92a9982f621effee658) -commit c715645c14ec00cd49e6bb86340351fa97ab6ea0 +commit 5815c7b5951fd46d69e5c40144b64e516c7afdbf Author: Jeff Smith Date: Fri Jan 26 06:25:20 2018 -0600 @@ -184,9 +7182,8 @@ Date: Fri Jan 26 06:25:20 2018 -0600 Signed-off-by: Jeff Smith Reviewed-by: Adam Jackson - (cherry picked from commit 5815c7b5951fd46d69e5c40144b64e516c7afdbf) -commit 38e6fb757386e2cb2c51a27e52346473d4ffb9a1 +commit 3e377e238f7257fd01e56a4a25dfd77e033673e4 Author: Jeff Smith Date: Fri Jan 26 06:25:19 2018 -0600 @@ -199,9 +7196,83 @@ Date: Fri Jan 26 06:25:19 2018 -0600 Bugzilla: https://bugs.freedesktop.org/98508 Signed-off-by: Jeff Smith Reviewed-by: Adam Jackson - (cherry picked from commit 3e377e238f7257fd01e56a4a25dfd77e033673e4) -commit f6cd99ed79c17e3aa04b8821d10ca95939bd8675 +commit 9b7b8720ebc8028b14796a66d0a21b002682a83c +Author: Jeff Smith +Date: Sat Jan 27 00:14:02 2018 -0600 + + edid: use value returned from pruning duplicate modes + + xf86PruneDuplicateModes is passed a linked list of modes, and after + pruning the duplicate nodes, the new head of the list is returned. If + the first element is removed, the head of the list will change and the + returned value needs to be assigned. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103722 + Thanks: John Lumby + Signed-off-by: Jeff Smith + Reviewed-by: Adam Jackson + +commit dd00e5466a0e4ea313d1860824da4123692827ed +Author: Adam Jackson +Date: Wed Jan 24 15:40:22 2018 -0500 + + xfree86: Remove broken RANDR disabling logic (v4) + + The only way to get at xf86Info.disableRandR from configuration is + Option "RANDR" "foo" in ServerFlags, which probably nobody is using + seeing as it's not documented. The other way it could be set is if a + screen supports RANDR 1.2, in which case we set it to avoid trying to + use the RANDR 1.1 compat code. If the second screen is not 1.2-aware + then this would mean we don't do RANDR setup on the second screen at + all, which would almost certainly crash the first time you try to do + RANDR operations on the second screen. + + Fix that all by deletion, and just check whether the screen already has + RANDR initialized before installing the stub support. If you want to + disable RANDR, use the Extensions section of xorg.conf instead. + + v2: Also remove a now entirely pointless log message, telling you to + ignore a line we will no longer print. + + v3: Explain the fallback path in InitOutput. (Keith Packard) + + v4: Check whether the RANDR private key is initialized before trying to + use it to look up the screen private. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 9a416a478c1a29d1aa12c394acf21fb1b4a3aca9 +Author: Hawking Zhang +Date: Thu Jan 25 18:03:57 2018 +0100 + + glamor: Add 30bit RGB color format support + + Signed-off-by: Hawking Zhang + + [ Michel Dänzer: Adapt to glamor changes since 1.19 ] + + Signed-off-by: Michel Dänzer + Acked-by: Alex Deucher + +commit fc8b7d05e74a6351df56ad8b17216aeb0dcc016b +Author: Olivier Fourdan +Date: Thu Jan 25 13:43:09 2018 +0100 + + xwayland: place a manual redirect on windows + + Place a manual redirect on windows on xwl_realize_window() and remove + it on xwl_unrealize_window() to avoid the X11 window manager removing + its redirect before Xwayland has unrealized the window (e.g. if the X11 + window manager has terminated unexpectedly) + + Suggested by Daniel Stone + + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 3362422e8413dd9f231cfac50ce0a0862525b1bf Author: Olivier Fourdan Date: Wed Jan 24 17:45:37 2018 +0100 @@ -244,9 +7315,23 @@ Date: Wed Jan 24 17:45:37 2018 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Daniel Stone - (cherry picked from commit 3362422e8413dd9f231cfac50ce0a0862525b1bf) -commit 9cd243f75dc52e1c649178963ab22583db52cd54 +commit 29a5423abd4bc6cb7bb800924a27b5d90951e408 +Author: Jason Gerecke +Date: Tue Nov 7 11:09:44 2017 -0800 + + xwayland: Support for BTN_STYLUS3 kernel events + + BTN_STYLUS3 has been introduced by the Linux 4.15 kernel to report the + status of the third button present on Wacom's new "Pro Pen 3D" stylus. + Treat this button like xf86-input-wacom and send a button 8 event + ("navigate back") when received from Wayland. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 71348e99a8e6a95542e483b93839168ca8f51f81 Author: Michal Srb Date: Mon Nov 27 09:59:01 2017 +0100 @@ -260,9 +7345,8 @@ Date: Mon Nov 27 09:59:01 2017 +0100 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103782 Signed-off-by: Michal Srb Reviewed-by: Adam Jackson - (cherry picked from commit 71348e99a8e6a95542e483b93839168ca8f51f81) -commit 5c456b6e2a9a579e67ba577f9147642406f2ce99 +commit d5c23b29487d5ff440abf5ed0beb22c00f21e387 Author: Peter Harris Date: Thu Dec 14 12:21:19 2017 -0500 @@ -278,9 +7362,79 @@ Date: Thu Dec 14 12:21:19 2017 -0500 Reviewed-by: Adam Jackson Signed-off-by: Peter Harris - (cherry picked from commit d5c23b29487d5ff440abf5ed0beb22c00f21e387) -commit df319f889ddc952dd065bbb3252d045b90baaf8e +commit ac138f9b31b0fba00742edbc3326afe66e28099a +Author: Rinat Ibragimov +Date: Tue Oct 24 01:43:43 2017 +0300 + + modesetting: setup colormap + + Signed-off-by: Rinat Ibragimov + Reviewed-by: Michel Dänzer + +commit 5cb330cd5d887b20351604ac080e8b71a4e28be7 +Author: Adam Jackson +Date: Wed Jan 24 15:24:00 2018 -0500 + + Revert "xfree86: Remove broken RANDR disabling logic (v3)" + + Tsk. This broke vesa for me, the rrGetScrPriv in InitOutput will crash + if randr's screen private key hasn't been initialized yet. That seems + dumb, but let's not leave it broken. + + This reverts commit c08d7c1cdde6a844338ed4c3645b00bf25843a31. + +commit c08d7c1cdde6a844338ed4c3645b00bf25843a31 +Author: Adam Jackson +Date: Tue Jan 23 12:10:52 2018 -0500 + + xfree86: Remove broken RANDR disabling logic (v3) + + The only way to get at xf86Info.disableRandR from configuration is + Option "RANDR" "foo" in ServerFlags, which probably nobody is using + seeing as it's not documented. The other way it could be set is if a + screen supports RANDR 1.2, in which case we set it to avoid trying to + use the RANDR 1.1 compat code. If the second screen is not 1.2-aware + then this would mean we don't do RANDR setup on the second screen at + all, which would almost certainly crash the first time you try to do + RANDR operations on the second screen. + + Fix that all by deletion, and just check whether the screen already has + RANDR initialized before installing the stub support. If you want to + disable RANDR, use the Extensions section of xorg.conf instead. + + v2: Also remove a now entirely pointless log message, telling you to + ignore a line we will no longer print. + + v3: Explain the fallback path in InitOutput. (Keith Packard) + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit da8de2a7f6ab52ef52039b0dc9978260232a34a6 +Author: Olivier Fourdan +Date: Thu Sep 7 17:43:16 2017 +0200 + + xwayland: Add optional xdg-output support + + The xdg-output protocol aims at describing outputs in way which is + more in line with the concept of an output on desktop oriented systems. + + For now it just features the position and logical size which describe + the output position and size in the global compositor space. + + This is however much useful for Xwayland to advertise the output size + and position to X11 clients which need this to configure their surfaces + in the global compositor space as the compositor may apply a different + scale from what is advertised by the output scaling property (to achieve + fractional scaling, for example). + + This was added in wayland-protocols 1.10. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 75408f53d4e203e462b2f13ea4b06264f0e59ad2 Author: Michel Dänzer Date: Wed Jan 24 12:28:38 2018 +0100 @@ -291,9 +7445,8 @@ Date: Wed Jan 24 12:28:38 2018 +0100 Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer - (cherry picked from commit 75408f53d4e203e462b2f13ea4b06264f0e59ad2) -commit d0d1a694f967af770fba0d36043fd5218ff20984 +commit 76732f498f1e73fb081841a04faf068660f3d5c7 Author: Michel Dänzer Date: Wed Jan 24 11:40:50 2018 +0100 @@ -309,9 +7462,151 @@ Date: Wed Jan 24 11:40:50 2018 +0100 https://cgit.freedesktop.org/mesa/mesa/commit/?id=7b0e8264dd21ae05521d08d41fecd84139401fef Bugzilla: https://bugs.freedesktop.org/104678 - (cherry picked from commit 76732f498f1e73fb081841a04faf068660f3d5c7) -commit 8be1dbeacf5f29c0b538414e87d47c9d5af08d9d +commit f704620e5db8305c54c6b6981657d801dbf6849b +Author: Adam Jackson +Date: Wed Jan 10 13:05:43 2018 -0500 + + glx: Move provider setup interface to glx_extinit.h + + Keeps us from needing to add glx/ to the include path everywhere, since + we can't add it to the dix include path because the header file names + conflict with glxproxy. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit c2b2f06aa03fe738301ebaa82f220d9cfed5ab1a +Author: Adam Jackson +Date: Wed Jan 10 13:05:42 2018 -0500 + + miinitext: General cleanup (v2) + + This really just wants to be the list of disable booleans and + initialization functions, and nothing else. Stop including the protocol + headers from extinit.h, remove a stray mention of xgl, and move an + XInput declaration to a better place. + + v2: A bunch of drivers assume they'll get the DPMS tokens implicitly, + so add it to globals.h. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 4d5aab66c052795c7f0381a3dfc7293c9a41e441 +Author: Keith Packard +Date: Thu Dec 21 18:54:39 2017 -0800 + + xfree86: Disable cursor whenever turning off CRTC during modeset + + This makes sure the CRTC's cursor is hidden before we hand the CRTC + over to some other application. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 29f79bedf2c80241ba4b482db6ead08a5709a982 +Author: Keith Packard +Date: Thu Dec 21 18:54:37 2017 -0800 + + randr: Declare incoming property values const + + RRChangeOutputProperty and RRConfigureOutputProperty should not modify + their parameters, and callers may want to pass pointers to fixed data, + so declare the value pointers as const in both cases. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit a12485ed846b852ca14d17d1e58c8b0f2399e577 +Author: Keith Packard +Date: Thu Dec 21 18:54:34 2017 -0800 + + xf86-video-modesetting: Update property values at detect and uevent time + + We were updating the link-status property when a uevent came in, but + we also want to update the non-desktop property, and potentially + others as well. We also want to check at detect time in case we don't + get a hotplug event. + + This patch updates every property provided by the kernel, sending + changes to DIX so it can track things as well. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 44d5f2eb8a2f92571698adec39ac569b71da5a1b +Author: Keith Packard +Date: Thu Dec 21 18:54:33 2017 -0800 + + xf86-video-modesetting: Support new vblank kernel API [v2] + + drmCrtcGetSequence returns the current vblank sequence and time. + + drmCrtcQueueSequence queues an event for delivery at a specified + vblank sequence. + + Use these (when available) in preference to drmWaitVBlank. + + v2: Remove FIRST_PIXEL_OUT_FLAG. This has been removed from the kernel + API. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 627dfc2f836a3a1fc6afbd3f2335f88f5ca55ffd +Author: Adam Jackson +Date: Mon Jan 22 15:43:05 2018 -0500 + + automake: Fix 'make distcheck' + + Add some missing meson.builds to the distball, and update the meson + build test to work when the distcheck srcdir != builddir. The test build + directory will be $(srcdir)/_distcheck_build so srcdir will need to be + writable; this shouldn't be too much to ask I hope. + + Signed-off-by: Adam Jackson + +commit 2d29daf4c69385513a322002570ec2c41cfc838f +Author: Jon Turney +Date: Thu Jan 18 16:18:12 2018 +0000 + + meson.build: Fix hw/xwin build when dependencies are installed in a non-default location + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 514d2c243e01b114de304ea72226bbf8772b1b11 +Author: Jon Turney +Date: Wed Jan 17 13:43:47 2018 +0000 + + meson: Use and prefer tirpc for Secure RPC authentication + + Reviewed-by: Adam Jackson + +commit f72587ecc7e1dedfb20a999a0e600b83c06a1b29 +Author: Pekka Paalanen +Date: Wed Dec 20 13:18:45 2017 +0200 + + xwayland: reduce over-damage + + If an X11 app draws a little here, some there, and a tiny bit in the + opposite corner, using RegionExtents for the damage to be sent to the + Wayland compositor will cause massive over-damaging. + + However, we cannot blindly send an arbitrary number of damage + rectangles, because there is a risk of overflowing the Wayland + connection. If that happens, it triggers an abort in libwayland-client. + + Try to be more accurate with the damage by sending up to 256 rectangles + per window, and fall back to extents otherwise. The number is completely + arbitrary. + + Signed-off-by: Pekka Paalanen + Reviewed-by: Daniel Stone + +commit a5e9bcad7ad0887f804905b482894b85751519fb Author: Martin Wilck Date: Tue Jan 9 20:33:09 2018 +0100 @@ -326,9 +7621,129 @@ Date: Tue Jan 9 20:33:09 2018 +0100 Signed-off-by: Martin Wilck Reviewed-by: Adam Jackson - (cherry picked from commit a5e9bcad7ad0887f804905b482894b85751519fb) -commit 71269c6e57cec82bbf81b1c99c8019098303d6a3 +commit 528cf6fcee1839cb829652a49c1b1bf45d6a37fb +Author: David Weinehall +Date: Thu Jan 18 15:12:46 2018 +0200 + + sync: Fix diffgreater comparison + + xsync: Fix diffgreater comparison + + While transitioning from CARD64 to int64, + the GreaterThan call was mistakenly transformed into ">=". + Part of this was fixed already in + commit 8060196a3e80a3c0ad2c0abbe459416821cd366c + + This patch fixes the remaining issue. + + Signed-off-by: David Weinehall + Reviewed-by: Keith Packard + +commit 32b42627217917337553121191e9bc3b423b8d99 +Author: Keith Packard +Date: Tue Jan 16 11:44:37 2018 -0800 + + modesetting: Use seq instead of msc in ms_queue_vblank failure path + + When the call to queue a vblank event fails, we need to clean up by + removing the user-space queue entry. That is indexed by the local + sequence number, not by the kernel vblank count. The call in this + case was just passing the wrong value. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 15d91df47424127b9e8d0d73692e2196c79dd3fe +Author: Adam Jackson +Date: Wed Jan 10 12:07:41 2018 -0500 + + x86emu: Teach the debug code about varargs + + With -Wformat-nonliteral and a debug build you'd get yelled at here: + + ../hw/xfree86/x86emu/x86emu/debug.h:188:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] + + To fix this, rewrite the printf code to actually use varargs and the + appropriate format attribute. All callers of DECODE_PRINTF() pass a + string with no % specifiers, so we pass that as the argument to + printf("%s"). For DECODE_PRINTF2() we just pass the args through. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 1274015186a8457c38c3b5dcc9965c62f1d2a7a6 +Author: Adam Jackson +Date: Mon Jan 8 15:50:29 2018 -0500 + + build: Remove <*dbm.h> checks + + Formerly used by the rgb database code, which hasn't been a thing in + over a decade. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit c3fbe2bbff19c67179f52b8dcd27b576a958fde7 +Author: Adam Jackson +Date: Mon Jan 8 15:50:28 2018 -0500 + + meson: Enable SUN-DES-1 auth code + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 4d82a150b2ee29c1025408cdb9ece255452a81bd +Author: Adam Jackson +Date: Tue Jan 9 11:48:10 2018 -0500 + + animcur: Handle allocation failure for the animation timer + + Signed-off-by: Adam Jackson + Reviewed-by: Aaron Plattner + Tested-by: Aaron Plattner + +commit de60245e05c0d2528d4ff42557a044387e53315c +Author: Adam Jackson +Date: Tue Jan 9 10:54:05 2018 -0500 + + animcur: Fix transitions between animated cursors + + We weren't cancelling the old timer when changing cursors, making things + go all crashy. Logically we could always cancel the timer first, but + then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis + is potentially expensive. + + Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967 + Signed-off-by: Adam Jackson + Reviewed-by: Aaron Plattner + Tested-by: Aaron Plattner + +commit a09fbe6c82efc674fc3790c7ffad7df70866a7df +Author: Adam Jackson +Date: Wed Dec 13 11:44:38 2017 -0500 + + glx: Stop printing messages about what GLX extensions we enable + + glxinfo already exists, use it. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + +commit 4ed8d5c9463cbef0693d98eb9faf7f9c2222c383 +Author: Adam Jackson +Date: Tue Nov 14 15:33:54 2017 -0500 + + ddc: Port some paranoia from drm_edid.c + + Avoid adding a "standard" mode timing if we've already got a matching + detailed timing. To help with that, parse CEA blocks for detailed + timings before doing standard or established timings. + + Signed-off-by: Adam Jackson + +commit 652913cd9474946bcb29271602bacfd98f46ad0b Author: Adam Jackson Date: Wed Dec 13 14:53:56 2017 -0500 @@ -350,9 +7765,26 @@ Date: Wed Dec 13 14:53:56 2017 -0500 Instead, cast address, not &address. Signed-off-by: Adam Jackson - (cherry picked from commit 652913cd9474946bcb29271602bacfd98f46ad0b) -commit 8f11ab2b475623d5c00e146a7d6108f356a16b52 +commit da4ffb2f6a0b5a039ae1362ae71e9b47441f90d2 +Author: Jon Turney +Date: Fri Dec 22 18:44:01 2017 +0000 + + meson: Correct the option for disabled int10 from 'disabled' to 'false' + + Fix meson_option.txt to align with the check of the int10 option against + 'disabled', not 'false' in hw/xfree/meson.build, to see if it shouldn't be + built at all. + + This keeps everything consistent that 'false' always turns things off. + + Not noticed before as options weren't validated against choices until meson + 0.43 + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit c601c8faf54ff9e3bcbc653421828d71042deef7 Author: Helmut Grohne Date: Thu Dec 21 11:48:15 2017 +0100 @@ -373,9 +7805,8 @@ Date: Thu Dec 21 11:48:15 2017 +0100 Signed-off-by: Helmut Grohne Bug-Debian: https://bugs.debian.org/882531 Reviewed-by: Adam Jackson - (cherry picked from commit c601c8faf54ff9e3bcbc653421828d71042deef7) -commit 7cec7fb7bc34ea857e2d40ad32ead8a328dbe1a1 +commit a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Author: Peter Hutterer Date: Fri Jan 5 11:58:42 2018 +1000 @@ -388,9 +7819,8 @@ Date: Fri Jan 5 11:58:42 2018 +1000 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382 Reviewed-by: Adam Jackson Signed-off-by: Peter Hutterer - (cherry picked from commit a309323328d9d6e0bf5d9ea1d75920e53b9beef3) -commit 16896d05a6a2a91fd53cf6af56ce5e79f6abb500 +commit dbfbe58b94ec07a45fd6170f96bffec55051724e Author: Corentin Rossignon Date: Thu Jan 4 08:34:01 2018 +0100 @@ -402,26 +7832,18 @@ Date: Thu Jan 4 08:34:01 2018 +0100 Signed-off-by: Corentin Rossignon Bugzilla: https://bugs.freedesktop.org/104405 Reviewed-by: Adam Jackson - (cherry picked from commit dbfbe58b94ec07a45fd6170f96bffec55051724e) -commit 5e83ebd76738455c443a66024b0b5eb92930b36c +commit ab54bc295cd05281e55bd4d9c37216c0a929fc83 Author: Adam Jackson -Date: Tue Jan 9 10:54:05 2018 -0500 +Date: Thu Oct 26 15:33:14 2017 -0400 - animcur: Fix transitions between animated cursors + animcur: Stop tracking the last display time in the SpriteInfoRec - We weren't cancelling the old timer when changing cursors, making things - go all crashy. Logically we could always cancel the timer first, but - then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis - is potentially expensive. - - Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967 + Reviewed-by: Robert Morell + Tested-by: Robert Morell Signed-off-by: Adam Jackson - Reviewed-by: Aaron Plattner - Tested-by: Aaron Plattner - (cherry picked from commit de60245e05c0d2528d4ff42557a044387e53315c) -commit 693f0e21d55d6e9fe792d91e76e4168aa813db71 +commit 094a63d56fbfb9e23210cc9ac538fb198af37cee Author: Adam Jackson Date: Thu Oct 26 15:24:39 2017 -0400 @@ -441,9 +7863,8 @@ Date: Thu Oct 26 15:24:39 2017 -0400 Reviewed-by: Robert Morell Tested-by: Robert Morell Signed-off-by: Adam Jackson - (cherry picked from commit 094a63d56fbfb9e23210cc9ac538fb198af37cee) -commit 354c48304d27f75b7c33c03a0adb050c37788ccf +commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87 Author: Adam Jackson Date: Thu Oct 26 13:53:06 2017 -0400 @@ -456,9 +7877,8 @@ Date: Thu Oct 26 13:53:06 2017 -0400 Reviewed-by: Robert Morell Tested-by: Robert Morell Signed-off-by: Adam Jackson - (cherry picked from commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87) -commit 26841b2c9ea03fda8b2d0da254e0344fd2a3afce +commit 3abbdb7318018584a27220737bd92081ce8ee67c Author: Adam Jackson Date: Thu Oct 26 13:40:57 2017 -0400 @@ -467,9 +7887,8 @@ Date: Thu Oct 26 13:40:57 2017 -0400 Reviewed-by: Robert Morell Tested-by: Robert Morell Signed-off-by: Adam Jackson - (cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c) -commit 725b4b46ff59a8db84d8c12fec02c6b1d94b27ce +commit f615cb62d47cb24ea31718e8226df53ce6651c91 Author: Lukáš Krejčí Date: Sat Dec 30 23:46:45 2017 +0100 @@ -503,9 +7922,8 @@ Date: Sat Dec 30 23:46:45 2017 +0100 Acked-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit f615cb62d47cb24ea31718e8226df53ce6651c91) -commit 16fd18479d2f617adf0e6de922586441be3808eb +commit 170c95978530f6373bdf4488116902b273f3abf4 Author: Olivier Fourdan Date: Fri Dec 15 16:43:47 2017 +0100 @@ -524,9 +7942,22 @@ Date: Fri Dec 15 16:43:47 2017 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 170c95978530f6373bdf4488116902b273f3abf4) -commit a13271f2feb6e480b2e698d4efa3b94150a6808b +commit c72049530503ebde493cfcd22156105557ea18d3 +Author: Konstantin Kharlamov +Date: Sun Dec 17 23:23:02 2017 +0300 + + modesetting: simplify bailing on calloc fail + + The "done" label restores crtc-> {x,y,rotation,mode}, frees output_id. + Doing the calloc() before writing to those values frees us from + necessity to restore them if calloc fails, and allows to merge + "if (mode)" block. + + Signed-off-by: Konstantin Kharlamov + Signed-off-by: Peter Hutterer + +commit c2954b16c8730c7ed8441fd8dba25900f3aed265 Author: Tapani Pälli Date: Tue Nov 28 09:23:29 2017 +0200 @@ -540,17 +7971,670 @@ Date: Tue Nov 28 09:23:29 2017 +0200 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103699 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103646 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103655 - (cherry picked from commit c2954b16c8730c7ed8441fd8dba25900f3aed265) -commit ebfb06b11955a6c32500b7086be912ab96b753a7 +commit cf7517675d988c2d1ff967d6d162a17acbdad466 +Author: Keith Packard +Date: Wed Aug 2 21:34:52 2017 -0700 + + xfree86: Hold input_lock across SPRITE functions in VGA arbiter + + Avoid scrambling the sprite functions wrapper. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101995 + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 3265d0c81f7a501258fa91e49fcc137714b4af5e +Author: Jon Turney +Date: Tue Oct 10 13:43:40 2017 +0100 + + meson: Add dependency on generated code fragments in hw/xwin/glx/ + + Somehow I'd managed to write this with this dependency missing, so this only + works correctly when the generated files already exist and the correct + automatic dependencies generated, but fails on a clean build. + + Including generated files with a .c extension into the sources for a target + causes meson to want to compile them (and it seems to be hard to say "make + the directory containing this generated file available to include"). + + So, change the extension of included generated C fragments to .ic + + Update the autotools build to align. + + Signed-off-by: Jon Turney + +commit edda951fa5145a50915611ee0e9e459074117700 +Author: Peter Harris +Date: Thu Oct 12 16:48:37 2017 -0400 + + os: Add epoll-like port implementation for Solaris + + x11perf -noop with 200 xlogos connected is slightly faster with ports: + + before after Operation + ---------- ----------------- -------------------- + 18400000.0 19200000.0 (1.04) X protocol NoOperation + + Acked-by: Keith Packard + Signed-off-by: Peter Harris + +commit 83c04ee6eae1edc80528203fb515425108171cd8 +Author: Peter Harris +Date: Thu Oct 12 16:48:36 2017 -0400 + + os: Add epoll-like pollset implementation for AIX + + AIX's poll only allows FD_SETSIZE entries in the fd list, which is + insufficient for expanded MaxClients. + + As a bonus, x11perf -noop with ~250 xlogos connected is slightly faster + with pollset: + + before after Operation + --------- ---------------- -------------------- + 5750000.0 5990000.0 (1.04) X protocol NoOperation + + Signed-off-by: Peter Harris + Acked-by: Keith Packard + +commit bed28300999a07514d741abe5c748adf234e18a6 Author: Adam Jackson -Date: Wed Dec 20 14:23:57 2017 -0500 +Date: Mon Nov 20 15:43:07 2017 -0500 - xserver 1.19.6 + kdrive: remove KdSignalWrapper etc. + + This no longer does anything useful. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + Reviewed-by: Dave Airlie + +commit 4353d83f60766824a65f183716616eee8e17bb24 +Author: Adam Jackson +Date: Mon Nov 20 15:43:06 2017 -0500 + + xfree86: remove xf86CaughtSignal etc. + + This no longer does anything useful. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + Reviewed-by: Dave Airlie + +commit 9c72887939f319e185d2726d9d9a4191b9d12efd +Author: Adam Jackson +Date: Mon Nov 20 15:43:05 2017 -0500 + + os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT + + SIGQUIT is a normal termination request, but any other signal we handle + here wants a core. This has the effect of making FatalError's call to + AbortServer trigger the + + if (CoreDump) + OsAbort(); + + path. This will allow us to remove some DDX code that has the same net + effect. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + Reviewed-by: Dave Airlie + +commit 0a255dceb79ee28a88667d5bd23cf989dbf9bed8 +Author: Adam Jackson +Date: Mon Nov 20 15:43:04 2017 -0500 + + xfree86: Remove xf86InterceptSignals + + The only consumer of this is the Linux vm86 backend for int10 (which you + should not use), and there all it serves to do is make signals generated + by the vm86 task non-fatal. In practice this error appears never to + happen, and marching ahead with root privileges after arbitrary code has + raised a signal seems like a poor plan. + + Remove the usage in the vm86 code, making this error fatal. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + Reviewed-by: Dave Airlie + +commit 722c8035dcf3ae0b18841066fe4ee030277274bc +Author: Adam Jackson +Date: Mon Nov 20 15:43:03 2017 -0500 + + xfree86: Remove xf86InterceptSigIll + + This was added in ~2004 for the sis driver, to detect whether it could + use SSE for memcpy. Charmingly, the code to check whether that feature + exists in the server is: + + #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,13,0) + #define SISCHECKOSSSE /* Automatic check OS for SSE; requires SigIll facility */ + #endif + + Which means it has never worked in any modular server release. + + A less gross way to do this is to check for SSE support with getauxval() + or /proc/cpuinfo or similar. Since no driver is using the existing + intercept mechanism, drop it. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + Reviewed-by: Dave Airlie + +commit fe46cbea0f19959d469ca4d1f09be379dc7b1e45 +Author: Olivier Fourdan +Date: Tue Nov 21 14:45:13 2017 +0100 + + xwayland: Give up “cleanly“ on Wayland socket errors + + Xwayland is a pretty standard Wayland client, we want to be able to + capture core dumps on crashes. + + Yet using "-core" causes any FatalError() to generate a core dump, + meaning that we would get a core file for all Wayland server crashes, + which would generate a lot of false positives. + + Instead of using FatalError() on Wayland socket errors, give up cleanly + to avoid dumping core files when "-core" is used. + + See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502 + and: https://bugzilla.gnome.org/show_bug.cgi?id=789086 + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 6883ae43eb72fe4e2651c1dca209563323fad2db +Author: Tomasz Śniatowski +Date: Wed Dec 6 12:16:17 2017 +0100 + + os: Fix strtok/free crash in ComputeLocalClient + + Don't reuse cmd for strtok output to ensure the proper pointer is + freed afterwards. + + The code incorrectly assumed the pointer returned by strtok(cmd, ":") + would always point to cmd. However, strtok(str, sep) != str if str + begins with sep. This caused an invalid-free crash when running + a program under X with a name beginning with a colon. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=104123 + Signed-off-by: Tomasz Śniatowski + Reviewed-by: Michel Dänzer + +commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf +Author: Adam Jackson +Date: Thu Jun 8 16:23:12 2017 -0400 + + xfixes: Remove the CursorCurrent array + + We're not wrapping all the ways a cursor can be destroyed, so this array + ends up with stale data. Rather than try harder to wrap more code paths, + just look up the cursor when we need it. Signed-off-by: Adam Jackson -commit 91c42093b248fc61a23cd1f48fec451fa29e122c +commit 3db7707df3cfd8ba62c10d08c7c731ec18ea8ddf +Author: Adam Jackson +Date: Wed Dec 6 15:12:20 2017 -0500 + + test: Fix build dependency for bigreq test + + libxcb-xinput isn't a thing in whichever Ubuntu it is that Travis is + using. The test is already optional, make it more so. + + Signed-off-by: Adam Jackson + +commit 9f7a9be13d6449c00c86d3035374f4f543654b3f +Author: Olivier Fourdan +Date: Tue Dec 5 09:59:06 2017 +0100 + + dix: avoid deferencing NULL PtrCtrl + + PtrCtrl really makes sense for relative pointing device only, absolute + devices such as touch devices do not have any PtrCtrl set. + + In some cases, if the client issues a XGetPointerControl() immediatlely + after a ChangeMasterDeviceClasses() copied the touch device to the VCP, + a NULL pointer dereference will occur leading to a crash of Xwayland. + + Check whether the PtrCtrl is not NULL in ProcGetPointerControl() and + return the default control values otherwise, to avoid the NULL pointer + dereference. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519533 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 60f4646ae10f0b57790fce46682baa531512b53e +Author: Carlos Garnacho +Date: Mon Dec 4 16:55:13 2017 +0100 + + xwayland: Keep separate variables for pointer and tablet foci + + The tablet/stylus interfaces reused xwl_seat->focus_window, which + would leave a somewhat inconsistent state of that variable for + wl_pointer purposes (basically, everything) if the pointer happened + to lay on the same surface than the stylus while proximity_out + happens. + + We just want the stylus xwl_window to correctly determine we have + stylus focus, and to correctly translate surface-local coordinates + to root coordinates, this can be done using a different variable. + + Signed-off-by: Carlos Garnacho + Acked-by: Jason Gerecke + Tested-by: Olivier Fourdan + +commit 97ac59b1ed3624f7c04e54dd3e3dadfa46a8f170 +Author: Olivier Fourdan +Date: Wed Sep 27 18:01:01 2017 +0200 + + xwayland: Fix non-argb cursor conversion + + From the bug: "What happens if bits->width is less than 8? :)" + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103012 + Signed-off-by: Olivier Fourdan + Reviewed-by: Emil Velikov + Reviewed-by: Daniel Stone + +commit a4c1e290824d0e40191ad26019b705f61c11e113 +Author: Adam Jackson +Date: Tue Nov 14 15:15:03 2017 -0500 + + glx: Implement GLX_EXT_no_config_context (v2) + + Only enabled for the DRI backends at the moment. In principle WGL/CGL + could support this - it's sort of implied by GL 3.0 support - but in + practice their implementations back GLX drawables with native drawables + (and not anonymous FBOs), so they would need either a corresponding + window system binding extension or significant implementation work. + + v2: Require that the two screen numbers match, per v4 of spec. + + Khronos: https://github.com/KhronosGroup/OpenGL-Registry/pull/102 + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit f0fffa926a5771e0e604fe9a48178b0514ca5d41 +Author: Adam Jackson +Date: Tue Nov 14 15:15:02 2017 -0500 + + glx: Prepare __glXGetDrawable for no-config contexts + + Any proper (GLX 1.3) drawable will already have a bound config, but if + we're doing the GLX 1.2 thing of making a Window current, we need to + infer the config from the window's Visual. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 5d667df6ea1634191a26f9a7c26bc883701d62b0 +Author: Adam Jackson +Date: Tue Nov 14 15:15:01 2017 -0500 + + glx: Fix glXQueryContext for GLX_FBCONFIG_ID and GLX_RENDER_TYPE (v2) + + Just never filled in, oops. Seems to have gone unnoticed because + normally glXQueryContext simply returns the values filled in by the + client library when the context was created. The only path by which you + normally get to a GLXQueryContext request is glXImportContext, and then + only if the context is already indirect. + + However, that's a statement about Mesa's libGL (and anything else that + inherited that bit of the SGI SI more or less intact). Nothing prevents + a mischeivous client from issuing that request of a direct context, and + if they did we'd be in trouble because we never bothered to preserve the + associated fbconfig in the context state, so we'd crash looking up + GLX_VISUAL_ID_EXT. So let's fix that too. + + v2: Fixed missing preservation of the config in DRI2 (Eric Anholt) + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 78b2ce1410dda758537d52398223ca9b757883bc +Author: Daniel Martin +Date: Mon Nov 20 10:47:43 2017 +0100 + + modesetting: Remove #if 0 CMAP_LOAD_EVEN_IF_OFFSCREEN + + CMAP_LOAD_EVEN_IF_OFFSCREEN has been encapsulated since the import of + xf86-video-modesetting into the tree. + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Martin + +commit d563443381142fbc0b102422d7e7389bf3621331 +Author: Daniel Martin +Date: Mon Nov 20 10:47:42 2017 +0100 + + modesetting: Remove unused define DRV_ERROR + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Martin + +commit 6804875662363764683a86c1614e4cf3cc70a20a +Author: Daniel Martin +Date: Mon Nov 20 10:47:41 2017 +0100 + + modesetting: Reset output_id if drmModeGetConnector failed + + If drmModeGetConnector() fails in drmmode_output_detect(), we have to + reset the output_id to -1 too. + + Yet another spot leading to a potential NULL dereference when handling + the mode_output member as output_id was != -1. Though, this case should + be very hard to hit. + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Martin + +commit e20b1016de22e893d5468960988ddd5677c11d98 +Author: Daniel Martin +Date: Mon Nov 20 10:47:40 2017 +0100 + + modesetting: Fix log msg if pixmap creation failed + + Add a missing new-line character and make the message more verbose than + "Failed". + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Martin + +commit 02981fe1a844e101c81037df79fc147f217f3bf9 +Author: Daniel Martin +Date: Mon Nov 20 10:47:39 2017 +0100 + + xfree86: Fix set but not used warnings in lnx_platform + + Those warnings are generated, when building without systemd support: + + ../hw/xfree86/os-support/linux/lnx_platform.c: In function ‘get_drm_info’: + ../hw/xfree86/os-support/linux/lnx_platform.c:29:16: warning: variable ‘minor’ set but not used [-Wunused-but-set-variable] + int major, minor, fd; + ^~~~~ + ../hw/xfree86/os-support/linux/lnx_platform.c:29:9: warning: variable ‘major’ set but not used [-Wunused-but-set-variable] + int major, minor, fd; + ^~~~~ + + In this case the functions are macros, which don't use theese arguments. + + v2: Add comments, why the warnings appear. Suggested by Emil Velikov + + Reviewed-by: Emil Velikov + Signed-off-by: Daniel Martin + +commit 918afeecbc63d70413e222efdb2ac4cfb16eae9e +Author: Daniel Martin +Date: Mon Nov 20 10:47:38 2017 +0100 + + os/xdmcp: Honour -once when session is dead + + Terminate a dead session when -once was passed. Don't restart it. + + Signed-off-by: Daniel Martin + Reviewed-by: Walter Harms + +commit 559954aaa8d811a22cf918cc16a7d618e12201a0 +Author: Michel Dänzer +Date: Mon Oct 2 11:33:43 2017 +0200 + + present: Only send PresentCompleteNotify events to the presenting client + + We were sending the events to all clients listening for them on the + window. But clients can get confused by events from another client, and + I can't imagine any case where receiving events from other clients would + be required. + + v2: + * Also restrict events sent to additional windows to the presenting + client + * Don't shorten line lengths + + Reviewed-by: Keith Packard + +commit fc7fb5bbe1c8f787e53500b9a2ca4af815f310d1 +Author: Giuseppe Bilotta +Date: Thu Nov 9 10:21:21 2017 +0100 + + randr: free crtc->outputs on destroy + + Reviewed-by: Adam Jackson + Signed-off-by: Giuseppe Bilotta + +commit 16381d186e7c791031392ed8afcfd33009854e9e +Author: Giuseppe Bilotta +Date: Thu Nov 9 10:21:20 2017 +0100 + + randr: always realloc crtcs and outputs + + When the last crtc (resp. output) is destroyed, the rrScrPriv crtcs + (resp. outputs) fields do not get cleared, which can lead to a situation + where the private's numCrtcs (resp. numOutputs) field is zero, but the + associated memory is still allocated. Just checking if numCrtcs (resp. + numOutputs) is zero is thus not a good criteria to determine whetehr to + use a realloc or a malloc. + + Since crtcs (resp. outputs) are NULL-initialized anyway, relying on + numCrtcs (resp. numOutputs) is actually unnecessary, because + reallocation of a NULL ptr is equivalent to a malloc anyway. + + Therefore, just use realloc() unconditionally, and ensure that the + fields are properly initialized. + + Reviewed-by: Adam Jackson + Signed-off-by: Giuseppe Bilotta + +commit fb5ee77b91a93e27801006be8ee34d27984e7fa6 +Author: Giuseppe Bilotta +Date: Thu Nov 9 10:21:19 2017 +0100 + + randr: rrGetScreenResources: initialize memory + + Similarly to bb766ef11227bd8c71ac65845d1930edd0eda40d, ensure that the + extra padding is set to 0. + + Reviewed-by: Adam Jackson + Signed-off-by: Giuseppe Bilotta + +commit 307c124d6bcfe26057767b2c0990dc9ac66b9c93 +Author: Adam Jackson +Date: Tue Nov 14 15:59:35 2017 -0500 + + glx: Only flush indirect contexts in MakeCurrent (v2) + + If the context is direct none of the GL commands were issued by this + process, the server couldn't flush them even if it wanted to. + + v2: Fix embarassingly obvious boolean inversion (Michel Dänzer) + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 66e8eaa456a0f200c0649c56a2e34914daa88065 +Author: Adam Jackson +Date: Thu Nov 2 16:10:50 2017 -0400 + + glamor: Drop the non-VAO rendering path + + GLES spells this extension as GL_OES_vertex_array_object, but it is + functionally equivalent to the GL_ARB version. Mesa has supported both + since 9.0, let's go ahead and require it. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit dbda03d5d15bec8fdff64bc8545875c39da81777 +Author: Adam Jackson +Date: Mon Nov 6 16:41:14 2017 -0500 + + glx: Drop references to + + This header is a truly ancient remnant of the SGI SI code, which used + the same struct for visual/fbconfig state on both sides of the wire. + We're not using this struct ourselves so let's stop depending on the + header. + + Signed-off-by: Adam Jackson + +commit eafcd009f1fe3e554219a428237ef1c71d1ba506 +Author: Adam Jackson +Date: Tue Oct 24 14:33:19 2017 -0400 + + xres: Return the atom naming the type, not its internal type number + + Signed-off-by: Adam Jackson + +commit 68556d74b49e99d3490166c446079f7d5de26ca4 +Author: Hector Martin +Date: Wed Nov 15 03:12:31 2017 +0900 + + edid: fix off-by-one error in CEA mode numbering + + The CEA extension short video descriptors contain the VIC, which starts + at 1, not 0. + + Reviewed-by: Adam Jackson + Signed-off-by: Hector Martin + +commit 9bd5a198dc5383d0d2a1e28f7aa4270132eca5db +Author: Adam Jackson +Date: Tue Jul 11 15:37:07 2017 -0400 + + glamor: Remove unused glamor_create_screen_resources + + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 081675f7ffda0cce20b395874d6e5755fb6600a0 +Author: Adam Jackson +Date: Fri Jul 14 14:52:01 2017 -0400 + + glamor: Un-inline glamor_[gs]et_screen_private + + text data bss dec hex filename + 2134764 45210 128704 2308678 233a46 build/hw/kdrive/ephyr/Xephyr.before + 2129972 45210 128704 2303886 23278e build/hw/kdrive/ephyr/Xephyr.after + + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 6dff5e5d49a21bc749e44f0e8cb390690ece750d +Author: Adam Jackson +Date: Mon Jul 10 10:56:58 2017 -0400 + + xwayland: Stop printing the EGL version + + It doesn't matter, none of this matters. + + Acked-by: Olivier Fourdan + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit c57f63829f0077b5a3e5968f8405e087a4490485 +Author: Adam Jackson +Date: Wed Sep 13 15:44:15 2017 -0400 + + dmx: Use noGlxExtension like other DDXes + + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit fd0eafb18426da14601d5c0d0a50092c49a7aff8 +Author: Adam Jackson +Date: Mon Nov 6 16:07:41 2017 -0500 + + glx: Fix typos that break GLX_ARB_context_flush_control + + The trailing \n are just wrong here, __glXEnableExtension wants a string + without them. + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + Reviewed-by: Emil Velikov + +commit 2e7f790b5770589ae2f97ee363ecd33fdb362c24 +Author: Adam Jackson +Date: Mon Nov 6 15:25:34 2017 -0500 + + dix: Remove ffs.c + + Your libc has ffs, I promise. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 4d15a2645f00995618d8687edf1fb0f4b2316ace +Author: Adam Jackson +Date: Mon Nov 6 15:25:33 2017 -0500 + + os: Remove mffs() + + This was always wide enough to work on an fd_mask ("mask" ffs + presumably). We don't operate on fd_masks anymore, so this can go. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 4b0a3cbab131eb453e2b3fc0337121969258a7be +Author: Giuseppe Bilotta +Date: Sat Nov 4 23:06:31 2017 +0100 + + glx: free fbconfigs on destroy + + Reviewed-by: Eric Engestrom + Signed-off-by: Giuseppe Bilotta + +commit bb766ef11227bd8c71ac65845d1930edd0eda40d +Author: Giuseppe Bilotta +Date: Sat Nov 4 23:06:29 2017 +0100 + + randr: ProcRRGetOutputInfo: initialize memory + + Running Xephyr under valgrind reveals that we're sending some + uninitialized memory over the wire (particularly, the leftover padding + that comes from rounding extraLen to the next 32-bit multiple). + + Solve by calloc()ing the memory instead of malloc()ing (the alternative + would be to memset just the padding, but I'm not sure it's more + convenient.) + + Signed-off-by: Giuseppe Bilotta + Reviewed-by: Adam Jackson + +commit 6828645916505a5925db5c2c2e816fee4e1050e5 +Author: Giuseppe Bilotta +Date: Sat Nov 4 23:06:28 2017 +0100 + + Xephyr: free driverPrivates on Fini + + Reviewed-by: Eric Engestrom + +commit b2167015043a458e9cf93b827b43eb5b7c552ce9 +Author: Giuseppe Bilotta +Date: Sat Nov 4 23:06:27 2017 +0100 + + xkb: initialize tsyms + + This fixes some “Conditional jump depends on uninitialized value(s)” + errors spotted by valgrind. + + Reviewed-by: Eric Engestrom + Signed-off-by: Giuseppe Bilotta + +commit 2dafa1bdafe583587431a5f6ebee6ec371c61a8d +Author: Giuseppe Bilotta +Date: Thu Nov 2 21:27:59 2017 +0100 + + dix/window: fix typos + + Reviewed-by: Adam Jackson + +commit f84e59a4f474d22860bac8aec2947798a86db69b Author: Thomas Hellstrom Date: Tue Sep 26 17:28:12 2017 -0700 @@ -584,319 +8668,8 @@ Date: Tue Sep 26 17:28:12 2017 -0700 Tested-By: Nick Sarnie Tested-by: Fredrik Höglund Reviewed-by: Adam Jackson - (cherry picked from commit f84e59a4f474d22860bac8aec2947798a86db69b) -commit 22b0880df680aee95e21bb8f93d6dd7d3434c681 -Author: Thomas Hellstrom -Date: Wed Sep 6 16:27:54 2017 +0200 - - glx: Fix visual fbconfig matching with respect to swap method - - For the built in visuals, we'd typically select the "best" fbconfig - without considering the swap method. If the client then requests a - specific swap method, say GLX_SWAP_COPY_OML, it may well happen that the - first fbconfig matching requirements would have been paired with the 32-bit - compositing visual, and the client would render a potentially transparent - window. - - Fix this so that we try to match fbconfigs with the same swap method to all - built-in visuals. That would guarantee that selecting a specific swap- - method would not influence the chance of getting a compositing visual. - - Signed-off-by: Thomas Hellstrom - Reviewed-by: Adam Jackson - (cherry picked from commit 4486d199bd3bcb5b2b8ad9bc54eb11604d9bd653) - -commit 1726badd61358e644b96f7c561ba239a68d87ba6 -Author: Thomas Hellstrom -Date: Wed Sep 6 16:27:53 2017 +0200 - - glx: Work around a GLX_OML swap method in older dri drivers - - The swapMethod config member would typically contain an arbitrary value - on older dri drivers. Fix this so that if we detect an illegal value, - return GLX_SWAP_UNDEFINED_OML. - - Signed-off-by: Thomas Hellstrom - Reviewed-by: Adam Jackson - (cherry picked from commit 0fc26310d5b09213c65f50bde444a1758172b016) - -commit c64bd21d7a732b6b8de0f8f636e93b1d1bb46135 -Author: Adam Jackson -Date: Thu Jan 19 17:20:49 2017 -0500 - - glx: Move Composite's synthetic visuals to a different select group - - Should you find yourself using a 16bpp display while also using a - compositor, you poor soul, you may find that your GLX applications - behave strangely; in particular, glxgears will be transparent. This is - because it clears to (0,0,0,0) which is transparent if you honor alpha, - and it will choose the synthetic visual because it has the most - available r/g/b bits. - - To avoid this, bump synthetic visuals to a higher (less-preferred) - select group. Unless the client explicitly asks for non-zero alpha bits, - this will prefer any rgb565 visual ahead of the argb8888 visual. - - Reviewed-by: Eric Anholt - Signed-off-by: Adam Jackson - (cherry picked from commit ea483af99a6351323afe00a0b630cd63310efdb1) - -commit 4c64b20a629287472908ae82a05844feed209dd9 -Author: Adam Jackson -Date: Thu Jan 19 17:20:49 2017 -0500 - - glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals - - We already send this for fbconfigs. Mesa happens to implement - glXChooseVisual relative to the fbconfig data, but that might not be - true of NVIDIA's libGL. - - Reviewed-by: Eric Anholt - Signed-off-by: Adam Jackson - (cherry picked from commit 43efaa6e4fd903229dc9c508da4177ad4bbdd4d8) - -commit 0a73e7bf10d5a9373be5f057fd583c8a5e8e511f -Author: Adam Jackson -Date: Thu Jul 27 16:02:28 2017 -0400 - - composite: Make compIsAlternateVisual safe even if Composite is off - - As of ea483af9 we're calling this unconditionally from the GLX code so - the synthetic visual is in a lower select group. If Composite has been - disabled then GetCompScreen() will return NULL, and this would crash. - - Rather than force the caller to check first, just always return FALSE if - Composite is disabled (which is correct, since none of the visuals will - be synthetic in that case). - - Signed-off-by: Adam Jackson - Reviewed-by: Aaron Plattner - (cherry picked from commit f80119120c487581ac050ce741808f7c8f438f35) - -commit 06d1c83d04a53f506ae3c8c3c86df5ae779b9ca9 -Author: Adam Jackson -Date: Thu Jan 19 17:20:49 2017 -0500 - - composite: Export compIsAlternateVisual - - Reviewed-by: Eric Anholt - Signed-off-by: Adam Jackson - (cherry picked from commit ef2345aaa28461a76f77c65240ce5facc180f98e) - -commit c70d8e5585ddcd3c9f5b4adac15eca1f9178d3c5 -Author: Adam Jackson -Date: Thu Jan 19 17:20:49 2017 -0500 - - composite: Remove a misleading comment - - This comment is above compIsAlternateVisual, which used to be the only - thing determining whether implicit redirect was needed. It's not anymore - due to the redirection exception list. That job is now performed by - compImplicitRedirect, whose code is self-explanitory. - - Reviewed-by: Eric Anholt - Signed-off-by: Adam Jackson - (cherry picked from commit bccbaf7c113b1300071601879002682ebbe8b1c1) - -commit dbf97534de61539873717b8e0fcc03f1be6362f8 -Author: Tomasz Śniatowski -Date: Wed Dec 6 12:16:17 2017 +0100 - - os: Fix strtok/free crash in ComputeLocalClient - - Don't reuse cmd for strtok output to ensure the proper pointer is - freed afterwards. - - The code incorrectly assumed the pointer returned by strtok(cmd, ":") - would always point to cmd. However, strtok(str, sep) != str if str - begins with sep. This caused an invalid-free crash when running - a program under X with a name beginning with a colon. - - Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=104123 - Signed-off-by: Tomasz Śniatowski - Reviewed-by: Michel Dänzer - (cherry picked from commit 6883ae43eb72fe4e2651c1dca209563323fad2db) - -commit 072dff82817bc02bb4bdb2dad594e6090586bf58 -Author: Olivier Fourdan -Date: Tue Dec 5 09:59:06 2017 +0100 - - dix: avoid deferencing NULL PtrCtrl - - PtrCtrl really makes sense for relative pointing device only, absolute - devices such as touch devices do not have any PtrCtrl set. - - In some cases, if the client issues a XGetPointerControl() immediatlely - after a ChangeMasterDeviceClasses() copied the touch device to the VCP, - a NULL pointer dereference will occur leading to a crash of Xwayland. - - Check whether the PtrCtrl is not NULL in ProcGetPointerControl() and - return the default control values otherwise, to avoid the NULL pointer - dereference. - - Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519533 - Reviewed-by: Adam Jackson - Signed-off-by: Olivier Fourdan - (cherry picked from commit 9f7a9be13d6449c00c86d3035374f4f543654b3f) - -commit f9a55653721980e3921083015ffb39f777606828 -Author: Olivier Fourdan -Date: Wed Sep 27 18:01:01 2017 +0200 - - xwayland: Fix non-argb cursor conversion - - From the bug: "What happens if bits->width is less than 8? :)" - - Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103012 - Signed-off-by: Olivier Fourdan - Reviewed-by: Emil Velikov - Reviewed-by: Daniel Stone - (cherry picked from commit 97ac59b1ed3624f7c04e54dd3e3dadfa46a8f170) - -commit b832dac751f81d803d33df7c4dd929f77a69c7b0 -Author: Adam Jackson -Date: Tue Nov 14 15:15:01 2017 -0500 - - glx: Fix glXQueryContext for GLX_FBCONFIG_ID and GLX_RENDER_TYPE (v2) - - Just never filled in, oops. Seems to have gone unnoticed because - normally glXQueryContext simply returns the values filled in by the - client library when the context was created. The only path by which you - normally get to a GLXQueryContext request is glXImportContext, and then - only if the context is already indirect. - - However, that's a statement about Mesa's libGL (and anything else that - inherited that bit of the SGI SI more or less intact). Nothing prevents - a mischeivous client from issuing that request of a direct context, and - if they did we'd be in trouble because we never bothered to preserve the - associated fbconfig in the context state, so we'd crash looking up - GLX_VISUAL_ID_EXT. So let's fix that too. - - v2: Fixed missing preservation of the config in DRI2 (Eric Anholt) - - Signed-off-by: Adam Jackson - Reviewed-by: Eric Anholt - (cherry picked from commit 5d667df6ea1634191a26f9a7c26bc883701d62b0) - -commit ee64427c6c5b22514b4d427fb9cee11b8239baea -Author: Daniel Martin -Date: Mon Nov 20 10:47:38 2017 +0100 - - os/xdmcp: Honour -once when session is dead - - Terminate a dead session when -once was passed. Don't restart it. - - Signed-off-by: Daniel Martin - Reviewed-by: Walter Harms - (cherry picked from commit 918afeecbc63d70413e222efdb2ac4cfb16eae9e) - -commit 5c00e693631475679c1c2504e03177652ec7de28 -Author: Michel Dänzer -Date: Mon Oct 2 11:33:43 2017 +0200 - - present: Only send PresentCompleteNotify events to the presenting client - - We were sending the events to all clients listening for them on the - window. But clients can get confused by events from another client, and - I can't imagine any case where receiving events from other clients would - be required. - - v2: - * Also restrict events sent to additional windows to the presenting - client - * Don't shorten line lengths - - Reviewed-by: Keith Packard - (cherry picked from commit 559954aaa8d811a22cf918cc16a7d618e12201a0) - -commit a4bd27bdc8e3569ffa67c1105a2e5cdf0f3de683 -Author: Giuseppe Bilotta -Date: Thu Nov 9 10:21:19 2017 +0100 - - randr: rrGetScreenResources: initialize memory - - Similarly to bb766ef11227bd8c71ac65845d1930edd0eda40d, ensure that the - extra padding is set to 0. - - Reviewed-by: Adam Jackson - Signed-off-by: Giuseppe Bilotta - (cherry picked from commit fb5ee77b91a93e27801006be8ee34d27984e7fa6) - -commit ece2e82ebf597ffda44b4753aa5cb7f5e1d97480 -Author: Adam Jackson -Date: Tue Nov 14 15:59:35 2017 -0500 - - glx: Only flush indirect contexts in MakeCurrent (v2) - - If the context is direct none of the GL commands were issued by this - process, the server couldn't flush them even if it wanted to. - - v2: Fix embarassingly obvious boolean inversion (Michel Dänzer) - - Signed-off-by: Adam Jackson - Reviewed-by: Michel Dänzer - (cherry picked from commit 307c124d6bcfe26057767b2c0990dc9ac66b9c93) - -commit d1a2a2757977bf2f241fd254be821bf96910b587 -Author: Hector Martin -Date: Wed Nov 15 03:12:31 2017 +0900 - - edid: fix off-by-one error in CEA mode numbering - - The CEA extension short video descriptors contain the VIC, which starts - at 1, not 0. - - Reviewed-by: Adam Jackson - Signed-off-by: Hector Martin - (cherry picked from commit 68556d74b49e99d3490166c446079f7d5de26ca4) - -commit b3fa60edc412e4c52bc6fa0346217eed0ebc98e3 -Author: Adam Jackson -Date: Mon Nov 6 16:07:41 2017 -0500 - - glx: Fix typos that break GLX_ARB_context_flush_control - - The trailing \n are just wrong here, __glXEnableExtension wants a string - without them. - - Signed-off-by: Adam Jackson - Reviewed-by: Michel Dänzer - Reviewed-by: Emil Velikov - (cherry picked from commit fd0eafb18426da14601d5c0d0a50092c49a7aff8) - -commit c010bcb8c36b2ca0bba1b80c9bde63ff89e42ed4 -Author: Giuseppe Bilotta -Date: Sat Nov 4 23:06:29 2017 +0100 - - randr: ProcRRGetOutputInfo: initialize memory - - Running Xephyr under valgrind reveals that we're sending some - uninitialized memory over the wire (particularly, the leftover padding - that comes from rounding extraLen to the next 32-bit multiple). - - Solve by calloc()ing the memory instead of malloc()ing (the alternative - would be to memset just the padding, but I'm not sure it's more - convenient.) - - Signed-off-by: Giuseppe Bilotta - Reviewed-by: Adam Jackson - (cherry picked from commit bb766ef11227bd8c71ac65845d1930edd0eda40d) - -commit c328570644e3b4dfaf840d057883a4db31976da7 -Author: Giuseppe Bilotta -Date: Sat Nov 4 23:06:27 2017 +0100 - - xkb: initialize tsyms - - This fixes some “Conditional jump depends on uninitialized value(s)” - errors spotted by valgrind. - - Reviewed-by: Eric Engestrom - Signed-off-by: Giuseppe Bilotta - (cherry picked from commit b2167015043a458e9cf93b827b43eb5b7c552ce9) - -commit c39de5f7358634eb2fea66041e3a3465e8cf6e13 +commit 30f4d440ebc3517fdcc1d3c6a422a8fbf3af1f23 Author: Eric Anholt Date: Tue Oct 31 12:22:31 2017 -0700 @@ -907,9 +8680,33 @@ Date: Tue Oct 31 12:22:31 2017 -0700 where I went wrong. Reviewed-by: Peter Hutterer - (cherry picked from commit 30f4d440ebc3517fdcc1d3c6a422a8fbf3af1f23) -commit 5a5b6d6cca469521daa6ac9087f3589b7489ab55 +commit 14af8bee242fe40af0e91c61465d6720aaa60e97 +Author: Eric Anholt +Date: Mon Oct 9 17:14:32 2017 -0700 + + test: Add a test for the overflow bug in bigreqs. + + The failing struct comes from the python test written by Michal Srb + . + + v2: Use a drawable (root window) and gc, so that PolyLines hopefully + actually tries processing things. However, the request seems to + process successfully so the poll() just stalls out. However, this + does let us distinguish between detecting the bigrequests error + and not, at least. + v3: Clean up the description of what we expect the poll() call to do. + v4: Use XI2 instead of PolyLine to trigger a predictable error. We know the + server replies with BadValue for a zero num_masks argument. So if we send + a bigreq with a num_masks 0 and a length 0, we can just check whether we + get killed (good) or a BadValue (bad). It doesn't test for specific memory + overflows or crashes, but based on the assumption that we shouldn't look + at *any* BigReq of size 0, this seems to be sufficient. + + Signed-off-by: Eric Anholt + Signed-off-by: Peter Hutterer + +commit 5aad81445c8c3d6b7b30d503cfe26027fa482870 Author: Peter Hutterer Date: Tue Sep 26 15:21:59 2017 +1000 @@ -921,9 +8718,22 @@ Date: Tue Sep 26 15:21:59 2017 +1000 anything else would be crazy anyway. Signed-off-by: Peter Hutterer - (cherry picked from commit 5aad81445c8c3d6b7b30d503cfe26027fa482870) -commit 8817747c8587d75c14e00069e8f26e3edb671013 +commit d5379b350fb63e42e604361c21ad9832b4c791b9 +Author: Daniel Martin +Date: Fri Oct 27 16:11:56 2017 +0200 + + Use ARRAY_SIZE all over the tree + + Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with + the ARRAY_SIZE macro from dix.h when possible. A semantic patch for + coccinelle has been used first. Additionally, a few macros have been + inlined as they had only one or two users. + + Signed-off-by: Daniel Martin + Reviewed-by: Adam Jackson + +commit 15a32ee5d1fffa171bb05af9a0e5b472e4af1488 Author: Daniel Martin Date: Fri Oct 27 16:11:55 2017 +0200 @@ -934,9 +8744,8 @@ Date: Fri Oct 27 16:11:55 2017 +0200 Signed-off-by: Daniel Martin Reviewed-by: Eric Engestrom - (cherry picked from commit 15a32ee5d1fffa171bb05af9a0e5b472e4af1488) -commit e663998fa8bb77bb753abed1e0c12922d4ce1669 +commit 0bcc65f2bf479c6a74ac70bb5b5181d6834dded6 Author: Daniel Martin Date: Fri Oct 27 16:11:54 2017 +0200 @@ -949,9 +8758,8 @@ Date: Fri Oct 27 16:11:54 2017 +0200 Signed-off-by: Daniel Martin Reviewed-by: Eric Engestrom - (cherry picked from commit 0bcc65f2bf479c6a74ac70bb5b5181d6834dded6) -commit e8530b872aa4b1648bba7fb3dddaf9abf70100ed +commit 04a305121fbc08ecc2ef345ee7155d6087a43fd1 Author: Daniel Martin Date: Fri Oct 27 16:11:53 2017 +0200 @@ -963,9 +8771,63 @@ Date: Fri Oct 27 16:11:53 2017 +0200 Signed-off-by: Daniel Martin Reviewed-by: Eric Engestrom - (cherry picked from commit 04a305121fbc08ecc2ef345ee7155d6087a43fd1) -commit 4ef1aef0fbbf47c937cf421f0180cc18fc23a03e +commit 2230e6c8af92b041821eee0ea6210eda82c74106 +Author: Adam Jackson +Date: Tue Oct 24 14:28:34 2017 -0400 + + glamor: Unconditionalize GLAMOR_TEXTURED_LARGE_PIXMAP + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 1edac5c1ceb8b21af45b20397ff64177ad22466c +Author: Adam Jackson +Date: Tue Oct 24 14:28:33 2017 -0400 + + glamor: Unconditionalize GLAMOR_PIXMAP_DYNAMIC_UPLOAD + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 13409b91b1936330dbf19bacefa4b48d0b6843b8 +Author: Adam Jackson +Date: Tue Oct 24 14:28:32 2017 -0400 + + glamor: Unconditionalize GLAMOR_GRADIENT_SHADER + + Effectively always true anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 266d9868ca1cf77b7d315d607b515f081a9f45c3 +Author: Alex Goins +Date: Thu Oct 19 20:02:30 2017 -0700 + + xf86-video-modesetting: Fix ms_queue_vblank(flags = MS_QUEUE_RELATIVE) + + Change 677c32bc refactored all usages of drmWaitVBlank() into a helper function, + ms_queue_vblank(). + + ms_queue_vblank() takes in an MS_QUEUE_RELATIVE flag to indicate that the + sequence number is relative rather than absolute, but still treats the actual + sequence number as absolute, passing it through ms_crtc_msc_to_kernel_msc() + unconditionally before calling drmWaitVBlank(). + + ms_crtc_msc_to_kernel_msc() works by subtracting a vblank offset from the + provided sequence number, which only makes sense for absolute sequence numbers. + In the case of PRIME Sync, drmmode_SharedPixmapPrsentOnVBlank() passes in 1, + which results in a large negative vblank offset. After subtracting, we're left + with a relative sequence number of 100,000+, i.e. wait for 100,000+ vblanks... + + In the relative case we want to pass in the sequence number unmodified. Simply + add a check to do this. + + Signed-off-by: Alex Goins + Reviewed-by: Keith Packard + +commit 68d95e759f8b6ebca6bd52e69e6bc34cc174f8ca Author: Alex Goins Date: Tue Oct 24 18:39:13 2017 -0700 @@ -986,9 +8848,229 @@ Date: Tue Oct 24 18:39:13 2017 -0700 Signed-off-by: Alex Goins Reviewed-by: Dave Airlie - (cherry picked from commit 68d95e759f8b6ebca6bd52e69e6bc34cc174f8ca) -commit cd5076a50c0274512bd2ce2c8ecf56c3517d0266 +commit 04163fe8c66ae6683a1384fd1bd91ea85f9892ee +Author: Adam Jackson +Date: Tue Oct 24 13:03:09 2017 -0400 + + meson: Use [ true, false, auto ] for tristate values + + For symmetry with the boolean options. I really do not want to care + whether an option is a tristate if I'm trying to set it explicitly. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit c2c6e9e68a8815420233c996acdd29ba572b1f0e +Author: Adam Jackson +Date: Tue Oct 24 14:38:13 2017 -0400 + + dix: Don't track the XKB client versions in the ClientRec + + XKB stores some stuff in the ClientRec that, style-wise, should probably + be in a client private. vMinor tracks the client's idea of the XKB + minor version, but is never read, we can just nuke it. vMajor is only + used for a bug-compat workaround for X11R6.0-vintage clients. We're + only using though (1<<4) for xkbClientFlags in the protocol, so we can + pack that field down to a u8 and store the bug-compat flag there. + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + +commit bc5fb8c0928498c32dc33680d40d50e6db5879b6 +Author: Adam Jackson +Date: Tue Oct 24 14:38:12 2017 -0400 + + dix: Don't vary the ClientRec ABI at build time + + Just no. + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + +commit 0c3ad9d1e06294b4f66717798afa4f5dfa505469 +Author: Adam Jackson +Date: Mon Oct 23 15:34:26 2017 -0400 + + travis: Bump linux Dockerfile to v7 for new meson + + Signed-off-by: Adam Jackson + +commit 4d53e30651c0fe5f7be38ae8529fa49846d39549 +Author: Lyude Paul +Date: Mon Oct 23 16:21:19 2017 -0400 + + meson: Don't use '' in link_with, ever + + String arguments as elements in the array passed to the link_with + argument in meson's executable() functions are not valid and will end up + causing the build file generation to file. This actually ended up + exposing a bug in meson that caused it not to report where in the + meson.build file it was failing: + + https://github.com/mesonbuild/meson/pull/2527 + + The proper way to have a variable that can contain either an empty link + target or an actual link target is: + + some_target = [] + if some_cond + some_target = static_library(...) + endif + + This way if some_cond is False, some_target gets set to [], gets passed + to executable() in the link_with array, and then gets removed by array + flattening. + + This also unbreaks Xwayland builds with -Dglx=false, the thing that + originally made me notice this. + + Signed-off-by: Lyude Paul + Reviewed-by: Jon Turney + +commit 5893e72a20ffa5cfcd6d0c7c5c934b92546d76c3 +Author: Jon Turney +Date: Tue Oct 24 12:07:08 2017 +0100 + + travis: Fix OSX build + + Turn off homebrew autoupdating before installing ccache, to avoid: + + /usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `
': Homebrew must + be run under Ruby 2.3! You're running 2.0.0. (RuntimeError) + + Signed-off-by: Jon Turney + Reviewed-by: Adam Jackson + +commit f44935cdb7321af242ce9f242975f096807b97f7 +Author: Daniel Martin +Date: Mon Oct 23 10:31:21 2017 +0200 + + modesetting: Use helper to fetch drmModeProperty(Blob)s + + Replace the various loops to lookup drmModeProperty(Blob)s by + introducing helper functions. + + Signed-off-by: Daniel Martin + +commit 6abdb54a11dac4e8854ff94ecdcb90a14321ab31 +Author: Daniel Martin +Date: Mon Oct 23 10:31:20 2017 +0200 + + modesetting: Fix leak of tile_blob in drmmode_output_destroy + + And drmModeFreePropertyBlob() can handle NULL pointers, no need to check + edid_blob. + + Signed-off-by: Daniel Martin + +commit 8d7f7e24261e68459e6f0a865e243473f65fe7ad +Author: Daniel Martin +Date: Fri Oct 20 10:05:35 2017 +0200 + + modesetting: Check crtc before searching link-status property + + No need to lookup the link-status property if we don't have a crtc. + + Signed-off-by: Daniel Martin + Reviewed-by: Adam Jackson + +commit 8c455db0ebb6e5313ca81428bb6dd75ef12aaa15 +Author: Daniel Martin +Date: Fri Oct 20 10:05:34 2017 +0200 + + modesetting: Remove #ifdefs XF86_PDEV_SERVER_FD + + XF86_PDEV_SERVER_FD is defined since: + + commit 5fb641a29bfb4a33da964e1e9af523f3472015c6 + Author: Hans de Goede + Date: Mon Jan 13 12:03:46 2014 +0100 + + hotplug: Extend OdevAttributes for server-managed fd support + + ifdef'ing for it is a leftover from the external xf86-video-modesetting. + + Signed-off-by: Daniel Martin + Reviewed-by: Adam Jackson + +commit 66d8cbf8ce9285a8771118e46daa44faa73ad847 +Author: Daniel Martin +Date: Fri Oct 20 10:05:33 2017 +0200 + + modesetting: Fix warning of unused variable if not GLAMOR_HAS_GBM + + ../hw/xfree86/drivers/modesetting/driver.c: In function ‘redisplay_dirty’: + ../hw/xfree86/drivers/modesetting/driver.c:586:20: warning: unused variable ‘ms’ [-Wunused-variable] + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); + + Move the variable ms into #ifdef GLAMOR_HAS_GBM, where it is used. + + Signed-off-by: Daniel Martin + Reviewed-by: Adam Jackson + +commit 6d7e1d1de06336c9b49a253810afda8ac4e9f7b2 +Author: Lyude Paul +Date: Fri Oct 13 15:44:32 2017 -0400 + + meson: Don't forget to define DEBUG! + + Changes since v2: + - Don't enable by default for debugoptimized builds + + Signed-off-by: Lyude Paul + Reviewed-by: Adam Jackson + +commit 0debe011901b87f686e2a76ce5edc150b04bf9d1 +Author: Lyude Paul +Date: Fri Oct 13 15:44:31 2017 -0400 + + meson: Silence -Wformat-nonliteral for x86emu + + Signed-off-by: Lyude Paul + Reviewed-by: Adam Jackson + +commit cbca18c5516084ee540255df52e116209f1c1cbe +Author: Lyude Paul +Date: Fri Oct 13 15:44:30 2017 -0400 + + x86emu: Fix type conversion warnings on x86_64 with DEBUG + + Warnings come from the fact that PRIx32 is not used for printing 32 bit + values instead of "%lx", and "%lx" evaluates to a 64 bit long on 64 bit + systems while PRIx32 always evaluates to the right type for the + respective arch. + + Signed-off-by: Lyude Paul + Reviewed-by: Adam Jackson + +commit 01470ce0a9628abc8af4fe7b960f0d1eced8cd46 +Author: Lyude Paul +Date: Fri Oct 13 15:44:29 2017 -0400 + + fbdevhw: Fix inconsistent #if DEBUG usage + + fbdevhw is the only file in X's source that actually uses #if DEBUG to + check for debugging instead of #ifdef DEBUG. This is contrary to + everything else that checks the DEBUG macro in the source, so let's make + it consistent and in turn, make our meson files a little simpler. + + Signed-off-by: Lyude Paul + Reviewed-by: Adam Jackson + +commit c66d65a645332bbf055a1c49f092636139eb9285 +Author: Eric Anholt +Date: Wed Jul 26 16:54:40 2017 -0700 + + glamor: Use GL_MESA_tile_raster_order for overlapping blits. + + Improves Raspberry Pi 3 x11perf -copywinwin500 from ~480/sec to + ~700/sec. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 885636b7d42b3c7b151fc386d358184db004ce45 Author: Nikolay Martynov Date: Wed Sep 13 23:23:13 2017 -0400 @@ -1008,30 +9090,70 @@ Date: Wed Sep 13 23:23:13 2017 -0400 Signed-off-by: Nikolay Martynov Reviewed-by: Adam Jackson - (cherry picked from commit 885636b7d42b3c7b151fc386d358184db004ce45) -commit a6776111b24f7211c08c7497466f5d9351d0756c -Author: Adam Jackson -Date: Thu Jun 8 16:23:12 2017 -0400 +commit a10b4fcdc016d7ac56e5bb35f7f844af41016efe +Author: Jon Turney +Date: Tue Oct 10 14:28:33 2017 +0100 - xfixes: Remove the CursorCurrent array + meson: Fix linkage of loadable modules for PE/COFF - We're not wrapping all the ways a cursor can be destroyed, so this array - ends up with stale data. Rather than try harder to wrap more code paths, - just look up the cursor when we need it. + For the loadable modules it makes sense to build for PE/COFF targets, link + those loadable modules with the import library for the Xorg executable, so + that symbols provided by the executable can be satisfied at link time (as + required by PE/COFF). - Signed-off-by: Adam Jackson - (cherry picked from commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf) - -commit b96e982e3a43513549636850186ff80a82190f64 -Author: Adam Jackson -Date: Thu Oct 12 12:32:31 2017 -0400 - - xserver 1.19.5 + Since this uses the syntax of using the returned build target object from an + executable() with an implib: kwarg to link_with:, introduced in meson 0.42 + and a syntax error with older meson, also update the minimum meson version + which we require in project() to that. - Signed-off-by: Adam Jackson + Signed-off-by: Jon Turney -commit 95f605b42d8bbb6bea2834a1abfc205981c5b803 +commit d43b1ca852562882fc6930afc36a982801e3be87 +Author: Jon Turney +Date: Tue Oct 10 14:28:32 2017 +0100 + + meson: Fix underlinkage of shadow loadable module + + Future work: probably some other modules are underlinked? + + Signed-off-by: Jon Turney + +commit 10cba7d54668698741510374ee63dec7a3cc3647 +Author: Lyude Paul +Date: Wed Oct 11 18:03:45 2017 -0400 + + meson: Add xkb_bin_dir option + + Now that we can actually configure all of the directories xkb uses for + finding things, we can (finally, but only with meson) finally make it so + that with the correct meson configuration the Xserver will "just work" + without any additional changes to the installation prefix after + building. + + For the people like me who have since scripted this part out of their + build process and forgotten about it, building and installing the X + server into a non-standard prefix has always required the following (or + something else that makes sure that X has a valid xkbcomp configuration) + commands be run right after doing the installation: + + # start in root of prefix you installed X to + mkdir -pv share/X11/xkb/rules + ln -s /usr/share/X11/xkb/rules/evdev share/X11/xkb/rules/ + rm -f bin/xkbcomp + ln -s /usr/bin/xkbcomp bin/ + + The one last piece of getting rid of this post-install junk is making + sure that we can control the directory that X uses for finding the + xkbcomp binary from meson so we can point it at the system provided + xkbcomp (/usr/bin/xkbcomp or similar). So, this patch adds a + configuration option for controlling this called xkb_bin_dir. + + Signed-off-by: Lyude Paul + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + +commit b747da5e25be944337a9cd1415506fc06b70aa81 Author: Nathan Kidd Date: Fri Jan 9 10:15:46 2015 -0500 @@ -1040,9 +9162,8 @@ Date: Fri Jan 9 10:15:46 2015 -0500 Reviewed-by: Julien Cristau Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit b747da5e25be944337a9cd1415506fc06b70aa81) -commit cc41e5b581d287c56f8d7113a97a4882dcfdd696 +commit 4ca68b878e851e2136c234f40a25008297d8d831 Author: Nathan Kidd Date: Fri Jan 9 10:09:14 2015 -0500 @@ -1055,9 +9176,8 @@ Date: Fri Jan 9 10:09:14 2015 -0500 Reviewed-by: Julien Cristau Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit 4ca68b878e851e2136c234f40a25008297d8d831) -commit 6c15122163a2d2615db7e998e8d436815a08dec6 +commit 859b08d523307eebde7724fd1a0789c44813e821 Author: Nathan Kidd Date: Wed Dec 24 16:22:18 2014 -0500 @@ -1068,9 +9188,8 @@ Date: Wed Dec 24 16:22:18 2014 -0500 Reviewed-by: Julien Cristau Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit 859b08d523307eebde7724fd1a0789c44813e821) -commit c77cd08efcf386bcc5d8dfbd0427134b2b2d0888 +commit d088e3c1286b548a58e62afdc70bb40981cdb9e8 Author: Nathan Kidd Date: Fri Jan 9 10:04:41 2015 -0500 @@ -1088,9 +9207,8 @@ Date: Fri Jan 9 10:04:41 2015 -0500 Signed-off-by: Jeremy Huddleston Sequoia Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit d088e3c1286b548a58e62afdc70bb40981cdb9e8) -commit d264da92f7f8129b8aad4f0114a6467fc38fc896 +commit 1b1d4c04695dced2463404174b50b3581dbd857b Author: Nathan Kidd Date: Sun Dec 21 01:10:03 2014 -0500 @@ -1105,9 +9223,8 @@ Date: Sun Dec 21 01:10:03 2014 -0500 Reviewed-by: Julien Cristau Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit 1b1d4c04695dced2463404174b50b3581dbd857b) -commit 61502107a30d64f991784648c3228ebc6694a032 +commit 55caa8b08c84af2b50fbc936cf334a5a93dd7db5 Author: Nathan Kidd Date: Fri Jan 9 11:43:05 2015 -0500 @@ -1123,9 +9240,8 @@ Date: Fri Jan 9 11:43:05 2015 -0500 Signed-off-by: Jeremy Huddleston Sequoia Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit 55caa8b08c84af2b50fbc936cf334a5a93dd7db5) -commit c206f36a4b6ecf2555ab2291c349ab7d7d0b02f5 +commit cad5a1050b7184d828aef9c1dd151c3ab649d37e Author: Nathan Kidd Date: Fri Jan 9 09:57:23 2015 -0500 @@ -1143,9 +9259,8 @@ Date: Fri Jan 9 09:57:23 2015 -0500 Reviewed-by: Julien Cristau Signed-off-by: Nathan Kidd Signed-off-by: Julien Cristau - (cherry picked from commit cad5a1050b7184d828aef9c1dd151c3ab649d37e) -commit e751722a7b0c5b595794e60b054ade0b3f6cdb4d +commit 9c23685009aa96f4b861dcc5d2e01dbee00c4dd9 Author: Michal Srb Date: Fri Jul 7 17:04:03 2017 +0200 @@ -1159,29 +9274,8 @@ Date: Fri Jul 7 17:04:03 2017 +0200 Signed-off-by: Eric Anholt Reviewed-by: Peter Hutterer - (cherry picked from commit 9c23685009aa96f4b861dcc5d2e01dbee00c4dd9) -commit 784d205ff6527c761ffbb1c43c9ad3669dd8d26e -Author: Adam Jackson -Date: Thu Oct 12 12:17:53 2017 -0400 - - Revert "xf86-video-modesetting: Add ms_queue_vblank helper [v3]" - - Apparently introduces a regression: - - https://bugs.freedesktop.org/103243 - - This reverts commit 388dc1aeac9acf2d51ad5103570beffd81d78b96. - -commit ec37e559614cf4eaba67d3ca0693f09fd95a5d57 -Author: Adam Jackson -Date: Wed Oct 4 15:29:18 2017 -0400 - - xserver 1.19.4 - - Signed-off-by: Adam Jackson - -commit 12fe3d3e9f494ef84832efe94ba00db92be499b1 +commit c2f2b25ab55c67f9f3ad07c02fa746eae7c61196 Author: Louis-Francis Ratté-Boulianne Date: Wed Sep 27 01:19:58 2017 -0400 @@ -1193,9 +9287,8 @@ Date: Wed Sep 27 01:19:58 2017 -0400 Signed-off-by: Louis-Francis Ratté-Boulianne Reviewed-by: Michel Dänzer - (cherry picked from commit c2f2b25ab55c67f9f3ad07c02fa746eae7c61196) -commit 388dc1aeac9acf2d51ad5103570beffd81d78b96 +commit 677c32bcda98a96585bb1f66b57e0755a157b772 Author: Keith Packard Date: Fri Sep 29 08:48:33 2017 -0700 @@ -1210,9 +9303,8 @@ Date: Fri Sep 29 08:48:33 2017 -0700 Signed-off-by: Keith Packard Reviewed-by: Adam Jackson - (cherry picked from commit 677c32bcda98a96585bb1f66b57e0755a157b772) -commit 8bd33a2db7337b2801fc630a57e36b6aeea219d9 +commit 94f11ca5cf011ef123bd222cabeaef6f424d76ac Author: Keith Packard Date: Thu Jul 27 10:08:32 2017 -0700 @@ -1226,9 +9318,8 @@ Date: Thu Jul 27 10:08:32 2017 -0700 Reviewed-by: Michal Srb Signed-off-by: Keith Packard Signed-off-by: Julien Cristau - (cherry picked from commit 94f11ca5cf011ef123bd222cabeaef6f424d76ac) -commit 3094c4c6d879215923f2183ecd048b4f5429b182 +commit eaf1f72ed8994b708d94ec2de7b1a99f5c4a39b8 Author: Michal Srb Date: Thu Jul 27 11:54:26 2017 +0200 @@ -1241,9 +9332,8 @@ Date: Thu Jul 27 11:54:26 2017 +0200 Reviewed-by: Keith Packard Signed-off-by: Julien Cristau - (cherry picked from commit eaf1f72ed8994b708d94ec2de7b1a99f5c4a39b8) -commit a510fb811100bc27f0bfafe5d073998551161819 +commit b95f25af141d33a65f6f821ea9c003f66a01e1f1 Author: Michal Srb Date: Fri Jul 28 16:27:10 2017 +0200 @@ -1254,51 +9344,355 @@ Date: Fri Jul 28 16:27:10 2017 +0200 existing client. Signed-off-by: Julien Cristau - (cherry picked from commit b95f25af141d33a65f6f821ea9c003f66a01e1f1) -commit 3cea13cc40e2421ebefcf2ee0eb949a7bc4e63fd +commit db465bae533f85e7f900deb96efecc831c9d550b Author: Adam Jackson -Date: Fri Jun 16 15:44:47 2017 -0400 +Date: Wed Sep 27 14:31:39 2017 -0400 - dmx: Remove some not-very-interesting debug prints + meson: Port default warning flags from xorg-macros - gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it - might, and we also don't care. Just delete all this. + Well, almost all of them. No -Wdeclaration-after-statement because + that's legal in C99, and in the limited ways we use it, more readable. Signed-off-by: Adam Jackson - Acked-by: Keith Packard - (cherry picked from commit d6db66811643d3762716f6b144a7358572216a4f) + Reviewed-by: Daniel Stone -commit 320e48c9217a8bdcd07dc8ce4aebec043e4afa3c +commit 40c90ead044aa3fab79280d7a5ca5ad8e390029e Author: Adam Jackson -Date: Fri Jun 16 15:44:46 2017 -0400 +Date: Wed Sep 27 14:31:38 2017 -0400 - dmx: Silence an unused-result warning + meson: Check for HAVE_TYPEOF - Modern glibc is very insistent that you care about whether write() - succeeds: - - ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: - ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] - write(priv->fd, &event, sizeof(event)); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Without this, exa's gc swap macros trigger gcc's -Wdiscarded-qualifiers. Signed-off-by: Adam Jackson - Reviewed-by: Keith Packard - (cherry picked from commit 17ad6e5d5616039021455bc821d6ee2497f7ebde) + Reviewed-by: Daniel Stone -commit c5d409a292008c4219c77a1bdb7621eb0ac42991 -Author: Jon TURNEY -Date: Mon Jun 26 14:54:04 2017 +0100 +commit 712b02ec72b98291b78e17dcb1073a13c4a1086e +Author: Adam Jackson +Date: Wed Sep 27 14:31:37 2017 -0400 - Move statically linked xorgxkb files from dixmods to a separate directory + meson: Default to gnu99 - [ajax: Fixed test/Makefile.am as well] + We don't really require all of C99, but enough that it's not worth + bothering with the distinction, especially if your toolchain is new + enough that meson is a thing for you. We could do strict C99 if we + really insisted on spelling it __typeof__, but who wants that? Nobody, + that's who. + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 041f25afa81dfc7e7ef350d5b955d2d5912846c9 +Author: Adam Jackson +Date: Wed Sep 27 14:31:36 2017 -0400 + + test: const correctness fix + + ../test/sync/sync.c: In function ‘main’: + ../test/sync/sync.c:288:40: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] + xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id); + ^~~~~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 1d1ff1142a5a3904175f45d2f52bbdffb0249e57 +Author: Adam Jackson +Date: Wed Sep 27 14:31:35 2017 -0400 + + dmx: More const correctness + + Fixes several dozen cases like: + + ../hw/dmx/examples/ev.c: In function ‘main’: + ../hw/dmx/examples/ev.c:147:29: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] + tmp = "X"; + ^ + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit eb25facb37ef74eab83060b75f8205ce1538817f +Author: Adam Jackson +Date: Wed Sep 27 14:31:34 2017 -0400 + + dmx: Fix a silly redeclaration bug + + ../hw/dmx/dmx.c:66:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’ [-Wredundant-decls] + extern int PanoramiXNumScreens; + ^~~~~~~~~~~~~~~~~~~ + In file included from ../hw/dmx/dmx.c:65:0: + ../Xext/panoramiXsrv.h:11:22: note: previous declaration of ‘PanoramiXNumScreens’ was here + extern _X_EXPORT int PanoramiXNumScreens; + ^~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 8060196a3e80a3c0ad2c0abbe459416821cd366c +Author: Louis-Francis Ratté-Boulianne +Date: Wed Sep 27 01:24:28 2017 -0400 + + sync: Fix delta value check + + While transitionning from CARD64 to int64, the GreaterThan call + as mistakenly been transformed into ">=". That was at least + causing problems with Mutter. + + Signed-off-by: Louis-Francis Ratté-Boulianne Reviewed-by: Adam Jackson - (cherry picked from commit fbdd73fac68383c93f6f5c6a7615860503039999) -commit 359186b13bc6ea6d8c3340c392c0aba5b9376a5d +commit 37f4e7651a2fd51efa613a08a1e705553be33e76 +Author: Keith Packard +Date: Mon Sep 25 16:18:22 2017 -0700 + + modesetting: Skip no-longer-present connectors when resetting BAD links + + Outputs may have NULL mode_output (connector) pointers if the + connector disappears while the server is running. Skip these when + resetting outputs with BAD link status. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 147b4602f9c47e8977d13b1cbb6566f86dba8647 +Author: Adam Jackson +Date: Mon Sep 25 15:06:44 2017 -0400 + + xfree86: Hush some warnings when Xv is disabled + + Spotted by Appveyor: + + xf86Crtc.c:3281:1: warning: ‘xf86_crtc_box_area’ defined but not used [-Wunused-function] + xf86_crtc_box_area(BoxPtr box) + ^~~~~~~~~~~~~~~~~~ + xf86Crtc.c:3268:1: warning: ‘x86_crtc_box’ defined but not used [-Wunused-function] + x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) + ^~~~~~~~~~~~ + xf86Crtc.c:3256:1: warning: ‘x86_crtc_box_intersect’ defined but not used [-Wunused-function] + x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) + ^~~~~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 0888b22fea71118b1a9a238134b3b8d1dc659734 +Author: Adam Jackson +Date: Mon Sep 25 15:01:32 2017 -0400 + + test: Fix a thinko in simple-xinit + + Spotted by clang courtesy of the shiny new OSX Travis target: + + simple-xinit.c:90:65: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [10]' [-Wsizeof-array-decay] + ret = read(displayfd, display_string, sizeof(display_string - 1)); + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 84e3b96b531363e47f6789aacfcae4aa60135e2e +Author: Nick Sarnie +Date: Sat Sep 23 17:35:48 2017 -0400 + + suid: Include sysmacros.h to fix build after glibc-2.25 + + [Added HAVE_SYS_SYSMACROS_H guard - ajax] + + Signed-off-by: Nick Sarnie + Reviewed-by: Adam Jackson + +commit 0b00440678fa22c1c1ca4a292b67db3ab8676969 +Author: Jon Turney +Date: Fri Sep 22 15:25:05 2017 +0100 + + travis: Also build on OSX + + Signed-off-by: Jon Turney + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit c30eca688781deb06b25a6a08297cb855aeb6ed2 +Author: Jon Turney +Date: Fri Sep 22 13:54:01 2017 +0100 + + meson: Make it possible to build for 32-bit targets + + Setting glx_align64 to '' gives a null string in the arguments list passed + to the compiler. This is taken as an input filename, leading to: + + "cc: error: : No such file or directory" + + Instead, assign an empty list to glx_align64, which gets flattened to + nothing in the arguments list. + + Signed-off-by: Jon Turney + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit 2c2e1b6f57753a82c7ca144a57950f9e2d76199e +Author: Adam Jackson +Date: Wed Aug 30 14:58:24 2017 -0400 + + glx: Be a bit more paranoid in glx client cleanup + + This would probably crash (via double-free) if you had multiple GPUs and + an indirect context. + + Signed-off-by: Adam Jackson + +commit d770f9293296d2d3c4e49e94130ff68c0890f625 +Author: Daniel Stone +Date: Wed Sep 20 07:22:13 2017 -0700 + + meson: Use dependency version_compare() + + We can check the version on an existing dependency, rather than spinning + up pkg-config again just to check the right version. + + Signed-off-by: Daniel Stone + +commit 86a89dd6020f59964c0e924acbfae9d5a51e3148 +Author: Daniel Stone +Date: Wed Sep 20 07:22:12 2017 -0700 + + Build: Use dri3proto/libdrm CFLAGS + + Make sure we get the CFLAGS required for building DRI3 into the + command line. + + Signed-off-by: Daniel Stone + +commit 294670682120c65001b36369d6395003704f4ac1 +Author: Eric Anholt +Date: Mon Sep 18 17:34:33 2017 -0700 + + sync: Clean up a bit of header formatting. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e0f872207aa203adb85e825c311ed50fe3a3af60 +Author: Eric Anholt +Date: Mon Sep 18 17:34:32 2017 -0700 + + sync: Convert from "CARD64" to int64_t. + + The extension was using the name CARD64 to represent 64-bit values, + with a #define from CARD64 to XSyncValue, a struct with a pair of + 32-bit values representing a signed 64-bit value. This interfered + with protocol headers using CARD64 to try to actually store a + uint64_t. Now that stdint.h exists, let's just use that here, + instead. + + v2: Fix alarm delta changes. + v3: Do the potentially overflowing math as uint and convert to int + afterward, out of C spec paranoia. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 5cbfa276541e6a621cf9c4b44b75323e90a5bd4c +Author: Eric Anholt +Date: Mon Sep 18 17:34:31 2017 -0700 + + test: Add basic SYNC tests. + + I couldn't find any, and I was modifying the implementation, so I had + to write some. I would like the test to end with a "make sure there + weren't any stray unchecked errors", but I didn't figure out how to do + that. + + v2: Extend sync tests to cover alarm delta and waitvalue changes. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 3336291fc68444ee65b48ba675ec947e505fed57 +Author: Eric Anholt +Date: Mon Sep 18 17:34:30 2017 -0700 + + test: Return error from simple-xinit if the client crashes. + + I want to be able to call client tests with simple-xinit, so assertion + failures should be an error. + + v2: Clean up identical returns. + + Signed-off-by: Eric Anholt + +commit a8eeb332ccf4d13b3fdcc382397bd3ea45e76212 +Author: Eric Anholt +Date: Mon Sep 18 17:34:29 2017 -0700 + + meson: Add Xvfb and Xephyr-glamor testing. + + The Xvfb tests are passing and Xephyr-glamor is failing for me, but it + fails identically on autotools. It's disabled on Travis for now + because the >10 minutes of silence during testing times out the entire + build. + + v2: Fix the disable on travis. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit a09743c9300f805d6527368ddcf44f5dccd4b366 +Author: Eric Anholt +Date: Mon Sep 18 17:34:28 2017 -0700 + + meson: Move Xvfb build under an option. + + Autotools also had it as an option. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit de3b61869140768335daed0e855a5ae4bdb75020 +Author: Jon Turney +Date: Fri Sep 15 14:36:52 2017 +0100 + + Add an .appveyor.yml for AppVeyor CI + + This currently does an autotools build using Cygwin. + + Signed-off-by: Jon Turney + Reviewed-by: Adam Jackson + +commit 7d0728d6c42f9200b90c58e0357776018de18496 +Author: Jon Turney +Date: Fri Sep 15 14:36:51 2017 +0100 + + Revert "dmx: fix linking" + + Since commit 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056, "dmx: fix + linking", linking dmx is broken for me: + + CCLD Xdmx.exe + ../../render/.libs/librender.a(glyph.o): In function `HashGlyph': + /wip/xserver/build.x86_64/../render/glyph.c:168: undefined reference to `x_sha1_init' + /wip/xserver/build.x86_64/../render/glyph.c:174: undefined reference to `x_sha1_update' + /wip/xserver/build.x86_64/../render/glyph.c:177: undefined reference to `x_sha1_update' + /wip/xserver/build.x86_64/../render/glyph.c:180: undefined reference to `x_sha1_final' + ../../render/.libs/librender.a(mipict.o): In function `miClipPictureReg': + /wip/xserver/build.x86_64/../render/mipict.c:233: undefined reference to `pixman_region_n_rects' + /wip/xserver/build.x86_64/../render/mipict.c:234: undefined reference to `pixman_region_n_rects' + /wip/xserver/build.x86_64/../render/mipict.c:235: undefined reference to `pixman_region_rectangles' + /wip/xserver/build.x86_64/../render/mipict.c:236: undefined reference to `pixman_region_rectangles' + /wip/xserver/build.x86_64/../render/mipict.c:248: undefined reference to `pixman_region_init' + /wip/xserver/build.x86_64/../render/mipict.c:251: undefined reference to `pixman_region_not_empty' + /wip/xserver/build.x86_64/../render/mipict.c:261: undefined reference to `pixman_region_not_empty' + ../../render/.libs/librender.a(mipict.o): In function `miComputeCompositeRegion': + /wip/xserver/build.x86_64/../render/mipict.c:340: undefined reference to `pixman_region_init' + + The change this was fixing appears to be effectively reverted by + 542d9f6807ac06b70f564ccab10af69fa21a1221, so just revert commit + 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056. + + Signed-off-by: Jon Turney + Reviewed-by: Adam Jackson + +commit fbd80b2c8ebe9fd41229dc5438524d107c071ff1 Author: Dawid Kurek Date: Thu Jul 6 14:51:11 2017 +0200 @@ -1319,135 +9713,140 @@ Date: Thu Jul 6 14:51:11 2017 +0200 'evdi', but it might be misleading when it comes to real reason for it. Signed-off-by: Dawid Kurek - (cherry picked from commit fbd80b2c8ebe9fd41229dc5438524d107c071ff1) -commit 5571318f22f17883e26977a4c72e1e46d17bdf5d -Author: Keith Packard -Date: Mon Sep 25 16:18:22 2017 -0700 +commit eac1a2e37b833c179b587107230805ea1fb3dfda +Author: Emil Velikov +Date: Thu Aug 3 19:43:28 2017 +0100 - modesetting: Skip no-longer-present connectors when resetting BAD links + dri2: sort DRI2InfoPtr::version checking in ascending order - Outputs may have NULL mode_output (connector) pointers if the - connector disappears while the server is running. Skip these when - resetting outputs with BAD link status. + Makes it easer to follow if 8 is between 7 and 9 ;-) - Signed-off-by: Keith Packard + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit 82df2ce38c560915f8c6574052bd56215b649072 +Author: Roman Gilg +Date: Tue Aug 22 15:38:26 2017 +0200 + + xwayland: Avoid repeatedly looping through window ancestor chain + + Calling xwl_window_from_window means looping through the window ancestor + chain whenever it is called on a child window or on an automatically + redirected window. + + Since these properties and the potential ancestor's xwl_window are constant + between window realization and unrealization, we can omit the looping by + always putting the respective xwl_window in the Window's private field on + its realization. If the Window doesn't feature an xwl_window on its own, + it's the xwl_window of its first ancestor with one. + + Signed-off-by: Roman Gilg + Reviewed-by: Pekka Paalanen + +commit 1089d5d518a315963a8cda6c7d47a0ce09de0979 +Author: Olivier Fourdan +Date: Thu Mar 2 11:03:15 2017 +0100 + + xwayland: add envvar XWAYLAND_NO_GLAMOR + + Not all compositors allow for customizing the Xwayland command line, + gnome-shell/mutter for example have the command line and path to + Xwayland binary hardcoded, which makes it harder for users to disable + glamor acceleration in Xwayland (glamor being used by default). + + Add an environment variable XWAYLAND_NO_GLAMOR to disable glamor support + in Xwayland. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Eric Engestrom + +commit 5abaa50b292798370a665ace5eec56fd830be226 +Author: Eric Anholt +Date: Fri Sep 1 12:22:59 2017 -0700 + + meson: Move the BUILD_DATE/TIME setup to configure time. + + By having it as a custom_target with build_always, every "ninja -C + build" would rebuild Xorg for the new date/time, even if the rest of + Xorg didn't change. + + We could build the rest of Xorg into a static lib, and regenerate + date/time when the static lib changes and link that into a final Xorg, + but BUILD_DATE/TIME is such a dubious feature (compared to including a + git sha, which is easy with meson) it doesn't seem worth the build + time cost. + + Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson - (cherry picked from commit 37f4e7651a2fd51efa613a08a1e705553be33e76) -commit 787655d5df0c8c43e5e424af3e6e35b8daf54a7d -Author: Martin Peres -Date: Mon Apr 10 16:48:21 2017 +0300 +commit 05e7e8b587dd9d37e8beadc72ab993f028c47fa1 +Author: Eric Anholt +Date: Fri Sep 1 12:22:58 2017 -0700 - modesetting: re-set the crtc's mode when link-status goes BAD + meson: Include BUILD_DATE in the meson xf86Build.h. - Despite all the careful planning of the kernel, a link may become - insufficient to handle the currently-set mode. At this point, the - kernel should mark this particular configuration as being broken - and potentially prune the mode before setting the offending connector's - link-status to BAD and send the userspace a hotplug event. This may - happen right after a modeset or later on. + Due to a typo, I only had BUILD_TIME present. - Upon receiving a hot-plug event, we iterate through the connectors to - re-apply the currently-set mode on all the connectors that have a - link-status property set to BAD. The kernel may be able to get the - link to work by dropping to using a lower link bpp (with the same - display bpp). However, the modeset may fail if the kernel has pruned - the mode, so to make users aware of this problem a warning is outputed - in the logs to warn about having a potentially-black display. - - This patch does not modify the current behaviour of always propagating - the events to the randr clients. This allows desktop environments to - re-probe the connectors and select a new resolution based on the new - (currated) mode list if a mode disapeared. This behaviour is expected in - order to pass the Display Port compliance tests. - - Signed-off-by: Martin Peres - Reviewed-by: Eric Anholt - (cherry picked from commit bcee1b76aa0db8525b491485e90b8740763d7de6) - -commit 126144c2355ce5a3a350f15ef97389c7f34bb6fb -Author: Peter Hutterer -Date: Fri May 5 09:04:35 2017 +1000 - - xfree86: up the path name size to 512 in xf86MatchDriverFromFiles - - ./hw/xfree86/common/xf86pciBus.c: In function ‘xf86MatchDriverFromFiles’: - ../hw/xfree86/common/xf86pciBus.c:1330:52: warning: ‘snprintf’ output may be - truncated before the last format character [-Wformat-truncation=] - snprintf(path_name, sizeof(path_name), "%s/%s", ^~~~~~~ - ../hw/xfree86/common/xf86pciBus.c:1330:13: note: ‘snprintf’ output between 2 - - dirent->d_name is 256, so sprintf("%s/%s") into a 256 buffer gives us: - - and 257 bytes into a destination of size 256 - - Signed-off-by: Peter Hutterer - (cherry picked from commit 96af794dc648eadcd596893412d7530e92cb5421) - -commit a114286c079c42067b001ac330501496e2e297a1 -Author: Peter Hutterer -Date: Wed Sep 6 11:53:02 2017 +1000 - - test: fix compiler warning - - signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] - - Signed-off-by: Peter Hutterer - (cherry picked from commit ea82ececbf85a7ac3d0931687f44c57534fde17c) - -commit d230e12d7dac4461626d0c6edfd692571592a280 -Author: Nick Sarnie -Date: Sat Sep 23 17:35:48 2017 -0400 - - suid: Include sysmacros.h to fix build after glibc-2.25 - - [Added HAVE_SYS_SYSMACROS_H guard - ajax] - - Signed-off-by: Nick Sarnie + Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson - (cherry picked from commit 84e3b96b531363e47f6789aacfcae4aa60135e2e) -commit c5320244a3501aaf9558715e9097a2a625cb768b +commit 2b080a14c87fc9e5f77fc3361297ac332aa04f02 +Author: Eric Anholt +Date: Fri Sep 1 12:22:57 2017 -0700 + + meson: Respect SOURCE_DATE_EPOCH for reproducible builds. + + This just copies over Chris Lamb's code from autotools. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 937ed782ae5e4e0da739f0630d1681b3754f0281 +Author: Chris Lamb +Date: Fri Sep 1 12:22:56 2017 -0700 + + configure.ac: Make BUILD_{DATE, TIME} respect SOURCE_DATE_EPOCH if set + + Whilst working on the Reproducible Builds effort [0], we noticed that + xorg-server could not be built reproducibly. One reason is because it + embeds a "current" build and date time. + + This should be compatible with both GNU and BSD date(1). + + [0] https://reproducible-builds.org/ + + v2: Fix change in Y-M-D format that broke the build. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit a49379b6045453c7b787cc638db6afd0d14dce9c Author: Adam Jackson -Date: Thu Apr 27 14:45:25 2017 -0400 +Date: Tue Sep 12 16:53:24 2017 -0400 - xfree86: Silence a new glibc warning + fb: Check whether the window is enabled directly - glibc would like to stop declaring major()/minor() macros in - because that header gets included absolutely everywhere - and unix device major/minor is perhaps usually not what's expected. Fair - enough. If one includes as well then glibc knows we - meant it and doesn't warn, so do that if it exists. + ... instead of its root window. Xwayland's rootless mode empties the + root window border clip since its root window has no storage, but + redirected windows (the only kind it can show) will have a non-empty + border clip anyway, cf. the #ifdef COMPOSITE in miComputeClips. With + this change, non-glamor Xwayland's GetImage actually works. + Other acceleration layers may need to change to account for this, but + this appears to be safe for the existing open source drivers. Only the + xfree86 DDX has any problem with losing its framebuffer on VT switch, + and even then only for UMS drivers (which excludes glamor, uxa, and sna + from consideration). This leaves exa, which already contains code to + evict pixmaps to host memory on VT switch. Since the xfree86 core will + still empty the root clip on VT switch, while the root window itself may + not contain a valid image we won't try to touch it, but GetImage from a + redirected window will now work even when switched away. + + Acked-by: Keith Packard Signed-off-by: Adam Jackson - (cherry picked from commit d732c36597fab2e9bc4f2aa72cf1110997697557) -commit 0e79797e3cb3f8fafe271f4f233a8a8fd25f2001 -Author: Adam Jackson -Date: Wed Aug 30 15:11:45 2017 -0400 - - os: Fix warning in LockServer - - The meson build gives me: - - ../os/utils.c: In function ‘LockServer’: - ../os/utils.c:310:40: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] - snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); - ^~~~~~~~~ - ../os/utils.c:310:5: note: ‘snprintf’ output between 12 and 13 bytes into a destination of size 12 - snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Which seems to be due to the %d part meaning that a negative number's - - sign would be one wider than we're expecting. Fine, just coerce it to - unsigned. - - Signed-off-by: Adam Jackson - Reviewed-by: Alan Coopersmith - (cherry picked from commit aabf65d2a0206bd1a9c6e9a9f3153ded873dfd43) - -commit 69ab094a08513849bb68cd2750840e88db6e5933 +commit 9869dcb349b49f6d4cc2fab5d927cd8b1d1f463c Author: Olivier Fourdan Date: Wed Jul 26 16:00:38 2017 +0200 @@ -1467,9 +9866,8 @@ Date: Wed Jul 26 16:00:38 2017 +0200 Signed-off-by: Olivier Fourdan Tested-by: Fabrice Bellet Reviewed-by: Adam Jackson - (cherry picked from commit 9869dcb349b49f6d4cc2fab5d927cd8b1d1f463c) -commit 421814bc81ba8dfaa9be59b8b35b3a9114dbcb8b +commit bd353e9b84e013fc34ed730319d5b63d20977903 Author: Olivier Fourdan Date: Wed Jul 26 16:00:37 2017 +0200 @@ -1482,9 +9880,84 @@ Date: Wed Jul 26 16:00:37 2017 +0200 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894 Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson - (cherry picked from commit bd353e9b84e013fc34ed730319d5b63d20977903) -commit baa25315014af350c9c04c2c83beeee36aead042 +commit 4486d199bd3bcb5b2b8ad9bc54eb11604d9bd653 +Author: Thomas Hellstrom +Date: Wed Sep 6 16:27:54 2017 +0200 + + glx: Fix visual fbconfig matching with respect to swap method + + For the built in visuals, we'd typically select the "best" fbconfig + without considering the swap method. If the client then requests a + specific swap method, say GLX_SWAP_COPY_OML, it may well happen that the + first fbconfig matching requirements would have been paired with the 32-bit + compositing visual, and the client would render a potentially transparent + window. + + Fix this so that we try to match fbconfigs with the same swap method to all + built-in visuals. That would guarantee that selecting a specific swap- + method would not influence the chance of getting a compositing visual. + + Signed-off-by: Thomas Hellstrom + Reviewed-by: Adam Jackson + +commit 0fc26310d5b09213c65f50bde444a1758172b016 +Author: Thomas Hellstrom +Date: Wed Sep 6 16:27:53 2017 +0200 + + glx: Work around a GLX_OML swap method in older dri drivers + + The swapMethod config member would typically contain an arbitrary value + on older dri drivers. Fix this so that if we detect an illegal value, + return GLX_SWAP_UNDEFINED_OML. + + Signed-off-by: Thomas Hellstrom + Reviewed-by: Adam Jackson + +commit da29a15874229d78ec61946eacdbbed9871e3664 +Author: Emil Velikov +Date: Thu Sep 29 18:36:43 2016 +0100 + + glx: remove unused systemTimeExtension + + Not even a single DRI2/DRISW driver in mesa ever used this. Appears to be a + dri1 artefact copy/pasted in the dri2/drisw codebase. + + Signed-off-by: Emil Velikov + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit ea82ececbf85a7ac3d0931687f44c57534fde17c +Author: Peter Hutterer +Date: Wed Sep 6 11:53:02 2017 +1000 + + test: fix compiler warning + + signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] + + Signed-off-by: Peter Hutterer + +commit e12e02b2e6ee4582ba902ec1d1e5309abc78e282 +Author: Emil Velikov +Date: Sun Apr 17 17:24:53 2016 +0100 + + glamor: use the lowercase xnf.*alloc API + + Signed-off-by: Emil Velikov + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit 17e488570067cdf499c7ad17ab198508c6f1531d +Author: Emil Velikov +Date: Sun Apr 17 17:24:52 2016 +0100 + + xwayland: use the lowercase xnf.*alloc API + + Signed-off-by: Emil Velikov + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit cdd0352ba05d4d8482aaca41797e05d40e58da36 Author: Olivier Fourdan Date: Thu Aug 31 10:23:00 2017 +0200 @@ -1525,9 +9998,460 @@ Date: Thu Aug 31 10:23:00 2017 +0200 Signed-off-by: Olivier Fourdan Acked-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit cdd0352ba05d4d8482aaca41797e05d40e58da36) -commit 6f29c8375281c0337ab94f7919a70c20149b0fc6 +commit 3fbc3c3eefd3803d0c4e86e42595d8a891aeb5f2 +Author: Olivier Fourdan +Date: Fri Sep 1 09:35:33 2017 +0200 + + xwayland: No grab handler without protocol support + + If the compositor has no support for the Xwayland keyboard grab + protocol, there is no need to set-up our keyboard grab handler. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit aabf65d2a0206bd1a9c6e9a9f3153ded873dfd43 +Author: Adam Jackson +Date: Wed Aug 30 15:11:45 2017 -0400 + + os: Fix warning in LockServer + + The meson build gives me: + + ../os/utils.c: In function ‘LockServer’: + ../os/utils.c:310:40: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] + snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); + ^~~~~~~~~ + ../os/utils.c:310:5: note: ‘snprintf’ output between 12 and 13 bytes into a destination of size 12 + snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Which seems to be due to the %d part meaning that a negative number's - + sign would be one wider than we're expecting. Fine, just coerce it to + unsigned. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 3bc32a7f593cbd2747237621135ef5196bc1e15a +Author: Adam Jackson +Date: Tue Aug 22 12:19:56 2017 -0400 + + glx: Fix error generation for non-reply vendor private requests + + Discarding the return value here is just wrong. + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + +commit 591ac95f73b1c1ea681c45e4da9afa2b1d505abe +Author: Emil Velikov +Date: Tue Aug 22 11:48:31 2017 +0100 + + xwin: automake: remove unused {SRCS, DEFS}_{NATIVEGDI, PRIMARYFB} + + Left over from the following commits: + + 8465ee788fd xwin: Remove native GDI engine (v2) + c79f824bf66 xwin: Remove primary DirectDraw engine + + v2: drop leading - in the makefile + + Cc: Adam Jackson + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney (v1) + +commit 69fe6156ec6cd37657d4e5af1c6f21ebf72b8fd7 +Author: Emil Velikov +Date: Tue Aug 22 11:48:30 2017 +0100 + + xwin: remove always true/set XWIN_RANDR conditional/define + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 8f1a200d0be261a60bb9e8e72d8704cef2d91cd4 +Author: Emil Velikov +Date: Tue Aug 22 11:48:29 2017 +0100 + + xwin: remove always true/set XWIN_MULTIWINDOW conditional/define + + v2: drop trailing endif (Jon) + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 9d00f6190a8e5cc4ebda9b315d7c0a0782b58501 +Author: Emil Velikov +Date: Tue Aug 22 11:48:28 2017 +0100 + + xwin: remove always true/set XWIN_CLIPBOARD conditional/define + + v2: drop trailing endif (Jon) + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 1ef65692258136d6e36d0d9d6c5efad9877c9ceb +Author: Emil Velikov +Date: Tue Aug 22 11:48:27 2017 +0100 + + os: make MitGenerateCookie() independent of XCSECURITY + + Analogous to previous commit. + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 292ee7151631cabbd928847a5a2ca47e14a06b75 +Author: Emil Velikov +Date: Tue Aug 22 11:48:26 2017 +0100 + + os: make GenerateRandomData() independent of XCSECURITY + + The function itself does not depend on the macro. Move it outside + of the ifdef guard and remove the identical copy in XWIN. + + This is step 1 towards removing the duplication in winauth.c and moving + the OS specifics to os/ + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 8aee1f40eaa3527c90698d6826ce8314b8b5a92a +Author: Emil Velikov +Date: Tue Aug 22 11:48:25 2017 +0100 + + xwin/glx: remove unused __GLXWinScreen::glx_enable_bits + + All the relevant code already uses the ::base::glx_enable_bits one. + + Signed-off-by: Emil Velikov + Reviewed-by: Jon Turney + +commit 43878fa8772d8642f601d65e78d2f702ecc0de41 +Author: Adam Jackson +Date: Wed Aug 16 14:49:18 2017 -0400 + + glx: Remove some unused stuff from glxserver.h + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Reviewed-by: Keith Packard + +commit 3d81abba9ca2f9d57b4c293e3b7fcb32ef853f44 +Author: Adam Jackson +Date: Wed Aug 16 14:49:17 2017 -0400 + + glx: Inline some reply swapping code + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + +commit 51bab63b7353319c51ec2f1adaed95d86e4f6119 +Author: Adam Jackson +Date: Wed Aug 16 14:49:16 2017 -0400 + + glx: Remove True/False defines + + Those are xlib spellings, we say TRUE/FALSE pretty consistently + elsewhere in the server. + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Reviewed-by: Keith Packard + +commit 8e3b26ceaa86eaf98a78f6b84f46a4a86aed8ef8 +Author: Michel Dänzer +Date: Fri Apr 14 19:08:41 2017 +0900 + + Make PixmapDirtyUpdateRec::src a DrawablePtr + + This allows making the master screen's pixmap_dirty_list entries + explicitly reflect that we're now tracking the root window instead of + the screen pixmap, in order to allow Present page flipping on master + outputs while there are active slave outputs. + + Define HAS_DIRTYTRACKING_DRAWABLE_SRC for drivers to check, but leave + HAS_DIRTYTRACKING_ROTATION defined as well to make things slightly + easier for drivers. + + Reviewed-by: Adam Jackson + +commit c52f77e4ca2cda878da341a6228e6411eec7b1a0 +Author: Peter Harris +Date: Mon Aug 14 15:54:36 2017 -0400 + + meson: Fix epoll detection + + The epoll code depends on epoll_create1, not epoll_create. + + Signed-off-by: Peter Harris + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit 27500ee82e97ef8a6b3199c2d7b623523c1ee2c1 +Author: Eric Anholt +Date: Mon Jul 10 12:08:29 2017 -0700 + + glamor: Scissor Render composite operations to the bounds of the drawing. + + Unlike the previous two fixes, this one introduces new GL calls and + statechanges of the scissor. However, given that our Render drawing + already does CPU side transformation and inefficient box upload, this + shouldn't be a limiting factor for Render acceleration. + + Surprisingly, it improves x11perf -comppixwin10 -repeat 1 -reps 10000 + on i965 by 3.21191% +/- 1.79977% (n=50). + + v2: Make the jump to the exit land after scissor disable. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e6ab3b1109e72a1512c6b7b92dd84525ad8c8052 +Author: Eric Anholt +Date: Thu Jul 6 16:15:17 2017 -0700 + + glamor: Scissor CopyArea to the bounds of the drawing. + + Like the previous fix to rectangles, this reduces the area drawn on + tiled renderers by letting the CPU-side tile setup know what tiles + might be drawn at all. + + Surprisingly, it improves x11perf -copypixwin1 -repeat 1 -reps 10000 + on i965 by 2.93185% +/- 1.5561% (n=90). + + v2: Drop extra glamor_bounds_union_box() from previous debugging + (caught by Mark Marshall). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard (v1) + +commit 60cc7e367a2a5e6014f193105dafd47a4d598fd9 +Author: Eric Anholt +Date: Thu Jul 6 15:43:14 2017 -0700 + + glamor: Scissor rectangle drawing to the bounds of the rects. + + Scissors provide a critical hint to tiled renderers as to what tiles + need to be load/stored because they could be modified by the + rendering. + + The bounds calculation here is limited to when we have a small number + of rects (large enough to cover rounded window corners, but probably + not xeyes) to avoid overhead on desktop GL. + + No performance difference on i965 with x11perf -rect1 -repeat 1 -reps + 10000 (n=50) + + v2: Clamp rectangle bounds addition. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit f2110157713cf22c8b5c46a0d5416fdb033c27d3 +Author: Eric Anholt +Date: Tue May 9 15:48:27 2017 -0700 + + test: Remove unused ddxstubs.c + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit f80119120c487581ac050ce741808f7c8f438f35 +Author: Adam Jackson +Date: Thu Jul 27 16:02:28 2017 -0400 + + composite: Make compIsAlternateVisual safe even if Composite is off + + As of ea483af9 we're calling this unconditionally from the GLX code so + the synthetic visual is in a lower select group. If Composite has been + disabled then GetCompScreen() will return NULL, and this would crash. + + Rather than force the caller to check first, just always return FALSE if + Composite is disabled (which is correct, since none of the visuals will + be synthetic in that case). + + Signed-off-by: Adam Jackson + Reviewed-by: Aaron Plattner + +commit b06a85e7fd6ddac58dd97e5d7ce3b5ea9553c8f6 +Author: Emil Velikov +Date: Mon Jul 31 14:13:48 2017 +0100 + + glx: remove unused GlxSetVisualConfigs stub + + The function was an empty since 2008 at least. Drop it since no + drivers use it any more. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit e8f190b445ae10b12896ee396cd8d57f6b6b8cc4 +Author: Eric Anholt +Date: Fri Aug 4 13:19:01 2017 -0700 + + travis: Request a new docker image with xkb-data and xkbcomp installed. + + Xvfb was erroring out with: + + XKB: Failed to compile keymap + Keyboard initialization failed. This could be a missing or incorrect + setup of xkeyboard-config. + (EE) Fatal server error: + (EE) Failed to activate virtual core keyboard: 2(EE) + + With this change, we can now run my xsync regression test on Travis. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit b62e486c4e3d7411f3e70b610af7f8b9dd5e8a73 +Author: Eric Anholt +Date: Fri Aug 4 13:19:00 2017 -0700 + + travis: Set prefix to /usr, so we find xkbcomp. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 2d50e32e0ba1045f8c73a14335743ae98121d102 +Author: Eric Anholt +Date: Tue Aug 1 13:11:25 2017 -0700 + + meson: Fix xwayland build since xwayland-keyboard-grab. + + The version detect was erroring out with 1.9 protos installed, and we + weren't building the new code. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0a448d133f4f1c913b1c2cb05accff31c74a3dbf +Author: Olivier Fourdan +Date: Wed Jul 12 11:51:08 2017 +0200 + + xwayland: Add grab protocol support + + The keyboard grabbing protocol for Xwayland is included in + wayland-protocol 1.9. + + Update the wayland-protocol required version in both configure and meson + builds and add support for this new protocol in Xwayland. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit abe49b009064c38823fac17c373fd5f1a390b3ab +Author: Jan Beich +Date: Fri Jul 7 19:59:05 2017 +0200 + + dix: unbreak --with-dtrace (default) on FreeBSD 11.1+ + + gmake[2]: Entering directory '/path/to/xserver/dix' + /usr/sbin/dtrace -G -C -o dtrace-dix.o -s ../dix/Xserver.d .libs/atom.o ... + dtrace: failed to compile script ../dix/Xserver.d: line 26: useless declaration + gmake[2]: *** [Makefile:1007: dtrace-dix.o] Error 1 + + Signed-off-by: Jan Beich + Reviewed-by: Alan Coopersmith + +commit c967e4cd8ba50034b6e02d87df10d04edf15ccf6 +Author: Emil Velikov +Date: Mon Jul 31 14:06:48 2017 +0100 + + glx: don't export __glXDRISWRastProvider + + The symbol is used only internally and is not part of the API/ABI. + + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit c09e906d61a0855a8202e58ba72ed6bb3b08f37f +Author: Emil Velikov +Date: Mon Jul 31 14:06:47 2017 +0100 + + glx: fix typo becuase -> because + + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit db0dd06ddf47d5190f2349ed8b0e71caa9e8e1eb +Author: Adam Jackson +Date: Thu Jul 27 16:02:33 2017 -0400 + + glx: Allow arbitrary context attributes for direct contexts + + For direct contexts, most context attributes don't require any + particular awareness on the part of the server. Examples include + GLX_ARB_create_context_no_error and GLX_ARB_context_flush_control, where + all of the behavior change lives in the renderer; since that's on the + client side for a direct context, there's no reason for the X server to + validate the attribute. + + The context attributes will still be validated on the client side, and + we still validate attributes for indirect contexts since the server + implementation might need to handle them. For example, the indirect + code might internally use ARB_context_flush_control for all contexts, in + which case it would need to manually emit glFlush when the client + switches between two indirect contexts that didn't request the no-flush + attribute. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 3050d277616ef472a24d8ccd24afcbf8e31ed80e +Author: Adam Jackson +Date: Tue Jun 27 11:18:48 2017 -0400 + + xfree86: Fix X -configure driver sort yet again + + There were two bugs here: The comparison function was not stable when + one or more of the drivers being compared is a fallback, and the last + driver in the list would never be moved. + + Signed-off-by: Adam Jackson + +commit 6f9939525c31f1f2d8d6c137a46404278384b4bf +Author: Adam Jackson +Date: Mon Jun 26 12:43:54 2017 -0400 + + modesetting: Fix PCI initialization on non-zero domains + + libdrm's busid matching for the legacy three-integer bus string format + simply ignores the domain number, rather than what we were doing here of + packing the domain into the bus number. Whatever, just use the existing + code to build a busid string, since that gets the domain right. + + Signed-off-by: Adam Jackson + +commit d16133e3e293fe16b291114d344fbd5a61d5ed65 +Author: Jeremy Huddleston Sequoia +Date: Thu Jul 20 19:48:26 2017 -0700 + + glx: Only include compositeext.h if COMPOSITE is supported + + Regressed-in: ea483af99a6351323afe00a0b630cd63310efdb1 + Signed-off-by: Jeremy Huddleston Sequoia + +commit dd0b721c977e88d7c3830cc2a672c2793bca4fa0 +Author: Jeremy Huddleston Sequoia +Date: Tue Jul 18 21:35:49 2017 -0700 + + XQuartz: Hack around an issue that can occur on macOS due to background apps incorrectly stealing focus + + Works around . + + Tested-by: Martin Otte + Tested-by: Tom Lane + Signed-off-by: Jeremy Huddleston Sequoia + +commit 211e05ac85a294ef361b9f80d689047fa52b9076 Author: Michal Srb Date: Fri Jul 7 17:21:46 2017 +0200 @@ -1536,9 +10460,8 @@ Date: Fri Jul 7 17:21:46 2017 +0200 Otherwise a client can send any value of num_barriers and cause reading or swapping of values on heap behind the receive buffer. Signed-off-by: Peter Hutterer - (cherry picked from commit 211e05ac85a294ef361b9f80d689047fa52b9076) -commit c8eb79c1834cef5657e227844111052e0dd78661 +commit abb031e731f5c159add1b3351de9c4bb121bf00a Author: Rodrigo Vivi Date: Thu Jun 29 13:29:58 2017 -0700 @@ -1550,9 +10473,20 @@ Date: Thu Jun 29 13:29:58 2017 -0700 Signed-off-by: Rodrigo Vivi Acked-by: Kenneth Graunke - (cherry picked from commit abb031e731f5c159add1b3351de9c4bb121bf00a) -commit 37815323721790c4311faff9743f4d2f902b5506 +commit 05a4396f08c83d9261b8ad16908d9e2730bd4bbf +Author: Emil Velikov +Date: Thu Jun 29 02:17:06 2017 +0100 + + glamor: update "required EGL extensions" comment + + The extensions listed have not been needed in a while. Replace with the + only remaining requirement. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 04511a0476b5c860e7d157b01080dff94d935f74 Author: Adam Jackson Date: Thu Jun 29 10:32:00 2017 -0400 @@ -1564,9 +10498,298 @@ Date: Thu Jun 29 10:32:00 2017 -0400 Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone - (cherry picked from commit 04511a0476b5c860e7d157b01080dff94d935f74) -commit 0934d56dc804780f3e83ae0153c797d392e6faba +commit ce393de0efb8626d15f3b97c97916971a6aefebd +Author: Dave Airlie +Date: Fri Jun 23 09:29:13 2017 +1000 + + modesetting: handle NULL cursor in drmmode_set_cursor. + + We had a bug reported with a touchscreen where we could end up + in here with a NULL cursor, so let's not crash the X server. + + Signed-off-by: Dave Airlie + Reviewed-and-Tested-by: Daniel Martin + Signed-off-by: Peter Hutterer + +commit 43527d31810fe94a5eb4b2543bbc8eb26b1654b7 +Author: Peter Hutterer +Date: Tue Jul 4 06:51:58 2017 +1000 + + xfree86: link to libinput(4) from the xorg.conf man page + + Signed-off-by: Peter Hutterer + Reviewed-by: Pekka Paalanen + +commit edaad0eff48219787d27f7723cd3d4d9b293de96 +Author: Adam Jackson +Date: Thu Jun 29 13:57:37 2017 -0400 + + automake: Add hw/xfree86/xkb/meson.build to EXTRA_DIST + + Signed-off-by: Adam Jackson + +commit 06419a5b17180126d2507c8699229e07f5b2c434 +Author: Emil Velikov +Date: Thu Jun 29 01:55:25 2017 +0100 + + glamor: remove no longer needed KHR_gl_texture_2D_image requirement + + The code that needed it was introduced with commit 7cfd9cc2327 ("Add + DRI3 support to glamor") back in 2013. And was nuked a couple of years + ago with commit 51984dddfcc ("glamor: Delay making pixmaps shareable + until we need to.") + + Signed-off-by: Emil Velikov + Reviewed-by: Eric Anholt + +commit 47a7b63f7455eaeacb634fd800e924f2087dacbd +Author: Jon TURNEY +Date: Mon Jun 26 14:54:06 2017 +0100 + + meson: Use --export-all-symbols when building PE/COFF objects + + Reviewed-by: Adam Jackson + +commit b34abb3d2da46339d59a0feefd2240790a6a6a0e +Author: Jon TURNEY +Date: Mon Jun 26 14:54:05 2017 +0100 + + meson: Shuffle around subdirs so we build Xorg loadable modules after Xorg + + Reviewed-by: Adam Jackson + +commit fbdd73fac68383c93f6f5c6a7615860503039999 +Author: Jon TURNEY +Date: Mon Jun 26 14:54:04 2017 +0100 + + Move statically linked xorgxkb files from dixmods to a separate directory + + [ajax: Fixed test/Makefile.am as well] + + Reviewed-by: Adam Jackson + +commit 5c8fb7d128e312e6c01cd40c7ada072c4b5f3776 +Author: Adam Jackson +Date: Wed Jun 21 15:58:43 2017 -0400 + + xfree86: Move DRICreatePCIBusID to xf86Pci.h + + xf86str.h is parsed into sdksyms unconditionally but the symbol is only + defined when building with PCI support. Move the decl to a header that + sdksyms only parses when building PCI support. + + Signed-off-by: Adam Jackson + Reviewed-by: Jon Turney + +commit 525db17e04d5cabaeefd20e38cebe7d606047a76 +Author: Adam Jackson +Date: Fri Jun 16 15:44:52 2017 -0400 + + glx/drisw: Use scratch GCs for swrastPutImage + + The scratch GC defaults to the same state as our persistent GCs. Except + for the "draw" GC, which would generate graphics exposures for... well, + no reason really, PutImage doesn't generate graphics exposures. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit ecc5e362985d1f649c29ac5f93be19851eaf7d87 +Author: Adam Jackson +Date: Fri Jun 16 15:44:51 2017 -0400 + + glx/drisw: Remove unused glx_enable_bits + + Sloppy of me! + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit a6c23ef31a4e5aea19ddabdf4a0760f4c48f1ebe +Author: Adam Jackson +Date: Fri Jun 16 15:44:50 2017 -0400 + + glx/dri2: Don't chirp when falling back to software + + This isn't an error if the screen isn't accelerated in the first place. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 0b1831d043028f7dd6accca19a81e2abd9a145b5 +Author: Adam Jackson +Date: Fri Jun 16 15:44:49 2017 -0400 + + glx: Remove some indirection around EXT_texture_from_pixmap + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit c33541e59e338cd53f89d94a6898555d350e84aa +Author: Adam Jackson +Date: Fri Jun 16 15:44:48 2017 -0400 + + glx: Remove __glXReply + + Static data bad, hulk smash. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit d6db66811643d3762716f6b144a7358572216a4f +Author: Adam Jackson +Date: Fri Jun 16 15:44:47 2017 -0400 + + dmx: Remove some not-very-interesting debug prints + + gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it + might, and we also don't care. Just delete all this. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 17ad6e5d5616039021455bc821d6ee2497f7ebde +Author: Adam Jackson +Date: Fri Jun 16 15:44:46 2017 -0400 + + dmx: Silence an unused-result warning + + Modern glibc is very insistent that you care about whether write() + succeeds: + + ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: + ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] + write(priv->fd, &event, sizeof(event)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit fbc4da6fef2a0d2111284a19c26d83686ebcbd1f +Author: Adam Jackson +Date: Fri Jun 16 15:44:44 2017 -0400 + + xfree86: Move DRICreatePCIBusID to the PCI code + + This symbol is used by some DRI2+ drivers and there's nothing + DRI1-specific about it. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit b723da8390d2fe1bf048247302416b37972a0cc3 +Author: Adam Jackson +Date: Fri Jun 16 15:44:43 2017 -0400 + + xfree86: Remove unused xf86EnableVTSwitch + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit f44e0af4daaad5b18d79f2076bc98d6e79f638af +Author: Adam Jackson +Date: Fri Jun 16 15:44:42 2017 -0400 + + dix: Remove extension aliases + + This appears to be essentially unused. The only known client-side + library for the SELinux extension is xcb, which does not look for the + name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of + superstition at this point, NVIDIA's driver does not expose it and Mesa + does not check for it. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 88e807d4fa90165868929190f601beef18252f57 +Author: Adam Jackson +Date: Fri Jun 16 15:44:41 2017 -0400 + + include: Remove some unused macros + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit d2e57f71ad16f1e677dd542a8bc0db87dfa9791d +Author: Michel Dänzer +Date: Mon Jun 19 19:05:32 2017 +0900 + + xfree86: Document BusID PCI domain format in ddxDesign.xml + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit 3b0fd9421add9f0ca8958ced0f39b2da21143c22 +Author: Michel Dänzer +Date: Mon Jun 19 19:05:31 2017 +0900 + + xfree86: Document BusID PCI domain format in xorg.conf manpage + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit 8e00dc59b51da7e0d3978c26b1884c4767aa2dc2 +Author: Michel Dänzer +Date: Mon Jun 19 19:05:30 2017 +0900 + + xfree86: Fix printing of PCI domain/bus in xf86MatchPciInstances + + It was attempting to use the @ format accepted by the BusID + stanza, but the two values were swapped. + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit e905b19a53f96013c4417bec993a1dea5a3b0a5f +Author: Michel Dänzer +Date: Mon Jun 19 19:05:29 2017 +0900 + + xfree86: Print BusID stanza compatible bus IDs for found devices + + The PCI domain has to be specified like this: + + "PCI:@::" + + Example before: + + (--) PCI:*(0:0:1:0) 1002:130f:1043:85cb [...] + (--) PCI: (0:1:0:0) 1002:6939:1458:229d [...] + + after: + + (--) PCI:*(0@0:1:0) 1002:130f:1043:85cb [...] + (--) PCI: (1@0:0:0) 1002:6939:1458:229d [...] + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit fb212f2c1bcfb015112aa665dd1f25d9b80f86fc +Author: Jon Turney +Date: Sat Jun 17 14:32:30 2017 +0100 + + meson: Make VBE and VGAHW modules optional + + Don't build them on platforms where they aren't meaningful. + + Note that autoconf defines WITH_VGAHW when building the VGAHW module, but + that doesn't seem to be used anywhere, so we just drop that. + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 6d2b7d33678e7a881ebdb5ceb4a32509ad3ee930 +Author: Jon Turney +Date: Thu May 4 14:08:48 2017 +0100 + + meson: Restore stub ossupport + + Don't build BSD ossupport when there is no specific support, build stubs + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 4212c884c423e5ce2cd3b4d67c0d656475fddc79 Author: Michel Dänzer Date: Fri Jun 16 11:30:03 2017 +0900 @@ -1579,9 +10802,8 @@ Date: Fri Jun 16 11:30:03 2017 +0900 xrandr --output DVI-I-0 --scale-from 3840x2160 --filter nearest Reviewed-by: Aaron Plattner - (cherry picked from commit 4212c884c423e5ce2cd3b4d67c0d656475fddc79) -commit 358f0bcd4f6703302b8895e42e20d1cbdfff102e +commit 091af80be48c37f16c679d35fc12ad33e6b0cd74 Author: Aaron Plattner Date: Thu Jun 15 14:28:27 2017 -0700 @@ -1605,9 +10827,8 @@ Date: Thu Jun 15 14:28:27 2017 -0700 Signed-off-by: Aaron Plattner Reviewed-and-Tested-by: Michel Dänzer - (cherry picked from commit 091af80be48c37f16c679d35fc12ad33e6b0cd74) -commit ed8fbabacac3cd4c7798bd36713894a2068cee13 +commit ba336b24052122b136486961c82deac76bbde455 Author: Michal Srb Date: Wed May 24 15:54:42 2017 +0300 @@ -1622,9 +10843,8 @@ Date: Wed May 24 15:54:42 2017 +0300 Signed-off-by: Michal Srb Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit ba336b24052122b136486961c82deac76bbde455) -commit e8f6a1bb77cbd1bb30d8dc956c5fdc98e25a22aa +commit 8caed4df36b1f802b4992edcfd282cbeeec35d9d Author: Michal Srb Date: Wed May 24 15:54:41 2017 +0300 @@ -1637,9 +10857,8 @@ Date: Wed May 24 15:54:41 2017 +0300 Signed-off-by: Michal Srb Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 8caed4df36b1f802b4992edcfd282cbeeec35d9d) -commit 21f559038c8776acc6439faadbdcab7df4300c66 +commit 215f894965df5fb0bb45b107d84524e700d2073c Author: Michal Srb Date: Wed May 24 15:54:40 2017 +0300 @@ -1667,9 +10886,8 @@ Date: Wed May 24 15:54:40 2017 +0300 Signed-off-by: Michal Srb Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 215f894965df5fb0bb45b107d84524e700d2073c) -commit cdf15ab8f94d54bce72f37653fc46daf482b1671 +commit 05442de962d3dc624f79fc1a00eca3ffc5489ced Author: Michal Srb Date: Wed May 24 15:54:39 2017 +0300 @@ -1688,9 +10906,174 @@ Date: Wed May 24 15:54:39 2017 +0300 Signed-off-by: Michal Srb Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 05442de962d3dc624f79fc1a00eca3ffc5489ced) -commit 3a53e4407fb9e0c0e0dbf8d147b67f6e36aea5ae +commit d82c3cee02a99cf7861d1effaa5c7d38683a7783 +Author: Eric Anholt +Date: Thu Jun 1 13:59:54 2017 -0700 + + travis: Enable ccache. + + We bind-mount the cache directory into the container. Cuts build time + from about 4 minutes to 2. + + Signed-off-by: Eric Anholt + +commit 01dfb65ee2e34148718d3f95dfd4629024edba84 +Author: Eric Anholt +Date: Thu Jun 1 12:29:12 2017 -0700 + + travis: Add a build script for Travis CI. + + This currently does a meson build using a docker image I've prepared. + The Dockerfile source is at: + + https://github.com/anholt/xserver-travis + + Docker proved to be necessary to cut the build time per Travis push. + If some day we end up using meson in more of the X stack, we may be + able to move more dependencies out of the docker image and into the CI + build (putting the I in CI). Until then, we'll have to do docker + image rebuilds when dependencies are added/updated. + + To enable Travis CI on your github repository, see the first two steps + of the docs at: + + https://docs.travis-ci.com/user/getting-started/ + + Once you do that, pushing branches to your github repo will trigger + builds, which will send you email if they fail. Current build status + can be veiewed your account on travis-ci.org: + + https://travis-ci.org/anholt/xserver + +commit fda2b064a0ebd223e8a39fd19f5c5ad1da0776e8 +Author: Eric Anholt +Date: Thu Jun 1 12:29:11 2017 -0700 + + meson: Fix test for whether we've built glamor-EGL. + + This matches the test we use for going into the glamor_egl subdir in + ../../meson.build. + +commit 75bf302ed20f4b9794f71f84c1da2b9fcd689356 +Author: Eric Anholt +Date: Fri Jun 2 09:12:41 2017 -0700 + + dmx: Remove includes of glxtokens.h + + Our top-level glx.h include already provides all of the tokens we use, + and fixes redefinition warnings in the meson build. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit f3689f637f5ac0fb6c231a470e65b39aa5e9ba20 +Author: Keith Packard +Date: Wed May 17 09:57:29 2017 -0700 + + os: Set oc->fd to -1 when connection is closed + + This ensures that we don't use the now-closed file descriptor in the + future. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit d05c754e1bde895589fb514d8f518afeccecbc05 +Author: Keith Packard +Date: Wed May 17 09:57:28 2017 -0700 + + os: Check oc->trans_conn before using oc->fd in YieldControlNoInput + + oc->trans_conn is set to NULL when the connection is closed. At this + point, oc->fd is no longer valid and shouldn't be used. Move + dereference of oc->fd up into YieldControlNoInput where the state of + oc->trans_conn can be checked in a single place. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 448a5586e9235bee9648d89e4103ed48e6237c15 +Author: Keith Packard +Date: Wed May 17 09:57:27 2017 -0700 + + os: Don't call ospoll_listen/ospoll_mute after connection is closed + + In set_poll_client, check oc->trans_conn to make sure the connection + is still running before changing the ospoll configuration of the file + descriptor in case some other bit of the server is now using this file + descriptor. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 523d35e3e1c703a655386f6348a4bfb4291c3969 +Author: Keith Packard +Date: Wed May 17 09:57:26 2017 -0700 + + os: Use CloseDownFileDescriptor from AbortClient, including ospoll_remove + + AbortClient performs most of the same operations as + CloseDownFileDescriptor except that it doesn't call ospoll_remove, + leaving that unaware that the file descriptor has been closed. + + If the file descriptor is re-used before the server comes back around + to clean up, and that new file descriptor is passed to SetNotifyFd, + then that function will mistakenly re-interpret the stale ClientPtr + returned by ospoll_data as a struct notify * instead and mangle data + badly. + + To fix this, the patch does: + + 1) Change CloseDownFileDescriptor so that it can be called multiple + times on the same OsCommPtr. The calls related to the file + descriptor are moved inside the check for trans_conn and + oc->trans_conn is set to NULL after cleaning up. + + 2) Move the XdmcpCloseDisplay call into CloseDownFileDescriptor. I + don't think the actually matters as we just need to know at some + point that the session client has exited. Moving it avoids the + possibility of having this accidentally trigger from another client + with the same fd which closes down at around the same time. + + 3) Change AbortClient to call CloseDownFileDescriptor. This makes sure + that all of the fd-related clean up happens in the same way + everywhere, in particular ensures that ospoll is notified about the + closed file descriptor at the time it is closed and not some time later. + + Debian-bug: https://bugs.debian.org/862824 + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 5d941ccb0b30399d505b48bff894c95cc3023bbe +Author: Keith Packard +Date: Wed May 17 09:57:25 2017 -0700 + + os: Eliminate ConnectionTranslation + + This infrastructure is no longer read, only written; the mapping + from fd to client is now handled by ospoll. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c86fc56b10b603b41ae37057eedfa9c86b609752 +Author: Keith Packard +Date: Mon Jun 12 17:46:51 2017 -0700 + + glamor: Clarify variable names in glamor_copy_cpu_fbo + + This function creates a temporary pixmap to hold data being moved from + the source to the destination. However, it labeled all of the + variables associated with this as src_, which makes it confusing to + read the code. Rename them tmp_ instead. Also fix the comment + describing the function to note that it copies from CPU to GPU, not + GPU to GPU. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit ffda82ed04d28feae2e001dbd0c32d6c795d90b1 Author: Michel Dänzer Date: Tue Jun 6 18:42:06 2017 +0900 @@ -1707,9 +11090,8 @@ Date: Tue Jun 6 18:42:06 2017 +0900 Bug: https://bugs.debian.org/857983 Reviewed-by: Keith Packard - (cherry picked from commit ffda82ed04d28feae2e001dbd0c32d6c795d90b1) -commit 87a7393799ab5d1ea4a19ae7687cd50ac0dceeb4 +commit d4995a3936ae283b9080fdaa0905daa669ebacfc Author: Adam Jackson Date: Mon Jun 12 14:43:23 2017 -0400 @@ -1722,9 +11104,52 @@ Date: Mon Jun 12 14:43:23 2017 -0400 Signed-off-by: Adam Jackson Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit d4995a3936ae283b9080fdaa0905daa669ebacfc) -commit faeee7646695261e60ea03d934a0c496a429f31b +commit 7c7a540f1e1d6b5466e1c9aa28476a2d7273d5ed +Author: Jason Gerecke +Date: Fri Jun 9 16:02:07 2017 -0700 + + xwayland: Implement tablet_tool_wheel for scrolling + + The 'tablet_tool_wheel' function for tablet scrolling was added back in + 8a1defcc634 but left unimplemented. This commit fills in the necessary + details, using the "clicks" count as the number of discrete scroll up/down + events to send. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit fbc9814975fe82be25becf1a55d4f8d34298a956 +Author: Jason Gerecke +Date: Fri Jun 9 16:02:06 2017 -0700 + + xwayland: Correct off-by-one error in tablet button numbering + + The 'tablet_tool_frame' function treats the button masks as though they + are zero-indexed, but 'tablet_tool_button_state' treats them as one- + indexed. The result is that an e.g. middle click event recieved from + Wayland will be sent from the X server as a right-click instead. + + Fixes: 773b04748d0 ("xwayland: handle button events after motion events") + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit d5e2f271ad93e50412ff3605fb25cb9622f437e0 +Author: Carlos Garnacho +Date: Sun May 28 15:56:22 2017 +0200 + + xwayland: Remove two unused proc pointers. + + Xwayland doesn't override these, so we don't need defining those + in the xwl_screen struct. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 95febc42cadf392a888104ad6d5cf4f34fdde7d5 Author: Carlos Garnacho Date: Sun May 28 15:56:21 2017 +0200 @@ -1735,9 +11160,8 @@ Date: Sun May 28 15:56:21 2017 +0200 Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 95febc42cadf392a888104ad6d5cf4f34fdde7d5) -commit c6df0d03de22b57d5faa77b19ac1ec0311f4f3a5 +commit ca17f3e9fd3b59fdc5ffd0e5d78e4db6ddc87aa1 Author: Carlos Garnacho Date: Sun May 28 15:56:20 2017 +0200 @@ -1758,9 +11182,8 @@ Date: Sun May 28 15:56:20 2017 +0200 Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit ca17f3e9fd3b59fdc5ffd0e5d78e4db6ddc87aa1) -commit 2ccea152c091e25474a83588e18475567471e7c8 +commit 513e3bd3870fdb8a8e0e2e52c0fa93872300bc8b Author: Carlos Garnacho Date: Sun May 28 15:56:19 2017 +0200 @@ -1776,9 +11199,8 @@ Date: Sun May 28 15:56:19 2017 +0200 Signed-off-by: Carlos Garnacho Acked-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 513e3bd3870fdb8a8e0e2e52c0fa93872300bc8b) -commit 0e5b08f2eef946e9d9d071f0a79ead379419d8a7 +commit fafdb0cc9697eb53635ed1e78bec1d4cd87ab3a2 Author: Carlos Garnacho Date: Sun May 28 15:56:18 2017 +0200 @@ -1791,9 +11213,8 @@ Date: Sun May 28 15:56:18 2017 +0200 Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit fafdb0cc9697eb53635ed1e78bec1d4cd87ab3a2) -commit 420f77a1ba8bfbbf8c06f6dd57e9ee36124b7360 +commit c217fcb4c4640ffd2fefee63c6fcd7ea5e64b942 Author: Carlos Garnacho Date: Sun May 28 15:56:17 2017 +0200 @@ -1805,9 +11226,25 @@ Date: Sun May 28 15:56:17 2017 +0200 Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit c217fcb4c4640ffd2fefee63c6fcd7ea5e64b942) -commit 40edd409bfc527223dfae89c7f84fea0721dec49 +commit f065721e6fa6e9057cca4eadaf145a4dc22a08d2 +Author: Carlos Garnacho +Date: Sun May 28 15:56:16 2017 +0200 + + dix: assume warping on the RootWindow always happens on visible coords + + If the root window borderClip region is null, the PointInWindowIsVisible() + check fails if pointer warping is attempted on the root window, making + the warping operation bail out early. + + Assume coordinates always lay inside the root window for this case, + the actual position will be clamped later within screen coordinates anyway. + + Signed-off-by: Carlos Garnacho + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7c88977d338a01aca866e52c9e736f8857fb9ae4 Author: Michel Dänzer Date: Fri May 26 12:30:13 2017 +0900 @@ -1838,9 +11275,119 @@ Date: Fri May 26 12:30:13 2017 +0900 Reviewed-by: Keith Packard Reviewed-by: Eric Anholt - (cherry picked from commit 7c88977d338a01aca866e52c9e736f8857fb9ae4) -commit 7c4f7b3a49a43984ab90788b85b35078feadf42a +commit d164c10850609c96fd46c8441efd40940b06dfe0 +Author: Michel Dänzer +Date: Thu May 25 16:19:35 2017 +0900 + + xfree86: Add Option "PreferCloneMode" + + When the default behaviour was changed from clone mode to horizontal + extended layout, a boolean ScrnInfoRec member preferClone was introduced + to choose the old default behaviour. Option "PreferCloneMode" allows + setting this preferClone member. + + Reviewed-by: Alex Deucher + +commit 87db150d8a572d8983a234663aaaab9cb8b6c98d +Author: Eric Anholt +Date: Thu Jun 1 10:07:55 2017 -0700 + + glamor: Remove the "delayed fallback" code. + + The usage of this died with the old core rendering code. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 72ddad7a97fa062bf9967d221c9a5520ebe33352 +Author: Eric Anholt +Date: Wed May 17 11:36:07 2017 -0700 + + glamor: Drop glamor_set_screen_pixmap(). + + All that was left here was updating the FBO's size. However, the FBO + size was always set correctly already through + glamor_set_pixmap_texture() from whoever had attached a new BO to the + pixmap. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 49b12cb7360608b14caef5facb12f146d0bd15e6 +Author: Eric Anholt +Date: Wed May 17 11:33:16 2017 -0700 + + glamor: Stop tracking the screen_fbo. + + This means we no longer get "s" for on-screen drawing in glamor_debug, + and there's only "m" (CPU memory) or "f" (Any GPU memory, aka FBOs). + That seems fine to me. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit fd0d2523a33620b36cd478925ddac5cf70f9c409 +Author: Eric Anholt +Date: Tue May 9 15:33:21 2017 -0700 + + glamor_egl: Stop saving the EGL major/minor version. + + We don't use them for anything. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 1f38a31ed3969471cbed69c61edb971f6cff5287 +Author: Jon Turney +Date: Sun May 7 20:53:04 2017 +0100 + + Add meson.build for XWin server (v2) + + This needs a meson with PRs #1784, #1792 and #1794 + + Future work: remove conditionals which are always on, and simplify redundant + CYGDEBUG conditionals + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 36b9dac212a0f8a287cdbd35db152a5eb5cbc744 +Author: Jon Turney +Date: Tue May 9 12:59:19 2017 +0100 + + hw/xwin: Remove pretense of Xv support + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 793af4d3f945b1d59eb2f84e625b581ea90b0066 +Author: Jon Turney +Date: Sun May 7 20:31:55 2017 +0100 + + hw/xwin: Don't unconditionally include rootless.h + + Don't unconditionally include rootless.h, and so we don't need to add + rootless to the include path unless building MWEXTWM. + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit d8ccfb132602be88e640cc87ea58496e0445aab7 +Author: Eric Anholt +Date: Thu Jun 1 16:46:02 2017 -0700 + + meson: Fix enabling of xshmfence. + + I misspelled the enable flag, so DRI3 would throw BadImplementation + when you tried to start any GL app. Same as in + c7be7a688a78a34f61b90c0d95914e14b90b0cdc, we also convert it to #ifdef + for consistency. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + +commit 4f29366f1e5678505fb882143c9b4a892d5b8273 Author: Lyude Date: Tue May 30 16:39:49 2017 -0400 @@ -1887,9 +11434,8 @@ Date: Tue May 30 16:39:49 2017 -0400 Signed-off-by: Lyude Reviewed-by: Michel Dänzer Signed-off-by: Peter Hutterer - (cherry picked from commit 4f29366f1e5678505fb882143c9b4a892d5b8273) -commit d8f63717e05ae8d820ceae74216916ebd180441d +commit 2fbf62b2fb3dcb29551251d09aa695715bb754f4 Author: Jason Gerecke Date: Fri May 26 14:27:19 2017 -0700 @@ -1906,9 +11452,315 @@ Date: Fri May 26 14:27:19 2017 -0700 Signed-off-by: Jason Gerecke Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 2fbf62b2fb3dcb29551251d09aa695715bb754f4) -commit 444929b446a0ef5873d6346c3f3091adb8fbe6bb +commit 96af794dc648eadcd596893412d7530e92cb5421 +Author: Peter Hutterer +Date: Fri May 5 09:04:35 2017 +1000 + + xfree86: up the path name size to 512 in xf86MatchDriverFromFiles + + ./hw/xfree86/common/xf86pciBus.c: In function ‘xf86MatchDriverFromFiles’: + ../hw/xfree86/common/xf86pciBus.c:1330:52: warning: ‘snprintf’ output may be + truncated before the last format character [-Wformat-truncation=] + snprintf(path_name, sizeof(path_name), "%s/%s", ^~~~~~~ + ../hw/xfree86/common/xf86pciBus.c:1330:13: note: ‘snprintf’ output between 2 + + dirent->d_name is 256, so sprintf("%s/%s") into a 256 buffer gives us: + + and 257 bytes into a destination of size 256 + + Signed-off-by: Peter Hutterer + +commit bf3a591fdc5c98f7cab232bf5ec39902947ae2e5 +Author: Peter Hutterer +Date: Mon May 8 10:07:51 2017 +1000 + + fb: remove some superfluous empty lines + + Signed-off-by: Peter Hutterer + +commit 933d80ba93cf9b5d32ce8673d60810c128debdab +Author: Adam Jackson +Date: Thu May 18 11:19:53 2017 -0400 + + misprite: Clean up some preprocessor abuse + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 57c223002c61c8ceb84fa7a02a3c1579517996f3 +Author: Adam Jackson +Date: Thu May 18 11:19:52 2017 -0400 + + misprite: Remove some dead cache variables + + Unused since Keith ported misprite to damage in '04. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Reviewed-by: Keith Packard + +commit d0675e96f1fc8501324c88afa648a9d394f35587 +Author: Eric Anholt +Date: Tue May 16 11:37:23 2017 -0700 + + glamor_egl: Drop glamor_egl_create_textured_screen_ext(). + + The function hasn't been doing anything useful since keithp's resource + freeing fixes in 2014. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit c36f56808ffbefc4a3dcf61dfad17f62aeb8e16c +Author: Eric Anholt +Date: Wed May 17 17:06:44 2017 -0700 + + glamor_egl: Automatically choose a GLES2 context if desktop GL fails. + + GLES2 support has been requested multiple times, and we've had this + code laying around trying to implement it. The GLES2 implementation + is not quite there yet (some pixel transfer failures), but it + shouldn't take much fixing at this point. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit f6bf5f1c7475ff1b19b0e8c3e71c1224d5b6bc82 +Author: Eric Anholt +Date: Wed May 17 17:06:43 2017 -0700 + + glamor_egl: Remove check for KHR_surfaceless_context_* + + Those extensions don't exist. There's only surfaceless_context. + + Signed-off-by: Eric Anholt + Reviewed-by: Emil Velikov + +commit 6e793ae08510639d011f638bcfc5246b9cccd1ae +Author: Eric Anholt +Date: Tue May 16 11:37:21 2017 -0700 + + glamor_egl: Drop warning about indirect GLX and GLES2. + + Indirect GLX uses its own context and doesn't care what glamor is + using. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 59de50d6ef3331ee03eb82d4acba45aa75c70d42 +Author: Eric Anholt +Date: Tue May 16 11:37:20 2017 -0700 + + glamor_egl: Avoid flink names in glamor_egl_create_textured_pixmap(). + + Using flink is banned on render nodes, and they needlessly expose our + screen pixmap contents to any authenticated client. This also + incidentally drops the dependency on EGL_MESA_drm_image. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 5d6f17d913bd4de0b4594585c0a8ba4f717a2a78 +Author: Eric Anholt +Date: Tue May 16 11:37:19 2017 -0700 + + glamor_egl: Drop dead "cpp" field + + It's been unused since the initial import. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 37618e810b70c24bb8a97dce844963ed1a99f897 +Author: Eric Anholt +Date: Tue May 16 11:37:18 2017 -0700 + + glamor_egl: Drop dead gl_context_depth. + + This was replaced in 4afe15d8bfd575c010ed1868697a7922a37ab378, but not + deleted. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit a6a751e5d8962b01abc2a92ec35300f68cb38d94 +Author: Eric Anholt +Date: Tue May 16 11:37:17 2017 -0700 + + glamor_egl: Drop unnecessary check for KHR_gl_renderbuffer_image. + + I couldn't find it being used anywhere in the history of the code. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 40a153ee452390f713f7e5638af320a70defe106 +Author: Eric Anholt +Date: Tue May 16 11:37:16 2017 -0700 + + glamor_egl: Always require the gbm-based image import path. + + This has been associated with dri3 for now, but we need to use it + elsewhere in order to avoid flink. The extensions have been + implemented for long enough that I couldn't find when it was that we + turned them on. Oddly, we already required renderbuffer import + support, which is basically as hard to implement as texture import. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + Acked-by: Daniel Stone + +commit b1b71b7a8b2d2c5d8f4afa67b75d10d4e7cbaa20 +Author: Eric Anholt +Date: Tue May 16 11:37:15 2017 -0700 + + glamor_egl: Drop the has_gem flag. + + We're using GBM, so we know we've got GEM. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 32957d9faeb8b0e968a23d91ed7391c0465dd1b9 +Author: Eric Anholt +Date: Tue May 16 11:37:14 2017 -0700 + + modesetting: Drop code for GLAMOR && !GLAMOR_HAS_GBM. + + The glamor_egl module that the GLAMOR paths are using is only built if + GLAMOR_HAS_GBM is true, and there's no plan for implementing the + module without GBM. Simplify modesetting's code as a result. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 5102ea38eb7331aeb1258cd148fd374cf0cbf8f2 +Author: Eric Anholt +Date: Tue May 16 11:37:13 2017 -0700 + + glamor_egl: Unifdef GLAMOR_HAS_GBM. + + We only build this code with GBM, and supporting non-GBM well would be + invasive. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 5064153c79d8b18767c0ade7635680a2f396f296 +Author: Eric Anholt +Date: Tue May 16 11:37:12 2017 -0700 + + glamor_egl: Print a useful identifying string on initialization. + + The EGL version is not used anywhere in the glamor code, so it's not + interesting. And when saying that we've started using GL + acceleration, it's nice to know what GL we're actually using. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit fd96ff7fb325f54cb06c2bf5b8c37c75457b5c42 +Author: Jon Turney +Date: Tue Apr 18 10:44:55 2017 +0100 + + hw/xwin: Fix -Wunused-function warning for MessageName() in non-debug builds + + ../hw/xwin/winmultiwindowwm.c:188:1: warning: ‘MessageName’ defined but not used [-Wunused-function] + + Signed-off-by: Jon Turney + Reviewed-by: Yaakov Selkowitz + +commit e49f5947eda578d8b029f42fb4ec9c90f413b4b3 +Author: Jon Turney +Date: Tue Apr 18 10:45:07 2017 +0100 + + hw/xwin: Fix -Wmaybe-uninitialized warnings in engine CloseScreen wrappers + + ../hw/xwin/winshadgdi.c: In function ‘winCloseScreenShadowGDI’: + ../hw/xwin/winshadgdi.c:632:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized] + ../hw/xwin/winshadgdi.c:579:10: note: ‘fReturn’ was declared here + ../hw/xwin/winshadddnl.c: In function ‘winCloseScreenShadowDDNL’: + ../hw/xwin/winshadddnl.c:711:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized] + ../hw/xwin/winshadddnl.c:661:10: note: ‘fReturn’ was declared here + + Signed-off-by: Jon Turney + Reviewed-by: Yaakov Selkowitz + +commit 319daa7a9fa8bcfdefb08d7770912775af22ad99 +Author: Jon Turney +Date: Wed Apr 19 13:30:27 2017 +0100 + + hw/xwin: Fix -Wmaybe-uninitialized warning in winWindowProc + + This is possibly an actual bug in failing to check we successfully retrieved + the monitor size before using it to set the X screen size. + + ../hw/xwin/winwndproc.c: In function ‘winWindowProc’: + ../hw/xwin/winwndproc.c:283:55: warning: ‘dwHeight’ may be used uninitialized in this function [-Wmaybe-uninitialized] + ../hw/xwin/winwndproc.c:240:32: note: ‘dwHeight’ was declared here + ../hw/xwin/winwndproc.c:281:54: warning: ‘dwWidth’ may be used uninitialized in this function [-Wmaybe-uninitialized] + ../hw/xwin/winwndproc.c:240:23: note: ‘dwWidth’ was declared here + + Signed-off-by: Jon Turney + Reviewed-by: Yaakov Selkowitz + +commit 7a90c9b24e6776c8f1fa43df4268f79a465c0d4e +Author: Jon Turney +Date: Tue Apr 18 10:32:31 2017 +0100 + + xfree86: Hide unused variables when !XSERVER_LIBPCIACCESS + + ../hw/xfree86/common/xf86Config.c: In function ‘xf86HandleConfigFile’: + ../hw/xfree86/common/xf86Config.c:2278:10: warning: unused variable ‘singlecard’ [-Wunused-variable] + ../hw/xfree86/common/xf86Config.c:2277:17: warning: unused variable ‘scanptr’ [-Wunused-variable] + + Signed-off-by: Jon Turney + Reviewed-by: Yaakov Selkowitz + +commit 7a19a3e093a62a779c3cab8c28930adcb1604e0d +Author: Peter Hutterer +Date: Mon May 8 10:24:34 2017 +1000 + + xfree86: build a shared lib identical to Xorg + + Because we can use a shared lib in dlsym() for the symbol loader test, + but we can't use the executable. + + v2: Drop a stray ' ' and rebase on 820a4cbe9fe, by anholt + + Signed-off-by: Peter Hutterer + Reviewed-by: Eric Anholt + +commit 49c742557457ff9200a10f32daadfcea50d4911c +Author: Adam Jackson +Date: Thu May 11 17:17:55 2017 -0400 + + meson: Fix CLOCK_MONOTONIC test + + C99 isn't enough on its own to get POSIX feature sets defined. + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + Tested-by: Pekka Paalanen + +commit 152375f4e4f1ee4833129802730b36af8d0f7e1a +Author: Adam Jackson +Date: Thu May 11 17:17:54 2017 -0400 + + os, xfree86: Stop being so weird about + + Whatever problem this is trying to fix, we don't care. Just include the + thing and stop worrying about whether _POSIX_SOURCE is defined. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + Reviewed-by: Julien Cristau + Tested-by: Pekka Paalanen + +commit d9e23ea4228575344e3b4c0443cecc5eb75356e4 Author: Keith Packard Date: Wed May 10 21:50:45 2017 -0700 @@ -1922,9 +11774,472 @@ Date: Wed May 10 21:50:45 2017 -0700 Signed-off-by: Keith Packard Tested-by: Nick Sarnie Reviewed-by: Michel Dänzer - (cherry picked from commit d9e23ea4228575344e3b4c0443cecc5eb75356e4) -commit d808b573992ae1fc7706d8897a92783b847040e3 +commit c394f6b27329d212d2a8b9b3c6da1ef7847c46f3 +Author: Julien Cristau +Date: Thu May 11 08:42:16 2017 +0200 + + Replace all checks for 'linux' macro with '__linux__' + + gcc -std=c99 does not define the former, and it's a horrible namespace + confusion anyway. + + Signed-off-by: Julien Cristau + Reviewed-by: Adam Jackson + Tested-by: Pekka Paalanen + +commit 6634ffc4d26846dcf892f27682f9021f6d9956a9 +Author: Julien Cristau +Date: Thu May 11 08:42:15 2017 +0200 + + Drop workaround for pre-glibc linux + + It seems unlikely anyone still needs to build against libc4/libc5. + + Reviewed-by: Adam Jackson + Signed-off-by: Julien Cristau + +commit 318257029578a30e29c191befa94a20ad07f97d4 +Author: Frank Binns +Date: Thu May 11 14:00:19 2017 +0100 + + hw/xfree86: fix comment typo + + Signed-off-by: Frank Binns + +commit 0848390d51f93ecfb9342cffe1cda46a65cfc07b +Author: Adam Jackson +Date: Wed May 10 11:14:57 2017 -0400 + + xephyr: Fix regeneration + + I had said: + + commit c42311a9d7d2e5a67bdb7f4fa32032b4feba59b1 + Author: Adam Jackson + Date: Fri Mar 24 15:58:54 2017 -0400 + + kdrive: Remove KdOsFuncs + + Only the Init slot was used, and Xephyr can just as easily do + that initialization directly. + + And I'd've been right, but I forgot to make that initialization only + happen on startup (i.e. when serverGeneration == 1). + + Reviewed-and-Tested-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 0ff2fb128bf35dffaa302f15e9ae004b65ee0827 +Author: Peter Harris +Date: Tue May 9 19:39:47 2017 -0400 + + meson: Detect strlcat/strlcpy/reallocarray in libbsd + + If we're linking with libbsd anyway, we might as well use the functions + it provides instead of compiling our replacements. + + Signed-off-by: Peter Harris + Reviewed-by: Eric Anholt + +commit c4c002d1ca80bd69776387dafb9c5bb082c72e48 +Author: Peter Harris +Date: Tue May 9 19:39:46 2017 -0400 + + meson: Only detect each function once + + Use conf_data outside of include/ to avoid re-running detection of the + same functions. + + Reviewed-by: Eric Anholt + Signed-off-by: Peter Harris + +commit 03d6275e6094a5ede5a70f05bbbdde653a9fd9e0 +Author: Peter Harris +Date: Tue May 9 19:39:45 2017 -0400 + + meson: Detect more functions + + Set HAVE_REALLOCARRAY, HAVE_SIGACTION, HAVE_STRCASESTR, HAVE_STRLCAT, + HAVE_STRLCPY, HAVE_TIMINGSAFE_MEMCMP, and BUSFAULT. + + Reviewed-by: Eric Anholt + Signed-off-by: Peter Harris + +commit ba1599610b1889545be8a9314dce8a740a2764d3 +Author: Peter Harris +Date: Tue May 9 19:39:44 2017 -0400 + + meson: Detect arc4random_buf + + Reviewed-by: Eric Anholt + Signed-off-by: Peter Harris + +commit e67ca940473e249c7b9712ce6d515310ed1e4cf9 +Author: Jon TURNEY +Date: Mon May 8 11:40:22 2017 +0100 + + meson: An empty array is not a dependency object + + Using the meson idiom of initializing a variaible to an empty array to + represent a null value does not work well for a variable expected to hold a + dependency object, as trying to apply found() to it will fail (currently). + + I think this can be demonstrated by configuing with Dglamor=no, then gbm_dep + is set to [] in meson.build, and then tested with found() in + include/meson.build. + + Use dependency('') to create an empty dependency. + + Future work: In the autotools build GBM is required if build_xorg & + build_glamor. I suspect that it was also required for build_xwayland & + build_glamor, but that was never checked. That test seems to have gone + missing in meson.build, the required:false when checking for gbm should + possibly be dropped? + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit 16054647abfc9fe5f71d0098e17415e45fa28199 +Author: Jon TURNEY +Date: Mon May 8 11:40:21 2017 +0100 + + meson: Refine build_dbus + + As in autotools build, only turn on build_dbus (build dbus-core.c) if it's + needed by build_hal or build_systemd_logind, not just because dbus is + available. + + Building dbus-core.c without NEED_DBUS defined fails, as the contents of + dbus-core.h are turned off. + + Signed-off-by: Jon Turney + Acked-by: Eric Anholt + +commit 820a4cbe9fef36bc97a7107ccc74a785180e227a +Author: Jon TURNEY +Date: Tue May 9 12:23:48 2017 +0100 + + meson: Make driprotos and libdrm optional + + Add options for DRI{1,2,3} + shmfence is required for DRI3 + libdrm is required for any DRI{1,2,3} + Consolidate calls to dependency('libdrm') + Set WITH_LIBDRM when building with libdrm + + v2: + Initialize libxserver_dri3 to [] + Manually flatten libxserver, since meson doesn't (currently) + Use version_compare rather than circumloctions with dependency() + + Signed-off-by: Jon Turney + Reviewed-by: Eric Anholt + +commit fdb11e2274f1d1069cdc9ff7b3655288c1b42cf4 +Author: Jon TURNEY +Date: Mon May 8 11:40:18 2017 +0100 + + meson: Don't require xf86dgaproto + + This dependency is never used, and build_dga is hardwired to false later on, + anyhow. + + Reviewed-by: Eric Anholt + Signed-off-by: Jon Turney + +commit 5bff2a68560837fc402905fef6244ce794c47843 +Author: Jon TURNEY +Date: Mon May 8 11:40:17 2017 +0100 + + meson: Nettle is required if it's the only SHA1 choice + + Reviewed-by: Eric Anholt + Signed-off-by: Jon Turney + +commit 95e5fa04762fa0f04ac1349708d9e33c30205a96 +Author: Jon TURNEY +Date: Mon May 8 11:40:16 2017 +0100 + + meson: Remove stray whitespace + + Reviewed-by: Eric Anholt + Signed-off-by: Jon Turney + +commit e9dbecf7c259f7e8b610fa93f97ea55f5dafa7af +Author: Adam Jackson +Date: Wed May 10 10:56:16 2017 -0400 + + timingsafe_memcmp: Fix meson build + + Include dix-config.h first to pick up _GNU_SOURCE so we get the + definition for sigset_t. + + Reported-by: Pekka Paalanen + Signed-off-by: Adam Jackson + +commit 5d3b6cc221aff5b9322b31aa6f5ae922271bc7d8 +Author: Karol Kosik +Date: Wed Jul 22 16:42:07 2015 -0700 + + xfree86: Improved autoconfig drivers matching + + Implementation of new drivers matching algorithm. New approach + doesn't add duplicate drivers and ease drivers matching phase. + + v2: Re-commit the patch reverted in + 2388f5e583d4ab2ee12f2b087d381b64aed3f7d5, with Aaron Plattner's + fix squashed in (by anholt). + + Signed-off-by: Karol Kosik + Signed-off-by: Aaron Plattner + Signed-off-by: Eric Anholt + Reviewed-by: Aaron Plattner (v1) + Reviewed-by: Emil Velikov (v1) + Tested-by: Peter Hutterer + Tested-by: Eric Anholt + +commit 2388f5e583d4ab2ee12f2b087d381b64aed3f7d5 +Author: Eric Anholt +Date: Tue May 9 13:37:59 2017 -0700 + + Revert "xfree86: Improved autoconfig drivers matching" + + This reverts commit 112d0d7d01b98fb0d67910281dd1feeec125247b. + + It broke Xorg for Adam, Peter, and myself, by failing hard when a + module load failed. + + Signed-off-by: Eric Anholt + +commit 1dd14e7a499428cf7215b49a9319199545bcd6cb +Author: Eric Anholt +Date: Mon May 8 10:36:30 2017 -0700 + + meson: Use link_whole() not link_with(), for the Xorg dixmods. + + I clearly hadn't run ninja test, since fb no longer had any of the fb + symbols in it. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + +commit a06bb73053d9df56d9070ce325a43af3a3c7a6a2 +Author: Lyude +Date: Thu May 4 18:04:31 2017 -0400 + + xwayland: Unconditionally initialize lists in init_tablet_manager_seat() + + In the event that xwayland gets launched on a wayland compositor that + doesn't yet have support for wp_tablet_manager, we end up skipping the + initialization of the lists. This is wrong, because regardless of + whether or not a tablet is present we still attempt to traverse these + lists later in xwl_set_cursor(), expecting that if the lists are empty + from no tablet manager that we simply won't execute any loop iterations. + + (EE) + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9] + (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7f73722545bf] + (EE) 2: Xwayland (xwl_set_cursor+0x9f) [0x429974] + (EE) 3: Xwayland (miPointerUpdateSprite+0x261) [0x4fe1ca] + (EE) 4: Xwayland (mieqProcessInputEvents+0x239) [0x4f8d33] + (EE) 5: Xwayland (ProcessInputEvents+0x9) [0x4282f0] + (EE) 6: Xwayland (Dispatch+0x42) [0x43e2d4] + (EE) 7: Xwayland (dix_main+0x5c9) [0x44c6dc] + (EE) 8: Xwayland (main+0x28) [0x61c523] + (EE) 9: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f7371e9d401] + (EE) 10: Xwayland (_start+0x2a) [0x4208fa] + (EE) 11: ? (?+0x2a) [0x2a] + (EE) + (EE) Segmentation fault at address 0x28 + (EE) + Fatal server error: + (EE) Caught signal 11 (Segmentation fault). Server aborting + (EE) + + Reproduced when trying to run upstream xwayland under fedora 25's weston + package. + + Signed-off-by: Lyude + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 5f83b951ac7e0e6bbd766a9bb860283e32808c90 +Author: Jon TURNEY +Date: Thu May 4 13:46:26 2017 +0100 + + meson: Fix typo in xephyr option description + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit ce6741f6ac63493d6b903f8f58b83bf571baf4b9 +Author: Jon TURNEY +Date: Thu May 4 13:46:25 2017 +0100 + + meson: Fix typoed filename + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit 492534813302ef95538f485401fbcf6eccbd0026 +Author: Jon TURNEY +Date: Thu May 4 13:46:24 2017 +0100 + + meson: Make xf86vidmode optional + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit 3b3ce4a55b0c1f83eff37fb8544156e8961f3fa3 +Author: Jon TURNEY +Date: Thu May 4 13:46:23 2017 +0100 + + meson: Test to build xserver_poll.c was inverted + + Test to build xserver_poll.c was inverted compared to autoconf. Build + xserver_poll.c if poll is missing. + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit 4b7dd6d1aa53bdeee2e3fd0c0a73f6ce40495682 +Author: Adam Jackson +Date: Wed May 3 15:40:08 2017 -0400 + + Makefile.am: make 'make distcheck' verify the meson build + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Signed-off-by: Peter Hutterer + +commit 111a5615a60565f7b68a7fa69dbac3d289d80c9e +Author: Peter Hutterer +Date: Wed May 3 15:40:07 2017 -0400 + + Makefile.am: add the meson files to the tarball + + While we're shipping both build systems, we'll likely have 'make dist' + generated tarballs - those tarballs should be buildable with meson to + have more exposure. List them all explicitly since the list isn't likely + to change much. + + Signed-off-by: Peter Hutterer + Reviewed-by: Eric Engestrom + Reviewed-by: Eric Anholt + +commit 11c133aafe63c776bde502057243d67fe2c630c8 +Author: Eric Anholt +Date: Wed May 3 15:33:46 2017 -0700 + + meson: Fix kdrive build. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit b7376fb933ac1b0c1771535c14cf77029eccb7f5 +Author: Adam Jackson +Date: Fri Mar 24 15:58:55 2017 -0400 + + kdrive: Remove dead slots from KdCardFuncs + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit c42311a9d7d2e5a67bdb7f4fa32032b4feba59b1 +Author: Adam Jackson +Date: Fri Mar 24 15:58:54 2017 -0400 + + kdrive: Remove KdOsFuncs + + Only the Init slot was used, and Xephyr can just as easily do that + initialization directly. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit c0375dced38674ed98562529530d89ff02c48100 +Author: Adam Jackson +Date: Fri Mar 24 15:58:53 2017 -0400 + + kdrive: static and dead code cleanup + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d732c36597fab2e9bc4f2aa72cf1110997697557 +Author: Adam Jackson +Date: Thu Apr 27 14:45:25 2017 -0400 + + xfree86: Silence a new glibc warning + + glibc would like to stop declaring major()/minor() macros in + because that header gets included absolutely everywhere + and unix device major/minor is perhaps usually not what's expected. Fair + enough. If one includes as well then glibc knows we + meant it and doesn't warn, so do that if it exists. + + Signed-off-by: Adam Jackson + +commit c3147a20065b212fac78eb29c9bb9e150f9b22f5 +Author: Adam Jackson +Date: Thu Apr 27 14:45:24 2017 -0400 + + dmx: Fix decl mismatch for XRT_WINDOW + + Building xserver with meson -Db_lto=true found this! Check it: + + ../hw/dmx/dmx.c:66:22: warning: type of ‘XRT_WINDOW’ does not match + original declaration [-Wlto-type-mismatch] + extern unsigned long XRT_WINDOW; + ^ + ../include/resource.h:58:18: note: type ‘RESTYPE’ should match type ‘long + unsigned int’ + typedef uint32_t RESTYPE; + ^ + ../Xext/panoramiX.c:85:9: note: ‘XRT_WINDOW’ was previously declared here + RESTYPE XRT_WINDOW; + ^ + ../Xext/panoramiX.c:85:9: note: code may be misoptimized unless + -fno-strict-aliasing is used + + I have never managed successfully to build xserver with LTO with + autotools, so, score one for meson. + + Get the decl from panoramiXsrv.h, which includes panoramiX.h first anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit ea275cd3d5fb561c6aed7876f486e1124082426c +Author: Eric Anholt +Date: Fri Apr 28 15:09:38 2017 -0700 + + meson: Fix glx build with DRI2 disabled. + + A common meson pattern is to use empty arrays for optional sources and + dependencies, since it generally iterates over trees of arrays looking + for values. A value of '' will actually go looking for ''. + + Daniel Stone + Signed-off-by: Eric Anholt + +commit 62f727c7ea359b7bdf58d9b827731a082b47553d +Author: Eric Anholt +Date: Fri Apr 28 15:09:37 2017 -0700 + + meson: use link_with for Xorg's shared modules as well as Xorg. + + I converted Xorg when meson 0.40 came out, but fumbled my grep and + forgot that I had instances of the .extract_all_objects() workaround + in dixmods, too. + + Signed-off-by: Eric Anholt + Reviewed-by: Daniel Stone + +commit e2f68296ffb8e40035c0ebd949b67d1e2e424e11 Author: Keith Packard Date: Sat Apr 29 00:26:10 2017 -0700 @@ -1936,9 +12251,8 @@ Date: Sat Apr 29 00:26:10 2017 -0700 Bugzilla: https://bugs.freedesktop.org/100863 Signed-off-by: Keith Packard Reviewed-and-Tested-by: Michel Dänzer - (cherry picked from commit e2f68296ffb8e40035c0ebd949b67d1e2e424e11) -commit 7a2525fba60a04a95a4a8b26c2b628dc8fdfdeff +commit a82971b07035ee9a4e3ed01326e7c1eab34b5a19 Author: Keith Packard Date: Sat Apr 29 00:21:47 2017 -0700 @@ -1951,9 +12265,309 @@ Date: Sat Apr 29 00:21:47 2017 -0700 Signed-off-by: Keith Packard Reviewed-and-Tested-by: Michel Dänzer - (cherry picked from commit a82971b07035ee9a4e3ed01326e7c1eab34b5a19) -commit b3de3ebcf450fd4ab1543dd2f133e45e9c0b9e7e +commit 8475e6360ce31551d50fd63a26f7a44d1e8928f2 +Author: Peter Hutterer +Date: Tue Feb 7 15:04:46 2017 +1000 + + xwayland: add tablet pad support + + Hooked up a bit differently to the other tools. Those tools can be static for + all and be re-used. The wacom driver initializes the pad with the correct + number of buttons though and we can't do this until we have the pad done event. + + If the tablet is removed and we plug a different one in, we should initialize + that correctly, so unlike the other tools the pad is properly removed and + re-initialized on plug. + + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit f471b5b8eb451b442554517c7cb6f0aa90d218c4 +Author: Carlos Garnacho +Date: Fri Nov 4 19:58:04 2016 +0100 + + xwayland: update cursor on tablet tools in proximity + + Each xwl_tablet_tool gets a xwl_cursor, as on wayland each of those + will get an independent cursor that can be set through + zwp_tablet_tool.set_cursor. + + However, all tools (and the pointer) share conceptually the same VCP + on Xwayland, so have cursor changes trigger a xwl_cursor update on + every tool (and the pointer, again). Maybe Xwayland could keep track + of the most recent device and only update that cursor to get better + visual results, but this is simpler, and it's going to be odd + anyway... + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 6d1ad39fe6c18220dd39b0653fd1e4145140e2dc +Author: Carlos Garnacho +Date: Fri Nov 4 19:36:10 2016 +0100 + + xwayland: Refactor cursor management into xwl_cursor + + This struct takes away the cursor info in xwl_seat, and has + an update function so we can share the frame handling code + across several xwl_cursors. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 773b04748d0c839bc8b12e33f74bb8d11c447f5b +Author: Peter Hutterer +Date: Tue Feb 7 12:23:46 2017 +1000 + + xwayland: handle button events after motion events + + Make sure the button events are sent after the motion events into the new + position. + + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 8a1defcc634daddbb3570519d69ec5c9e39a8b56 +Author: Jason Gerecke +Date: Fri Oct 14 14:31:46 2016 -0700 + + xwayland: Handle tablet_tool events + + Translates Wayland tablet events into corresponding X11 tablet events. As + with the prior commit, these events are modeled after those created by the + xf86-input-wacom driver to maximize compatibility with existing applications. + + Signed-off-by: Jason Gerecke + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 5812d1c28f4fb7b7de8b96a81415a21425561fd4 +Author: Jason Gerecke +Date: Fri Jan 15 17:01:38 2016 -0800 + + xwayland: Handle wp_tablet events + + Creates and maintains the canonical trio of X devices (stylus, eraser, + and cursor) to be shared by all connected tablets. A per-tablet trio + could be created instead, but there are very few benefits to such a + configuration since all tablets still ultimately share control of a + single master pointer. + + The three X devices are modeled after those created by xf86-input-wacom + but use a generic maximum X and Y that should be large enough to + accurately represent values from even the largest currently-available + tablets. + + Signed-off-by: Jason Gerecke + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 47c4415912b5b16b115135be365beb370858df76 +Author: Jason Gerecke +Date: Fri Oct 14 14:50:18 2016 -0700 + + xwayland: Listen for wp_tablet_seat events + + The wp_tablet_seat interface provides us with notifications as tablets, + tools, and pads are connected to the system. Add listener functions and + store references to the obtained devices. + + Signed-off-by: Jason Gerecke + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 7d48b758a601ce0252ebd21297a7c42263adfaaf +Author: Jason Gerecke +Date: Fri Jan 15 17:29:37 2016 -0800 + + xwayland: Bind to wp_tablet_manager if available and get its seats + + If we're notified about the existence of the wp_tablet_manager interface, + we bind to it so that we can make use of any tablets that are (or later + become) available. For each seat that exists or comes into existance at + a later point, obtain the associated tablet_seat. + + Signed-off-by: Jason Gerecke + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 89c841915ac4fba6d2a5ad0051c778f1a76ffbf3 +Author: Jason Gerecke +Date: Thu Oct 13 10:39:46 2016 -0700 + + xwayland: Depend on wayland-protocols to build tablet protocol headers + + Signed-off-by: Jason Gerecke + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Acked-by: Ping Cheng + +commit 59554eaa6c4d3d3c170a4be4fc385a86d05c5558 +Author: Adam Jackson +Date: Thu Apr 27 13:23:56 2017 -0400 + + meson: Build libvbe.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 2f1a1be46c3366a47657fe7550bc59fb99acf91c +Author: Adam Jackson +Date: Thu Apr 27 13:19:11 2017 -0400 + + meson: Build libshadowfb.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit bdce17959cd17fa6d46a1df361b53b5855ff62e8 +Author: Adam Jackson +Date: Thu Apr 27 13:15:55 2017 -0400 + + meson: Build libvgahw.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 5c7d92362b25670856091663e70d3e0dc2350efb +Author: Adam Jackson +Date: Thu Apr 27 13:10:33 2017 -0400 + + meson: Build libfbdevhw.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 6413a87bcd3bfb91ac1536b41c37af0c6e47a9b6 +Author: Adam Jackson +Date: Thu Apr 27 12:58:54 2017 -0400 + + meson: Build libwfb.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 1597297067fd14d479a2279ad1ab20082317271a +Author: Adam Jackson +Date: Thu Apr 27 12:50:13 2017 -0400 + + meson: Build libglx.so + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 47f047462dcb492203ff569a2b1528bff8cd3ff3 +Author: Adam Jackson +Date: Thu Apr 27 11:49:11 2017 -0400 + + meson: Fix linking the dmx utilities + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 5d785693a8843d18be806ea9f8caecc2dcbf1007 +Author: Adam Jackson +Date: Thu Apr 27 11:47:11 2017 -0400 + + meson: Factor out the AC_REPLACE_FUNCS stuff to its own library + + This is all just stuff we wish we had in libc, and some of this gets + used in eg. the dmx utilities build, so split it to its own library to + avoid pulling in xserver stuff. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 8659aac2ccc6649477f601908e1a4062fad8635e +Author: Adam Jackson +Date: Thu Apr 27 12:52:29 2017 -0400 + + meson: Fix a typo + + "bulid" isn't valid anything, and build_xwayland was already defined + above. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 112d0d7d01b98fb0d67910281dd1feeec125247b +Author: Karol Kosik +Date: Wed Jul 22 16:42:07 2015 -0700 + + xfree86: Improved autoconfig drivers matching + + Implementation of new drivers matching algorithm. New approach + doesn't add duplicate drivers and ease drivers matching phase. + + Signed-off-by: Karol Kosik + Reviewed-by: Aaron Plattner + Reviewed-by: Emil Velikov + +commit 1549e30372756cfdb85379fd8d93c769297ab6e6 +Author: Eric Anholt +Date: Sat Mar 11 10:24:04 2017 -0800 + + Add a Meson build system alongside autotools. + + This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest, + and Xdmx so far. The outline of Xquartz/Xwin support is in tree, but + hasn't been built yet. The unit tests are also not done. + + The intent is to build this as a complete replacement for the + autotools system, then eventually replace autotools. meson is faster + to generate the build, faster to run the bulid, shorter to write the + build files in, and less error-prone than autotools. + + v2: Fix indentation nits, move version declaration to project(), use + existing meson_options for version-config.h's vendor name/web. + + Signed-off-by: Eric Anholt + Acked-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit c7be7a688a78a34f61b90c0d95914e14b90b0cdc +Author: Eric Anholt +Date: Tue Apr 25 16:03:00 2017 -0700 + + Use #ifdef instead of #if for features to make Meson easier. + + We mostly use #ifdef throughout the tree, and this lets the generated + config.h files just be #define TOKEN instead of #define TOKEN 1. + + Reviewed-by: Peter Hutterer + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit ace6bfd5901e19045371f9bd18b997b37f55b589 +Author: Eric Anholt +Date: Tue Apr 25 16:02:59 2017 -0700 + + dix: Remove a redundant #define + + Found when the meson conversion set the symbol to defined, instead of + defined to 1. + + Reviewed-by: Peter Hutterer + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 27a6b9f7c84c914d0f5909ec1069d72f5035bc04 Author: Michel Dänzer Date: Wed Apr 26 18:31:08 2017 +0900 @@ -1971,9 +12585,114 @@ Date: Wed Apr 26 18:31:08 2017 +0900 Reviewed-by: Eric Anholt Signed-off-by: Michel Dänzer - (cherry picked from commit 27a6b9f7c84c914d0f5909ec1069d72f5035bc04) -commit e59a32c897c9f093f54ce4b695e9aff1ba20bda2 +commit 23f2f1932a1d3f36468eaf735ae34934d246567b +Author: Eric Anholt +Date: Tue Apr 25 11:33:50 2017 -0700 + + modesetting: Add the "DPI" connector type. + + The number for it was merged to drm_mode.h in kernel 4.7, and the + output_names[] array just requires that we slot in new strings in + order. + + Signed-off-by: Eric Anholt + Reviewed-by: Alex Deucher + +commit fec9607c8e0a84dc86466c638d00b502f21ec622 +Author: Eric Anholt +Date: Fri Apr 21 12:03:45 2017 -0700 + + Remove support for unaligned swaps. + + The previous misc.h code went out of its way to allow swapping of + unaligned pointers to values. However, the members of an X + request/response are always naturally aligned within the struct, and + the buffers containing a request/response will also be aligned to at + least 8 bytes, so we can just drop it. + + text data bss dec hex filename + before: 2215167 51552 132016 2398735 249a0f hw/xfree86/Xorg + after: 2214919 51552 132016 2398487 249917 hw/xfree86/Xorg + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 4552238960fc05ff885bcabbc24d1489370fbd89 +Author: Eric Anholt +Date: Tue Mar 28 13:09:30 2017 -0700 + + Add unit tests for the byte swapping macros. + + Peter noted a weirdness in my new bswap code, which could use some + tests to justify it. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + +commit 563b6ee873b898c0f3e3671cf6adaf91def5d92a +Author: Eric Anholt +Date: Mon Mar 27 14:59:06 2017 -0700 + + Rewrite the byte swapping macros. + + The clever pointer tricks were actually not working, and we were doing + the byte-by-byte moves in general. By just doing the memcpy and + obvious byte swap code, we end up generating actual byte swap + instructions, thanks to optimizing compilers. + + text data bss dec hex filename + before: 2240807 51552 132016 2424375 24fe37 hw/xfree86/Xorg + after: 2215167 51552 132016 2398735 249a0f hw/xfree86/Xorg + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 5ef4e785131bb30e774a8175099c0432537533fa +Author: Eric Anholt +Date: Fri Mar 31 17:38:27 2017 -0700 + + Remove default defines of some directories. + + The build defines these, so having the defaults is just a way for the + build system's configuration to get out of sync with the code. + + v2: Drop #ifndefs around the other two defines. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit da27ca84b4324b68037d6ec19a73b9e0a5ef10bc +Author: Eric Anholt +Date: Fri Mar 31 17:33:52 2017 -0700 + + xorg: Change __XCONFIGFILE__ to XCONFIGFILE (and DIR) to fix scan.c. + + parser/scan.c was checking for #ifdef XCONFIGFILE and XCONFIGDIR and + defaulting to "xorg.conf", and "xorg.conf.d", so if you had changed + __XCONFIGFILE__ to anything else, it would have got out of sync. + Settle on the name without gratuitous underscores. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit f81343dd2fff49c70f53e3efdd40f8f89a38e460 +Author: Alan Coopersmith +Date: Sat Apr 22 18:10:42 2017 -0700 + + Mark test_data static in Xinput protocol tests to avoid clashes + + Fixes warning from Solaris linker: + ld: warning: symbol 'test_data' has differing sizes: + (file tests-protocol-xigetselectedevents.o value=0x418; + file tests-protocol-xigetclientpointer.o value=0x18); + tests-protocol-xigetselectedevents.o definition taken + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7bfb87a2137853295ecc9e544a15626cfd773a02 Author: Olivier Fourdan Date: Fri Apr 21 09:05:51 2017 +0200 @@ -2001,9 +12720,46 @@ Date: Fri Apr 21 09:05:51 2017 +0200 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100710 Fixes: https://bugzilla.redhat.com/1412814 Reviewed-by: Eric Anholt - (cherry picked from commit 7bfb87a2137853295ecc9e544a15626cfd773a02) -commit 6a6bf1ae046124a9d8a6f3f53f02707951c85c43 +commit be80a3cb48a7860b9ed985b123f4d8a3b4ae3c89 +Author: Eric Anholt +Date: Mon Mar 27 14:21:43 2017 -0700 + + glx: Use the same endian swapping as the rest of the server. + + This dumps a ton of configure-time checks for system endian macros. + Given that we're marking the mixed-endian fixup code as cold, getting + at the system macros is a waste of code. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit dae97e1bb4d4f86db118c22dfeea0eef0d3f8bdd +Author: Eric Anholt +Date: Thu Mar 23 17:06:17 2017 -0700 + + configure: Stop checking for XdmcpWrap + + As far back as the initial import, it seems to have been exposed, and + there's no explanation why the test happened in the initial xserver + import. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit cc882af336c8963a2cba0c93e29869ef59b19818 +Author: Roman Gilg +Date: Tue Apr 11 15:52:58 2017 +0200 + + xwayland: Small comment edit + + Be more precise in describing the return value. + + Signed-off-by: Roman Gilg + Reviewed-by: Daniel Stone + Signed-off-by: Peter Hutterer + +commit 41dafcc2a2942fc4c94ce3cbafc4a1b413c460c3 Author: Michel Dänzer Date: Wed Apr 12 17:58:05 2017 +0900 @@ -2019,9 +12775,62 @@ Date: Wed Apr 12 17:58:05 2017 +0900 xf86RandR12Init12 v2") Tested-by: Mariusz Bialonczyk Reviewed-by: Alex Deucher - (cherry picked from commit 41dafcc2a2942fc4c94ce3cbafc4a1b413c460c3) -commit 74126530c0c22cf3e5f8bd2dd2740fded2df098f +commit bcee1b76aa0db8525b491485e90b8740763d7de6 +Author: Martin Peres +Date: Mon Apr 10 16:48:21 2017 +0300 + + modesetting: re-set the crtc's mode when link-status goes BAD + + Despite all the careful planning of the kernel, a link may become + insufficient to handle the currently-set mode. At this point, the + kernel should mark this particular configuration as being broken + and potentially prune the mode before setting the offending connector's + link-status to BAD and send the userspace a hotplug event. This may + happen right after a modeset or later on. + + Upon receiving a hot-plug event, we iterate through the connectors to + re-apply the currently-set mode on all the connectors that have a + link-status property set to BAD. The kernel may be able to get the + link to work by dropping to using a lower link bpp (with the same + display bpp). However, the modeset may fail if the kernel has pruned + the mode, so to make users aware of this problem a warning is outputed + in the logs to warn about having a potentially-black display. + + This patch does not modify the current behaviour of always propagating + the events to the randr clients. This allows desktop environments to + re-probe the connectors and select a new resolution based on the new + (currated) mode list if a mode disapeared. This behaviour is expected in + order to pass the Display Port compliance tests. + + Signed-off-by: Martin Peres + Reviewed-by: Eric Anholt + +commit ea91996a9c2081d0692f5c2f79a9fda9effba358 +Author: Daniel Stone +Date: Tue Apr 11 07:55:00 2017 +0100 + + README: Add link to fd.o CoC + + The Contributor Covenant applies to all fd.o-hosted resources, including + lists and Bugzilla. Add a note to the README, reminding people to act + like human beings. + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Stone + +commit 8bdf340e478524262c85fb81687d7f02b14ad71c +Author: Daniel Stone +Date: Tue Apr 11 07:54:59 2017 +0100 + + README: HTTPS everywhere + + All fd.o HTTP services are now HTTPS-only (with redirects, but still). + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Stone + +commit 14d2fe74f4e51c5b37eab4b7475c804a0340b530 Author: Adam Jackson Date: Fri Apr 7 10:24:54 2017 -0400 @@ -2034,9 +12843,24 @@ Date: Fri Apr 7 10:24:54 2017 -0400 Signed-off-by: Adam Jackson Reviewed-by: Eric Anholt - (cherry picked from commit 14d2fe74f4e51c5b37eab4b7475c804a0340b530) -commit 60ae865a703cb2c51c0b00cd768a46a20d79f0f1 +commit 7dfb9608d080b46a7b21b57dc8aa2f52670addce +Author: Adam Jackson +Date: Wed Apr 5 13:21:10 2017 -0400 + + glx: Remove enter/leave server API + + Dead code since: + + commit 8aacf47e1778d8b72811b025a82452b933d3c1f2 + Author: Adam Jackson + Date: Fri Oct 4 12:58:19 2013 -0400 + + glx: Remove DRI1 AIGLX (v2) + + Signed-off-by: Adam Jackson + +commit 0c8e6ed85810e96d84173a52d628863802a78d82 Author: Daniel Stone Date: Fri Apr 7 14:27:58 2017 +0100 @@ -2055,9 +12879,69 @@ Date: Fri Apr 7 14:27:58 2017 +0100 Reviewed-by: Adam Jackson Signed-off-by: Daniel Stone - (cherry picked from commit 0c8e6ed85810e96d84173a52d628863802a78d82) -commit df4d01e6aa957ec8eb2814832de2f78ca42ee238 +commit e4d0757fc2620fd3182448c5e4b5a55a509594d3 +Author: Adam Jackson +Date: Wed Mar 29 11:35:32 2017 -0400 + + xfree86: Remove driver entity hooks and private + + No driver is using these, as far as I know. + + v2: Tripwire the entity hook arguments to xf86Config*Entity, fix + documentation (Eric Anholt) + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 33604187674ec78b2c0bf7f67af250acc80cf23a +Author: Adam Jackson +Date: Fri Mar 24 12:30:58 2017 -0400 + + dpms: Consolidate a bunch of stuff into Xext/dpms.c + + Most of this is a legacy of the old "extmod" design where you could load + _some_ extensions dynamically but only if the server had been built with + support for them in the first place. + + Note that since we now only initialize the DPMS extension if at least + one screen supports it, we no longer need DPMSCapableFlag: if it would + be false, we would never read its value. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 7f1ef9289d974fc2bacc968ae0b5d7714382cb9e +Author: Adam Jackson +Date: Fri Mar 24 12:30:57 2017 -0400 + + dix: Lift DPMS to a screen hook + + Following on from the previous change, this adds a DPMS hook to the + ScreenRec and uses that to infer DPMS support. As a result we can drop + the dpms stub code from Xext. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 8ed0b00fceb34cdb54a0ea113c3cdff3b4c9e7e1 +Author: Adam Jackson +Date: Fri Mar 24 12:30:56 2017 -0400 + + xfree86: Clean up DPMS support + + Rather than setting up a per-screen private, just conditionally + initialize ScrnInfoRec::DPMSSet based on the config options, and inspect + that to determine whether DPMS is supported. + + We also move the "turn the screen back on at CloseScreen" logic into the + DPMS extension's (new) reset hook. This would be a behavior change for + the non-xfree86 servers, if any of them had non-stub DPMS support. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 21eda7464d0e13ac6558edaf6531c3d3251e05df Author: Tobias Stoeckmann Date: Sun Mar 12 14:21:38 2017 +0100 @@ -2071,9 +12955,168 @@ Date: Sun Mar 12 14:21:38 2017 +0100 start Xdmx again without a segmentation fault. Reviewed-by: Adam Jackson - (cherry picked from commit 21eda7464d0e13ac6558edaf6531c3d3251e05df) -commit e23000d83f8dbab4effd9f344f3d776634a1d56e +commit 5cdfcdef819efa6406807254cb3c7aba6ba5475e +Author: Matt Turner +Date: Thu Mar 23 19:37:46 2017 -0700 + + xkb: Correct type of XkbDfltAccessXOptions. + + Declared as unsigned short in xkb/xkbAccessX.c. + + Signed-off-by: Matt Turner + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f4b78286ea8d4c94a913a02a3579cbe55e8f1f6b +Author: Adam Jackson +Date: Mon Mar 20 13:08:19 2017 -0400 + + glx: Fix MakeCurrent with no drawables + + GLX_ARB_create_context, which we aspire to support, allows making GL 3.0 + or newer contexts current with null current drawables. Strictly this + might not be legal for pre-3.0 contexts, but there's no harm in allowing + it anyway. + + Signed-off-by: Adam Jackson + +commit e2e50c509718ea8c7f4684dc18f5ce66e526792b +Author: Eric Anholt +Date: Wed Mar 22 15:11:35 2017 -0700 + + xserver: Unifdef HAVE_CONFIG_H + + The X Server never generates a global config.h, and instead all these + paths are including dix-config.h or xorg-config.h. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit 266af991c8e41e62f054ac9870468a9ba2aaa9f2 +Author: Eric Anholt +Date: Wed Mar 22 15:11:34 2017 -0700 + + glamor: Fix some formatting that confused the unifdef command. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit 2da405759fbabd4b918838a0de728c1911b4a2fa +Author: Eric Anholt +Date: Wed Mar 22 15:11:33 2017 -0700 + + xserver: Check the right HAVE_*_CONFIG_H. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit 190c2adf4a237a4c0dc13d7566ca91662271d3e4 +Author: Eric Anholt +Date: Wed Mar 22 15:11:32 2017 -0700 + + kdrive: Drop kdrive-config.h. + + It had nothing left in it that was used but wasn't in dix-config.h. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit 5c7ed785e3bdb9f0fbf8fbfdc93b5fdd2b2c7dbf +Author: Eric Anholt +Date: Wed Mar 22 15:11:31 2017 -0700 + + kdrive: Remove vestiges of TSLIB support. + + The actual code was gone in 27819950e4158326e0f83a30f2e8968b932625ef, + but some checks remained. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit 1b1a8c481773e15142202a7b761d614b33f12577 +Author: Eric Anholt +Date: Wed Mar 22 15:11:30 2017 -0700 + + kdrive: Unifdef KDRIVE_EVDEV. + + ajax deleted the evdev driver in the removal of fbdev and the linux + backend. + + Reviewed-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Eric Anholt + +commit ad6689b7db0a4b0d22716acedae98462a68ea1ae +Author: Mariusz Bialonczyk +Date: Fri Mar 17 11:20:22 2017 +0100 + + configure.ac: fix checking for libdrm version after 9232835bd + + No matter what libdrm version was installed, it always set + the GLAMOR_HAS_DRM_NAME_FROM_FD_2 conditional to 1. + This obviously leads to compilation problems. + + Fixes: 9232835bd16b ("glamor: use drmGetDeviceNameFromFD2 when available") + Signed-off-by: Mariusz Bialonczyk + Reviewed-and-Tested-by: Qiang Yu + +commit eb2cf11724df5cbe0be3cce1ad4c61ba61e8ec6b +Author: Michel Dänzer +Date: Thu Mar 23 12:42:37 2017 +0900 + + Xephyr: Handle source-only pictures in ephyrPrepare/DoneComposite + + There is no pixmap associated with source-only pictures. + + Fixes Xephyr -fakexa crashing on startup. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Peter Hutterer + +commit fdc79fe72bc0b97776df2c3a664076c60e08a87c +Author: Michel Dänzer +Date: Thu Mar 9 17:34:55 2017 +0900 + + edid: Prune duplicates after adding modes from DDC + + Multiple calls to xf86EdidMonitorSet (which can be triggered e.g. by + running xrandr) would potentially keep adding the same modes, causing + the Monitor->Modes list to keep growing larger and using up more memory. + + Fix this by calling xf86PruneDuplicateModes after adding the modes + returned by xf86DDCGetModes. This makes sure there's only one instance + of each unique mode in the list. + + v2: + * Replace semicolon with {} for empty for loop (Emil Velikov) + * Slightly tweak commit log to avoid minor inaccuracy about what + xf86PruneDuplicateModes does + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99521 + Signed-off-by: Michel Dänzer + Reviewed-by: Emil Velikov + +commit 4e76c2711740b775242170d8e5ee56c7e6829cce +Author: Adam Jackson +Date: Mon Mar 20 13:42:12 2017 -0400 + + dix: Remove PRIVATE_DAMAGE + + None of this is actually wired up to anything, so we can also remove the + devPrivates from the DamageRec. The DamageExtRec is what would need + devPrivates for selinux labeling, in principle. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 40c12a76c2ae57adefd3b1d412387ebbfe2fb784 Author: Tobias Stoeckmann Date: Sun Mar 19 17:55:07 2017 +0100 @@ -2087,9 +13130,53 @@ Date: Sun Mar 19 17:55:07 2017 +0100 XRecordUnregisterClients(dpy, rc, clients, 0x40000001); Reviewed-by: Adam Jackson - (cherry picked from commit 40c12a76c2ae57adefd3b1d412387ebbfe2fb784) -commit 3166138ea681537dbe164e2888ccb96bb022220b +commit 1ad230682338a9d2fc6eca6966a5bebb007df32c +Author: Adam Jackson +Date: Mon Sep 26 13:28:42 2016 -0400 + + glamor: Avoid software fallback for planemasked ZPixmap GetImage + + Same trick as in fb: just do a normal GetImage and deal with the + planemask on the CPU if you have to. Since the software fallback hit for + glamor is pretty brutal, this is a much more impressive win for glamor + than it was for fb: + + 11100.0 87700.0 (7.901) (copy 0xaaaaaaaa) ShmGetImage 10x10 square + 9840.0 47800.0 (4.858) (copy 0xaaaaaaaa) ShmGetImage 100x100 square + 1550.0 4240.0 (2.735) (copy 0xaaaaaaaa) ShmGetImage 500x500 square + 9450.0 78900.0 (8.349) (0xaaaaaaaa) GetImage 10x10 square + 6910.0 30900.0 (4.472) (0xaaaaaaaa) GetImage 100x100 square + 431.0 2020.0 (4.687) (0xaaaaaaaa) GetImage 500x500 square + + Measured with Xephyr -glamor on Skylake GT3e. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 4aa35c46dab72bc945981f6fd29e494133bc2b0a +Author: Adam Jackson +Date: Wed Sep 28 11:18:34 2016 -0400 + + fb: Handle ZPixmap planemask in GetImage the other way around + + Formerly we'd zero the image data and then pull out a plane at a time. + It's faster to apply the planemask after the fact, since that turns the + GetImage into a memcpy: + + 100000.0 101000.0 (1.010) (copy 0xaaaaaaaa) ShmGetImage 10x10 square + 42400.0 59400.0 (1.401) (copy 0xaaaaaaaa) ShmGetImage 100x100 square + 3040.0 5280.0 (1.737) (copy 0xaaaaaaaa) ShmGetImage 500x500 square + 96100.0 95200.0 (0.991) (0xaaaaaaaa) GetImage 10x10 square + 29600.0 36800.0 (1.243) (0xaaaaaaaa) GetImage 100x100 square + 1850.0 2620.0 (1.416) (0xaaaaaaaa) GetImage 500x500 square + + Measured with Xvfb at depth 24 on Skylake i7-6560U. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 368f60d461421fe5e2bbd90652d6ac858dbff8fe Author: Kenneth Graunke Date: Fri Mar 17 13:45:04 2017 -0700 @@ -2099,9 +13186,8 @@ Date: Fri Mar 17 13:45:04 2017 -0700 Signed-off-by: Kenneth Graunke Acked-by: Eric Anholt - (cherry picked from commit 368f60d461421fe5e2bbd90652d6ac858dbff8fe) -commit 2191f9b49e5e542e39f451d1819de00043a90e8f +commit 8805a48ed35afb2ca66315656c1575ae5a01c639 Author: Olivier Fourdan Date: Fri Mar 17 15:58:26 2017 +0100 @@ -2137,9 +13223,48 @@ Date: Fri Mar 17 15:58:26 2017 +0100 Bugzilla: https://bugzilla.redhat.com/1433305 Signed-off-by: Olivier Fourdan Reviewed-by: Eric Anholt - (cherry picked from commit 8805a48ed35afb2ca66315656c1575ae5a01c639) -commit 0f3196bf805b1d36b786852096dd86be290a2c9d +commit 0803918e64262482035f042e5e1f2a571d3dea1b +Author: Adam Jackson +Date: Sat Sep 24 19:40:52 2016 -0400 + + fb: Remove 24bpp support (v3) + + v2: + - Require power-of-two bpp in ScreenInit + - Eliminate fbCreatePixmapBpp + + v3 + - Squash in the exa and glamor changes so we can remove pRotatedPixmap + in the same stroke. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit e33be78e2ab63abc84aa0baddff90bcefa9c183a +Author: Adam Jackson +Date: Fri Feb 28 13:19:00 2014 -0500 + + xfree86: Remove 24bpp pixmap format support (v2) + + There's really no reason to pretend to support this, apps hate it, all + we're doing is giving people a way to injure themselves. It doesn't work + anyway with any Radeon, any NVIDIA chip, or any Intel chip since i810. + Rip out all the logic for handling 24bpp pixmaps and framebuffers, and + silently ignore the old options that would ask for it. + + The cirrus alpine driver has been updated to default to 16bpp, and both + it and the i810 driver can now use the 32->24 conversion code in shadow + if they want. All other drivers support 32bpp. Configurations that + explicitly request 24bpp in order to fit in VRAM will be broken now + though. + + v2: Fix command line options to silently ignore 24bpp rather than fail + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 83c4297d2c4fd501a9d36bc0cb7d357a8d22394c Author: Adam Jackson Date: Fri Mar 17 12:40:03 2017 -0400 @@ -2150,9 +13275,8 @@ Date: Fri Mar 17 12:40:03 2017 -0400 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit 83c4297d2c4fd501a9d36bc0cb7d357a8d22394c) -commit c58bff7e9601b3eeb0be95c0a60c6588d051e923 +commit fe0b297420fc1de8a7fab28457d0864b3182e967 Author: Eric Anholt Date: Wed Mar 15 17:51:46 2017 -0700 @@ -2166,9 +13290,19 @@ Date: Wed Mar 15 17:51:46 2017 -0700 Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Michel Dänzer - (cherry picked from commit fe0b297420fc1de8a7fab28457d0864b3182e967) -commit 2f36c6faa0dac168cee6049d7dfac59a5e32edcd +commit 5b5ba7dc3d544868035b7088e9aac62eb2511e10 +Author: Adam Jackson +Date: Thu Mar 16 14:19:37 2017 -0400 + + Revert "sdksyms: Tighten up the symbols we add to the magic table" + + Enough people are reporting build issues pointing at this commit that + it's not worth the benefit. + + This reverts commit 3dad57b121fdf001e75fffa7e3007a9a0a154f67. + +commit e337de2d488a124e5fee0fdcb882567b68f1767d Author: Adam Jackson Date: Wed Nov 2 12:49:25 2016 -0400 @@ -2186,18 +13320,16 @@ Date: Wed Nov 2 12:49:25 2016 -0400 v4: Clamp the region to 15 bits to avoid overflow (Keith Packard) Signed-off-by: Adam Jackson - (cherry picked from commit e337de2d488a124e5fee0fdcb882567b68f1767d) -commit 8c609764004560081bad23ac14e7d3975e83ce6b +commit f1f865e909090406841a9b9416ea6259a75c2086 Author: Adam Jackson Date: Mon Jan 23 11:31:36 2017 -0500 parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL) Signed-off-by: Adam Jackson - (cherry picked from commit f1f865e909090406841a9b9416ea6259a75c2086) -commit 9db3361b29396684122b3db056368e927e8de6d6 +commit 455051a0f1d2bc84f605c325f647bd64d414c47d Author: Olivier Fourdan Date: Tue Mar 14 15:06:34 2017 +0100 @@ -2208,9 +13340,8 @@ Date: Tue Mar 14 15:06:34 2017 +0100 Bugzilla: https://bugzilla.redhat.com/1417575 Signed-off-by: Olivier Fourdan - (cherry picked from commit 455051a0f1d2bc84f605c325f647bd64d414c47d) -commit 703ba42ce658faadb3d8ad32ea03fa9c9f0c91b1 +commit 04b4bad7c048fd077fe839f10634c99ef1e488af Author: Olivier Fourdan Date: Tue Mar 14 14:58:26 2017 +0100 @@ -2232,9 +13363,8 @@ Date: Tue Mar 14 14:58:26 2017 +0100 Bugzilla: https://bugzilla.redhat.com/1417575 Signed-off-by: Olivier Fourdan - (cherry picked from commit 04b4bad7c048fd077fe839f10634c99ef1e488af) -commit 52ab10aa9a98076227e7db40fcd4b19b55a66861 +commit b0ce1d088a863492f5de11e4dbde10af4261d892 Author: Olivier Fourdan Date: Tue Mar 14 15:22:32 2017 +0100 @@ -2246,9 +13376,8 @@ Date: Tue Mar 14 15:22:32 2017 +0100 Fixes: https://bugzilla.redhat.com/1431633 Reviewed-by: Michel Dänzer Signed-off-by: Olivier Fourdan - (cherry picked from commit b0ce1d088a863492f5de11e4dbde10af4261d892) -commit 2a47e328641c061d73b3fc4602343500d18500c1 +commit f40ff18c96e02ff18a367bf53feeb4bd8ee952a0 Author: Olivier Fourdan Date: Tue Mar 14 15:22:31 2017 +0100 @@ -2287,39 +13416,38 @@ Date: Tue Mar 14 15:22:31 2017 +0100 Bugzilla: https://bugzilla.redhat.com/1431633 Reviewed-by: Michel Dänzer Signed-off-by: Olivier Fourdan - (cherry picked from commit f40ff18c96e02ff18a367bf53feeb4bd8ee952a0) -commit d88937ba8354d6a4e0be2a398037443146701ddc +commit 646bc74cded8b77d57312ae858a2ed01b0d17c21 Author: Adam Jackson -Date: Wed Mar 15 13:44:05 2017 -0400 +Date: Fri Mar 3 14:51:51 2017 -0500 - xserver 1.19.3 + test: Fix distcheck failures Signed-off-by: Adam Jackson -commit b258ed457d8f22cfba8a45b35a9be9b53fd37e1e -Author: Chris Wilson -Date: Fri Feb 17 08:18:52 2017 +0000 +commit bca221609004aecbcc8928382ad29ce319d2eb6f +Author: Jon TURNEY +Date: Mon Mar 6 17:44:19 2017 +0000 - os: Fix iteration over busfaults + xfree86: work around a sdksyms problem with gcc5 on Cygwin - Fixes a regression from + The linemarkers in the preprocessor output from gcc5 on Cygwin have + canonicalized paths to included files (e.g. xserver/build/../include/misc.h + is canonicalized to xserver/build/include/misc.h). (see gcc svn rev 210264, + which causes the transformation performed by -fcanonical-system-headers to + be applied to all include pathnames) - commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a - Author: Keith Packard - Date: Sun Nov 3 13:12:40 2013 -0800 + These canonicalized paths won't match $topdir, so sdksyms doesn't look at + the contents of those headers for sdk exported symbols. - Trap SIGBUS to handle truncated shared memory segments + Workaround this by canonicalizing all the paths we consider, using readlink. - that causes the SIGBUS handler to fail to chain up correctly and - corrupts nearby memory instead. + v2: + Keep a cache of readlink results so it isn't quite so dreadfully slow. - Signed-off-by: Chris Wilson - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit acdb5bf2de57c0080d2a6e730c788a0a428e13dc) + Reviewed-by: Adam Jackson -commit 7c4fab2f1f411b6f7d7adc76271fca7c29365ac4 +commit ac15d4cecca377c5c31ab852c39bbd554ca48fe2 Author: Tobias Stoeckmann Date: Mon Mar 13 19:13:14 2017 +0100 @@ -2334,38 +13462,29 @@ Date: Mon Mar 13 19:13:14 2017 +0100 out of boundary read later on. Validated by using ASAN. Reviewed-by: Adam Jackson - (cherry picked from commit ac15d4cecca377c5c31ab852c39bbd554ca48fe2) -commit fbb46e0be897ffe78b731a2456673b4cbb73b2be -Author: Dr.-Ing. Dieter Jurzitza -Date: Thu Feb 23 12:57:26 2017 -0500 +commit 0c1574d9882a91b2c1a046bf4ac5a9b138a37965 +Author: Michel Dänzer +Date: Thu Mar 9 18:13:31 2017 +0900 - glamor: Fix missing declaration in dash vertex shader + glamor: Fix typo: "vec2_pos" -> "vec2 pos" - Fixes a GLSL compilation error: + Fixes crash when trying to use dashed lines: - Failed to compile VS: 0:13(43): error: `pos' undeclared - 0:13(14): error: operands to arithmetic operators must be numeric - 0:13(13): error: operands to arithmetic operators must be numeric + Failed to compile VS: 0:8(2): error: `vec2_pos' undeclared - [1.19: Squash in Michel's typo fix from 0c1574d9] + Trivial. - Tested-by: Stefan Dirsch - Reviewed-by: Adam Jackson - (cherry picked from commit d8161aeb50891ae10c5656487ce8f982deed5f9f) - (cherry picked from commit 0c1574d9882a91b2c1a046bf4ac5a9b138a37965) + Fixes: d8161aeb5089 ("glamor: Fix missing declaration in dash vertex + shader") + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99943 -commit 18fcb66688057f5676952e2535d4bb9942371199 +commit 937527f9798d573ec82c2c508821899c229c018f Author: Olivier Fourdan -Date: Thu Mar 2 10:19:26 2017 +0100 +Date: Wed Mar 8 10:32:22 2017 +0100 xwayland: Monitor client states to destroy callbacks - In XWayland, dri3_send_open_reply() is called from a sync callback, so - there is a possibility that the client might be gone when we get to the - callback eventually, which leads to a crash in _XSERVTransSendFd() from - WriteFdToClient() . - Client resources can survive the client itself, in which case we may end up in our sync callback trying to access client's data after it's been freed/reclaimed. @@ -2373,14 +13492,42 @@ Date: Thu Mar 2 10:19:26 2017 +0100 Add a ClientStateCallback handler to monitor the client state changes and clear the sync callback set up by the glamor drm code if any. - Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1416553 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100040 Tested-by: Mark B Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer - (cherry picked from commit 937527f9798d573ec82c2c508821899c229c018f) -commit d402b86b4561eb2580421de91d977a35abe88190 +commit 669eb0a65430678fe97de9405e4e42dcb4417ed2 +Author: Jon Turney +Date: Wed Mar 8 23:46:27 2017 +0000 + + test: Use correct signature for XISetEventMask wrapper + + This looks like it's always been wrong, but didn't matter before the single + test binary changes as the wrapper was only in place for tests which didn't + care about it's effects, so didn't forward to the real implementation. (see + the changes to protocol-xiselectevents.c in 773fc07e) + + This fixes the protocol_xigetselectedevents_test for me. I'm a bit + surprised that passes for anyone at the moment. + + Signed-off-by: Jon Turney + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 9232835bd16b6948442f7a4588fb9376782cb814 +Author: Qiang Yu +Date: Tue Mar 7 11:53:23 2017 +0800 + + glamor: use drmGetDeviceNameFromFD2 when available + + This is for glamor can support fd from DRM render node which is useful + for a render only DDX. + + Reviewed-by: Adam Jackson + Signed-off-by: Qiang Yu + +commit d4b7e0eaa4b2e97ce1dec653a2ae7d9621fe1431 Author: Olivier Fourdan Date: Tue Mar 7 10:28:35 2017 +0100 @@ -2399,67 +13546,29 @@ Date: Tue Mar 7 10:28:35 2017 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Pekka Paalanen Reviewed-by: Rui Matos - (cherry picked from commit d4b7e0eaa4b2e97ce1dec653a2ae7d9621fe1431) -commit db1326cd6625747e4036e6cdc75bc7a0e1b0426b -Author: Qiang Yu -Date: Thu Jan 26 18:13:53 2017 +0800 +commit 64ca14b85e45b13628396f21d1903e311f92a9e1 +Author: Olivier Fourdan +Date: Thu Mar 2 10:19:26 2017 +0100 - present: disable page flip only when a slave crtc is active + xwayland: make sure client is not gone in sync callback - This prevents the tearing of moving window in a composite WM - desktop when output slave is attached but none of its crtc is - really active. + in XWayland, dri3_send_open_reply() is called from a sync callback, so + there is a possibility that the client might be gone when we get to the + callback eventually, which leads to a crash in _XSERVTransSendFd() from + WriteFdToClient() . - [1.19: Also fix DMX_LIBS= in configure.ac so it still links - ajax] + Check if clientGone has been set in the sync callback handler to avoid + this. - Signed-off-by: Qiang Yu - Reviewed-by: Michel Dänzer - (cherry picked from commit bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5) - -commit 1097bc9c184db4c722d5a8d2c5a4c0da9cdc70f5 -Author: Chris Wilson -Date: Thu Mar 9 11:25:34 2017 +0000 - - Revert "prime: Sync shared pixmap from root window instead of screen pixmap" - - This reverts commit b5b292896f647c85f03f53b20b2f03c0e94de428. - - This breaks the concept of the screen->pixmap_dirty_list as it no longer - tracks the relationship between the PixmapDirtyUpdate src and slave_dst, - for the supposed convenience of not tracking present flips. - - Bugzilla: https://bugs.freedesktop.org/100086 + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99149 + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100040 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1416553 Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + Tested-by: Mark B -commit 0ec92f06d4b3bad2e62da24ee7fb64fc88a75820 -Author: Adam Jackson -Date: Fri Mar 10 10:54:17 2017 -0500 - - Revert "present: Allow flipping with PRIME slave outputs" - - This reverts commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9. - - Bugzilla: https://bugs.freedesktop.org/100086 - Reviewed-by: Adam Jackson - -commit f23e65f96365706c69fa781b2c6cbf3203619c9f -Author: Adam Jackson -Date: Thu Mar 2 17:53:04 2017 -0500 - - xserver 1.19.2, no, really - - Signed-off-by: Adam Jackson - -commit 96d4df934bb4397a251d7d1f2dc0e1296c2e9bb3 -Author: Adam Jackson -Date: Thu Mar 2 15:07:00 2017 -0500 - - xserver 1.19.2 - - Signed-off-by: Adam Jackson - -commit f4ff7b6b559c3ebf7ec1156d170b3daa0618eec2 +commit 5c44169caed811e59a65ba346de1cadb46d266ec Author: Adam Jackson Date: Thu Mar 2 17:20:30 2017 -0500 @@ -2469,28 +13578,59 @@ Date: Thu Mar 2 17:20:30 2017 -0500 timingsafe_memcmp(const void *b1, const void *b2, size_t len) Signed-off-by: Adam Jackson - (cherry picked from commit 5c44169caed811e59a65ba346de1cadb46d266ec) -commit 1aa40b96e2f099eabfeef66e77fff36dbd377aa0 +commit 0d7f05ed99b71a4641415c9f26e245c3bb24a9a0 Author: Adam Jackson -Date: Thu Mar 2 15:43:15 2017 -0500 +Date: Wed Mar 1 16:13:59 2017 -0500 - Revert "xserver 1.19.2" + miarc: "Cache" arc span data for dashed arcs - Apparently I need to fight make distcheck some more, so let's not - pretend this is released yet. + This avoids recomputing the span data for every dash. x11perf thinks + this is a pretty modest speedup: - This reverts commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211. - -commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211 -Author: Adam Jackson -Date: Thu Mar 2 15:07:00 2017 -0500 - - xserver 1.19.2 + 832919.4 840471.1 ( 1.009) 100-pixel dashed ellipse + 672353.1 680652.2 ( 1.012) 100-pixel double-dashed ellipse + 13748.9 24287.9 ( 1.767) 100-pixel wide dashed ellipse + 9236.3 21298.2 ( 2.306) 100-pixel wide double-dashed ellipse + But part of the reason it's so modest there is that the arcs are + relatively small (100 pixel diameter at line width 10, so ~6000 pixels) + and the dashes relatively large (30 on 20 off so ~6 dashes per + quadrant). + + With larger arcs and finer dashes this is much more impressive. A fairly + trivial testcase of a single 15000x13000 arc with the default {2, 2} + dash pattern drops from ~3500 milliseconds to 10 milliseconds. + + Reviewed-by: Keith Packard Signed-off-by: Adam Jackson -commit e4dd73b242522942d9a5f1c9cada92321710a682 +commit 849c825855b82caf44d25edb8155bc9f17869256 +Author: Adam Jackson +Date: Wed Mar 1 16:13:58 2017 -0500 + + miarc: Make the caller free the arc span data + + drawArc does some fairly expensive computation, but it's only sensitive + to arc width/height. Thread the span data up through the call chain so + it's at least possible for the caller to cache things. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 9426c5500b72e1fe004fef4c3b259023c4ec49f7 +Author: Adam Jackson +Date: Wed Mar 1 16:13:57 2017 -0500 + + miarc: Style cleanup for miWideArc + + Outdent, normalize comment formatting, and use 'goto out' idiom for + error paths. No functional change. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit fe5c340046c8cf755b92763a49b2dc475e856a76 Author: Olivier Fourdan Date: Wed Mar 1 08:51:31 2017 +0100 @@ -2513,9 +13653,86 @@ Date: Wed Mar 1 08:51:31 2017 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit fe5c340046c8cf755b92763a49b2dc475e856a76) -commit c84f5c3dd19ae114da4eb3441b3e4e3a29f195df +commit 27819950e4158326e0f83a30f2e8968b932625ef +Author: Adam Jackson +Date: Thu Feb 16 12:46:23 2017 -0500 + + kdrive: Remove now-unused linux backend + + With Xfbdev gone this has no consumers. + + Signed-off-by: Adam Jackson + Acked-by: Alex Deucher + +commit feed7e3f982a7ac14f6fe85ed2e1ec4a83700841 +Author: Adam Jackson +Date: Thu Feb 16 12:46:22 2017 -0500 + + xfbdev: Remove + + With the shadow framebuffer overallocation bug fixed (ref below), Xorg + + fbdev has tens to hundreds of kilobytes more baseline memory usage than + Xfbdev. That's not nothing, but it's little enough that we should focus + our efforts on the server that actually gets development attention. + + https://cgit.freedesktop.org/xorg/driver/xf86-video-fbdev/commit/?id=2c5eba8 + + Signed-off-by: Adam Jackson + Acked-by: Alex Deucher + +commit 35fbcb3f9987758bc26a87d5d7c033f4367cbd39 +Author: Adam Jackson +Date: Thu Feb 16 12:46:21 2017 -0500 + + xfake: Remove + + We already have Xvfb for a dummy DDX. + + Signed-off-by: Adam Jackson + Acked-by: Alex Deucher + +commit 3dad57b121fdf001e75fffa7e3007a9a0a154f67 +Author: Adam Jackson +Date: Thu Feb 16 14:00:03 2017 -0500 + + sdksyms: Tighten up the symbols we add to the magic table + + The code as written would match anything declared extern. _X_EXPORT is + what we really mean here. That's a macro, so check for what it expands + to and skip if not found. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e +Author: Matthieu Herrb +Date: Wed Mar 1 20:28:34 2017 +0100 + + Brown bag commit to fix 957e8d (arc4random_buf() support) + + - typo in #ifdef check + - also need to add AC_CHECK_FUNCS([arc4random_buf]) + + Reported-by Eric Engestrom. Thanks + + Reviewed-by: Adam Jackson + Signed-off-by: Matthieu Herrb + +commit dc7ceda90fdedb2212f105095fe8d449bfdb0eb4 +Author: Adam Jackson +Date: Thu Feb 16 14:56:45 2017 -0500 + + dispatch: Mark swapped dispatch as _X_COLD + + This touches everything that ends up in the Xorg binary; the big missing + part is GLX since that's all generated code. Cuts about 14k from the + binary on amd64. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 8c9909a99292b2fb4a86de694bb0029f61e35662 Author: Olivier Fourdan Date: Tue Feb 28 14:27:52 2017 +0100 @@ -2536,24 +13753,18 @@ Date: Tue Feb 28 14:27:52 2017 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 8c9909a99292b2fb4a86de694bb0029f61e35662) -commit 94c3454d9fdbcefb01042c5c9d88468d86dd4725 -Author: Matthieu Herrb -Date: Wed Mar 1 20:28:34 2017 +0100 +commit c9cbdada755f1d00d164bef7833f1aef139ffeb0 +Author: Adam Jackson +Date: Mon Feb 20 10:24:14 2017 -0500 - Brown bag commit to fix 957e8d (arc4random_buf() support) + vfb: Bump default depth to 24 - - typo in #ifdef check - - also need to add AC_CHECK_FUNCS([arc4random_buf]) - - Reported-by Eric Engestrom. Thanks - - Reviewed-by: Adam Jackson - Signed-off-by: Matthieu Herrb - (cherry picked from commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e) + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + Reviewed-by: Eric Anholt -commit b0298c02f0383760be899448fa666d0ea56f5d79 +commit 2855f759b1e7bf7f5e57cac36c1f0d0e5ac1a683 Author: Matthieu Herrb Date: Tue Feb 28 19:18:56 2017 +0100 @@ -2565,9 +13776,8 @@ Date: Tue Feb 28 19:18:56 2017 +0100 Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith - (cherry picked from commit 2855f759b1e7bf7f5e57cac36c1f0d0e5ac1a683) -commit ab15f65fe5d6d50e705c1064a6a5c1a0c2a8e045 +commit 957e8db38f27932d353e86e9aa69cf16778b18f1 Author: Matthieu Herrb Date: Tue Feb 28 19:18:43 2017 +0100 @@ -2575,9 +13785,8 @@ Date: Tue Feb 28 19:18:43 2017 +0100 Reviewed-by: Adam Jackson Signed-off-by: Matthieu Herrb - (cherry picked from commit 957e8db38f27932d353e86e9aa69cf16778b18f1) -commit 3f61c7a09b220805ee6778f4bf2f429e3df8e37a +commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c Author: Matthieu Herrb Date: Tue Feb 28 19:18:25 2017 +0100 @@ -2587,9 +13796,8 @@ Date: Tue Feb 28 19:18:25 2017 +0100 Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith - (cherry picked from commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c) -commit b5c98aa6779b97882246b03c5dea646bd1355991 +commit 1b12249fd6d4d3b566043d556503f3f625b9b4ba Author: Peter Hutterer Date: Thu Feb 23 10:21:49 2017 +1000 @@ -2601,115 +13809,411 @@ Date: Thu Feb 23 10:21:49 2017 +1000 Signed-off-by: Peter Hutterer Tested-by: Olivier Fourdan Reviewed-by: Olivier Fourdan - (cherry picked from commit 1b12249fd6d4d3b566043d556503f3f625b9b4ba) -commit 04c72d3c30623e360fd0bd37ed559915b93467f4 -Author: Michel Dänzer -Date: Tue Feb 7 17:38:23 2017 +0900 +commit 7d7788e0f2fbbf5d05cb918df11a5e1b7e047e48 +Author: Olivier Fourdan +Date: Fri Feb 17 09:16:24 2017 +0100 - damage: Validate source pictures bound to windows before unwrapping + Revert "xwayland: bump wayland-protocols version to 1.7" - The lower layers also do this, but no damage may be reported there, - since we unwrap before calling down. + This reverts commit 371ff0c969a38a0013688391bbd7375bc7b6f933. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220 - Signed-off-by: Michel Dänzer - Reviewed-by: Alex Deucher - (cherry picked from commit 38696ea56854e055c31bd2730adfc7c39aa115b0) + Reviewed-by: Adam Jackson -commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9 -Author: Michel Dänzer -Date: Wed Feb 1 18:35:57 2017 +0900 +commit 9f4d308cdad957a354912f17febe5bcad7f44812 +Author: Pekka Paalanen +Date: Wed Nov 23 13:30:53 2016 +0200 - present: Allow flipping with PRIME slave outputs + xwayland: use _XWAYLAND_ALLOW_COMMITS property - Works fine now. + The X11 window manager (XWM) of a Wayland compositor can use the + _XWAYLAND_ALLOW_COMMITS property to control when Xwayland sends + wl_surface.commit requests. If the property is not set, the behaviour + remains what it was. + + XWM uses the property to inhibit commits until the window is ready to be + shown. This gives XWM time to set up the window decorations and internal + state before Xwayland does the first commit. XWM can use this to ensure + the first commit carries fully drawn decorations and the window + management state is correct when the window becomes visible. + + Setting the property to zero inhibits further commits, and setting it to + non-zero allows commits. Deleting the property allows commits. + + When the property is changed from zero to non-zero, there will be a + commit on next block_handler() call provided that some damage has been + recorded. + + Without this patch (i.e. with the old behaviour) Xwayland can and will + commit the surface very soon as the application window has been realized + and drawn into. This races with XWM and may cause visible glitches. + + v3: + - introduced a simple setter for xwl_window::allow_commits + - split xwl_window_property_allow_commits() out of + xwl_property_callback() + - check MakeAtom(_XWAYLAND_ALLOW_COMMITS) + + v2: + - use PropertyStateCallback instead of XACE, based on the patch + "xwayland: Track per-window support for netwm frame sync" by + Adam Jackson + - check property type is XA_CARDINAL + - drop a useless memcpy() + + Weston Bug: https://phabricator.freedesktop.org/T7622 + Reviewed-by: Adam Jackson + Signed-off-by: Pekka Paalanen + +commit a6308cea602f688ac653e3466cd57767e02093a9 +Author: Pekka Paalanen +Date: Thu Nov 24 11:54:44 2016 +0200 + + xwayland: fix 'buffer' may be used uninitialized warning + + Fix the following warning due to --disable-glamor: + + CC Xwayland-xwayland.o + In file included from /home/pq/local/include/wayland-client.h:40:0, + from xwayland.h:35, + from xwayland.c:26: + xwayland.c: In function ‘block_handler’: + /home/pq/local/include/wayland-client-protocol.h:3446:2: warning: ‘buffer’ may be used uninitialized in this function [-Wmaybe-uninitialized] + wl_proxy_marshal((struct wl_proxy *) wl_surface, + ^ + xwayland.c:466:23: note: ‘buffer’ was declared here + struct wl_buffer *buffer; + ^ + + Signed-off-by: Pekka Paalanen + Reviewed-by: Olivier Fourdan + +commit f7b8560f23ac5582e2f97dc9f6de32a42e61e520 +Author: Pekka Paalanen +Date: Thu Nov 24 11:45:25 2016 +0200 + + xwayland: refactor into xwl_window_post_damage() + + Refactor xwl_screen_post_damage() and split the window specific code + into a new function xwl_window_post_damage(). + + This is a pure refactoring, there are no behavioral changes. An assert + is added to xwl_window_post_damage() to ensure frame callbacks are not + leaked if a future patch changes the call. + + Signed-off-by: Pekka Paalanen + Reviewed-by: Olivier Fourdan + +commit 8e3f9ce6c06e7605832c55dfd180396f66ec8b66 +Author: Adam Jackson +Date: Sat Jul 12 12:45:23 2014 -0400 + + dix: Add a callback chain for window property state change + + This will be used by in-server features that need to react to property + changes. The first one will be _XWAYLAND_ALLOW_COMMITS. + + Signed-off-by: Adam Jackson + [Pekka: add commit message body] + Signed-off-by: Pekka Paalanen + +commit 50bcea8be337ea983e464f2b5b8b2dc6d1024532 +Author: Adam Jackson +Date: Sat Jul 12 12:39:21 2014 -0400 + + dix: Pass the whole property into deliverPropertyNotifyEvent + + Instead of just the atom. No functional change. + + Signed-off-by: Adam Jackson + Signed-off-by: Pekka Paalanen + +commit fde5cd78488f3370c92397868ca78929296f7ad1 +Author: Mihail Konev +Date: Tue Jan 31 20:16:35 2017 +0500 + + tests: Fix guards for ld -wrap + + Fixes XQuartz build. + + Regressed-in: 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit d8161aeb50891ae10c5656487ce8f982deed5f9f +Author: Dr.-Ing. Dieter Jurzitza +Date: Thu Feb 23 12:57:26 2017 -0500 + + glamor: Fix missing declaration in dash vertex shader + + Fixes a GLSL compilation error: + + Failed to compile VS: 0:13(43): error: `pos' undeclared + 0:13(14): error: operands to arithmetic operators must be numeric + 0:13(13): error: operands to arithmetic operators must be numeric + + Tested-by: Stefan Dirsch + Reviewed-by: Adam Jackson + +commit acdb5bf2de57c0080d2a6e730c788a0a428e13dc +Author: Chris Wilson +Date: Fri Feb 17 08:18:52 2017 +0000 + + os: Fix iteration over busfaults + + Fixes a regression from + + commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a + Author: Keith Packard + Date: Sun Nov 3 13:12:40 2013 -0800 + + Trap SIGBUS to handle truncated shared memory segments + + that causes the SIGBUS handler to fail to chain up correctly and + corrupts nearby memory instead. + + Signed-off-by: Chris Wilson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit dcb63deb1b6337781943a7bea5bb2b04c6d76b55 +Author: Chris Wilson +Date: Wed Feb 22 14:56:28 2017 +0000 + + inputthread: Initialise inputThreadInfo->changed before use + + ==8734== Thread 2 InputThread: + ==8734== Conditional jump or move depends on uninitialised value(s) + ==8734== at 0x2FDB05: InputThreadDoWork (inputthread.c:333) + ==8734== by 0x6924423: start_thread (pthread_create.c:333) + ==8734== by 0x6C229BE: clone (clone.S:105) + + Signed-off-by: Chris Wilson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 23d85c54421ebdd12460566918fcb7f309d2ee30 +Author: Olivier Fourdan +Date: Fri Feb 17 14:13:51 2017 +0100 + + os: remove unused define MAX_TIMES_PER + + Remove leftover from commit e10ba9e, MAX_TIMES_PER is not used anymore. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 8b170c4447868c8d4656cf2143f009db20885f3a +Author: Adam Jackson +Date: Thu Feb 16 13:00:24 2017 -0500 + + mi: Add include guards to migc.h Reviewed-by: Alex Deucher - Signed-off-by: Michel Dänzer - (cherry picked from commit 542d9f6807ac06b70f564ccab10af69fa21a1221) + Signed-off-by: Adam Jackson -commit 10f8cf3572297764c6b50ac1f01b3ee195b1a453 -Author: Michel Dänzer -Date: Wed Feb 1 18:35:56 2017 +0900 +commit e161853f380a0b176c81284024066cb2776136c3 +Author: Adam Jackson +Date: Thu Feb 16 13:00:24 2017 -0500 - prime: Sync shared pixmap from root window instead of screen pixmap + fb: Remove stray references to fbHasVisualTypes - The screen pixmap doesn't receive updates while there's a Present flip - window. - - [1.19: Squashed in a6566f9e to avoid intermediate regression - ajax] + Removed in 84e8de12. Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 4c7d229582a97e07014091909745ac7dc4d5e93e +Author: Adam Jackson +Date: Thu Feb 16 13:00:24 2017 -0500 + + fb: Remove unused fbGetFreeCompClip macro + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 706e6d9cd074da606016ed4ecff51e9c2a822087 +Author: Adam Jackson +Date: Thu Feb 16 13:00:24 2017 -0500 + + wfb: Hide init function decls behind FB_ACCESS_WRAPPER + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 790c1c0b10968776440a962e1fc6d1d3157b1559 +Author: Adam Jackson +Date: Thu Feb 16 13:00:24 2017 -0500 + + wfb: Add missing rename for fbGlyphs + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit a6566f9e4dbf9ea9568a14e22cb5d004e10dbd4d +Author: Michel Dänzer +Date: Thu Feb 16 16:13:56 2017 +0900 + + prime: Clear PixmapDirtyUpdateRec::damage when it's destroyed + + The root window, and by extension any damage records referencing it, + may be destroyed before shared pixmaps referencing it, which resulted in + use-after-free / double-free in PixmapStopDirtyTracking. + + Fixes: b5b292896f64 ("prime: Sync shared pixmap from root window instead of screen pixmap") Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer - (cherry picked from commit b5b292896f647c85f03f53b20b2f03c0e94de428) - (cherry picked from commit a6566f9e4dbf9ea9568a14e22cb5d004e10dbd4d) -commit e2243e5b805df387cb3881b2298bffaac4f02942 +commit 371ff0c969a38a0013688391bbd7375bc7b6f933 Author: Olivier Fourdan -Date: Tue Jan 24 18:08:30 2017 +0100 +Date: Thu Feb 16 10:43:06 2017 +0100 - glamor: Two pass won't work on memory pixmaps + xwayland: bump wayland-protocols version to 1.7 - When selecting "CA_TWO_PASS" in glamor_composite_clipped_region() when - the hardware does not support "GL_ARB_blend_func_extended", we call - glamor_composite_choose_shader() twice in a row, which in turn calls - glamor_pixmap_ensure_fbo(). + Xwayland support for pointer locking in confinement requires + wayland-protocols version 1.7 or later. - On memory pixmaps, the first call will set the FBO and the second one - will fail an assertion in glamor_upload_picture_to_texture() because - the FBO is already set. + Update the required version in configure.ac to match the minimal + required version of wayland-protocols. - Bail out earlier when the mask pixmap is in memory and the hardware - capabilities would require to use two pass, so that the assertion is not - failed and the rendering is correct. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99346 - Signed-off-by: Olivier Fourdan - Reviewed-by: Eric Anholt - (cherry picked from commit 86463981361064dd0352ec215abf1696ce7fc5ea) - -commit ada5328290f444e3fc0e6a05557d5963dec626e5 -Author: Svitozar Cherepii -Date: Fri Feb 3 01:49:04 2017 +0200 - - xwayland: Add hack for FWXGA resolution #99574 - - For some applications (like fullscreen games) it matters for XRandr - resolution to be correctly set and equal to root window resolution. - - In XServer there is already hack for this, adapted it for XWayland. - - Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574 - - Signed-off-by: Svitozar Cherepii - Tested-by: Svitozar Cherepii - Acked-by: Olivier Fourdan - (cherry picked from commit 1c78bec9ca3cd1975a38bf5ebdba7dea65b309ab) - -commit abf3bc68db579eb524c2eb5786daa5a00957a2f8 -Author: Olivier Fourdan -Date: Tue Feb 7 15:31:22 2017 +0100 - - xwayland: CRTC should support all rotations - - If the Wayland compositor sets a rotation on the output, Xwayland - translates the transformation as an xrandr rotation for the given - output. - - However, if the rotation is not supported by the CRTC, this is not - a valid setup and xrandr queries will fail. - - Pretend we support all rotations and reflections so that the - configuration remains a valid xrandr setup. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 - Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson - (cherry picked from commit afeace27d3818274b75d59375771dc964d2f56bb) + Signed-off-by: Olivier Fourdan -commit fd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df +commit 5d29b493666f728eccd8dd91992ea020bd4be9f9 +Author: Adam Jackson +Date: Tue Feb 14 15:30:56 2017 -0500 + + xfree86: Reorganize the reserved ScrnInfoRec slots + + First, move them to the end of the struct, for marginally better cache + locality for the struct members that actually have meaning; move the + existing slots at the end of the struct up near some others with similar + meanings. Second, only keep four slots each of integer, data pointer, + and function pointer; we've rarely used this escape hatch so this is + still plenty. + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 47db92473f7da2b7d6775ff681ec747009f8cf3f +Author: Adam Jackson +Date: Tue Feb 14 15:30:55 2017 -0500 + + xfree86: Remove unused chipID/Rev from ScrnInfoRec + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 4dcf68e41857cdf78387a6232160cba5cb467fb0 +Author: Adam Jackson +Date: Tue Feb 14 15:30:54 2017 -0500 + + xfree86: Remove memClk from ScrnInfoRec + + Never set by the core, not used in any modern driver. + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 0b6f2806029493afa246b4472ee88fc173976c5a +Author: Adam Jackson +Date: Tue Feb 14 15:30:53 2017 -0500 + + xfree86: Remove Option "BiosBase" (v2) + + Just no. + + The ddxDesign chunk removes the whole para about xf86FixPciResource, + since it turns out that function doesn't exist at all anymore. + + The only drivers that reference this at all are i128 and mga, and even + then only in the non-pciaccess path. + + v2: + - Update commentary about i128/mga + - Don't remove the BiosBase keyword from the config parser since that + would turn a no-op into a fatal error (Aaron Plattner) + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 76ef102be3b47d23ebfaaaa04fb5cfc0511d43f1 +Author: Adam Jackson +Date: Tue Feb 14 15:30:52 2017 -0500 + + xfree86: Drop virtualFrom from ScrnInfoRec + + Seriously not worth the effort of tracking this, especially now that + competent drivers don't have a limit. The sis driver does inspect this + member, but hilariously does so only so it can print the same information + as the core does. + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 5a945f54e738f6e9c5a489febdd8b87cd8a41210 +Author: Adam Jackson +Date: Tue Feb 14 15:30:51 2017 -0500 + + xfree86: Remove max[HV]Value from ScrnInfoRec + + Only mach64 and rendition actually use this feature. Everyone else just + checks it in their ValidMode hook, they can too. + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 3e1a23281dd64ee7457f36208cac77c01846a28f +Author: Adam Jackson +Date: Tue Feb 14 15:30:50 2017 -0500 + + xfree86: Fix a comment about ScrnInfoRec + + We don't actually need (or intend) to keep this struct the same across + revisions. + + Reviewed-by: Alex Deucher + Reviewed-by: Aaron Plattner + Acked-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 4c00609c370dab130b69207cb2684c2b92bd3084 +Author: Alan Coopersmith +Date: Sun Feb 12 09:35:21 2017 -0800 + + DetermineClientCmd: try using /proc/pid/cmdline on Solaris too + + Solaris 11.3.5 introduced support for /proc/pid/cmdline, so try it + first, and if we can't open it, then fallback to /proc/pid/psinfo + as we did before. + + Reviewed-by: Adam Jackson + Signed-off-by: Alan Coopersmith + +commit 3f9507ed2f7246b2c8cf2bbc430cc99c5f35c92a +Author: Adam Jackson +Date: Thu Feb 9 13:53:41 2017 -0500 + + xfree86: Bump video ABI to 24.0 + + c02f6a68 changed the layout of xf86CrtcFuncs. + + Signed-off-by: Adam Jackson + +commit 058809c43ec578a407cf40d4c3e54a42503e3562 Author: Olivier Fourdan Date: Wed Feb 8 09:23:20 2017 +0100 @@ -2738,25 +14242,206 @@ Date: Wed Feb 8 09:23:20 2017 +0100 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson - (cherry picked from commit 058809c43ec578a407cf40d4c3e54a42503e3562) -commit 9a9c6af22e0f0136b11d7c19ce06c48e720a9ca4 +commit afeace27d3818274b75d59375771dc964d2f56bb +Author: Olivier Fourdan +Date: Tue Feb 7 15:31:22 2017 +0100 + + xwayland: CRTC should support all rotations + + If the Wayland compositor sets a rotation on the output, Xwayland + translates the transformation as an xrandr rotation for the given + output. + + However, if the rotation is not supported by the CRTC, this is not + a valid setup and xrandr queries will fail. + + Pretend we support all rotations and reflections so that the + configuration remains a valid xrandr setup. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + +commit 38696ea56854e055c31bd2730adfc7c39aa115b0 +Author: Michel Dänzer +Date: Tue Feb 7 17:38:23 2017 +0900 + + damage: Validate source pictures bound to windows before unwrapping + + The lower layers also do this, but no damage may be reported there, + since we unwrap before calling down. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220 + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 1c78bec9ca3cd1975a38bf5ebdba7dea65b309ab +Author: Svitozar Cherepii +Date: Fri Feb 3 01:49:04 2017 +0200 + + xwayland: Add hack for FWXGA resolution #99574 + + For some applications (like fullscreen games) it matters for XRandr + resolution to be correctly set and equal to root window resolution. + + In XServer there is already hack for this, adapted it for XWayland. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574 + + Signed-off-by: Svitozar Cherepii + Tested-by: Svitozar Cherepii + Acked-by: Olivier Fourdan + +commit 542d9f6807ac06b70f564ccab10af69fa21a1221 +Author: Michel Dänzer +Date: Wed Feb 1 18:35:57 2017 +0900 + + present: Allow flipping with PRIME slave outputs + + Works fine now. + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit b5b292896f647c85f03f53b20b2f03c0e94de428 +Author: Michel Dänzer +Date: Wed Feb 1 18:35:56 2017 +0900 + + prime: Sync shared pixmap from root window instead of screen pixmap + + The screen pixmap doesn't receive updates while there's a Present flip + window. + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + +commit eb04b20160d706d4e0e67122d0adb1e723c0da92 +Author: Michael Thayer +Date: Fri Sep 30 15:18:45 2016 +0200 + + modesetting: allow switching from software to hardware cursors (v5). + + Currently if modesetting ever fails to set a hardware cursor it will switch + to using a software cursor and never go back. Change this to only + permanently switch to a software cursor if -ENXIO is returned (which means + hardware cursors not supported), and to otherwise still try a hardware + cursor first every time a new one is set. This is needed because hardware + may be able to handle some cursors in hardware and others not, or virtual + hardware may be able to handle hardware cursors at some times and not + others. + + Changes since v1, v2 and v3: + * take into account the switch to load_cursor_argb_check + * keep the permanent software cursor fall-back if -ENXIO is returned + * move parts of v3 into separate patches + + Reviewed-by: Adam Jackson + Signed-off-by: Michael Thayer + +commit ecd0a62323f26b333c49bddd7237dd5118482a35 +Author: Michael Thayer +Date: Fri Sep 30 08:02:09 2016 +0200 + + modesetting: Immediately handle failure to set HW cursor, v5 + + Based on v4 by Alexandre Courbot + + There is currently no reliable way to report failure to set a HW + cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM + ioctl fails (which currently happens at least with modesetting on Tegra + for format incompatibility reasons). + + As failures are currently handled by setting the HW cursor size to + (0,0), the fallback to SW cursor will not happen until the next time the + cursor changes and xf86CursorSetCursor() is called again. In the + meantime, the cursor will be invisible to the user. + + This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and + _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. + This allows to propagate errors up to xf86CursorSetCursor(), which can + then fall back to using the SW cursor immediately. + + v5: + - Removed parts of patch already committed as part of 14c21ea1. + - Adjusted code slightly to match surrounding code. + - Effectively reverted af916477 which is made unnecessary by this patch. + + Reviewed-by: Adam Jackson + Signed-off-by: Michael Thayer + +commit c02f6a687c3d6bd0727322b055ee788f8fefa005 +Author: Michael Thayer +Date: Thu Sep 29 20:23:12 2016 +0200 + + xfree86: Immediately handle failure to set HW cursor, v5 + + Based on v4 by Alexandre Courbot + + There is currently no reliable way to report failure to set a HW + cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM + ioctl fails (which currently happens at least with modesetting on Tegra + for format incompatibility reasons). + + As failures are currently handled by setting the HW cursor size to + (0,0), the fallback to SW cursor will not happen until the next time the + cursor changes and xf86CursorSetCursor() is called again. In the + meantime, the cursor will be invisible to the user. + + This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and + _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. + This allows to propagate errors up to xf86CursorSetCursor(), which can + then fall back to using the SW cursor immediately. + + v5: Updated the patch to apply to current git HEAD, split up into two + patches (server and modesetting driver) and adjusted the code slightly + to match surrounding code. I also removed the new exported function + ShowCursorCheck(), as instead just changing ShowCursor() to return Bool + should not affect its current callers. + + Reviewed-by: Adam Jackson + Signed-off-by: Michael Thayer + +commit 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056 +Author: Mihail Konev +Date: Sat Feb 4 00:03:24 2017 +0500 + + dmx: fix linking + + Reviewed-by: Adam Jackson + +commit e50da50118408a195d4d2e1b39817fe7c4447c56 +Author: Adam Jackson +Date: Wed Jan 25 15:08:25 2017 -0500 + + dri1: Remove some dead event code + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 0702f2e840370be53d129fc5e3c243dac47ee720 +Author: Peter Hutterer +Date: Tue Feb 7 11:44:51 2017 +1000 + + xwayland: replace hardcoded function name with __func__ in error msg + + Signed-off-by: Peter Hutterer + Reviewed-by: Pekka Paalanen + Reviewed-by: Olivier Fourdan + +commit 3eb964e25243056dd998f52d3b00171b71c89189 Author: Chris Wilson Date: Fri Jan 20 09:49:19 2017 +0000 xfree86: Take input_lock() for xf86ScreenCheckHWCursor - - (cherry picked from commit 3eb964e25243056dd998f52d3b00171b71c89189) -commit 2a6904306f9cebc30aa472956a3417ff02221d00 +commit cfddd919cce4178baba07959e5e862d02e166522 Author: Chris Wilson Date: Mon Jan 16 22:36:34 2017 +0000 xfree86: Take input lock for xf86TransparentCursor - - (cherry picked from commit cfddd919cce4178baba07959e5e862d02e166522) -commit da85ab9dd87e3646be8bc617bfd4c8a86ec0b662 +commit 7198a6d4e74f684cb383b3e0f70dd2bae405e6e7 Author: Chris Wilson Date: Mon Jan 16 22:17:36 2017 +0000 @@ -2769,17 +14454,522 @@ Date: Mon Jan 16 22:17:36 2017 +0000 xf86RecolorCursor() References: https://bugs.freedesktop.org/show_bug.cgi?id=99358 - (cherry picked from commit 7198a6d4e74f684cb383b3e0f70dd2bae405e6e7) -commit ad2facda30f453d749492c51d29f2626aee6326a -Author: Adam Jackson -Date: Wed Jan 11 16:15:57 2017 -0500 +commit bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5 +Author: Qiang Yu +Date: Thu Jan 26 18:13:53 2017 +0800 - xserver 1.19.1 + present: disable page flip only when a slave crtc is active + This prevents the tearing of moving window in a composite WM + desktop when output slave is attached but none of its crtc is + really active. + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 45e0eb4b156f2155687cce268b07f10540fc507b +Author: Michel Dänzer +Date: Thu Jan 26 16:24:03 2017 +0900 + + loader: Handle mod->VersionInfo == NULL + + This can happen when a module fails to load: + + Program received signal SIGSEGV, Segmentation fault. + UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 + 848 name = mod->VersionInfo->modname; + (gdb) bt + #0 UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 + #1 0x00005555555ddd1b in LoadModule (module=module@entry=0x5555559c7ce0 "fbdev", options=0x0, modreq=modreq@entry=0x0, errmaj=errmaj@entry=0x7fffffffe8ec) at ../../../../hw/xfree86/loader/loadmod.c:824 + #2 0x00005555555edfe9 in xf86LoadModules (list=list@entry=0x5555559dcf50, optlist=optlist@entry=0x0) at ../../../../hw/xfree86/common/xf86Init.c:1506 + #3 0x00005555555ee7bc in InitOutput (pScreenInfo=pScreenInfo@entry=0x5555559abf80 , argc=argc@entry=4, argv=argv@entry=0x7fffffffeb18) at ../../../../hw/xfree86/common/xf86Init.c:484 + #4 0x00005555555a885c in dix_main (argc=4, argv=0x7fffffffeb18, envp=) at ../../dix/main.c:197 + #5 0x00007ffff5d582b1 in __libc_start_main (main=0x555555593130
, argc=4, argv=0x7fffffffeb18, init=, fini=, rtld_fini=, stack_end=0x7fffffffeb08) at ../csu/libc-start.c:291 + #6 0x000055555559316a in _start () + + Fixes: 8e83eacb9e2d ("loader: Remove unused path and name from ModuleDescPtr") + Signed-off-by: Michel Dänzer + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7617a0a180a2cd3427a8ffa9534152df6a8fecbf +Author: Qiang Yu +Date: Wed Jan 11 13:59:22 2017 +0800 + + dri2: refine dri2_probe_driver_name (v2) + + V2: + 1. update comment + 2. check bustype if PCI + 3. configure add libdrm version check for drmGetDevice + + Get PCI information from info->fd with drmGetDevice instead of + assuming the info->fd is the first entity of scrn which is not + true for multi entities scrn. + + Signed-off-by: Qiang Yu + Reviewed-by: Emil Velikov + +commit b1a6986395f85b0194646a34b49367086dc9239d +Author: Martin Peres +Date: Wed Jan 25 17:29:15 2017 +0200 + + tests: shuffle around the linking order to please GNU ld + + Classic GNU ld resolves symbol dependencies only forward, while GOLD + seems to work regardless of the specified library order. + + Suggested-by: Eero Tamminen + Reviewed-by: Mihail Konev + Signed-off-by: Martin Peres + +commit cc0f173ea2936d1405e382329c1bd58c7af67ea7 +Author: Adam Jackson +Date: Thu Apr 14 15:56:46 2016 -0400 + + loader: Learn about the joy of snprintf + + Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson -commit 82dcb68a8782d0cce6e6ce1a375cda05c91fe8c3 +commit 8e83eacb9e2d2c6c2b9f8cdb9e82c976a0237f24 +Author: Adam Jackson +Date: Thu Apr 14 15:30:35 2016 -0400 + + loader: Remove unused path and name from ModuleDescPtr + + Just a waste of memory. Path was never referenced at all, and name was + only used when unloading the module; we can just as well get the + module's internal idea of its name from VersionInfo. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 8920dca0091675f1202c1198336cd4d8e0259100 +Author: Adam Jackson +Date: Thu Apr 14 11:45:58 2016 -0400 + + loader: Remove unused arguments from LoadModule + + Nobody was ever calling this with a non-null argument for subdir list or + pattern list. Having done this, InitSubdirs is only ever called with a + NULL argument, so it's really just a complicated way of duplicating the + default list; we can remove that and just walk the list directly. + + The minor error code was only ever used to distinguish among two cases + of LDR_BADUSAGE. Whatever. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit ba726ba6a73efe1bd19708b058f481f28068a85b +Author: Adam Jackson +Date: Thu Apr 14 11:30:02 2016 -0400 + + loader: Turn LoaderListDirs into LoaderListDir + + Callers only ever use this for a single directory anyway. + + While we're at it, also move xf86DriverListFromCompile near its only + user in the X -configure code (and inline it out of existence), and + remove LoaderFreeDirList as it's unused (since X -configure is just + going to exit anyway, none of that code cares about cleanup). + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit c54a9ca152898ec2ffe50f6d5b70d483b85c1c34 +Author: Adam Jackson +Date: Thu Apr 14 11:17:22 2016 -0400 + + loader: Move loader list details to internal header + + There's no reason a driver should ever care about this. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit d55284e8638ede15be851aa8a19a98dbbff0ce20 +Author: Adam Jackson +Date: Wed Apr 13 16:06:50 2016 -0400 + + xfree86: Remove a stray reference to font modules + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit d7879c46724a36bfd9a3a08e49903d001ffbf93e +Author: Adam Jackson +Date: Wed Apr 13 15:58:33 2016 -0400 + + xfree86: Fix up some bad indentation + + indent(1) gets confused by function-like macros with no trailing + semicolon, which is fair enough really. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 5c577da5f3a65c68d2ee12e4afca8f20c3e8ccf4 +Author: Adam Jackson +Date: Thu Jul 14 15:42:18 2016 -0400 + + xfree86: Remove DriverRec1 compat struct + + The idea here is that the driver might have once been old enough to not + have the driverFunc slot in DriverRec, with the module ABI not having + changed when it was added. That was ages ago, and drivers always declare + themselves with DriverRec not DriverRec1, so uninitialized slots will + simply be zero. + + Reviewed-by: Emil Velikov + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 2e3ad7e2506d9eb6667a5f229b5213d215451a5a +Author: Adam Jackson +Date: Wed Apr 13 15:50:39 2016 -0400 + + loader: Remove silly "unspecified" version handling + + Everybody using this functionality specifies a major version, which + makes sense. If you don't care about a minor version, that's equivalent + to saying you require minor >= 0, so just say so; likewise patch level. + + Likewise ABI class is always specified. + + Reviewed-by: Emil Velikov + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit ef533a912d18db31456b29a18c8bced649309565 +Author: Adam Jackson +Date: Tue Mar 1 08:29:06 2016 -0500 + + loader: Remove unused loader error codes and dead enum + + The enum has been unused since at least the removal of elfloader. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 7e3cccf8e4426a4b25a7a94d52775d334693572f +Author: Adam Jackson +Date: Wed Apr 13 14:59:27 2016 -0400 + + loader: Include fewer headers from xf86Module.h + + This looks like more, but only if you don't compare it to the number + pulled in by misc.h. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 49fa76801348f6d044128f7ec743693d0759d683 +Author: Adam Jackson +Date: Fri Jun 5 11:01:30 2015 -0400 + + loader: Don't add internal/ to the search path + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 97bd6e453676516891250389ec0fd695c110087c +Author: Adam Jackson +Date: Fri Jun 5 10:58:20 2015 -0400 + + loader: Remove *GetOS + + This API is dumb. uname(3) exists, feel free to use it, but ideally + write to the interface not to the OS. There are a couple of drivers + using this API, they could all reasonably just not. + + This also removes the OS name from the loader subdirectory path search. + Having /usr/lib/xorg shared across OSes is a non-goal here. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit a6fcb15472bb7663ae917f5913bf07b6d3c7f186 +Author: Adam Jackson +Date: Mon Jun 16 11:30:18 2014 -0400 + + loader: Port from xfree86 to dix API + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 778cfc59762cdf528cf8672bfb5696844e91ebc3 +Author: Emil Velikov +Date: Sun Apr 17 21:07:30 2016 +0100 + + xfree86: flatten pathlist management in the loader + + Now that users can set the path only via LoaderSetPath(), we can simplify + things. + + Reviewed-by: Eric Anholt + Reviewed-by: Julien Cristau + Signed-off-by: Emil Velikov + +commit 7b71055fc65242a9c4b651e72bb07dbb3f00c4e6 +Author: Emil Velikov +Date: Sun Apr 17 21:07:29 2016 +0100 + + xfree86: remove dummy/dead function prototype for LoadDriver + + Reviewed-by: Julien Cristau + Signed-off-by: Emil Velikov + +commit 57eec704c3ddea0fecea2d8fbd1c3547f0b8fccf +Author: Emil Velikov +Date: Sun Apr 17 21:07:27 2016 +0100 + + xfree86: remove references to LoadSubModule's path from the doc + + Afaics the argument hasn't been part of the API since the documentation + has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc + documents to DocBook/XML" + + Reviewed-by: Julien Cristau + Signed-off-by: Emil Velikov + +commit 2196bb50383bd96d364f799018c0693c9309ed7f +Author: Emil Velikov +Date: Sun Apr 17 21:07:28 2016 +0100 + + xfree86: remove unused path from the LoadModule API + + Similar to its little brother - LoadSubModule. Currently all call sites + provide NULL anyway ;-) + + Reviewed-by: Aaron Plattner + Reviewed-by: Julien Cristau + Signed-off-by: Emil Velikov + +commit ea483af99a6351323afe00a0b630cd63310efdb1 +Author: Adam Jackson +Date: Thu Jan 19 17:20:49 2017 -0500 + + glx: Move Composite's synthetic visuals to a different select group + + Should you find yourself using a 16bpp display while also using a + compositor, you poor soul, you may find that your GLX applications + behave strangely; in particular, glxgears will be transparent. This is + because it clears to (0,0,0,0) which is transparent if you honor alpha, + and it will choose the synthetic visual because it has the most + available r/g/b bits. + + To avoid this, bump synthetic visuals to a higher (less-preferred) + select group. Unless the client explicitly asks for non-zero alpha bits, + this will prefer any rgb565 visual ahead of the argb8888 visual. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 43efaa6e4fd903229dc9c508da4177ad4bbdd4d8 +Author: Adam Jackson +Date: Thu Jan 19 17:20:49 2017 -0500 + + glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals + + We already send this for fbconfigs. Mesa happens to implement + glXChooseVisual relative to the fbconfig data, but that might not be + true of NVIDIA's libGL. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit ef2345aaa28461a76f77c65240ce5facc180f98e +Author: Adam Jackson +Date: Thu Jan 19 17:20:49 2017 -0500 + + composite: Export compIsAlternateVisual + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit bccbaf7c113b1300071601879002682ebbe8b1c1 +Author: Adam Jackson +Date: Thu Jan 19 17:20:49 2017 -0500 + + composite: Remove a misleading comment + + This comment is above compIsAlternateVisual, which used to be the only + thing determining whether implicit redirect was needed. It's not anymore + due to the redirection exception list. That job is now performed by + compImplicitRedirect, whose code is self-explanitory. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 86463981361064dd0352ec215abf1696ce7fc5ea +Author: Olivier Fourdan +Date: Tue Jan 24 18:08:30 2017 +0100 + + glamor: Two pass won't work on memory pixmaps + + When selecting "CA_TWO_PASS" in glamor_composite_clipped_region() when + the hardware does not support "GL_ARB_blend_func_extended", we call + glamor_composite_choose_shader() twice in a row, which in turn calls + glamor_pixmap_ensure_fbo(). + + On memory pixmaps, the first call will set the FBO and the second one + will fail an assertion in glamor_upload_picture_to_texture() because + the FBO is already set. + + Bail out earlier when the mask pixmap is in memory and the hardware + capabilities would require to use two pass, so that the assertion is not + failed and the rendering is correct. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99346 + Signed-off-by: Olivier Fourdan + Reviewed-by: Eric Anholt + +commit e7b8b7b131d8283c96ed0aff4593ab41441b5d3b +Author: Adam Jackson +Date: Thu Jan 19 17:30:40 2017 -0500 + + kdrive: Remove non-evdev input drivers + + Use evdev. + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit d740e1830a7ef32433fdf338c1e04dc6c9a927cb +Author: Adam Jackson +Date: Thu Jan 19 17:30:39 2017 -0500 + + dmx: Remove non-evdev hardware input drivers + + Use evdev. + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit 6f531b0cdf8c9d7f711dd46071a26c50db3f1a16 +Author: Mihail Konev +Date: Sat Jan 14 12:51:45 2017 +0500 + + tests: Fix typo + + Remove redundrant/incorrect automake assignment. + + Buglink: https://lists.x.org/archives/xorg-devel/2017-January/052320.html + Reported-by: Michel Dänzer + Signed-off-by: Mihail Konev + Reviewed-by: Jon Turney + +commit 3f8c2f94483bf0b96e129c97ef4950170a3f05b4 +Author: Giuseppe Bilotta +Date: Fri Jan 13 18:44:01 2017 +0100 + + tests: Fix without-dtrace build + + Signed-off-by: Giuseppe Bilotta + Reviewed-by: Mihail Konev + Signed-off-by: Mihail Konev + +commit b44bef513bd83249036cb5a237dc20eb6088c17c +Author: Adam Jackson +Date: Mon Jan 16 14:59:40 2017 -0500 + + Revert "tests: fix --disable-xorg build" + + Pushed the wrong thing. + + This reverts commit 730fd8c05f56da21894691bbd2e7ff37f67b45f4. + +commit 730fd8c05f56da21894691bbd2e7ff37f67b45f4 +Author: Mihail Konev +Date: Sat Jan 14 15:19:30 2017 +0500 + + tests: fix --disable-xorg build + +commit 704a867f8fb7652a8b7d5569bbe44e188457db4e +Author: Mihail Konev +Date: Thu Jan 12 13:21:12 2017 +0500 + + tests: Remove obsolete libxservertest.la + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 +Author: Mihail Konev +Date: Thu Jan 12 13:21:11 2017 +0500 + + tests: Move test/{xi1,xi2}/tests to test/ + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit ead5064581665ff40c177dd1b447949f1420e209 +Author: Mihail Konev +Date: Thu Jan 12 13:21:10 2017 +0500 + + tests: Convert test/ to single binary + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit 773fc07e4c2f816966809492a924a9bd1a15d059 +Author: Mihail Konev +Date: Thu Jan 12 13:21:09 2017 +0500 + + tests: Convert test/xi2/ to single binary + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit 371576f64baa99c4ab1e736fbae7975a32577275 +Author: Mihail Konev +Date: Thu Jan 12 13:21:08 2017 +0500 + + tests: Convert test/xi1/ to single binary + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit ff66bca3e8797db709e03572d296358dc4b95653 +Author: Mihail Konev +Date: Thu Jan 12 13:21:07 2017 +0500 + + tests: Refactor wraps into protocol-common.c + + Part of refactoring the tests into a single binary, + to make partial rebuild slightly faster and less verbose. + + Prepares for joining test/xi2/protocol-* into a single binary. + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit 45546219e117c1b6129fd9f9be2ce5b592486feb +Author: Mihail Konev +Date: Tue Jan 3 23:40:18 2017 +0500 + + tests: Avoid libtool message + + The "copying selected object files" message appears as some source + files have the same name, and some objects are included twice. + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + +commit 785053d033e73d2deb0ded4b97eabfd881991978 Author: Keith Packard Date: Mon Jan 9 18:10:21 2017 -0800 @@ -2797,9 +14987,18 @@ Date: Mon Jan 9 18:10:21 2017 -0800 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99333 Reviewed-by: Adam Jackson Signed-off-by: Keith Packard - (cherry picked from commit 785053d033e73d2deb0ded4b97eabfd881991978) -commit 14516988e095ed748e738c14a87c3656006846f7 +commit 436da935bde43076f3052a758a463ed080e8a747 +Author: Qiang Yu +Date: Tue Jan 10 18:51:57 2017 +0800 + + modesetting: cleanup pci device open + + Signed-off-by: Qiang Yu + Reviewed-by: Hans de Goede + Signed-off-by: Peter Hutterer + +commit 555e0a42d138ac8d83af62638752a1bebad602d6 Author: Qiang Yu Date: Tue Jan 10 18:51:55 2017 +0800 @@ -2814,9 +15013,8 @@ Date: Tue Jan 10 18:51:55 2017 +0800 Signed-off-by: Qiang Yu Reviewed-by: Hans de Goede Signed-off-by: Peter Hutterer - (cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6) -commit 3381e2c26b2ac40b1dd909439bf72559b80d0d86 +commit 1012510620de7dadd0ab18b19a8e11facd884601 Author: Qiang Yu Date: Tue Jan 10 18:51:54 2017 +0800 @@ -2825,9 +15023,8 @@ Date: Tue Jan 10 18:51:54 2017 +0800 Signed-off-by: Qiang Yu Reviewed-by: Hans de Goede Signed-off-by: Peter Hutterer - (cherry picked from commit 1012510620de7dadd0ab18b19a8e11facd884601) -commit 27a2772cf3a1bcd656efdf653a7504597911dbc4 +commit e473b2bc016adacfe3fa47fdf6a8ce9f8cddff62 Author: Michel Dänzer Date: Fri Nov 25 17:34:05 2016 +0900 @@ -2849,9 +15046,63 @@ Date: Fri Nov 25 17:34:05 2016 +0900 Fixes: bab0f450a719 ("present: Fix presentation of flips out of order") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98854 Reviewed-by: Alex Deucher - (cherry picked from commit e473b2bc016adacfe3fa47fdf6a8ce9f8cddff62) -commit 943e3cbeb0139d719589fc07c4f471195e4efe0a +commit 9d32b71c93cf6187e9320c99ae857e34a51b7102 +Author: Mihail Konev +Date: Wed Jan 4 07:08:51 2017 +0500 + + xkb: Match key releases with an overlaid press + + Testcase: + + In ~/.xbindkeysrc: + "xterm &" + XF86LaunchA + + In ~/ov.xkb: + xkb_keymap { + xkb_keycodes { include "evdev" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" + interpret Overlay1_Enable+AnyOfOrNone(all) { + action= SetControls(controls=Overlay1); + }; + }; + xkb_symbols { include "pc+inet(evdev)+us" + key { [ Overlay1_Enable ] }; + key { overlay1 = }; // Insert+1 => 2 + key { overlay1 = }; // Insert+~ => XF86LaunchA + }; + xkb_geometry { include "pc(pc104)" }; + }; + + Apply this layout: 'xkbcomp ~/ov.xkb $DISPLAY'. + Run "xbindkeys -n -v" + In the exact order: + - press Insert + - press Tilde + - release Insert + - wait + - release Tilde + Keyboard input in the new terminal window(s) would be locked + until another Insert+Tilde . + + Reported-by: Mariusz Mazur + Signed-off-by: Mihail Konev + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 29a4f3db60fdeaef7bca3aa2746bb43a1850fddd +Author: Adam Jackson +Date: Mon Jan 2 15:38:08 2017 -0500 + + glamor: Squash unused variable warning + + Accidentally introduced in 05e19644. + + Signed-off-by: Adam Jackson + +commit 9874f73e88678c9eacbcba05e52336fc63a32712 Author: Kai-Heng Feng Date: Thu Dec 15 13:56:38 2016 +0800 @@ -2863,9 +15114,8 @@ Date: Thu Dec 15 13:56:38 2016 +0800 Signed-off-by: Kai-Heng Feng Acked-by: Alex Deucher - (cherry picked from commit 9874f73e88678c9eacbcba05e52336fc63a32712) -commit cb3057da2254f9b6434a9c40486c72865cd1ab5e +commit 1b42f9505ff3a39b441464f553442079b750fe88 Author: Peter Hutterer Date: Thu Dec 8 14:32:06 2016 +1000 @@ -2884,7 +15134,7 @@ Date: Thu Dec 8 14:32:06 2016 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard -commit db03742cd33d6d54834bb138886a4f84bc452a85 +commit c96c860b6420adf0d004707a323af30491a1d7d3 Author: Michal Srb Date: Mon Dec 12 17:45:22 2016 +0200 @@ -2892,7 +15142,7 @@ Date: Mon Dec 12 17:45:22 2016 +0200 Reviewed-by: Adam Jackson -commit 862c1c43c10eda955db1440cc72ff0387e24a35f +commit 05e19644250698aa126a60bc671e85425df784d1 Author: Hans De Goede Date: Tue Dec 20 13:00:43 2016 +0100 @@ -2911,14 +15161,11 @@ Date: Tue Dec 20 13:00:43 2016 +0100 libEGL + the modesetting driver on a secondary GPU crashing inside glamor_egl_init() sometimes. - [1.19: squash in typo fix from 29a4f3db - ajax] - Cc: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Hans de Goede - (cherry picked from commit 05e19644250698aa126a60bc671e85425df784d1) -commit 8790bd993ac2f8f8dd54a1946312e6b6dc929e00 +commit 5b74e260e009d8bdf26433724495802b85cce7c3 Author: Mihail Konev Date: Thu Dec 29 12:37:18 2016 +0500 @@ -2938,9 +15185,205 @@ Date: Thu Dec 29 12:37:18 2016 +0500 Reviewed-by: Adam Jackson Signed-off-by: Mihail Konev - (cherry picked from commit 5b74e260e009d8bdf26433724495802b85cce7c3) -commit 8cf47472bff1d5ca3de6ff83a80f0d2820c3fb93 +commit b5dffbbac193aa640ffcfa0a431c21b862854e53 +Author: Hans De Goede +Date: Mon Dec 12 17:03:17 2016 +0100 + + xfree86: Add ModulePath support for OutputClass config Sections + + Allow OutputClass config snippets to modify the module-path. + + Note that any specified ModulePaths will be pre-pended to the normal + ModulePath. The idea behind this is that any output hardware specific + modules should have preference over the normal modules. + + One use-case for this is the nvidia binary driver, this allows a + config snippet like this: + + Section "OutputClass" + MatchDriver "nvidia" + Modulepath "/usr/lib64/nvidia/modules" + EndSection + + To get the nvidia glx specific glx module loaded, but only when the + nvidia kernel driver is loaded. + + Together with the glvnd work done recently, this allows the nouveau + + mesa and nvidia-binary userspace stacks to co-exist on the same + system without any ldconfig / xorg.conf tweaking and the xserver will + automatically do the right thing depending on which kernel driver + (nouveau or nvidia) is loaded. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit d75ffcdbf8c1e3c8e0d46debcd533a9f2560f0a8 +Author: Hans De Goede +Date: Mon Dec 12 17:03:16 2016 +0100 + + xfree86: Allow overriding primary GPU detection from an OutputClass section + + Allow using: + + Option "PrimaryGPU" "yes" + + In an OutputClass section to override the default primary GPU device + selection which selects the GPU used as output by the firmware. + + If multiple output devices match an OutputClass section with + the PrimaryGPU option set, the first one enumerated becomes the + primary GPU. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit ab1a65b7755d081b41188104b21f4d21eaa3187b +Author: Hans De Goede +Date: Mon Dec 12 17:03:15 2016 +0100 + + xfree86: xf86platformProbe: split finding pci-info and setting primary GPU + + This is a preparation patch for allowing an OutputClass section to + override the default primary GPU device selection. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 9cd3cc75269d9196898487b5712ee47b8291e077 +Author: Hans De Goede +Date: Mon Dec 12 17:03:14 2016 +0100 + + xfree86: Add options support for OutputClass Options + + Add support for setting options in OutputClass Sections and having these + applied to any matching output devices. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 08b84d72878e43401e99059c3c926dfa42a360c3 +Author: Hans De Goede +Date: Mon Dec 12 17:03:13 2016 +0100 + + xfree86: Make OutputClassMatches take a xf86_platform_device + + Make OutputClassMatches directly take a xf86_platform_device as argument, + rather then an index into xf86_platform_devices. This makes things + easier for callers which already have a xf86_platform_device pointer. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit c57c1e53ea3d76ebba5b2a23b7260817d3e6b921 +Author: Hans De Goede +Date: Mon Dec 12 17:03:12 2016 +0100 + + xfree86: Free devlist returned by xf86MatchDevice + + xf86MatchDevice returns a dynamically allocated list of GDevPtr-s, + free this when we're done with it. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 32e632e85894eddc3ace83f16f1e973b1be478fe +Author: Adam Jackson +Date: Mon Dec 12 13:08:17 2016 -0500 + + Revert "damage: Make damageRegionProcessPending take a damage not a drawable" + + The commit message makes the assertion that the code below damage is not + allowed to change whether there's a damage monitor for the drawable. + That turns out not to be the case! exa's mixed code, at least, will + create and destroy a damage in PrepareAccess. The destroy path can then + be catastrophic, as damageRegionProcessPending will attempt to + RegionEmpty memory from the middle of a freed block. + + I'd wanted that invariant for performance, but faster isn't worth + broken, so revert it. I think what exa's doing is reasonable, so the + better way to improve performance for the unmonitored case is to either + revisit dynamically wrapping into the GC, or inline damage into dix. + + This reverts commit 4e124203f2260daaf54155f4a05fe469733e0b97. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389886 + Signed-off-by: Adam Jackson + +commit 6dd65a6e9bd41237afe7615bea1cc9510e82781a +Author: Adam Jackson +Date: Fri Dec 9 14:52:38 2016 -0500 + + shadow: Remove unused shadowAlloc + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 8d985c1e696bf46edaea0021f03f6f613ce37860 +Author: Adam Jackson +Date: Fri Dec 9 14:52:37 2016 -0500 + + shadow: Macro cleanup + + shadowDamage is just obfuscation. The other two macros won't work + outside shadow.c since the private key is in fact static there (meaning + the extern decl is a lie). + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit a530dc2a62349d922de77a75786a3795102aec11 +Author: Adam Jackson +Date: Fri Dec 9 14:52:36 2016 -0500 + + shadow: Remove indirection stubs + + These are no longer used in the drivers. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 1ae09800863992cfb1d5d21c600e2bc29e3b6ab2 +Author: Adam Jackson +Date: Fri Dec 9 14:52:35 2016 -0500 + + shadow: Lift 32->24 conversion from modesetting to dix + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 2b486f052d8a7d3bada9eb2615aa19d79e999cbe +Author: Adam Jackson +Date: Fri Dec 9 14:52:34 2016 -0500 + + shadowfb: Rename this particular shadow.c to shadowfb.c + + So as not to conflict with the one in miext/shadow. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 98caba9f5669291e84f8610cc3071a9ac2df205f +Author: Adam Jackson +Date: Fri Dec 9 14:52:29 2016 -0500 + + dix: Clear graphicsExposures for scratch GCs in one place + + ... instead of in all the CreateScratchGC callers. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit e900a00f8dc5a1db63bafddd4ad1cde744975db1 +Author: Adam Jackson +Date: Fri Dec 9 14:52:28 2016 -0500 + + dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5 Author: Ben Crocker Date: Tue Nov 15 16:34:38 2016 -0500 @@ -2985,9 +15428,8 @@ Date: Tue Nov 15 16:34:38 2016 -0500 Reviewed-by: Adam Jackson Signed-off-by: Ben Crocker - (cherry picked from commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5) -commit 06a3e7ef3bf9a907f1fba84a3601870a5697f657 +commit b365c5d16894a259dbf29db4ca2640d8ed768063 Author: Pekka Paalanen Date: Wed Dec 7 15:43:06 2016 +0200 @@ -3009,9 +15451,8 @@ Date: Wed Dec 7 15:43:06 2016 +0200 Reviewed-by: Adam Jackson Signed-off-by: Pekka Paalanen - (cherry picked from commit b365c5d16894a259dbf29db4ca2640d8ed768063) -commit 543287e60af5e9d91b5fc7e4a42e51eafa63db21 +commit f31875510d818ba517f082e124adb294db906e51 Author: Adam Jackson Date: Tue Dec 6 14:11:11 2016 -0500 @@ -3032,9 +15473,55 @@ Date: Tue Dec 6 14:11:11 2016 -0500 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499 Signed-off-by: Adam Jackson Reviewed-by: Keith Packard - (cherry picked from commit f31875510d818ba517f082e124adb294db906e51) -commit c24c9cc956038a61922f8b11ee68b8b0fc6b9f83 +commit 75c4f6e412e07c5d416fa9ad8d7defd972d2baa9 +Author: Hans de Goede +Date: Fri Sep 30 12:29:09 2016 +0200 + + xfree86: Try harder to find atleast 1 non GPU Screen + + If we did not find any non GPU Screens, try again ignoring the notion + of any video devices being the primary device. This fixes Xorg exiting + with a "no screens found" error when using virtio-vga in a + virtual-machine and when using a device driven by simpledrm. + + This is a somewhat ugly solution, but it is the best I can come up with + without major surgery to the bus and probe code. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 7121b03d324fccf687d49b63c53da7c8d93038c9 +Author: Hans de Goede +Date: Fri Sep 30 11:59:04 2016 +0200 + + xfree86: Make adding unclaimed devices as GPU devices a separate step + + This is primarily a preparation patch for fixing the xserver exiting with + a "no screens found" error even though there are supported video cards, + due to the server not recognizing any card as the primary card. + + This also fixes the (mostly theoretical) case of a platformBus capable + driver adding a device as GPUscreen before a driver which only supports + the old PCI probe method gets a chance to claim it as a normal screen. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit b72d161cad15bec9dd082d30521c5383be526c56 +Author: Hans de Goede +Date: Tue Sep 27 14:30:10 2016 +0200 + + xfree86: Remove redundant ServerIsNotSeat0 check from xf86CallDriverProbe + + If foundScreen is TRUE, then all the code below the removed if + will not execute until we reach the return foundScreen; at the + end, so this entire if block is redundant. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c Author: Hans de Goede Date: Tue Nov 22 14:53:20 2016 +0100 @@ -3084,9 +15571,8 @@ Date: Tue Nov 22 14:53:20 2016 +0100 Cc: Dave Airlie Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie - (cherry picked from commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c) -commit 26132f57ee6fae9376955e7990ac2fbad5b49fac +commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1 Author: Hans de Goede Date: Tue Nov 22 14:48:14 2016 +0100 @@ -3120,9 +15606,20 @@ Date: Tue Nov 22 14:48:14 2016 +0100 Cc: Dave Airlie Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie - (cherry picked from commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1) -commit 6c51845e6b0f313a90e4375f2821f1da9cc53014 +commit e1d30075c923f96a375895d74ea12a3c92a640c6 +Author: Adam Jackson +Date: Tue Nov 22 10:51:24 2016 -0500 + + configure: Enable glamor when building just Xwayland + + Signed-off-by: Adam Jackson + Acked-by: Daniel Stone + Reviewed-by: Pekka Paalanen + Tested-by: Pekka Paalanen + Reviewed-by: Eric Anholt + +commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b Author: Olivier Fourdan Date: Wed Nov 30 09:42:43 2016 +0100 @@ -3153,9 +15650,8 @@ Date: Wed Nov 30 09:42:43 2016 +0100 Tested-by: Vít Ondruch Tested-by: Satish Balay Reviewed-by: Jonas Ådahl - (cherry picked from commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b) -commit b711efb05714bf3d0a102c717a05cde4fefdae3f +commit f43207c1c4a8487600cf3ea116c10437417c861b Author: Olivier Fourdan Date: Thu Nov 3 09:59:30 2016 +0100 @@ -3188,9 +15684,8 @@ Date: Thu Nov 3 09:59:30 2016 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Hans de Goede Reviewed-by: Eric Anholt - (cherry picked from commit f43207c1c4a8487600cf3ea116c10437417c861b) -commit 201ff45c2d7e6c7d73fd29d28871bb8b944074be +commit d6a6e1d6abb110ff00ad31b94cd29d92ca7c71a5 Author: Peter Hutterer Date: Fri Nov 11 15:28:50 2016 +1000 @@ -3203,9 +15698,8 @@ Date: Fri Nov 11 15:28:50 2016 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone - (cherry picked from commit d6a6e1d6abb110ff00ad31b94cd29d92ca7c71a5) -commit 738c17b7ef4c70ad00c7bc01cf64edb770dda840 +commit 5611585b87ce48428a66f98ece319a083f55d205 Author: Rui Matos Date: Thu Nov 24 19:56:18 2016 +0100 @@ -3232,9 +15726,25 @@ Date: Thu Nov 24 19:56:18 2016 +0100 Signed-off-by: Rui Matos Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 5611585b87ce48428a66f98ece319a083f55d205) -commit cd8f43e1b06aee8500548a94e3743cf153591683 +commit 2de37eb71b928f6f50c109536c2f7b77293ad8e3 +Author: Pekka Paalanen +Date: Wed Nov 23 09:54:27 2016 +0200 + + xwayland: fix order of calloc() args + + The definition by the manual is: + calloc(size_t nmemb, size_t size) + + Swap the arguments of calloc() calls to be the right way around. + + Presumably this makes no functional difference, but better follow the + spec. + + Signed-off-by: Pekka Paalanen + Signed-off-by: Peter Hutterer + +commit cf8860786c3e301486cd2853bc82977ba75e6b17 Author: Rhys Kidd Date: Fri Oct 28 22:44:30 2016 -0400 @@ -3279,31 +15789,27 @@ Date: Fri Oct 28 22:44:30 2016 -0400 Signed-off-by: Rhys Kidd Reviewed-by: Keith Packard Signed-off-by: Peter Hutterer - (cherry picked from commit cf8860786c3e301486cd2853bc82977ba75e6b17) -commit d6da2086951693e047fdd22b0d21c539ea1bb1e1 -Author: Adam Jackson -Date: Mon Dec 12 13:08:17 2016 -0500 +commit f0f8d5bb535814d5803df541b0ef4cb0354fabbe +Author: Keith Packard +Date: Fri Nov 18 09:48:28 2016 -0800 - Revert "damage: Make damageRegionProcessPending take a damage not a drawable" + Bump to post-1.19 development version - The commit message makes the assertion that the code below damage is not - allowed to change whether there's a damage monitor for the drawable. - That turns out not to be the case! exa's mixed code, at least, will - create and destroy a damage in PrepareAccess. The destroy path can then - be catastrophic, as damageRegionProcessPending will attempt to - RegionEmpty memory from the middle of a freed block. + Signed-off-by: Keith Packard + +commit 45af7fcb522464922831005d63cc362dc09f19a9 +Author: Olivier Fourdan +Date: Thu Nov 10 09:36:40 2016 +0100 + + xwayland: Remove MIPOINTER() definition - I'd wanted that invariant for performance, but faster isn't worth - broken, so revert it. I think what exa's doing is reasonable, so the - better way to improve performance for the unmonitored case is to either - revisit dynamically wrapping into the GC, or inline damage into dix. + Not needed anymore now that mipointer exposes an API for that, + miPointerInvalidateSprite() - This reverts commit 4e124203f2260daaf54155f4a05fe469733e0b97. - - Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389886 - Signed-off-by: Adam Jackson - (cherry picked from commit 32e632e85894eddc3ace83f16f1e973b1be478fe) + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer commit 7e5c9bdf73e4185ac4cf7f044da0793a5cc3e62c Author: Keith Packard diff --git a/xserver/Makefile.am b/xserver/Makefile.am index f0fa2d839..19511f765 100644 --- a/xserver/Makefile.am +++ b/xserver/Makefile.am @@ -72,7 +72,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xorg-server.pc endif -EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh +EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh README.md DISTCHECK_CONFIGURE_FLAGS=\ --with-xkb-path=$(XKB_BASE_DIRECTORY) \ @@ -128,3 +128,88 @@ install-headers: Makefile (cd `dirname "$$m"` && make install-sdkHEADERS) \ fi \ done + +distcheck-hook: + cd $(srcdir) && \ + meson setup _distcheck_build && \ + meson configure _distcheck_build && \ + ninja -C _distcheck_build && \ + rm -rf _distcheck_build && \ + cd - + +EXTRA_DIST += \ + meson_options.txt \ + include/xorg-config.h.meson.in \ + include/xwin-config.h.meson.in \ + hw/xfree86/loader/symbol-test.c \ + hw/xfree86/common/xf86Build.sh \ + composite/meson.build \ + config/meson.build \ + damageext/meson.build \ + dbe/meson.build \ + dix/meson.build \ + dri3/meson.build \ + exa/meson.build \ + fb/meson.build \ + glamor/meson.build \ + glx/meson.build \ + hw/dmx/config/meson.build \ + hw/dmx/examples/meson.build \ + hw/dmx/glxProxy/meson.build \ + hw/dmx/input/meson.build \ + hw/dmx/meson.build \ + hw/kdrive/ephyr/meson.build \ + hw/kdrive/meson.build \ + hw/kdrive/src/meson.build \ + hw/meson.build \ + hw/vfb/meson.build \ + hw/xfree86/common/meson.build \ + hw/xfree86/ddc/meson.build \ + hw/xfree86/dixmods/meson.build \ + hw/xfree86/dri2/meson.build \ + hw/xfree86/dri/meson.build \ + hw/xfree86/drivers/modesetting/meson.build \ + hw/xfree86/exa/meson.build \ + hw/xfree86/fbdevhw/meson.build \ + hw/xfree86/glamor_egl/meson.build \ + hw/xfree86/i2c/meson.build \ + hw/xfree86/int10/meson.build \ + hw/xfree86/loader/meson.build \ + hw/xfree86/meson.build \ + hw/xfree86/modes/meson.build \ + hw/xfree86/os-support/meson.build \ + hw/xfree86/parser/meson.build \ + hw/xfree86/ramdac/meson.build \ + hw/xfree86/shadowfb/meson.build \ + hw/xfree86/vbe/meson.build \ + hw/xfree86/vgahw/meson.build \ + hw/xfree86/x86emu/meson.build \ + hw/xfree86/xkb/meson.build \ + hw/xnest/meson.build \ + hw/xquartz/meson.build \ + hw/xwayland/meson.build \ + hw/xwin/dri/meson.build \ + hw/xwin/glx/meson.build \ + hw/xwin/meson.build \ + hw/xwin/winclipboard/meson.build \ + include/meson.build \ + meson.build \ + miext/damage/meson.build \ + miext/shadow/meson.build \ + miext/sync/meson.build \ + mi/meson.build \ + os/meson.build \ + present/meson.build \ + pseudoramiX/meson.build \ + randr/meson.build \ + record/meson.build \ + render/meson.build \ + test/bigreq/meson.build \ + test/bigreq/request-length.c \ + test/meson.build \ + test/sync/meson.build \ + test/sync/sync.c \ + Xext/meson.build \ + xfixes/meson.build \ + Xi/meson.build \ + xkb/meson.build diff --git a/xserver/Makefile.in b/xserver/Makefile.in index 905de3c8e..453694368 100644 --- a/xserver/Makefile.in +++ b/xserver/Makefile.in @@ -51,11 +51,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xorg-server.pc.in \ $(srcdir)/xserver.ent.in $(top_srcdir)/configure COPYING \ ChangeLog INSTALL config.guess config.sub depcomp install-sh \ - ltmain.sh missing + ltmain.sh missing ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -73,7 +73,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = xserver.ent xorg-server.pc CONFIG_CLEAN_VPATH_FILES = @@ -366,6 +366,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -384,15 +385,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -400,6 +404,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -471,8 +477,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -582,7 +586,41 @@ SUBDIRS = \ @XORG_TRUE@aclocal_DATA = xorg-server.m4 @XORG_TRUE@pkgconfigdir = $(libdir)/pkgconfig @XORG_TRUE@pkgconfig_DATA = xorg-server.pc -EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh +EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh README.md \ + meson_options.txt include/xorg-config.h.meson.in \ + include/xwin-config.h.meson.in hw/xfree86/loader/symbol-test.c \ + hw/xfree86/common/xf86Build.sh composite/meson.build \ + config/meson.build damageext/meson.build dbe/meson.build \ + dix/meson.build dri3/meson.build exa/meson.build \ + fb/meson.build glamor/meson.build glx/meson.build \ + hw/dmx/config/meson.build hw/dmx/examples/meson.build \ + hw/dmx/glxProxy/meson.build hw/dmx/input/meson.build \ + hw/dmx/meson.build hw/kdrive/ephyr/meson.build \ + hw/kdrive/meson.build hw/kdrive/src/meson.build hw/meson.build \ + hw/vfb/meson.build hw/xfree86/common/meson.build \ + hw/xfree86/ddc/meson.build hw/xfree86/dixmods/meson.build \ + hw/xfree86/dri2/meson.build hw/xfree86/dri/meson.build \ + hw/xfree86/drivers/modesetting/meson.build \ + hw/xfree86/exa/meson.build hw/xfree86/fbdevhw/meson.build \ + hw/xfree86/glamor_egl/meson.build hw/xfree86/i2c/meson.build \ + hw/xfree86/int10/meson.build hw/xfree86/loader/meson.build \ + hw/xfree86/meson.build hw/xfree86/modes/meson.build \ + hw/xfree86/os-support/meson.build \ + hw/xfree86/parser/meson.build hw/xfree86/ramdac/meson.build \ + hw/xfree86/shadowfb/meson.build hw/xfree86/vbe/meson.build \ + hw/xfree86/vgahw/meson.build hw/xfree86/x86emu/meson.build \ + hw/xfree86/xkb/meson.build hw/xnest/meson.build \ + hw/xquartz/meson.build hw/xwayland/meson.build \ + hw/xwin/dri/meson.build hw/xwin/glx/meson.build \ + hw/xwin/meson.build hw/xwin/winclipboard/meson.build \ + include/meson.build meson.build miext/damage/meson.build \ + miext/shadow/meson.build miext/sync/meson.build mi/meson.build \ + os/meson.build present/meson.build pseudoramiX/meson.build \ + randr/meson.build record/meson.build render/meson.build \ + test/bigreq/meson.build test/bigreq/request-length.c \ + test/meson.build test/sync/meson.build test/sync/sync.c \ + Xext/meson.build xfixes/meson.build Xi/meson.build \ + xkb/meson.build DISTCHECK_CONFIGURE_FLAGS = \ --with-xkb-path=$(XKB_BASE_DIRECTORY) \ --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \ @@ -972,6 +1010,7 @@ distcheck: dist test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ @@ -1182,6 +1221,14 @@ install-headers: Makefile fi \ done +distcheck-hook: + cd $(srcdir) && \ + meson setup _distcheck_build && \ + meson configure _distcheck_build && \ + ninja -C _distcheck_build && \ + rm -rf _distcheck_build && \ + cd - + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/xserver/README b/xserver/README.md similarity index 57% rename from xserver/README rename to xserver/README.md index b2499a059..bc39f41cd 100644 --- a/xserver/README +++ b/xserver/README.md @@ -1,4 +1,5 @@ - X Server +X Server +-------- The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program @@ -11,28 +12,24 @@ and draggable titlebars and borders. For a comprehensive overview of X Server and X Window System, consult the following article: -http://en.wikipedia.org/wiki/X_server +https://en.wikipedia.org/wiki/X_server All questions regarding this software should be directed at the Xorg mailing list: - http://lists.freedesktop.org/mailman/listinfo/xorg - -Please submit bug reports to the Xorg bugzilla: - - https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + https://lists.freedesktop.org/mailman/listinfo/xorg The master development code repository can be found at: - git://anongit.freedesktop.org/git/xorg/xserver - - http://cgit.freedesktop.org/xorg/xserver + https://gitlab.freedesktop.org/xorg/xserver For patch submission instructions, see: - http://www.x.org/wiki/Development/Documentation/SubmittingPatches + https://www.x.org/wiki/Development/Documentation/SubmittingPatches -For more information on the git code manager, see: - - http://wiki.x.org/wiki/GitPage +As with other projects hosted on freedesktop.org, X.Org follows its +Code of Conduct, based on the Contributor Covenant. Please conduct +yourself in a respectful and civilized manner when using the above +mailing lists, bug trackers, etc: + https://www.freedesktop.org/wiki/CodeOfConduct diff --git a/xserver/Xext/Makefile.am b/xserver/Xext/Makefile.am index 1ceb9803d..32a27eba8 100644 --- a/xserver/Xext/Makefile.am +++ b/xserver/Xext/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la libXvidmode.la +noinst_LTLIBRARIES = libXext.la libXvidmode.la AM_CFLAGS = $(DIX_CFLAGS) @@ -96,8 +96,6 @@ endif libXext_la_SOURCES = $(BUILTIN_SRCS) libXext_la_LIBADD = $(BUILTIN_LIBS) -libXextdpmsstubs_la_SOURCES = dpmsstubs.c - # XVidMode extension libXvidmode_la_SOURCES = vidmode.c diff --git a/xserver/Xext/Makefile.in b/xserver/Xext/Makefile.in index 244e9df2f..5c0c3111c 100644 --- a/xserver/Xext/Makefile.in +++ b/xserver/Xext/Makefile.in @@ -82,7 +82,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -130,9 +130,6 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libXextdpmsstubs_la_LIBADD = -am_libXextdpmsstubs_la_OBJECTS = dpmsstubs.lo -libXextdpmsstubs_la_OBJECTS = $(am_libXextdpmsstubs_la_OBJECTS) libXvidmode_la_LIBADD = am_libXvidmode_la_OBJECTS = vidmode.lo libXvidmode_la_OBJECTS = $(am_libXvidmode_la_OBJECTS) @@ -170,10 +167,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libXext_la_SOURCES) $(libXextdpmsstubs_la_SOURCES) \ - $(libXvidmode_la_SOURCES) +SOURCES = $(libXext_la_SOURCES) $(libXvidmode_la_SOURCES) DIST_SOURCES = $(am__libXext_la_SOURCES_DIST) \ - $(libXextdpmsstubs_la_SOURCES) $(libXvidmode_la_SOURCES) + $(libXvidmode_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -396,6 +392,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -414,15 +411,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -430,6 +430,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -501,8 +503,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -567,7 +567,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la libXvidmode.la +noinst_LTLIBRARIES = libXext.la libXvidmode.la AM_CFLAGS = $(DIX_CFLAGS) @XORG_TRUE@sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h \ @XORG_TRUE@ syncsdk.h $(am__append_6) $(am__append_8) @@ -617,7 +617,6 @@ DPMS_SRCS = dpms.c dpmsproc.h # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la libXext_la_SOURCES = $(BUILTIN_SRCS) libXext_la_LIBADD = $(BUILTIN_LIBS) -libXextdpmsstubs_la_SOURCES = dpmsstubs.c # XVidMode extension libXvidmode_la_SOURCES = vidmode.c @@ -681,8 +680,6 @@ clean-noinstLTLIBRARIES: } libXext.la: $(libXext_la_OBJECTS) $(libXext_la_DEPENDENCIES) $(EXTRA_libXext_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS) -libXextdpmsstubs.la: $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_DEPENDENCIES) $(EXTRA_libXextdpmsstubs_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_LIBADD) $(LIBS) libXvidmode.la: $(libXvidmode_la_OBJECTS) $(libXvidmode_la_DEPENDENCIES) $(EXTRA_libXvidmode_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXvidmode_la_OBJECTS) $(libXvidmode_la_LIBADD) $(LIBS) @@ -694,7 +691,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bigreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpms.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpmsstubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashtable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panoramiX.Plo@am__quote@ diff --git a/xserver/Xext/dpms.c b/xserver/Xext/dpms.c index cdfaa9724..e43a37974 100644 --- a/xserver/Xext/dpms.c +++ b/xserver/Xext/dpms.c @@ -40,6 +40,77 @@ Equipment Corporation. #include #include "dpmsproc.h" #include "extinit.h" +#include "scrnintstr.h" +#include "windowstr.h" + +CARD16 DPMSPowerLevel = 0; +Bool DPMSDisabledSwitch = FALSE; +CARD32 DPMSStandbyTime = -1; +CARD32 DPMSSuspendTime = -1; +CARD32 DPMSOffTime = -1; +Bool DPMSEnabled; + +Bool +DPMSSupported(void) +{ + int i; + + /* For each screen, check if DPMS is supported */ + for (i = 0; i < screenInfo.numScreens; i++) + if (screenInfo.screens[i]->DPMS != NULL) + return TRUE; + + for (i = 0; i < screenInfo.numGPUScreens; i++) + if (screenInfo.gpuscreens[i]->DPMS != NULL) + return TRUE; + + return FALSE; +} + +static Bool +isUnblank(int mode) +{ + switch (mode) { + case SCREEN_SAVER_OFF: + case SCREEN_SAVER_FORCER: + return TRUE; + case SCREEN_SAVER_ON: + case SCREEN_SAVER_CYCLE: + return FALSE; + default: + return TRUE; + } +} + +int +DPMSSet(ClientPtr client, int level) +{ + int rc, i; + + DPMSPowerLevel = level; + + if (level != DPMSModeOn) { + if (isUnblank(screenIsSaved)) { + rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive); + if (rc != Success) + return rc; + } + } else if (!isUnblank(screenIsSaved)) { + rc = dixSaveScreens(client, SCREEN_SAVER_OFF, ScreenSaverReset); + if (rc != Success) + return rc; + } + + for (i = 0; i < screenInfo.numScreens; i++) + if (screenInfo.screens[i]->DPMS != NULL) + screenInfo.screens[i]->DPMS(screenInfo.screens[i], level); + + for (i = 0; i < screenInfo.numGPUScreens; i++) + if (screenInfo.gpuscreens[i]->DPMS != NULL) + screenInfo.gpuscreens[i]->DPMS(screenInfo.gpuscreens[i], level); + + return Success; +} static int ProcDPMSGetVersion(ClientPtr client) @@ -72,7 +143,7 @@ ProcDPMSCapable(ClientPtr client) .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .capable = DPMSCapableFlag + .capable = TRUE }; REQUEST_SIZE_MATCH(xDPMSCapableReq); @@ -140,11 +211,9 @@ ProcDPMSEnable(ClientPtr client) REQUEST_SIZE_MATCH(xDPMSEnableReq); - if (DPMSCapableFlag) { - DPMSEnabled = TRUE; - if (!was_enabled) - SetScreenSaverTimer(); - } + DPMSEnabled = TRUE; + if (!was_enabled) + SetScreenSaverTimer(); return Success; } @@ -234,7 +303,7 @@ ProcDPMSDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcDPMSGetVersion(ClientPtr client) { REQUEST(xDPMSGetVersionReq); @@ -246,7 +315,7 @@ SProcDPMSGetVersion(ClientPtr client) return ProcDPMSGetVersion(client); } -static int +static int _X_COLD SProcDPMSCapable(ClientPtr client) { REQUEST(xDPMSCapableReq); @@ -257,7 +326,7 @@ SProcDPMSCapable(ClientPtr client) return ProcDPMSCapable(client); } -static int +static int _X_COLD SProcDPMSGetTimeouts(ClientPtr client) { REQUEST(xDPMSGetTimeoutsReq); @@ -268,7 +337,7 @@ SProcDPMSGetTimeouts(ClientPtr client) return ProcDPMSGetTimeouts(client); } -static int +static int _X_COLD SProcDPMSSetTimeouts(ClientPtr client) { REQUEST(xDPMSSetTimeoutsReq); @@ -282,7 +351,7 @@ SProcDPMSSetTimeouts(ClientPtr client) return ProcDPMSSetTimeouts(client); } -static int +static int _X_COLD SProcDPMSEnable(ClientPtr client) { REQUEST(xDPMSEnableReq); @@ -293,7 +362,7 @@ SProcDPMSEnable(ClientPtr client) return ProcDPMSEnable(client); } -static int +static int _X_COLD SProcDPMSDisable(ClientPtr client) { REQUEST(xDPMSDisableReq); @@ -304,7 +373,7 @@ SProcDPMSDisable(ClientPtr client) return ProcDPMSDisable(client); } -static int +static int _X_COLD SProcDPMSForceLevel(ClientPtr client) { REQUEST(xDPMSForceLevelReq); @@ -317,7 +386,7 @@ SProcDPMSForceLevel(ClientPtr client) return ProcDPMSForceLevel(client); } -static int +static int _X_COLD SProcDPMSInfo(ClientPtr client) { REQUEST(xDPMSInfoReq); @@ -328,7 +397,7 @@ SProcDPMSInfo(ClientPtr client) return ProcDPMSInfo(client); } -static int +static int _X_COLD SProcDPMSDispatch(ClientPtr client) { REQUEST(xReq); @@ -354,10 +423,29 @@ SProcDPMSDispatch(ClientPtr client) } } +static void +DPMSCloseDownExtension(ExtensionEntry *e) +{ + DPMSSet(serverClient, DPMSModeOn); +} + void DPMSExtensionInit(void) { - AddExtension(DPMSExtensionName, 0, 0, - ProcDPMSDispatch, SProcDPMSDispatch, - NULL, StandardMinorOpcode); +#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_) \ + if (_timeout_value_ == -1) { /* not yet set from config */ \ + _timeout_value_ = ScreenSaverTime; \ + } + + CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSStandbyTime) + CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSSuspendTime) + CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSOffTime) + + DPMSPowerLevel = DPMSModeOn; + DPMSEnabled = DPMSSupported(); + + if (DPMSEnabled) + AddExtension(DPMSExtensionName, 0, 0, + ProcDPMSDispatch, SProcDPMSDispatch, + DPMSCloseDownExtension, StandardMinorOpcode); } diff --git a/xserver/Xext/dpmsproc.h b/xserver/Xext/dpmsproc.h index 82dccbd67..1e24f1f55 100644 --- a/xserver/Xext/dpmsproc.h +++ b/xserver/Xext/dpmsproc.h @@ -9,7 +9,14 @@ #include "dixstruct.h" -int _X_EXPORT DPMSSet(ClientPtr client, int level); -Bool _X_EXPORT DPMSSupported(void); +extern int DPMSSet(ClientPtr client, int level); +extern Bool DPMSSupported(void); + +extern CARD32 DPMSStandbyTime; +extern CARD32 DPMSSuspendTime; +extern CARD32 DPMSOffTime; +extern CARD16 DPMSPowerLevel; +extern Bool DPMSEnabled; +extern Bool DPMSDisabledSwitch; #endif diff --git a/xserver/Xext/dpmsstubs.c b/xserver/Xext/dpmsstubs.c deleted file mode 100644 index f05d1e9f9..000000000 --- a/xserver/Xext/dpmsstubs.c +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************** - -Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dpmsproc.h" - -#define FALSE 0 - -Bool -DPMSSupported(void) -{ - return FALSE; -} - -int -DPMSSet(ClientPtr client, int level) -{ - return Success; -} diff --git a/xserver/Xext/geext.c b/xserver/Xext/geext.c index 6312f248b..5009c081a 100644 --- a/xserver/Xext/geext.c +++ b/xserver/Xext/geext.c @@ -47,7 +47,6 @@ static const int version_requests[] = { /* Forward declarations */ static void SGEGenericEvent(xEvent *from, xEvent *to); -#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) #define EXT_MASK(ext) ((ext) & 0x7F) /************************************************************/ @@ -98,7 +97,7 @@ static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = { /************************************************************/ /* swapped request handlers */ /************************************************************/ -static int +static int _X_COLD SProcGEQueryVersion(ClientPtr client) { REQUEST(xGEQueryVersionReq); @@ -127,7 +126,7 @@ ProcGEDispatch(ClientPtr client) REQUEST(xGEReq); - if (pGEClient->major_version >= NUM_VERSION_REQUESTS) + if (pGEClient->major_version >= ARRAY_SIZE(version_requests)) return BadRequest; if (stuff->ReqType > version_requests[pGEClient->major_version]) return BadRequest; @@ -136,7 +135,7 @@ ProcGEDispatch(ClientPtr client) } /* dispatch swapped requests */ -static int +static int _X_COLD SProcGEDispatch(ClientPtr client) { REQUEST(xGEReq); @@ -159,7 +158,7 @@ GEResetProc(ExtensionEntry * extEntry) * written on the wire, this one calls the registered swap function to do the * work. */ -static void +static void _X_COLD SGEGenericEvent(xEvent *from, xEvent *to) { xGenericEvent *gefrom = (xGenericEvent *) from; diff --git a/xserver/Xext/hashtable.c b/xserver/Xext/hashtable.c index 41b2e0013..93d1a2aec 100644 --- a/xserver/Xext/hashtable.c +++ b/xserver/Xext/hashtable.c @@ -77,10 +77,13 @@ ht_destroy(HashTable ht) for (c = 0; c < numBuckets; ++c) { xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) { xorg_list_del(&it->l); + free(it->key); + free(it->data); free(it); } } free(ht->buckets); + free(ht); } static Bool diff --git a/xserver/Xext/panoramiX.c b/xserver/Xext/panoramiX.c index 844ea49ce..bd9c45b03 100644 --- a/xserver/Xext/panoramiX.c +++ b/xserver/Xext/panoramiX.c @@ -751,11 +751,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth) PanoramiXNumDepths, sizeof(DepthRec)); PanoramiXDepths[j].depth = pDepth->depth; PanoramiXDepths[j].numVids = 0; - /* XXX suboptimal, should grow these dynamically */ - if (pDepth->numVids) - PanoramiXDepths[j].vids = xallocarray(pDepth->numVids, sizeof(VisualID)); - else - PanoramiXDepths[j].vids = NULL; + PanoramiXDepths[j].vids = NULL; } static void @@ -796,6 +792,9 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual) for (k = 0; k < PanoramiXNumDepths; k++) { if (PanoramiXDepths[k].depth == pVisual->nplanes) { + PanoramiXDepths[k].vids = reallocarray(PanoramiXDepths[k].vids, + PanoramiXDepths[k].numVids + 1, + sizeof(VisualID)); PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid; PanoramiXDepths[k].numVids++; break; diff --git a/xserver/Xext/panoramiXSwap.c b/xserver/Xext/panoramiXSwap.c index b6ff6f918..022defdc7 100644 --- a/xserver/Xext/panoramiXSwap.c +++ b/xserver/Xext/panoramiXSwap.c @@ -47,7 +47,7 @@ Equipment Corporation. #include "globals.h" #include "panoramiXh.h" -static int +static int _X_COLD SProcPanoramiXQueryVersion(ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); @@ -57,7 +57,7 @@ SProcPanoramiXQueryVersion(ClientPtr client) return ProcPanoramiXQueryVersion(client); } -static int +static int _X_COLD SProcPanoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); @@ -68,7 +68,7 @@ SProcPanoramiXGetState(ClientPtr client) return ProcPanoramiXGetState(client); } -static int +static int _X_COLD SProcPanoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); @@ -79,7 +79,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client) return ProcPanoramiXGetScreenCount(client); } -static int +static int _X_COLD SProcPanoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); @@ -91,7 +91,7 @@ SProcPanoramiXGetScreenSize(ClientPtr client) return ProcPanoramiXGetScreenSize(client); } -static int +static int _X_COLD SProcXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); @@ -101,7 +101,7 @@ SProcXineramaIsActive(ClientPtr client) return ProcXineramaIsActive(client); } -static int +static int _X_COLD SProcXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); @@ -111,7 +111,7 @@ SProcXineramaQueryScreens(ClientPtr client) return ProcXineramaQueryScreens(client); } -int +int _X_COLD SProcPanoramiXDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/saver.c b/xserver/Xext/saver.c index 45ac4d2c9..c27a66c80 100644 --- a/xserver/Xext/saver.c +++ b/xserver/Xext/saver.c @@ -53,6 +53,7 @@ in this Software without prior written authorization from the X Consortium. #endif #ifdef DPMSExtension #include +#include "dpmsproc.h" #endif #include "protocol-versions.h" @@ -426,7 +427,7 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced) } } -static void +static void _X_COLD SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * from, xScreenSaverNotifyEvent * to) { @@ -1208,17 +1209,26 @@ static int ProcScreenSaverSuspend(ClientPtr client) { ScreenSaverSuspensionPtr *prev, this; + BOOL suspend; REQUEST(xScreenSaverSuspendReq); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); + /* + * Old versions of XCB encode suspend as 1 byte followed by three + * pad bytes (which are always cleared), instead of a 4 byte + * value. Be compatible by just checking for a non-zero value in + * all 32-bits. + */ + suspend = stuff->suspend != 0; + /* Check if this client is suspending the screensaver */ for (prev = &suspendingClients; (this = *prev); prev = &this->next) if (this->pClient == client) break; if (this) { - if (stuff->suspend == TRUE) + if (suspend == TRUE) this->count++; else if (--this->count == 0) FreeResource(this->clientResource, RT_NONE); @@ -1227,7 +1237,7 @@ ProcScreenSaverSuspend(ClientPtr client) } /* If we get to this point, this client isn't suspending the screensaver */ - if (stuff->suspend == FALSE) + if (suspend == FALSE) return Success; /* @@ -1267,19 +1277,17 @@ ProcScreenSaverQueryVersion, ProcScreenSaverSetAttributes, ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,}; -#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0])) - static int ProcScreenSaverDispatch(ClientPtr client) { REQUEST(xReq); - if (stuff->data < NUM_REQUESTS) + if (stuff->data < ARRAY_SIZE(NormalVector)) return (*NormalVector[stuff->data]) (client); return BadRequest; } -static int +static int _X_COLD SProcScreenSaverQueryVersion(ClientPtr client) { REQUEST(xScreenSaverQueryVersionReq); @@ -1288,7 +1296,7 @@ SProcScreenSaverQueryVersion(ClientPtr client) return ProcScreenSaverQueryVersion(client); } -static int +static int _X_COLD SProcScreenSaverQueryInfo(ClientPtr client) { REQUEST(xScreenSaverQueryInfoReq); @@ -1298,7 +1306,7 @@ SProcScreenSaverQueryInfo(ClientPtr client) return ProcScreenSaverQueryInfo(client); } -static int +static int _X_COLD SProcScreenSaverSelectInput(ClientPtr client) { REQUEST(xScreenSaverSelectInputReq); @@ -1309,7 +1317,7 @@ SProcScreenSaverSelectInput(ClientPtr client) return ProcScreenSaverSelectInput(client); } -static int +static int _X_COLD SProcScreenSaverSetAttributes(ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); @@ -1327,7 +1335,7 @@ SProcScreenSaverSetAttributes(ClientPtr client) return ProcScreenSaverSetAttributes(client); } -static int +static int _X_COLD SProcScreenSaverUnsetAttributes(ClientPtr client) { REQUEST(xScreenSaverUnsetAttributesReq); @@ -1337,12 +1345,13 @@ SProcScreenSaverUnsetAttributes(ClientPtr client) return ProcScreenSaverUnsetAttributes(client); } -static int +static int _X_COLD SProcScreenSaverSuspend(ClientPtr client) { REQUEST(xScreenSaverSuspendReq); swaps(&stuff->length); + swapl(&stuff->suspend); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); return ProcScreenSaverSuspend(client); } @@ -1354,12 +1363,12 @@ SProcScreenSaverQueryVersion, SProcScreenSaverSetAttributes, SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,}; -static int +static int _X_COLD SProcScreenSaverDispatch(ClientPtr client) { REQUEST(xReq); - if (stuff->data < NUM_REQUESTS) + if (stuff->data < ARRAY_SIZE(NormalVector)) return (*SwappedVector[stuff->data]) (client); return BadRequest; } diff --git a/xserver/Xext/security.c b/xserver/Xext/security.c index 8cb3a2c73..162d07ae0 100644 --- a/xserver/Xext/security.c +++ b/xserver/Xext/security.c @@ -601,7 +601,7 @@ ProcSecurityDispatch(ClientPtr client) } } /* ProcSecurityDispatch */ -static int +static int _X_COLD SProcSecurityQueryVersion(ClientPtr client) { REQUEST(xSecurityQueryVersionReq); @@ -613,7 +613,7 @@ SProcSecurityQueryVersion(ClientPtr client) return ProcSecurityQueryVersion(client); } /* SProcSecurityQueryVersion */ -static int +static int _X_COLD SProcSecurityGenerateAuthorization(ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); @@ -637,7 +637,7 @@ SProcSecurityGenerateAuthorization(ClientPtr client) return ProcSecurityGenerateAuthorization(client); } /* SProcSecurityGenerateAuthorization */ -static int +static int _X_COLD SProcSecurityRevokeAuthorization(ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); @@ -648,7 +648,7 @@ SProcSecurityRevokeAuthorization(ClientPtr client) return ProcSecurityRevokeAuthorization(client); } /* SProcSecurityRevokeAuthorization */ -static int +static int _X_COLD SProcSecurityDispatch(ClientPtr client) { REQUEST(xReq); @@ -665,7 +665,7 @@ SProcSecurityDispatch(ClientPtr client) } } /* SProcSecurityDispatch */ -static void +static void _X_COLD SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from, xSecurityAuthorizationRevokedEvent * to) { diff --git a/xserver/Xext/shape.c b/xserver/Xext/shape.c index 142f9c178..e7c7a45b0 100644 --- a/xserver/Xext/shape.c +++ b/xserver/Xext/shape.c @@ -1074,7 +1074,7 @@ ProcShapeDispatch(ClientPtr client) } } -static void +static void _X_COLD SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to) { to->type = from->type; @@ -1089,7 +1089,7 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to) to->shaped = from->shaped; } -static int +static int _X_COLD SProcShapeQueryVersion(ClientPtr client) { REQUEST(xShapeQueryVersionReq); @@ -1098,7 +1098,7 @@ SProcShapeQueryVersion(ClientPtr client) return ProcShapeQueryVersion(client); } -static int +static int _X_COLD SProcShapeRectangles(ClientPtr client) { REQUEST(xShapeRectanglesReq); @@ -1112,7 +1112,7 @@ SProcShapeRectangles(ClientPtr client) return ProcShapeRectangles(client); } -static int +static int _X_COLD SProcShapeMask(ClientPtr client) { REQUEST(xShapeMaskReq); @@ -1126,7 +1126,7 @@ SProcShapeMask(ClientPtr client) return ProcShapeMask(client); } -static int +static int _X_COLD SProcShapeCombine(ClientPtr client) { REQUEST(xShapeCombineReq); @@ -1140,7 +1140,7 @@ SProcShapeCombine(ClientPtr client) return ProcShapeCombine(client); } -static int +static int _X_COLD SProcShapeOffset(ClientPtr client) { REQUEST(xShapeOffsetReq); @@ -1153,7 +1153,7 @@ SProcShapeOffset(ClientPtr client) return ProcShapeOffset(client); } -static int +static int _X_COLD SProcShapeQueryExtents(ClientPtr client) { REQUEST(xShapeQueryExtentsReq); @@ -1164,7 +1164,7 @@ SProcShapeQueryExtents(ClientPtr client) return ProcShapeQueryExtents(client); } -static int +static int _X_COLD SProcShapeSelectInput(ClientPtr client) { REQUEST(xShapeSelectInputReq); @@ -1175,7 +1175,7 @@ SProcShapeSelectInput(ClientPtr client) return ProcShapeSelectInput(client); } -static int +static int _X_COLD SProcShapeInputSelected(ClientPtr client) { REQUEST(xShapeInputSelectedReq); @@ -1186,7 +1186,7 @@ SProcShapeInputSelected(ClientPtr client) return ProcShapeInputSelected(client); } -static int +static int _X_COLD SProcShapeGetRectangles(ClientPtr client) { REQUEST(xShapeGetRectanglesReq); @@ -1196,7 +1196,7 @@ SProcShapeGetRectangles(ClientPtr client) return ProcShapeGetRectangles(client); } -static int +static int _X_COLD SProcShapeDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/shm.c b/xserver/Xext/shm.c index a95c91cbf..fa121f72c 100644 --- a/xserver/Xext/shm.c +++ b/xserver/Xext/shm.c @@ -834,6 +834,19 @@ ProcPanoramiXShmGetImage(ClientPtr client) return BadMatch; } + if (format == ZPixmap) { + widthBytesLine = PixmapBytePad(w, pDraw->depth); + length = widthBytesLine * h; + } + else { + widthBytesLine = PixmapBytePad(w, 1); + lenPer = widthBytesLine * h; + plane = ((Mask) 1) << (pDraw->depth - 1); + length = lenPer * Ones(planemask & (plane | (plane - 1))); + } + + VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); + drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr)); if (!drawables) return BadAlloc; @@ -856,18 +869,6 @@ ProcPanoramiXShmGetImage(ClientPtr client) .depth = pDraw->depth }; - if (format == ZPixmap) { - widthBytesLine = PixmapBytePad(w, pDraw->depth); - length = widthBytesLine * h; - } - else { - widthBytesLine = PixmapBytePad(w, 1); - lenPer = widthBytesLine * h; - plane = ((Mask) 1) << (pDraw->depth - 1); - length = lenPer * Ones(planemask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); xgi.size = length; if (length == 0) { /* nothing to do */ @@ -1195,25 +1196,30 @@ shm_tmpfile(void) { #ifdef SHMDIR int fd; - int flags; char template[] = SHMDIR "/shmfd-XXXXXX"; #ifdef O_TMPFILE fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); if (fd >= 0) { - ErrorF ("Using O_TMPFILE\n"); + DebugF ("Using O_TMPFILE\n"); return fd; } ErrorF ("Not using O_TMPFILE\n"); #endif +#ifdef HAVE_MKOSTEMP + fd = mkostemp(template, O_CLOEXEC); +#else fd = mkstemp(template); +#endif if (fd < 0) return -1; unlink(template); - flags = fcntl(fd, F_GETFD); +#ifndef HAVE_MKOSTEMP + int flags = fcntl(fd, F_GETFD); if (flags != -1) { flags |= FD_CLOEXEC; (void) fcntl(fd, F_SETFD, &flags); } +#endif return fd; #else return -1; @@ -1297,9 +1303,14 @@ static int ProcShmDispatch(ClientPtr client) { REQUEST(xReq); - switch (stuff->data) { - case X_ShmQueryVersion: + + if (stuff->data == X_ShmQueryVersion) return ProcShmQueryVersion(client); + + if (!client->local) + return BadRequest; + + switch (stuff->data) { case X_ShmAttach: return ProcShmAttach(client); case X_ShmDetach: @@ -1333,7 +1344,7 @@ ProcShmDispatch(ClientPtr client) } } -static void +static void _X_COLD SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to) { to->type = from->type; @@ -1345,7 +1356,7 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to) cpswapl(from->offset, to->offset); } -static int +static int _X_COLD SProcShmQueryVersion(ClientPtr client) { REQUEST(xShmQueryVersionReq); @@ -1354,7 +1365,7 @@ SProcShmQueryVersion(ClientPtr client) return ProcShmQueryVersion(client); } -static int +static int _X_COLD SProcShmAttach(ClientPtr client) { REQUEST(xShmAttachReq); @@ -1365,7 +1376,7 @@ SProcShmAttach(ClientPtr client) return ProcShmAttach(client); } -static int +static int _X_COLD SProcShmDetach(ClientPtr client) { REQUEST(xShmDetachReq); @@ -1375,7 +1386,7 @@ SProcShmDetach(ClientPtr client) return ProcShmDetach(client); } -static int +static int _X_COLD SProcShmPutImage(ClientPtr client) { REQUEST(xShmPutImageReq); @@ -1396,7 +1407,7 @@ SProcShmPutImage(ClientPtr client) return ProcShmPutImage(client); } -static int +static int _X_COLD SProcShmGetImage(ClientPtr client) { REQUEST(xShmGetImageReq); @@ -1413,7 +1424,7 @@ SProcShmGetImage(ClientPtr client) return ProcShmGetImage(client); } -static int +static int _X_COLD SProcShmCreatePixmap(ClientPtr client) { REQUEST(xShmCreatePixmapReq); @@ -1429,7 +1440,7 @@ SProcShmCreatePixmap(ClientPtr client) } #ifdef SHM_FD_PASSING -static int +static int _X_COLD SProcShmAttachFd(ClientPtr client) { REQUEST(xShmAttachFdReq); @@ -1440,7 +1451,7 @@ SProcShmAttachFd(ClientPtr client) return ProcShmAttachFd(client); } -static int +static int _X_COLD SProcShmCreateSegment(ClientPtr client) { REQUEST(xShmCreateSegmentReq); @@ -1452,13 +1463,18 @@ SProcShmCreateSegment(ClientPtr client) } #endif /* SHM_FD_PASSING */ -static int +static int _X_COLD SProcShmDispatch(ClientPtr client) { REQUEST(xReq); - switch (stuff->data) { - case X_ShmQueryVersion: + + if (stuff->data == X_ShmQueryVersion) return SProcShmQueryVersion(client); + + if (!client->local) + return BadRequest; + + switch (stuff->data) { case X_ShmAttach: return SProcShmAttach(client); case X_ShmDetach: diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c index 63350685c..8f22a865b 100644 --- a/xserver/Xext/sync.c +++ b/xserver/Xext/sync.c @@ -237,7 +237,37 @@ SyncAddTriggerToSyncObject(SyncTrigger * pTrigger) */ static Bool -SyncCheckTriggerPositiveComparison(SyncTrigger * pTrigger, CARD64 oldval) +SyncCheckTriggerPositiveComparison(SyncTrigger * pTrigger, int64_t oldval) +{ + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *) pTrigger->pSync; + + return pCounter == NULL || pCounter->value >= pTrigger->test_value; +} + +static Bool +SyncCheckTriggerNegativeComparison(SyncTrigger * pTrigger, int64_t oldval) +{ + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *) pTrigger->pSync; + + return pCounter == NULL || pCounter->value <= pTrigger->test_value; +} + +static Bool +SyncCheckTriggerPositiveTransition(SyncTrigger * pTrigger, int64_t oldval) { SyncCounter *pCounter; @@ -249,11 +279,12 @@ SyncCheckTriggerPositiveComparison(SyncTrigger * pTrigger, CARD64 oldval) pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || - XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value)); + (oldval < pTrigger->test_value && + pCounter->value >= pTrigger->test_value)); } static Bool -SyncCheckTriggerNegativeComparison(SyncTrigger * pTrigger, CARD64 oldval) +SyncCheckTriggerNegativeTransition(SyncTrigger * pTrigger, int64_t oldval) { SyncCounter *pCounter; @@ -265,45 +296,12 @@ SyncCheckTriggerNegativeComparison(SyncTrigger * pTrigger, CARD64 oldval) pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || - XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value)); + (oldval > pTrigger->test_value && + pCounter->value <= pTrigger->test_value)); } static Bool -SyncCheckTriggerPositiveTransition(SyncTrigger * pTrigger, CARD64 oldval) -{ - SyncCounter *pCounter; - - /* Non-counter sync objects should never get here because they - * never trigger this comparison. */ - if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) - return FALSE; - - pCounter = (SyncCounter *) pTrigger->pSync; - - return (pCounter == NULL || - (XSyncValueLessThan(oldval, pTrigger->test_value) && - XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value))); -} - -static Bool -SyncCheckTriggerNegativeTransition(SyncTrigger * pTrigger, CARD64 oldval) -{ - SyncCounter *pCounter; - - /* Non-counter sync objects should never get here because they - * never trigger this comparison. */ - if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) - return FALSE; - - pCounter = (SyncCounter *) pTrigger->pSync; - - return (pCounter == NULL || - (XSyncValueGreaterThan(oldval, pTrigger->test_value) && - XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value))); -} - -static Bool -SyncCheckTriggerFence(SyncTrigger * pTrigger, CARD64 unused) +SyncCheckTriggerFence(SyncTrigger * pTrigger, int64_t unused) { SyncFence *pFence = (SyncFence *) pTrigger->pSync; @@ -389,16 +387,15 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject, if (pTrigger->value_type == XSyncAbsolute) pTrigger->test_value = pTrigger->wait_value; else { /* relative */ - Bool overflow; if (pCounter == NULL) return BadMatch; - XSyncValueAdd(&pTrigger->test_value, pCounter->value, - pTrigger->wait_value, &overflow); + overflow = checked_int64_add(&pTrigger->test_value, + pCounter->value, pTrigger->wait_value); if (overflow) { - client->errorValue = XSyncValueHigh32(pTrigger->wait_value); + client->errorValue = pTrigger->wait_value >> 32; return BadValue; } } @@ -441,15 +438,15 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm) .type = SyncEventBase + XSyncAlarmNotify, .kind = XSyncAlarmNotify, .alarm = pAlarm->alarm_id, - .alarm_value_hi = XSyncValueHigh32(pTrigger->test_value), - .alarm_value_lo = XSyncValueLow32(pTrigger->test_value), + .alarm_value_hi = pTrigger->test_value >> 32, + .alarm_value_lo = pTrigger->test_value, .time = currentTime.milliseconds, .state = pAlarm->state }; if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) { - ane.counter_value_hi = XSyncValueHigh32(pCounter->value); - ane.counter_value_lo = XSyncValueLow32(pCounter->value); + ane.counter_value_hi = pCounter->value >> 32; + ane.counter_value_lo = pCounter->value; } else { /* XXX what else can we do if there's no counter? */ @@ -487,13 +484,13 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, pev->type = SyncEventBase + XSyncCounterNotify; pev->kind = XSyncCounterNotify; pev->counter = pTrigger->pSync->id; - pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); - pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); + pev->wait_value_lo = pTrigger->test_value; + pev->wait_value_hi = pTrigger->test_value >> 32; if (SYNC_COUNTER == pTrigger->pSync->type) { SyncCounter *pCounter = (SyncCounter *) pTrigger->pSync; - pev->counter_value_lo = XSyncValueLow32(pCounter->value); - pev->counter_value_hi = XSyncValueHigh32(pCounter->value); + pev->counter_value_lo = pCounter->value; + pev->counter_value_hi = pCounter->value >> 32; } else { pev->counter_value_lo = 0; @@ -530,7 +527,7 @@ SyncAlarmTriggerFired(SyncTrigger * pTrigger) { SyncAlarm *pAlarm = (SyncAlarm *) pTrigger; SyncCounter *pCounter; - CARD64 new_test_value; + int64_t new_test_value; if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) return; @@ -546,7 +543,7 @@ SyncAlarmTriggerFired(SyncTrigger * pTrigger) * no change is made to value (test-value) and the alarm * state is changed to Inactive before the event is generated." */ - if (pCounter == NULL || (XSyncValueIsZero(pAlarm->delta) + if (pCounter == NULL || (pAlarm->delta == 0 && (pAlarm->trigger.test_type == XSyncPositiveComparison || pAlarm->trigger.test_type == @@ -557,7 +554,7 @@ SyncAlarmTriggerFired(SyncTrigger * pTrigger) if (pAlarm->state == XSyncAlarmActive) { Bool overflow; - CARD64 oldvalue; + int64_t oldvalue; SyncTrigger *paTrigger = &pAlarm->trigger; SyncCounter *paCounter; @@ -576,8 +573,8 @@ SyncAlarmTriggerFired(SyncTrigger * pTrigger) /* XXX really should do something smarter here */ do { - XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value, - pAlarm->delta, &overflow); + overflow = checked_int64_add(&paTrigger->test_value, + paTrigger->test_value, pAlarm->delta); } while (!overflow && (*paTrigger->CheckTrigger) (paTrigger, paCounter->value)); @@ -636,7 +633,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger) * be stored in the events. */ for (; numwaits; numwaits--, pAwait++) { - CARD64 diff; + int64_t diff; Bool overflow, diffgreater, diffequal; /* "A CounterNotify event with the destroyed flag set to TRUE is @@ -655,16 +652,16 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger) * calculated by subtracting the test value from the value of * the counter." */ - XSyncValueSubtract(&diff, pCounter->value, - pAwait->trigger.test_value, &overflow); + overflow = checked_int64_subtract(&diff, pCounter->value, + pAwait->trigger.test_value); /* "If the difference lies outside the range for an INT64, an * event is not generated." */ if (overflow) continue; - diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold); - diffequal = XSyncValueEqual(diff, pAwait->event_threshold); + diffgreater = diff > pAwait->event_threshold; + diffequal = diff == pAwait->event_threshold; /* "If the test-type is PositiveTransition or * PositiveComparison, a CounterNotify event is generated if @@ -699,10 +696,10 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger) FreeResource(pAwaitUnion->header.delete_id, RT_NONE); } -static CARD64 -SyncUpdateCounter(SyncCounter *pCounter, CARD64 newval) +static int64_t +SyncUpdateCounter(SyncCounter *pCounter, int64_t newval) { - CARD64 oldval = pCounter->value; + int64_t oldval = pCounter->value; pCounter->value = newval; return oldval; } @@ -711,10 +708,10 @@ SyncUpdateCounter(SyncCounter *pCounter, CARD64 newval) * any triggers depending on the counter will be checked. */ void -SyncChangeCounter(SyncCounter * pCounter, CARD64 newval) +SyncChangeCounter(SyncCounter * pCounter, int64_t newval) { SyncTriggerList *ptl, *pnext; - CARD64 oldval; + int64_t oldval; oldval = SyncUpdateCounter(pCounter, newval); @@ -822,7 +819,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, case XSyncCAValue: mask &= ~XSyncCAValue; - XSyncIntsToValue(&pAlarm->trigger.wait_value, values[1], values[0]); + pAlarm->trigger.wait_value = ((int64_t)values[0] << 32) | values[1]; values += 2; break; @@ -834,7 +831,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, case XSyncCADelta: mask &= ~XSyncCADelta; - XSyncIntsToValue(&pAlarm->delta, values[1], values[0]); + pAlarm->delta = ((int64_t)values[0] << 32) | values[1]; values += 2; break; @@ -862,16 +859,13 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, * greater than zero, a Match error is generated." */ if (origmask & (XSyncCADelta | XSyncCATestType)) { - CARD64 zero; - - XSyncIntToValue(&zero, 0); if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) || (pAlarm->trigger.test_type == XSyncPositiveTransition)) - && XSyncValueLessThan(pAlarm->delta, zero)) + && pAlarm->delta < 0) || (((pAlarm->trigger.test_type == XSyncNegativeComparison) || (pAlarm->trigger.test_type == XSyncNegativeTransition)) - && XSyncValueGreaterThan(pAlarm->delta, zero)) + && pAlarm->delta > 0) ) { return BadMatch; } @@ -919,7 +913,7 @@ SyncCreate(ClientPtr client, XID id, unsigned char type) int SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL initially_triggered) { -#if HAVE_XSHMFENCE +#ifdef HAVE_XSHMFENCE SyncFence *pFence; int status; @@ -945,7 +939,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL int SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *pFence) { -#if HAVE_XSHMFENCE +#ifdef HAVE_XSHMFENCE return miSyncFDFromFence(pDraw, pFence); #else return BadImplementation; @@ -953,7 +947,7 @@ SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *pFence) } static SyncCounter * -SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue) +SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue) { SyncCounter *pCounter; @@ -977,8 +971,8 @@ static int FreeCounter(void *, XID); SyncCounter* SyncCreateSystemCounter(const char *name, - CARD64 initial, - CARD64 resolution, + int64_t initial, + int64_t resolution, SyncCounterType counterType, SyncSystemCounterQueryValue QueryValue, SyncSystemCounterBracketValues BracketValues @@ -1002,8 +996,8 @@ SyncCreateSystemCounter(const char *name, psci->QueryValue = QueryValue; psci->BracketValues = BracketValues; psci->private = NULL; - XSyncMaxValue(&psci->bracket_greater); - XSyncMinValue(&psci->bracket_less); + psci->bracket_greater = LLONG_MAX; + psci->bracket_less = LLONG_MIN; xorg_list_add(&psci->entry, &SysCounterList); } return pCounter; @@ -1023,8 +1017,8 @@ SyncComputeBracketValues(SyncCounter * pCounter) SyncTriggerList *pCur; SyncTrigger *pTrigger; SysCounterInfo *psci; - CARD64 *pnewgtval = NULL; - CARD64 *pnewltval = NULL; + int64_t *pnewgtval = NULL; + int64_t *pnewltval = NULL; SyncCounterType ct; if (!pCounter) @@ -1035,44 +1029,42 @@ SyncComputeBracketValues(SyncCounter * pCounter) if (ct == XSyncCounterNeverChanges) return; - XSyncMaxValue(&psci->bracket_greater); - XSyncMinValue(&psci->bracket_less); + psci->bracket_greater = LLONG_MAX; + psci->bracket_less = LLONG_MIN; for (pCur = pCounter->sync.pTriglist; pCur; pCur = pCur->next) { pTrigger = pCur->pTrigger; if (pTrigger->test_type == XSyncPositiveComparison && ct != XSyncCounterNeverIncreases) { - if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, - psci->bracket_greater)) { + if (pCounter->value < pTrigger->test_value && + pTrigger->test_value < psci->bracket_greater) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } - else if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { + else if (pCounter->value > pTrigger->test_value && + pTrigger->test_value > psci->bracket_less) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } } else if (pTrigger->test_type == XSyncNegativeComparison && ct != XSyncCounterNeverDecreases) { - if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, - psci->bracket_less)) { + if (pCounter->value > pTrigger->test_value && + pTrigger->test_value > psci->bracket_less) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } - else if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { + else if (pCounter->value < pTrigger->test_value && + pTrigger->test_value < psci->bracket_greater) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } } else if (pTrigger->test_type == XSyncNegativeTransition && ct != XSyncCounterNeverIncreases) { - if (XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { + if (pCounter->value >= pTrigger->test_value && + pTrigger->test_value > psci->bracket_less) { /* * If the value is exactly equal to our threshold, we want one * more event in the negative direction to ensure we pick up @@ -1081,16 +1073,16 @@ SyncComputeBracketValues(SyncCounter * pCounter) psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } - else if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { + else if (pCounter->value < pTrigger->test_value && + pTrigger->test_value < psci->bracket_greater) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } } else if (pTrigger->test_type == XSyncPositiveTransition && ct != XSyncCounterNeverDecreases) { - if (XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { + if (pCounter->value <= pTrigger->test_value && + pTrigger->test_value < psci->bracket_greater) { /* * If the value is exactly equal to our threshold, we * want one more event in the positive direction to @@ -1100,8 +1092,8 @@ SyncComputeBracketValues(SyncCounter * pCounter) psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } - else if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { + else if (pCounter->value > pTrigger->test_value && + pTrigger->test_value > psci->bracket_less) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } @@ -1283,8 +1275,8 @@ ProcSyncListSystemCounters(ClientPtr client) char *pname_in_reply; walklist->counter = psci->pCounter->sync.id; - walklist->resolution_hi = XSyncValueHigh32(psci->resolution); - walklist->resolution_lo = XSyncValueLow32(psci->resolution); + walklist->resolution_hi = psci->resolution >> 32; + walklist->resolution_lo = psci->resolution; namelen = strlen(psci->name); walklist->name_length = namelen; @@ -1391,14 +1383,14 @@ static int ProcSyncCreateCounter(ClientPtr client) { REQUEST(xSyncCreateCounterReq); - CARD64 initial; + int64_t initial; REQUEST_SIZE_MATCH(xSyncCreateCounterReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - XSyncIntsToValue(&initial, stuff->initial_value_lo, - stuff->initial_value_hi); + initial = ((int64_t)stuff->initial_value_hi << 32) | stuff->initial_value_lo; + if (!SyncCreateCounter(client, stuff->cid, initial)) return BadAlloc; @@ -1413,7 +1405,7 @@ ProcSyncSetCounter(ClientPtr client) { REQUEST(xSyncSetCounterReq); SyncCounter *pCounter; - CARD64 newvalue; + int64_t newvalue; int rc; REQUEST_SIZE_MATCH(xSyncSetCounterReq); @@ -1428,7 +1420,7 @@ ProcSyncSetCounter(ClientPtr client) return BadAccess; } - XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi); + newvalue = ((int64_t)stuff->value_hi << 32) | stuff->value_lo; SyncChangeCounter(pCounter, newvalue); return Success; } @@ -1441,7 +1433,7 @@ ProcSyncChangeCounter(ClientPtr client) { REQUEST(xSyncChangeCounterReq); SyncCounter *pCounter; - CARD64 newvalue; + int64_t newvalue; Bool overflow; int rc; @@ -1457,8 +1449,8 @@ ProcSyncChangeCounter(ClientPtr client) return BadAccess; } - XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi); - XSyncValueAdd(&newvalue, pCounter->value, newvalue, &overflow); + newvalue = (int64_t)stuff->value_hi << 32 | stuff->value_lo; + overflow = checked_int64_add(&newvalue, newvalue, pCounter->value); if (overflow) { /* XXX 64 bit value can't fit in 32 bits; do the best we can */ client->errorValue = stuff->value_hi; @@ -1529,7 +1521,7 @@ SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion * pAwaitUnion) pAwait = &(pAwaitUnion + 1)->await; /* skip over header */ for (i = 0; i < items; i++, pAwait++) { - CARD64 value; + int64_t value; /* don't have to worry about NULL counters because the request * errors before we get here out if they occur @@ -1539,7 +1531,7 @@ SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion * pAwaitUnion) value = ((SyncCounter *) pAwait->trigger.pSync)->value; break; default: - XSyncIntToValue(&value, 0); + value = 0; } if ((*pAwait->trigger.CheckTrigger) (&pAwait->trigger, value)) { @@ -1598,9 +1590,9 @@ ProcSyncAwait(ClientPtr client) /* sanity checks are in SyncInitTrigger */ pAwait->trigger.pSync = NULL; pAwait->trigger.value_type = pProtocolWaitConds->value_type; - XSyncIntsToValue(&pAwait->trigger.wait_value, - pProtocolWaitConds->wait_value_lo, - pProtocolWaitConds->wait_value_hi); + pAwait->trigger.wait_value = + ((int64_t)pProtocolWaitConds->wait_value_hi << 32) | + pProtocolWaitConds->wait_value_lo; pAwait->trigger.test_type = pProtocolWaitConds->test_type; status = SyncInitTrigger(client, &pAwait->trigger, @@ -1616,9 +1608,10 @@ ProcSyncAwait(ClientPtr client) /* this is not a mistake -- same function works for both cases */ pAwait->trigger.TriggerFired = SyncAwaitTriggerFired; pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired; - XSyncIntsToValue(&pAwait->event_threshold, - pProtocolWaitConds->event_threshold_lo, - pProtocolWaitConds->event_threshold_hi); + pAwait->event_threshold = + ((int64_t) pProtocolWaitConds->event_threshold_hi << 32) | + pProtocolWaitConds->event_threshold_lo; + pAwait->pHeader = &pAwaitUnion->header; pAwaitUnion->header.num_waitconditions++; } @@ -1656,8 +1649,8 @@ ProcSyncQueryCounter(ClientPtr client) .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .value_hi = XSyncValueHigh32(pCounter->value), - .value_lo = XSyncValueLow32(pCounter->value) + .value_hi = pCounter->value >> 32, + .value_lo = pCounter->value }; if (client->swapped) { @@ -1701,7 +1694,7 @@ ProcSyncCreateAlarm(ClientPtr client) pTrigger = &pAlarm->trigger; pTrigger->pSync = NULL; pTrigger->value_type = XSyncAbsolute; - XSyncIntToValue(&pTrigger->wait_value, 0L); + pTrigger->wait_value = 0; pTrigger->test_type = XSyncPositiveComparison; pTrigger->TriggerFired = SyncAlarmTriggerFired; pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed; @@ -1714,7 +1707,7 @@ ProcSyncCreateAlarm(ClientPtr client) pAlarm->client = client; pAlarm->alarm_id = stuff->id; - XSyncIntToValue(&pAlarm->delta, 1L); + pAlarm->delta = 1; pAlarm->events = TRUE; pAlarm->state = XSyncAlarmInactive; pAlarm->pEventClients = NULL; @@ -1826,17 +1819,17 @@ ProcSyncQueryAlarm(ClientPtr client) * on. */ .value_type = pTrigger->value_type, - .wait_value_hi = XSyncValueHigh32(pTrigger->wait_value), - .wait_value_lo = XSyncValueLow32(pTrigger->wait_value), + .wait_value_hi = pTrigger->wait_value >> 32, + .wait_value_lo = pTrigger->wait_value, #else .value_type = XSyncAbsolute, - .wait_value_hi = XSyncValueHigh32(pTrigger->test_value), - .wait_value_lo = XSyncValueLow32(pTrigger->test_value), + .wait_value_hi = pTrigger->test_value >> 32, + .wait_value_lo = pTrigger->test_value, #endif .test_type = pTrigger->test_type, - .delta_hi = XSyncValueHigh32(pAlarm->delta), - .delta_lo = XSyncValueLow32(pAlarm->delta), + .delta_hi = pAlarm->delta >> 32, + .delta_lo = pAlarm->delta, .events = pAlarm->events, .state = pAlarm->state }; @@ -2067,7 +2060,7 @@ ProcSyncAwaitFence(ClientPtr client) * satisfy SyncInitTrigger's validation logic */ pAwait->trigger.value_type = XSyncAbsolute; - XSyncIntToValue(&pAwait->trigger.wait_value, 0); + pAwait->trigger.wait_value = 0; pAwait->trigger.test_type = 0; status = SyncInitTrigger(client, &pAwait->trigger, @@ -2083,7 +2076,7 @@ ProcSyncAwaitFence(ClientPtr client) pAwait->trigger.TriggerFired = SyncAwaitTriggerFired; pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired; /* event_threshold is unused for fence syncs */ - XSyncIntToValue(&pAwait->event_threshold, 0); + pAwait->event_threshold = 0; pAwait->pHeader = &pAwaitUnion->header; pAwaitUnion->header.num_waitconditions++; } @@ -2151,7 +2144,7 @@ ProcSyncDispatch(ClientPtr client) * Boring Swapping stuff ... */ -static int +static int _X_COLD SProcSyncInitialize(ClientPtr client) { REQUEST(xSyncInitializeReq); @@ -2161,7 +2154,7 @@ SProcSyncInitialize(ClientPtr client) return ProcSyncInitialize(client); } -static int +static int _X_COLD SProcSyncListSystemCounters(ClientPtr client) { REQUEST(xSyncListSystemCountersReq); @@ -2171,7 +2164,7 @@ SProcSyncListSystemCounters(ClientPtr client) return ProcSyncListSystemCounters(client); } -static int +static int _X_COLD SProcSyncCreateCounter(ClientPtr client) { REQUEST(xSyncCreateCounterReq); @@ -2184,7 +2177,7 @@ SProcSyncCreateCounter(ClientPtr client) return ProcSyncCreateCounter(client); } -static int +static int _X_COLD SProcSyncSetCounter(ClientPtr client) { REQUEST(xSyncSetCounterReq); @@ -2197,7 +2190,7 @@ SProcSyncSetCounter(ClientPtr client) return ProcSyncSetCounter(client); } -static int +static int _X_COLD SProcSyncChangeCounter(ClientPtr client) { REQUEST(xSyncChangeCounterReq); @@ -2210,7 +2203,7 @@ SProcSyncChangeCounter(ClientPtr client) return ProcSyncChangeCounter(client); } -static int +static int _X_COLD SProcSyncQueryCounter(ClientPtr client) { REQUEST(xSyncQueryCounterReq); @@ -2221,7 +2214,7 @@ SProcSyncQueryCounter(ClientPtr client) return ProcSyncQueryCounter(client); } -static int +static int _X_COLD SProcSyncDestroyCounter(ClientPtr client) { REQUEST(xSyncDestroyCounterReq); @@ -2232,7 +2225,7 @@ SProcSyncDestroyCounter(ClientPtr client) return ProcSyncDestroyCounter(client); } -static int +static int _X_COLD SProcSyncAwait(ClientPtr client) { REQUEST(xSyncAwaitReq); @@ -2243,7 +2236,7 @@ SProcSyncAwait(ClientPtr client) return ProcSyncAwait(client); } -static int +static int _X_COLD SProcSyncCreateAlarm(ClientPtr client) { REQUEST(xSyncCreateAlarmReq); @@ -2256,7 +2249,7 @@ SProcSyncCreateAlarm(ClientPtr client) return ProcSyncCreateAlarm(client); } -static int +static int _X_COLD SProcSyncChangeAlarm(ClientPtr client) { REQUEST(xSyncChangeAlarmReq); @@ -2268,7 +2261,7 @@ SProcSyncChangeAlarm(ClientPtr client) return ProcSyncChangeAlarm(client); } -static int +static int _X_COLD SProcSyncQueryAlarm(ClientPtr client) { REQUEST(xSyncQueryAlarmReq); @@ -2279,7 +2272,7 @@ SProcSyncQueryAlarm(ClientPtr client) return ProcSyncQueryAlarm(client); } -static int +static int _X_COLD SProcSyncDestroyAlarm(ClientPtr client) { REQUEST(xSyncDestroyAlarmReq); @@ -2290,7 +2283,7 @@ SProcSyncDestroyAlarm(ClientPtr client) return ProcSyncDestroyAlarm(client); } -static int +static int _X_COLD SProcSyncSetPriority(ClientPtr client) { REQUEST(xSyncSetPriorityReq); @@ -2302,7 +2295,7 @@ SProcSyncSetPriority(ClientPtr client) return ProcSyncSetPriority(client); } -static int +static int _X_COLD SProcSyncGetPriority(ClientPtr client) { REQUEST(xSyncGetPriorityReq); @@ -2313,7 +2306,7 @@ SProcSyncGetPriority(ClientPtr client) return ProcSyncGetPriority(client); } -static int +static int _X_COLD SProcSyncCreateFence(ClientPtr client) { REQUEST(xSyncCreateFenceReq); @@ -2324,7 +2317,7 @@ SProcSyncCreateFence(ClientPtr client) return ProcSyncCreateFence(client); } -static int +static int _X_COLD SProcSyncTriggerFence(ClientPtr client) { REQUEST(xSyncTriggerFenceReq); @@ -2335,7 +2328,7 @@ SProcSyncTriggerFence(ClientPtr client) return ProcSyncTriggerFence(client); } -static int +static int _X_COLD SProcSyncResetFence(ClientPtr client) { REQUEST(xSyncResetFenceReq); @@ -2346,7 +2339,7 @@ SProcSyncResetFence(ClientPtr client) return ProcSyncResetFence(client); } -static int +static int _X_COLD SProcSyncDestroyFence(ClientPtr client) { REQUEST(xSyncDestroyFenceReq); @@ -2357,7 +2350,7 @@ SProcSyncDestroyFence(ClientPtr client) return ProcSyncDestroyFence(client); } -static int +static int _X_COLD SProcSyncQueryFence(ClientPtr client) { REQUEST(xSyncQueryFenceReq); @@ -2368,7 +2361,7 @@ SProcSyncQueryFence(ClientPtr client) return ProcSyncQueryFence(client); } -static int +static int _X_COLD SProcSyncAwaitFence(ClientPtr client) { REQUEST(xSyncAwaitFenceReq); @@ -2379,7 +2372,7 @@ SProcSyncAwaitFence(ClientPtr client) return ProcSyncAwaitFence(client); } -static int +static int _X_COLD SProcSyncDispatch(ClientPtr client) { REQUEST(xReq); @@ -2434,7 +2427,7 @@ SProcSyncDispatch(ClientPtr client) * Event Swapping */ -static void +static void _X_COLD SCounterNotifyEvent(xSyncCounterNotifyEvent * from, xSyncCounterNotifyEvent * to) { @@ -2451,7 +2444,7 @@ SCounterNotifyEvent(xSyncCounterNotifyEvent * from, to->destroyed = from->destroyed; } -static void +static void _X_COLD SAlarmNotifyEvent(xSyncAlarmNotifyEvent * from, xSyncAlarmNotifyEvent * to) { to->type = from->type; @@ -2541,15 +2534,18 @@ SyncExtensionInit(void) */ static void *ServertimeCounter; -static XSyncValue Now; -static XSyncValue *pnext_time; +static int64_t Now; +static int64_t *pnext_time; -#define GetTime()\ -{\ - unsigned long millis = GetTimeInMillis();\ - unsigned long maxis = XSyncValueHigh32(Now);\ - if (millis < XSyncValueLow32(Now)) maxis++;\ - XSyncIntsToValue(&Now, millis, maxis);\ +static void GetTime(void) +{ + unsigned long millis = GetTimeInMillis(); + unsigned long maxis = Now >> 32; + + if (millis < (Now & 0xffffffff)) + maxis++; + + Now = ((int64_t)maxis << 32) | millis; } /* @@ -2559,21 +2555,16 @@ static XSyncValue *pnext_time; /*ARGSUSED*/ static void ServertimeBlockHandler(void *env, void *wt) { - XSyncValue delay; unsigned long timeout; if (pnext_time) { GetTime(); - if (XSyncValueGreaterOrEqual(Now, *pnext_time)) { + if (Now >= *pnext_time) { timeout = 0; } else { - Bool overflow; - - XSyncValueSubtract(&delay, *pnext_time, Now, &overflow); - (void) overflow; - timeout = XSyncValueLow32(delay); + timeout = *pnext_time - Now; } AdjustWaitForDelay(wt, timeout); /* os/utils.c */ } @@ -2588,22 +2579,22 @@ ServertimeWakeupHandler(void *env, int rc) if (pnext_time) { GetTime(); - if (XSyncValueGreaterOrEqual(Now, *pnext_time)) { + if (Now >= *pnext_time) { SyncChangeCounter(ServertimeCounter, Now); } } } static void -ServertimeQueryValue(void *pCounter, CARD64 * pValue_return) +ServertimeQueryValue(void *pCounter, int64_t *pValue_return) { GetTime(); *pValue_return = Now; } static void -ServertimeBracketValues(void *pCounter, CARD64 * pbracket_less, - CARD64 * pbracket_greater) +ServertimeBracketValues(void *pCounter, int64_t *pbracket_less, + int64_t *pbracket_greater) { if (!pnext_time && pbracket_greater) { RegisterBlockAndWakeupHandlers(ServertimeBlockHandler, @@ -2619,10 +2610,9 @@ ServertimeBracketValues(void *pCounter, CARD64 * pbracket_less, static void SyncInitServerTime(void) { - CARD64 resolution; + int64_t resolution = 4; - XSyncIntsToValue(&Now, GetTimeInMillis(), 0); - XSyncIntToValue(&resolution, 4); + Now = GetTimeInMillis(); ServertimeCounter = SyncCreateSystemCounter("SERVERTIME", Now, resolution, XSyncCounterNeverDecreases, ServertimeQueryValue, @@ -2635,13 +2625,13 @@ SyncInitServerTime(void) */ typedef struct { - XSyncValue *value_less; - XSyncValue *value_greater; + int64_t *value_less; + int64_t *value_greater; int deviceid; } IdleCounterPriv; static void -IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) +IdleTimeQueryValue(void *pCounter, int64_t *pValue_return) { int deviceid; CARD32 idle; @@ -2654,7 +2644,7 @@ IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) else deviceid = XIAllDevices; idle = GetTimeInMillis() - LastEventTime(deviceid).milliseconds; - XSyncIntsToValue(pValue_return, idle, 0); + *pValue_return = idle; } static void @@ -2662,9 +2652,9 @@ IdleTimeBlockHandler(void *pCounter, void *wt) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); - XSyncValue *less = priv->value_less, - *greater = priv->value_greater; - XSyncValue idle, old_idle; + int64_t *less = priv->value_less; + int64_t *greater = priv->value_greater; + int64_t idle, old_idle; SyncTriggerList *list = counter->sync.pTriglist; SyncTrigger *trig; @@ -2681,10 +2671,10 @@ IdleTimeBlockHandler(void *pCounter, void *wt) * may be past the lower bracket if we dawdled with the events, so * check for whether we did reset and bomb out of select immediately. */ - if (less && XSyncValueGreaterThan(idle, *less) && + if (less && idle > *less && LastEventTimeWasReset(priv->deviceid)) { AdjustWaitForDelay(wt, 0); - } else if (less && XSyncValueLessOrEqual(idle, *less)) { + } else if (less && idle <= *less) { /* * We've been idle for less than the threshold value, and someone * wants to know about that, but now we need to know whether they @@ -2706,7 +2696,7 @@ IdleTimeBlockHandler(void *pCounter, void *wt) * idle time greater than this. Schedule a wakeup for the next * millisecond so we won't miss a transition. */ - if (XSyncValueEqual(idle, *less)) + if (idle == *less) AdjustWaitForDelay(wt, 1); } else if (greater) { @@ -2717,12 +2707,8 @@ IdleTimeBlockHandler(void *pCounter, void *wt) * that level-triggered, schedule an immediate wakeup. */ - if (XSyncValueLessThan(idle, *greater)) { - XSyncValue value; - Bool overflow; - - XSyncValueSubtract(&value, *greater, idle, &overflow); - AdjustWaitForDelay(wt, XSyncValueLow32(value)); + if (idle < *greater) { + AdjustWaitForDelay(wt, *greater - idle); } else { for (list = counter->sync.pTriglist; list; @@ -2740,10 +2726,11 @@ IdleTimeBlockHandler(void *pCounter, void *wt) } static void -IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, XSyncValue *greater) +IdleTimeCheckBrackets(SyncCounter *counter, int64_t idle, + int64_t *less, int64_t *greater) { - if ((greater && XSyncValueGreaterOrEqual(idle, *greater)) || - (less && XSyncValueLessOrEqual(idle, *less))) { + if ((greater && idle >= *greater) || + (less && idle <= *less)) { SyncChangeCounter(counter, idle); } else @@ -2755,9 +2742,9 @@ IdleTimeWakeupHandler(void *pCounter, int rc) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); - XSyncValue *less = priv->value_less, - *greater = priv->value_greater; - XSyncValue idle; + int64_t *less = priv->value_less; + int64_t *greater = priv->value_greater; + int64_t idle; if (!less && !greater) return; @@ -2772,10 +2759,8 @@ IdleTimeWakeupHandler(void *pCounter, int rc) */ if (LastEventTimeWasReset(priv->deviceid)) { LastEventTimeToggleResetFlag(priv->deviceid, FALSE); - if (!XSyncValueIsZero(idle)) { - XSyncValue zero; - XSyncIntsToValue(&zero, 0, 0); - IdleTimeCheckBrackets(counter, zero, less, greater); + if (idle != 0) { + IdleTimeCheckBrackets(counter, 0, less, greater); less = priv->value_less; greater = priv->value_greater; } @@ -2785,13 +2770,13 @@ IdleTimeWakeupHandler(void *pCounter, int rc) } static void -IdleTimeBracketValues(void *pCounter, CARD64 * pbracket_less, - CARD64 * pbracket_greater) +IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less, + int64_t *pbracket_greater) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); - XSyncValue *less = priv->value_less, - *greater = priv->value_greater; + int64_t *less = priv->value_less; + int64_t *greater = priv->value_greater; Bool registered = (less || greater); if (registered && !pbracket_less && !pbracket_greater) { @@ -2813,12 +2798,11 @@ IdleTimeBracketValues(void *pCounter, CARD64 * pbracket_less, static SyncCounter* init_system_idle_counter(const char *name, int deviceid) { - CARD64 resolution; - XSyncValue idle; + int64_t resolution = 4; + int64_t idle; SyncCounter *idle_time_counter; IdleTimeQueryValue(NULL, &idle); - XSyncIntToValue(&resolution, 4); idle_time_counter = SyncCreateSystemCounter(name, idle, resolution, XSyncCounterUnrestricted, diff --git a/xserver/Xext/syncsrv.h b/xserver/Xext/syncsrv.h index a8062d1c6..63f91a980 100644 --- a/xserver/Xext/syncsrv.h +++ b/xserver/Xext/syncsrv.h @@ -67,19 +67,19 @@ typedef enum { } SyncCounterType; typedef void (*SyncSystemCounterQueryValue)(void *counter, - CARD64 *value_return + int64_t *value_return ); typedef void (*SyncSystemCounterBracketValues)(void *counter, - CARD64 *pbracket_less, - CARD64 *pbracket_greater + int64_t *pbracket_less, + int64_t *pbracket_greater ); typedef struct _SysCounterInfo { SyncCounter *pCounter; char *name; - CARD64 resolution; - CARD64 bracket_greater; - CARD64 bracket_less; + int64_t resolution; + int64_t bracket_greater; + int64_t bracket_less; SyncCounterType counterType; /* how can this counter change */ SyncSystemCounterQueryValue QueryValue; SyncSystemCounterBracketValues BracketValues; @@ -97,7 +97,7 @@ typedef struct _SyncAlarm { SyncTrigger trigger; ClientPtr client; XSyncAlarm alarm_id; - CARD64 delta; + int64_t delta; int events; int state; SyncAlarmClientList *pEventClients; @@ -111,7 +111,7 @@ typedef struct { typedef struct { SyncTrigger trigger; - CARD64 event_threshold; + int64_t event_threshold; SyncAwaitHeader *pHeader; } SyncAwait; @@ -121,16 +121,15 @@ typedef union { } SyncAwaitUnion; extern SyncCounter* SyncCreateSystemCounter(const char *name, - CARD64 initial_value, - CARD64 resolution, + int64_t initial_value, + int64_t resolution, SyncCounterType counterType, SyncSystemCounterQueryValue QueryValue, SyncSystemCounterBracketValues BracketValues ); extern void SyncChangeCounter(SyncCounter *pCounter, - CARD64 new_value - ); + int64_t new_value); extern void SyncDestroySystemCounter(void *pCounter); diff --git a/xserver/Xext/vidmode.c b/xserver/Xext/vidmode.c index 76055c89a..6e4a7c709 100644 --- a/xserver/Xext/vidmode.c +++ b/xserver/Xext/vidmode.c @@ -1703,7 +1703,7 @@ ProcVidModeDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcVidModeQueryVersion(ClientPtr client) { REQUEST(xXF86VidModeQueryVersionReq); @@ -1711,7 +1711,7 @@ SProcVidModeQueryVersion(ClientPtr client) return ProcVidModeQueryVersion(client); } -static int +static int _X_COLD SProcVidModeGetModeLine(ClientPtr client) { REQUEST(xXF86VidModeGetModeLineReq); @@ -1721,7 +1721,7 @@ SProcVidModeGetModeLine(ClientPtr client) return ProcVidModeGetModeLine(client); } -static int +static int _X_COLD SProcVidModeGetAllModeLines(ClientPtr client) { REQUEST(xXF86VidModeGetAllModeLinesReq); @@ -1731,7 +1731,7 @@ SProcVidModeGetAllModeLines(ClientPtr client) return ProcVidModeGetAllModeLines(client); } -static int +static int _X_COLD SProcVidModeAddModeLine(ClientPtr client) { xXF86OldVidModeAddModeLineReq *oldstuff = @@ -1776,7 +1776,7 @@ SProcVidModeAddModeLine(ClientPtr client) return ProcVidModeAddModeLine(client); } -static int +static int _X_COLD SProcVidModeDeleteModeLine(ClientPtr client) { xXF86OldVidModeDeleteModeLineReq *oldstuff = @@ -1821,7 +1821,7 @@ SProcVidModeDeleteModeLine(ClientPtr client) return ProcVidModeDeleteModeLine(client); } -static int +static int _X_COLD SProcVidModeModModeLine(ClientPtr client) { xXF86OldVidModeModModeLineReq *oldstuff = @@ -1866,7 +1866,7 @@ SProcVidModeModModeLine(ClientPtr client) return ProcVidModeModModeLine(client); } -static int +static int _X_COLD SProcVidModeValidateModeLine(ClientPtr client) { xXF86OldVidModeValidateModeLineReq *oldstuff = @@ -1911,7 +1911,7 @@ SProcVidModeValidateModeLine(ClientPtr client) return ProcVidModeValidateModeLine(client); } -static int +static int _X_COLD SProcVidModeSwitchMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchModeReq); @@ -1922,7 +1922,7 @@ SProcVidModeSwitchMode(ClientPtr client) return ProcVidModeSwitchMode(client); } -static int +static int _X_COLD SProcVidModeSwitchToMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchToModeReq); @@ -1932,7 +1932,7 @@ SProcVidModeSwitchToMode(ClientPtr client) return ProcVidModeSwitchToMode(client); } -static int +static int _X_COLD SProcVidModeLockModeSwitch(ClientPtr client) { REQUEST(xXF86VidModeLockModeSwitchReq); @@ -1943,7 +1943,7 @@ SProcVidModeLockModeSwitch(ClientPtr client) return ProcVidModeLockModeSwitch(client); } -static int +static int _X_COLD SProcVidModeGetMonitor(ClientPtr client) { REQUEST(xXF86VidModeGetMonitorReq); @@ -1953,7 +1953,7 @@ SProcVidModeGetMonitor(ClientPtr client) return ProcVidModeGetMonitor(client); } -static int +static int _X_COLD SProcVidModeGetViewPort(ClientPtr client) { REQUEST(xXF86VidModeGetViewPortReq); @@ -1963,7 +1963,7 @@ SProcVidModeGetViewPort(ClientPtr client) return ProcVidModeGetViewPort(client); } -static int +static int _X_COLD SProcVidModeSetViewPort(ClientPtr client) { REQUEST(xXF86VidModeSetViewPortReq); @@ -1975,7 +1975,7 @@ SProcVidModeSetViewPort(ClientPtr client) return ProcVidModeSetViewPort(client); } -static int +static int _X_COLD SProcVidModeGetDotClocks(ClientPtr client) { REQUEST(xXF86VidModeGetDotClocksReq); @@ -1985,7 +1985,7 @@ SProcVidModeGetDotClocks(ClientPtr client) return ProcVidModeGetDotClocks(client); } -static int +static int _X_COLD SProcVidModeSetClientVersion(ClientPtr client) { REQUEST(xXF86VidModeSetClientVersionReq); @@ -1996,7 +1996,7 @@ SProcVidModeSetClientVersion(ClientPtr client) return ProcVidModeSetClientVersion(client); } -static int +static int _X_COLD SProcVidModeSetGamma(ClientPtr client) { REQUEST(xXF86VidModeSetGammaReq); @@ -2009,7 +2009,7 @@ SProcVidModeSetGamma(ClientPtr client) return ProcVidModeSetGamma(client); } -static int +static int _X_COLD SProcVidModeGetGamma(ClientPtr client) { REQUEST(xXF86VidModeGetGammaReq); @@ -2019,7 +2019,7 @@ SProcVidModeGetGamma(ClientPtr client) return ProcVidModeGetGamma(client); } -static int +static int _X_COLD SProcVidModeSetGammaRamp(ClientPtr client) { int length; @@ -2035,7 +2035,7 @@ SProcVidModeSetGammaRamp(ClientPtr client) return ProcVidModeSetGammaRamp(client); } -static int +static int _X_COLD SProcVidModeGetGammaRamp(ClientPtr client) { REQUEST(xXF86VidModeGetGammaRampReq); @@ -2046,7 +2046,7 @@ SProcVidModeGetGammaRamp(ClientPtr client) return ProcVidModeGetGammaRamp(client); } -static int +static int _X_COLD SProcVidModeGetGammaRampSize(ClientPtr client) { REQUEST(xXF86VidModeGetGammaRampSizeReq); @@ -2056,7 +2056,7 @@ SProcVidModeGetGammaRampSize(ClientPtr client) return ProcVidModeGetGammaRampSize(client); } -static int +static int _X_COLD SProcVidModeGetPermissions(ClientPtr client) { REQUEST(xXF86VidModeGetPermissionsReq); @@ -2066,7 +2066,7 @@ SProcVidModeGetPermissions(ClientPtr client) return ProcVidModeGetPermissions(client); } -static int +static int _X_COLD SProcVidModeDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xcmisc.c b/xserver/Xext/xcmisc.c index ed25650cd..c3c0b7f43 100644 --- a/xserver/Xext/xcmisc.c +++ b/xserver/Xext/xcmisc.c @@ -142,7 +142,7 @@ ProcXCMiscDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcXCMiscGetVersion(ClientPtr client) { REQUEST(xXCMiscGetVersionReq); @@ -154,7 +154,7 @@ SProcXCMiscGetVersion(ClientPtr client) return ProcXCMiscGetVersion(client); } -static int +static int _X_COLD SProcXCMiscGetXIDRange(ClientPtr client) { REQUEST(xReq); @@ -163,7 +163,7 @@ SProcXCMiscGetXIDRange(ClientPtr client) return ProcXCMiscGetXIDRange(client); } -static int +static int _X_COLD SProcXCMiscGetXIDList(ClientPtr client) { REQUEST(xXCMiscGetXIDListReq); @@ -174,7 +174,7 @@ SProcXCMiscGetXIDList(ClientPtr client) return ProcXCMiscGetXIDList(client); } -static int +static int _X_COLD SProcXCMiscDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c index f2584c221..529595bb7 100644 --- a/xserver/Xext/xf86bigfont.c +++ b/xserver/Xext/xf86bigfont.c @@ -40,13 +40,6 @@ #include #ifdef HAS_SHM -#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2) -/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */ -/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers): - Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define - PAGE_SIZE. It is defined in . */ -#include -#endif #ifdef SVR4 #include #endif @@ -657,7 +650,7 @@ ProcXF86BigfontDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcXF86BigfontQueryVersion(ClientPtr client) { REQUEST(xXF86BigfontQueryVersionReq); @@ -666,7 +659,7 @@ SProcXF86BigfontQueryVersion(ClientPtr client) return ProcXF86BigfontQueryVersion(client); } -static int +static int _X_COLD SProcXF86BigfontQueryFont(ClientPtr client) { REQUEST(xXF86BigfontQueryFontReq); @@ -677,7 +670,7 @@ SProcXF86BigfontQueryFont(ClientPtr client) return ProcXF86BigfontQueryFont(client); } -static int +static int _X_COLD SProcXF86BigfontDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c index bc54133d2..7a7aabc9b 100644 --- a/xserver/Xext/xres.c +++ b/xserver/Xext/xres.c @@ -274,6 +274,24 @@ ResFindAllRes(void *value, XID id, RESTYPE type, void *cdata) counts[(type & TypeMask) - 1]++; } +static CARD32 +resourceTypeAtom(int i) +{ + CARD32 ret; + + const char *name = LookupResourceName(i); + if (strcmp(name, XREGISTRY_UNKNOWN)) + ret = MakeAtom(name, strlen(name), TRUE); + else { + char buf[40]; + + snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1); + ret = MakeAtom(buf, strlen(buf), TRUE); + } + + return ret; +} + static int ProcXResQueryClientResources(ClientPtr client) { @@ -318,22 +336,12 @@ ProcXResQueryClientResources(ClientPtr client) if (num_types) { xXResType scratch; - const char *name; for (i = 0; i < lastResourceType; i++) { if (!counts[i]) continue; - name = LookupResourceName(i + 1); - if (strcmp(name, XREGISTRY_UNKNOWN)) - scratch.resource_type = MakeAtom(name, strlen(name), TRUE); - else { - char buf[40]; - - snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1); - scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE); - } - + scratch.resource_type = resourceTypeAtom(i + 1); scratch.count = counts[i]; if (client->swapped) { @@ -693,7 +701,7 @@ AddSubResourceSizeSpec(void *value, sizeFunc(value, id, &size); crossRef->spec.resource = id; - crossRef->spec.type = type; + crossRef->spec.type = resourceTypeAtom(type); crossRef->bytes = size.resourceSize; crossRef->refCount = size.refCnt; crossRef->useCount = 1; @@ -766,7 +774,7 @@ AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void *cdata) sizeFunc(ptr, id, &size); value->size.spec.resource = id; - value->size.spec.type = type; + value->size.spec.type = resourceTypeAtom(type); value->size.bytes = size.resourceSize; value->size.refCount = size.refCnt; value->size.useCount = 1; @@ -1009,14 +1017,14 @@ ProcResDispatch(ClientPtr client) return BadRequest; } -static int +static int _X_COLD SProcXResQueryVersion(ClientPtr client) { REQUEST_SIZE_MATCH(xXResQueryVersionReq); return ProcXResQueryVersion(client); } -static int +static int _X_COLD SProcXResQueryClientResources(ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); @@ -1025,7 +1033,7 @@ SProcXResQueryClientResources(ClientPtr client) return ProcXResQueryClientResources(client); } -static int +static int _X_COLD SProcXResQueryClientPixmapBytes(ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); @@ -1034,7 +1042,7 @@ SProcXResQueryClientPixmapBytes(ClientPtr client) return ProcXResQueryClientPixmapBytes(client); } -static int +static int _X_COLD SProcXResQueryClientIds (ClientPtr client) { REQUEST(xXResQueryClientIdsReq); @@ -1047,7 +1055,7 @@ SProcXResQueryClientIds (ClientPtr client) /** @brief Implements the XResQueryResourceBytes of XResProto v1.2. This variant byteswaps request contents before issuing the rest of the work to ProcXResQueryResourceBytes */ -static int +static int _X_COLD SProcXResQueryResourceBytes (ClientPtr client) { REQUEST(xXResQueryResourceBytesReq); @@ -1066,7 +1074,7 @@ SProcXResQueryResourceBytes (ClientPtr client) return ProcXResQueryResourceBytes(client); } -static int +static int _X_COLD SProcResDispatch (ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xselinux_ext.c b/xserver/Xext/xselinux_ext.c index fb7b2d526..1395a563b 100644 --- a/xserver/Xext/xselinux_ext.c +++ b/xserver/Xext/xselinux_ext.c @@ -528,13 +528,13 @@ ProcSELinuxDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcSELinuxQueryVersion(ClientPtr client) { return ProcSELinuxQueryVersion(client); } -static int +static int _X_COLD SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) { REQUEST(SELinuxSetCreateContextReq); @@ -544,7 +544,7 @@ SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) return ProcSELinuxSetCreateContext(client, offset); } -static int +static int _X_COLD SProcSELinuxSetDeviceContext(ClientPtr client) { REQUEST(SELinuxSetContextReq); @@ -555,7 +555,7 @@ SProcSELinuxSetDeviceContext(ClientPtr client) return ProcSELinuxSetDeviceContext(client); } -static int +static int _X_COLD SProcSELinuxGetDeviceContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); @@ -565,7 +565,7 @@ SProcSELinuxGetDeviceContext(ClientPtr client) return ProcSELinuxGetDeviceContext(client); } -static int +static int _X_COLD SProcSELinuxGetDrawableContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); @@ -575,7 +575,7 @@ SProcSELinuxGetDrawableContext(ClientPtr client) return ProcSELinuxGetDrawableContext(client); } -static int +static int _X_COLD SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetPropertyContextReq); @@ -586,7 +586,7 @@ SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) return ProcSELinuxGetPropertyContext(client, privKey); } -static int +static int _X_COLD SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetContextReq); @@ -596,7 +596,7 @@ SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) return ProcSELinuxGetSelectionContext(client, privKey); } -static int +static int _X_COLD SProcSELinuxListProperties(ClientPtr client) { REQUEST(SELinuxGetContextReq); @@ -606,7 +606,7 @@ SProcSELinuxListProperties(ClientPtr client) return ProcSELinuxListProperties(client); } -static int +static int _X_COLD SProcSELinuxGetClientContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); @@ -616,7 +616,7 @@ SProcSELinuxGetClientContext(ClientPtr client) return ProcSELinuxGetClientContext(client); } -static int +static int _X_COLD SProcSELinuxDispatch(ClientPtr client) { REQUEST(xReq); @@ -714,6 +714,4 @@ SELinuxExtensionInit(void) SELinuxNumberEvents, SELinuxNumberErrors, ProcSELinuxDispatch, SProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode); - - AddExtensionAlias("Flask", extEntry); } diff --git a/xserver/Xext/xtest.c b/xserver/Xext/xtest.c index 2371a69e1..38b80122b 100644 --- a/xserver/Xext/xtest.c +++ b/xserver/Xext/xtest.c @@ -468,7 +468,7 @@ ProcXTestDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcXTestGetVersion(ClientPtr client) { REQUEST(xXTestGetVersionReq); @@ -479,7 +479,7 @@ SProcXTestGetVersion(ClientPtr client) return ProcXTestGetVersion(client); } -static int +static int _X_COLD SProcXTestCompareCursor(ClientPtr client) { REQUEST(xXTestCompareCursorReq); @@ -491,7 +491,7 @@ SProcXTestCompareCursor(ClientPtr client) return ProcXTestCompareCursor(client); } -static int +static int _X_COLD XTestSwapFakeInput(ClientPtr client, xReq * req) { int nev; @@ -514,7 +514,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) return Success; } -static int +static int _X_COLD SProcXTestFakeInput(ClientPtr client) { int n; @@ -528,7 +528,7 @@ SProcXTestFakeInput(ClientPtr client) return ProcXTestFakeInput(client); } -static int +static int _X_COLD SProcXTestGrabControl(ClientPtr client) { REQUEST(xXTestGrabControlReq); @@ -538,7 +538,7 @@ SProcXTestGrabControl(ClientPtr client) return ProcXTestGrabControl(client); } -static int +static int _X_COLD SProcXTestDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xvdisp.c b/xserver/Xext/xvdisp.c index 4d412b857..5232b37d6 100644 --- a/xserver/Xext/xvdisp.c +++ b/xserver/Xext/xvdisp.c @@ -1115,7 +1115,7 @@ ProcXvDispatch(ClientPtr client) /* Swapped Procs */ -static int +static int _X_COLD SProcXvQueryExtension(ClientPtr client) { REQUEST(xvQueryExtensionReq); @@ -1124,7 +1124,7 @@ SProcXvQueryExtension(ClientPtr client) return XvProcVector[xv_QueryExtension] (client); } -static int +static int _X_COLD SProcXvQueryAdaptors(ClientPtr client) { REQUEST(xvQueryAdaptorsReq); @@ -1134,7 +1134,7 @@ SProcXvQueryAdaptors(ClientPtr client) return XvProcVector[xv_QueryAdaptors] (client); } -static int +static int _X_COLD SProcXvQueryEncodings(ClientPtr client) { REQUEST(xvQueryEncodingsReq); @@ -1144,7 +1144,7 @@ SProcXvQueryEncodings(ClientPtr client) return XvProcVector[xv_QueryEncodings] (client); } -static int +static int _X_COLD SProcXvGrabPort(ClientPtr client) { REQUEST(xvGrabPortReq); @@ -1155,7 +1155,7 @@ SProcXvGrabPort(ClientPtr client) return XvProcVector[xv_GrabPort] (client); } -static int +static int _X_COLD SProcXvUngrabPort(ClientPtr client) { REQUEST(xvUngrabPortReq); @@ -1166,7 +1166,7 @@ SProcXvUngrabPort(ClientPtr client) return XvProcVector[xv_UngrabPort] (client); } -static int +static int _X_COLD SProcXvPutVideo(ClientPtr client) { REQUEST(xvPutVideoReq); @@ -1186,7 +1186,7 @@ SProcXvPutVideo(ClientPtr client) return XvProcVector[xv_PutVideo] (client); } -static int +static int _X_COLD SProcXvPutStill(ClientPtr client) { REQUEST(xvPutStillReq); @@ -1206,7 +1206,7 @@ SProcXvPutStill(ClientPtr client) return XvProcVector[xv_PutStill] (client); } -static int +static int _X_COLD SProcXvGetVideo(ClientPtr client) { REQUEST(xvGetVideoReq); @@ -1226,7 +1226,7 @@ SProcXvGetVideo(ClientPtr client) return XvProcVector[xv_GetVideo] (client); } -static int +static int _X_COLD SProcXvGetStill(ClientPtr client) { REQUEST(xvGetStillReq); @@ -1246,7 +1246,7 @@ SProcXvGetStill(ClientPtr client) return XvProcVector[xv_GetStill] (client); } -static int +static int _X_COLD SProcXvPutImage(ClientPtr client) { REQUEST(xvPutImageReq); @@ -1270,7 +1270,7 @@ SProcXvPutImage(ClientPtr client) } #ifdef MITSHM -static int +static int _X_COLD SProcXvShmPutImage(ClientPtr client) { REQUEST(xvShmPutImageReq); @@ -1298,7 +1298,7 @@ SProcXvShmPutImage(ClientPtr client) #define SProcXvShmPutImage ProcXvShmPutImage #endif -static int +static int _X_COLD SProcXvSelectVideoNotify(ClientPtr client) { REQUEST(xvSelectVideoNotifyReq); @@ -1308,7 +1308,7 @@ SProcXvSelectVideoNotify(ClientPtr client) return XvProcVector[xv_SelectVideoNotify] (client); } -static int +static int _X_COLD SProcXvSelectPortNotify(ClientPtr client) { REQUEST(xvSelectPortNotifyReq); @@ -1318,7 +1318,7 @@ SProcXvSelectPortNotify(ClientPtr client) return XvProcVector[xv_SelectPortNotify] (client); } -static int +static int _X_COLD SProcXvStopVideo(ClientPtr client) { REQUEST(xvStopVideoReq); @@ -1329,7 +1329,7 @@ SProcXvStopVideo(ClientPtr client) return XvProcVector[xv_StopVideo] (client); } -static int +static int _X_COLD SProcXvSetPortAttribute(ClientPtr client) { REQUEST(xvSetPortAttributeReq); @@ -1341,7 +1341,7 @@ SProcXvSetPortAttribute(ClientPtr client) return XvProcVector[xv_SetPortAttribute] (client); } -static int +static int _X_COLD SProcXvGetPortAttribute(ClientPtr client) { REQUEST(xvGetPortAttributeReq); @@ -1352,7 +1352,7 @@ SProcXvGetPortAttribute(ClientPtr client) return XvProcVector[xv_GetPortAttribute] (client); } -static int +static int _X_COLD SProcXvQueryBestSize(ClientPtr client) { REQUEST(xvQueryBestSizeReq); @@ -1366,7 +1366,7 @@ SProcXvQueryBestSize(ClientPtr client) return XvProcVector[xv_QueryBestSize] (client); } -static int +static int _X_COLD SProcXvQueryPortAttributes(ClientPtr client) { REQUEST(xvQueryPortAttributesReq); @@ -1376,7 +1376,7 @@ SProcXvQueryPortAttributes(ClientPtr client) return XvProcVector[xv_QueryPortAttributes] (client); } -static int +static int _X_COLD SProcXvQueryImageAttributes(ClientPtr client) { REQUEST(xvQueryImageAttributesReq); @@ -1389,7 +1389,7 @@ SProcXvQueryImageAttributes(ClientPtr client) return XvProcVector[xv_QueryImageAttributes] (client); } -static int +static int _X_COLD SProcXvListImageFormats(ClientPtr client) { REQUEST(xvListImageFormatsReq); @@ -1419,7 +1419,7 @@ SProcXvQueryExtension, SProcXvListImageFormats, SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,}; -int +int _X_COLD SProcXvDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/Xext/xvmain.c b/xserver/Xext/xvmain.c index c9b11d4bb..c520c7d29 100644 --- a/xserver/Xext/xvmain.c +++ b/xserver/Xext/xvmain.c @@ -984,7 +984,7 @@ XvdiGetPortAttribute(ClientPtr client, } -static void +static void _X_COLD WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to) { @@ -998,7 +998,7 @@ WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to) } -static void +static void _X_COLD WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to) { diff --git a/xserver/Xext/xvmc.c b/xserver/Xext/xvmc.c index 7565c173d..c7338b766 100644 --- a/xserver/Xext/xvmc.c +++ b/xserver/Xext/xvmc.c @@ -690,7 +690,7 @@ ProcXvMCDispatch(ClientPtr client) return BadRequest; } -static int +static int _X_COLD SProcXvMCDispatch(ClientPtr client) { /* We only support local */ diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in index 61e4a5d7d..05fed0c06 100644 --- a/xserver/Xi/Makefile.in +++ b/xserver/Xi/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -321,6 +321,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -339,15 +340,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -355,6 +359,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -426,8 +432,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/Xi/allowev.c b/xserver/Xi/allowev.c index 770fe9fd8..c25edb3bf 100644 --- a/xserver/Xi/allowev.c +++ b/xserver/Xi/allowev.c @@ -69,7 +69,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXAllowDeviceEvents(ClientPtr client) { REQUEST(xAllowDeviceEventsReq); diff --git a/xserver/Xi/chgdctl.c b/xserver/Xi/chgdctl.c index b3ee867f0..a778fa380 100644 --- a/xserver/Xi/chgdctl.c +++ b/xserver/Xi/chgdctl.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangeDeviceControl(ClientPtr client) { xDeviceCtl *ctl; @@ -247,7 +247,7 @@ ProcXChangeDeviceControl(ClientPtr client) * */ -void +void _X_COLD SRepXChangeDeviceControl(ClientPtr client, int size, xChangeDeviceControlReply * rep) { diff --git a/xserver/Xi/chgfctl.c b/xserver/Xi/chgfctl.c index 224c2ba0a..1de4da9ef 100644 --- a/xserver/Xi/chgfctl.c +++ b/xserver/Xi/chgfctl.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangeFeedbackControl(ClientPtr client) { REQUEST(xChangeFeedbackControlReq); diff --git a/xserver/Xi/chgkbd.c b/xserver/Xi/chgkbd.c index ea91eb371..4f5abd731 100644 --- a/xserver/Xi/chgkbd.c +++ b/xserver/Xi/chgkbd.c @@ -72,7 +72,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangeKeyboardDevice(ClientPtr client) { REQUEST(xChangeKeyboardDeviceReq); diff --git a/xserver/Xi/chgkmap.c b/xserver/Xi/chgkmap.c index 49660f944..befe6e7ae 100644 --- a/xserver/Xi/chgkmap.c +++ b/xserver/Xi/chgkmap.c @@ -69,7 +69,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangeDeviceKeyMapping(ClientPtr client) { unsigned int count; diff --git a/xserver/Xi/chgprop.c b/xserver/Xi/chgprop.c index 84fb51dcb..1d72770f1 100644 --- a/xserver/Xi/chgprop.c +++ b/xserver/Xi/chgprop.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangeDeviceDontPropagateList(ClientPtr client) { REQUEST(xChangeDeviceDontPropagateListReq); diff --git a/xserver/Xi/chgptr.c b/xserver/Xi/chgptr.c index f99d1aaea..06047a62a 100644 --- a/xserver/Xi/chgptr.c +++ b/xserver/Xi/chgptr.c @@ -74,7 +74,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXChangePointerDevice(ClientPtr client) { REQUEST(xChangePointerDeviceReq); diff --git a/xserver/Xi/closedev.c b/xserver/Xi/closedev.c index 154e6ce08..199d38a5a 100644 --- a/xserver/Xi/closedev.c +++ b/xserver/Xi/closedev.c @@ -70,7 +70,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXCloseDevice(ClientPtr client) { REQUEST(xCloseDeviceReq); diff --git a/xserver/Xi/devbell.c b/xserver/Xi/devbell.c index 07865d270..2e2a348f9 100644 --- a/xserver/Xi/devbell.c +++ b/xserver/Xi/devbell.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXDeviceBell(ClientPtr client) { REQUEST(xDeviceBellReq); diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c index 7a86ee2e7..33dacbeb4 100644 --- a/xserver/Xi/extinit.c +++ b/xserver/Xi/extinit.c @@ -407,7 +407,7 @@ ProcIDispatch(ClientPtr client) * */ -static int +static int _X_COLD SProcIDispatch(ClientPtr client) { REQUEST(xReq); @@ -425,7 +425,7 @@ SProcIDispatch(ClientPtr client) * */ -static void +static void _X_COLD SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) { /* All we look at is the type field */ @@ -859,7 +859,7 @@ SBarrierEvent(xXIBarrierEvent * from, } /** Event swapping function for XI2 events. */ -void +void _X_COLD XI2EventSwap(xGenericEvent *from, xGenericEvent *to) { switch (from->evtype) { @@ -1202,7 +1202,7 @@ MakeDeviceTypeAtoms(void) */ #define DO_SWAP(func,type) func ((type *)from, (type *)to) -static void +static void _X_COLD SEventIDispatch(xEvent *from, xEvent *to) { int type = from->u.u.type & 0177; diff --git a/xserver/Xi/getbmap.c b/xserver/Xi/getbmap.c index 49b868889..ce3e9e60b 100644 --- a/xserver/Xi/getbmap.c +++ b/xserver/Xi/getbmap.c @@ -67,7 +67,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceButtonMapping(ClientPtr client) { REQUEST(xGetDeviceButtonMappingReq); @@ -122,7 +122,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client) * */ -void +void _X_COLD SRepXGetDeviceButtonMapping(ClientPtr client, int size, xGetDeviceButtonMappingReply * rep) { diff --git a/xserver/Xi/getdctl.c b/xserver/Xi/getdctl.c index 6f73e0979..149f5e14e 100644 --- a/xserver/Xi/getdctl.c +++ b/xserver/Xi/getdctl.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceControl(ClientPtr client) { REQUEST(xGetDeviceControlReq); @@ -153,7 +153,7 @@ CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf) * */ -void +void _X_COLD SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/getfctl.c b/xserver/Xi/getfctl.c index 599b2ef97..eea0113c1 100644 --- a/xserver/Xi/getfctl.c +++ b/xserver/Xi/getfctl.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetFeedbackControl(ClientPtr client) { REQUEST(xGetFeedbackControlReq); @@ -258,7 +258,7 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf) * */ -void +void _X_COLD SRepXGetFeedbackControl(ClientPtr client, int size, xGetFeedbackControlReply * rep) { diff --git a/xserver/Xi/getfocus.c b/xserver/Xi/getfocus.c index 40546cb84..cf8e02449 100644 --- a/xserver/Xi/getfocus.c +++ b/xserver/Xi/getfocus.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceFocus(ClientPtr client) { REQUEST(xGetDeviceFocusReq); @@ -130,7 +130,7 @@ ProcXGetDeviceFocus(ClientPtr client) * */ -void +void _X_COLD SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/getkmap.c b/xserver/Xi/getkmap.c index 87c197759..c6db2cee2 100644 --- a/xserver/Xi/getkmap.c +++ b/xserver/Xi/getkmap.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceKeyMapping(ClientPtr client) { REQUEST(xGetDeviceKeyMappingReq); @@ -146,7 +146,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client) * */ -void +void _X_COLD SRepXGetDeviceKeyMapping(ClientPtr client, int size, xGetDeviceKeyMappingReply * rep) { diff --git a/xserver/Xi/getmmap.c b/xserver/Xi/getmmap.c index f07f2bb5c..19d8eb221 100644 --- a/xserver/Xi/getmmap.c +++ b/xserver/Xi/getmmap.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceModifierMapping(ClientPtr client) { REQUEST(xGetDeviceModifierMappingReq); @@ -125,7 +125,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client) * */ -void +void _X_COLD SRepXGetDeviceModifierMapping(ClientPtr client, int size, xGetDeviceModifierMappingReply * rep) { diff --git a/xserver/Xi/getprop.c b/xserver/Xi/getprop.c index 19f18af21..b744f35cb 100644 --- a/xserver/Xi/getprop.c +++ b/xserver/Xi/getprop.c @@ -72,7 +72,7 @@ extern int ExtEventIndex; * */ -int +int _X_COLD SProcXGetDeviceDontPropagateList(ClientPtr client) { REQUEST(xGetDeviceDontPropagateListReq); @@ -173,7 +173,7 @@ XEventClass * */ -void +void _X_COLD SRepXGetDeviceDontPropagateList(ClientPtr client, int size, xGetDeviceDontPropagateListReply * rep) { diff --git a/xserver/Xi/getselev.c b/xserver/Xi/getselev.c index 60a46c2d1..0623c7ac4 100644 --- a/xserver/Xi/getselev.c +++ b/xserver/Xi/getselev.c @@ -70,7 +70,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetSelectedExtensionEvents(ClientPtr client) { REQUEST(xGetSelectedExtensionEventsReq); @@ -164,7 +164,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) * */ -void +void _X_COLD SRepXGetSelectedExtensionEvents(ClientPtr client, int size, xGetSelectedExtensionEventsReply * rep) { diff --git a/xserver/Xi/getvers.c b/xserver/Xi/getvers.c index 829e69535..a56ff1684 100644 --- a/xserver/Xi/getvers.c +++ b/xserver/Xi/getvers.c @@ -70,7 +70,7 @@ XExtensionVersion XIVersion; * */ -int +int _X_COLD SProcXGetExtensionVersion(ClientPtr client) { REQUEST(xGetExtensionVersionReq); @@ -120,7 +120,7 @@ ProcXGetExtensionVersion(ClientPtr client) * */ -void +void _X_COLD SRepXGetExtensionVersion(ClientPtr client, int size, xGetExtensionVersionReply * rep) { diff --git a/xserver/Xi/grabdev.c b/xserver/Xi/grabdev.c index 090043814..eb4f9bfde 100644 --- a/xserver/Xi/grabdev.c +++ b/xserver/Xi/grabdev.c @@ -72,7 +72,7 @@ extern int ExtEventIndex; * */ -int +int _X_COLD SProcXGrabDevice(ClientPtr client) { REQUEST(xGrabDeviceReq); @@ -205,7 +205,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count, * */ -void +void _X_COLD SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/grabdevb.c b/xserver/Xi/grabdevb.c index 8b4ae698e..a2f7eb395 100644 --- a/xserver/Xi/grabdevb.c +++ b/xserver/Xi/grabdevb.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGrabDeviceButton(ClientPtr client) { REQUEST(xGrabDeviceButtonReq); diff --git a/xserver/Xi/grabdevk.c b/xserver/Xi/grabdevk.c index 8694f9e6d..e856fa82c 100644 --- a/xserver/Xi/grabdevk.c +++ b/xserver/Xi/grabdevk.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGrabDeviceKey(ClientPtr client) { REQUEST(xGrabDeviceKeyReq); diff --git a/xserver/Xi/gtmotion.c b/xserver/Xi/gtmotion.c index cde5351a6..7c6684996 100644 --- a/xserver/Xi/gtmotion.c +++ b/xserver/Xi/gtmotion.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXGetDeviceMotionEvents(ClientPtr client) { REQUEST(xGetDeviceMotionEventsReq); @@ -162,7 +162,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) * */ -void +void _X_COLD SRepXGetDeviceMotionEvents(ClientPtr client, int size, xGetDeviceMotionEventsReply * rep) { diff --git a/xserver/Xi/listdev.c b/xserver/Xi/listdev.c index 6a10091d0..c15e61b37 100644 --- a/xserver/Xi/listdev.c +++ b/xserver/Xi/listdev.c @@ -74,7 +74,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXListInputDevices(ClientPtr client) { REQUEST(xListInputDevicesReq); @@ -413,7 +413,7 @@ ProcXListInputDevices(ClientPtr client) * */ -void +void _X_COLD SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/opendev.c b/xserver/Xi/opendev.c index 6708bade1..3472c97dd 100644 --- a/xserver/Xi/opendev.c +++ b/xserver/Xi/opendev.c @@ -73,7 +73,7 @@ extern CARD8 event_base[]; * */ -int +int _X_COLD SProcXOpenDevice(ClientPtr client) { REQUEST(xOpenDeviceReq); @@ -163,7 +163,7 @@ ProcXOpenDevice(ClientPtr client) * */ -void +void _X_COLD SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/queryst.c b/xserver/Xi/queryst.c index 04a652be3..6c9d66606 100644 --- a/xserver/Xi/queryst.c +++ b/xserver/Xi/queryst.c @@ -53,7 +53,7 @@ from The Open Group. * */ -int +int _X_COLD SProcXQueryDeviceState(ClientPtr client) { REQUEST(xQueryDeviceStateReq); @@ -179,7 +179,7 @@ ProcXQueryDeviceState(ClientPtr client) * */ -void +void _X_COLD SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/selectev.c b/xserver/Xi/selectev.c index 284bd29e5..b9b8112aa 100644 --- a/xserver/Xi/selectev.c +++ b/xserver/Xi/selectev.c @@ -119,7 +119,7 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, * */ -int +int _X_COLD SProcXSelectExtensionEvent(ClientPtr client) { REQUEST(xSelectExtensionEventReq); diff --git a/xserver/Xi/sendexev.c b/xserver/Xi/sendexev.c index 5ecc228ee..5c2e0fc56 100644 --- a/xserver/Xi/sendexev.c +++ b/xserver/Xi/sendexev.c @@ -73,7 +73,7 @@ extern int lastEvent; /* Defined in extension.c */ * */ -int +int _X_COLD SProcXSendExtensionEvent(ClientPtr client) { CARD32 *p; diff --git a/xserver/Xi/setbmap.c b/xserver/Xi/setbmap.c index 94796558d..f94db861d 100644 --- a/xserver/Xi/setbmap.c +++ b/xserver/Xi/setbmap.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXSetDeviceButtonMapping(ClientPtr client) { REQUEST(xSetDeviceButtonMappingReq); @@ -130,7 +130,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client) * */ -void +void _X_COLD SRepXSetDeviceButtonMapping(ClientPtr client, int size, xSetDeviceButtonMappingReply * rep) { diff --git a/xserver/Xi/setdval.c b/xserver/Xi/setdval.c index 463e4f38c..e57cb259d 100644 --- a/xserver/Xi/setdval.c +++ b/xserver/Xi/setdval.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXSetDeviceValuators(ClientPtr client) { REQUEST(xSetDeviceValuatorsReq); @@ -137,7 +137,7 @@ ProcXSetDeviceValuators(ClientPtr client) * */ -void +void _X_COLD SRepXSetDeviceValuators(ClientPtr client, int size, xSetDeviceValuatorsReply * rep) { diff --git a/xserver/Xi/setfocus.c b/xserver/Xi/setfocus.c index 809184189..8ca19d520 100644 --- a/xserver/Xi/setfocus.c +++ b/xserver/Xi/setfocus.c @@ -71,7 +71,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXSetDeviceFocus(ClientPtr client) { REQUEST(xSetDeviceFocusReq); diff --git a/xserver/Xi/setmmap.c b/xserver/Xi/setmmap.c index 1320cfec7..d60096a5a 100644 --- a/xserver/Xi/setmmap.c +++ b/xserver/Xi/setmmap.c @@ -70,7 +70,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXSetDeviceModifierMapping(ClientPtr client) { REQUEST(xSetDeviceModifierMappingReq); @@ -136,7 +136,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client) * */ -void +void _X_COLD SRepXSetDeviceModifierMapping(ClientPtr client, int size, xSetDeviceModifierMappingReply * rep) { diff --git a/xserver/Xi/setmode.c b/xserver/Xi/setmode.c index 5ed09136e..e7e12d4e0 100644 --- a/xserver/Xi/setmode.c +++ b/xserver/Xi/setmode.c @@ -68,7 +68,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXSetDeviceMode(ClientPtr client) { REQUEST(xSetDeviceModeReq); @@ -138,7 +138,7 @@ ProcXSetDeviceMode(ClientPtr client) * */ -void +void _X_COLD SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/ungrdev.c b/xserver/Xi/ungrdev.c index 162a00abf..fd4fc0f45 100644 --- a/xserver/Xi/ungrdev.c +++ b/xserver/Xi/ungrdev.c @@ -67,7 +67,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXUngrabDevice(ClientPtr client) { REQUEST(xUngrabDeviceReq); diff --git a/xserver/Xi/ungrdevb.c b/xserver/Xi/ungrdevb.c index b02510ea0..47b97d716 100644 --- a/xserver/Xi/ungrdevb.c +++ b/xserver/Xi/ungrdevb.c @@ -73,7 +73,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXUngrabDeviceButton(ClientPtr client) { REQUEST(xUngrabDeviceButtonReq); diff --git a/xserver/Xi/ungrdevk.c b/xserver/Xi/ungrdevk.c index f98117168..753b14d70 100644 --- a/xserver/Xi/ungrdevk.c +++ b/xserver/Xi/ungrdevk.c @@ -75,7 +75,7 @@ SOFTWARE. * */ -int +int _X_COLD SProcXUngrabDeviceKey(ClientPtr client) { REQUEST(xUngrabDeviceKeyReq); diff --git a/xserver/Xi/xiallowev.c b/xserver/Xi/xiallowev.c index ca263ef1f..676480157 100644 --- a/xserver/Xi/xiallowev.c +++ b/xserver/Xi/xiallowev.c @@ -44,7 +44,7 @@ #include "exevents.h" #include "xiallowev.h" -int +int _X_COLD SProcXIAllowEvents(ClientPtr client) { REQUEST(xXIAllowEventsReq); diff --git a/xserver/Xi/xibarriers.c b/xserver/Xi/xibarriers.c index b0a4a92a1..1926762ad 100644 --- a/xserver/Xi/xibarriers.c +++ b/xserver/Xi/xibarriers.c @@ -611,7 +611,9 @@ CreatePointerBarrierClient(ClientPtr client, } pbd->deviceid = dev->id; + input_lock(); xorg_list_add(&pbd->entry, &ret->per_device); + input_unlock(); } ret->id = stuff->barrier; @@ -626,7 +628,9 @@ CreatePointerBarrierClient(ClientPtr client, ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX); if (barrier_is_vertical(&ret->barrier)) ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY); + input_lock(); xorg_list_add(&ret->entry, &cs->barriers); + input_unlock(); *client_out = ret; return Success; @@ -689,7 +693,9 @@ BarrierFreeBarrier(void *data, XID id) mieqEnqueue(dev, (InternalEvent *) &ev); } + input_lock(); xorg_list_del(&c->entry); + input_unlock(); FreePointerBarrierClient(c); return Success; @@ -709,7 +715,9 @@ static void add_master_func(void *res, XID id, void *devid) pbd = AllocBarrierDevice(); pbd->deviceid = *deviceid; + input_lock(); xorg_list_add(&pbd->entry, &barrier->per_device); + input_unlock(); } static void remove_master_func(void *res, XID id, void *devid) @@ -752,7 +760,9 @@ static void remove_master_func(void *res, XID id, void *devid) mieqEnqueue(dev, (InternalEvent *) &ev); } + input_lock(); xorg_list_del(&pbd->entry); + input_unlock(); free(pbd); } @@ -823,7 +833,7 @@ XIDestroyPointerBarrier(ClientPtr client, return Success; } -int +int _X_COLD SProcXIBarrierReleasePointer(ClientPtr client) { xXIBarrierReleasePointerInfo *info; diff --git a/xserver/Xi/xichangecursor.c b/xserver/Xi/xichangecursor.c index 8e6255b6e..a9a1ac9fc 100644 --- a/xserver/Xi/xichangecursor.c +++ b/xserver/Xi/xichangecursor.c @@ -53,7 +53,7 @@ * */ -int +int _X_COLD SProcXIChangeCursor(ClientPtr client) { REQUEST(xXIChangeCursorReq); diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c index 7286eff55..cbdd91258 100644 --- a/xserver/Xi/xichangehierarchy.c +++ b/xserver/Xi/xichangehierarchy.c @@ -127,7 +127,7 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) * */ -int +int _X_COLD SProcXIChangeHierarchy(ClientPtr client) { REQUEST(xXIChangeHierarchyReq); diff --git a/xserver/Xi/xigetclientpointer.c b/xserver/Xi/xigetclientpointer.c index 306dd396b..c3d494d61 100644 --- a/xserver/Xi/xigetclientpointer.c +++ b/xserver/Xi/xigetclientpointer.c @@ -46,7 +46,7 @@ * setting. */ -int +int _X_COLD SProcXIGetClientPointer(ClientPtr client) { REQUEST(xXIGetClientPointerReq); @@ -96,7 +96,7 @@ ProcXIGetClientPointer(ClientPtr client) * */ -void +void _X_COLD SRepXIGetClientPointer(ClientPtr client, int size, xXIGetClientPointerReply * rep) { diff --git a/xserver/Xi/xigrabdev.c b/xserver/Xi/xigrabdev.c index e2a2ae333..cf3ee7b95 100644 --- a/xserver/Xi/xigrabdev.c +++ b/xserver/Xi/xigrabdev.c @@ -43,7 +43,7 @@ #include "xigrabdev.h" #include "inpututils.h" -int +int _X_COLD SProcXIGrabDevice(ClientPtr client) { REQUEST(xXIGrabDeviceReq); @@ -132,7 +132,7 @@ ProcXIGrabDevice(ClientPtr client) return ret; } -int +int _X_COLD SProcXIUngrabDevice(ClientPtr client) { REQUEST(xXIUngrabDeviceReq); @@ -171,7 +171,7 @@ ProcXIUngrabDevice(ClientPtr client) return Success; } -void +void _X_COLD SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index 9241ffdea..65d5870f6 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -46,7 +46,7 @@ #include "misc.h" #include "inpututils.h" -int +int _X_COLD SProcXIPassiveGrabDevice(ClientPtr client) { int i; @@ -88,7 +88,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) }; int i, ret = Success; uint32_t *modifiers; - xXIGrabModifierInfo *modifiers_failed; + xXIGrabModifierInfo *modifiers_failed = NULL; GrabMask mask = { 0 }; GrabParameters param; void *tmp; @@ -232,13 +232,13 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (rep.num_modifiers) WriteToClient(client, rep.length * 4, modifiers_failed); - free(modifiers_failed); out: + free(modifiers_failed); xi2mask_free(&mask.xi2mask); return ret; } -void +void _X_COLD SRepXIPassiveGrabDevice(ClientPtr client, int size, xXIPassiveGrabDeviceReply * rep) { @@ -249,7 +249,7 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size, WriteToClient(client, size, rep); } -int +int _X_COLD SProcXIPassiveUngrabDevice(ClientPtr client) { int i; diff --git a/xserver/Xi/xiproperty.c b/xserver/Xi/xiproperty.c index b7a1f59f4..6ec419e87 100644 --- a/xserver/Xi/xiproperty.c +++ b/xserver/Xi/xiproperty.c @@ -372,8 +372,7 @@ XIGetKnownProperty(const char *name) if (!name) return None; - for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties)); - i++) { + for (i = 0; i < ARRAY_SIZE(dev_properties); i++) { if (strcmp(name, dev_properties[i].name) == 0) { if (dev_properties[i].type == None) { dev_properties[i].type = @@ -393,8 +392,7 @@ XIResetProperties(void) { int i; - for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties)); - i++) + for (i = 0; i < ARRAY_SIZE(dev_properties); i++) dev_properties[i].type = None; } @@ -1013,7 +1011,7 @@ ProcXGetDeviceProperty(ClientPtr client) return Success; } -int +int _X_COLD SProcXListDeviceProperties(ClientPtr client) { REQUEST(xListDevicePropertiesReq); @@ -1023,7 +1021,7 @@ SProcXListDeviceProperties(ClientPtr client) return (ProcXListDeviceProperties(client)); } -int +int _X_COLD SProcXChangeDeviceProperty(ClientPtr client) { REQUEST(xChangeDevicePropertyReq); @@ -1036,7 +1034,7 @@ SProcXChangeDeviceProperty(ClientPtr client) return (ProcXChangeDeviceProperty(client)); } -int +int _X_COLD SProcXDeleteDeviceProperty(ClientPtr client) { REQUEST(xDeleteDevicePropertyReq); @@ -1047,7 +1045,7 @@ SProcXDeleteDeviceProperty(ClientPtr client) return (ProcXDeleteDeviceProperty(client)); } -int +int _X_COLD SProcXGetDeviceProperty(ClientPtr client) { REQUEST(xGetDevicePropertyReq); @@ -1063,7 +1061,7 @@ SProcXGetDeviceProperty(ClientPtr client) /* Reply swapping */ -void +void _X_COLD SRepXListDeviceProperties(ClientPtr client, int size, xListDevicePropertiesReply * rep) { @@ -1074,7 +1072,7 @@ SRepXListDeviceProperties(ClientPtr client, int size, WriteToClient(client, size, rep); } -void +void _X_COLD SRepXGetDeviceProperty(ClientPtr client, int size, xGetDevicePropertyReply * rep) { @@ -1252,7 +1250,7 @@ ProcXIGetProperty(ClientPtr client) return Success; } -int +int _X_COLD SProcXIListProperties(ClientPtr client) { REQUEST(xXIListPropertiesReq); @@ -1263,7 +1261,7 @@ SProcXIListProperties(ClientPtr client) return (ProcXIListProperties(client)); } -int +int _X_COLD SProcXIChangeProperty(ClientPtr client) { REQUEST(xXIChangePropertyReq); @@ -1277,7 +1275,7 @@ SProcXIChangeProperty(ClientPtr client) return (ProcXIChangeProperty(client)); } -int +int _X_COLD SProcXIDeleteProperty(ClientPtr client) { REQUEST(xXIDeletePropertyReq); @@ -1289,7 +1287,7 @@ SProcXIDeleteProperty(ClientPtr client) return (ProcXIDeleteProperty(client)); } -int +int _X_COLD SProcXIGetProperty(ClientPtr client) { REQUEST(xXIGetPropertyReq); @@ -1304,7 +1302,7 @@ SProcXIGetProperty(ClientPtr client) return (ProcXIGetProperty(client)); } -void +void _X_COLD SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) { swaps(&rep->sequenceNumber); @@ -1314,7 +1312,7 @@ SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) WriteToClient(client, size, rep); } -void +void _X_COLD SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/xiquerydevice.c b/xserver/Xi/xiquerydevice.c index 67a9a4f3f..fbb51fe81 100644 --- a/xserver/Xi/xiquerydevice.c +++ b/xserver/Xi/xiquerydevice.c @@ -50,7 +50,7 @@ static int ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info); static int SizeDeviceInfo(DeviceIntPtr dev); static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info); -int +int _X_COLD SProcXIQueryDevice(ClientPtr client) { REQUEST(xXIQueryDeviceReq); @@ -237,6 +237,18 @@ SizeDeviceClasses(DeviceIntPtr dev) return len; } +/** + * Get pointers to button information areas holding button mask and labels. + */ +static void +ButtonInfoData(xXIButtonInfo *info, int *mask_words, unsigned char **mask, + Atom **atoms) +{ + *mask_words = bytes_to_int32(bits_to_bytes(info->num_buttons)); + *mask = (unsigned char*) &info[1]; + *atoms = (Atom*) ((*mask) + (*mask_words) * 4); +} + /** * Write button information into info. * @return Number of bytes written into info. @@ -245,21 +257,20 @@ int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, Bool reportState) { unsigned char *bits; + Atom *labels; int mask_len; int i; if (!dev || !dev->button) return 0; - mask_len = bytes_to_int32(bits_to_bytes(dev->button->numButtons)); - info->type = ButtonClass; info->num_buttons = dev->button->numButtons; + ButtonInfoData(info, &mask_len, &bits, &labels); info->length = bytes_to_int32(sizeof(xXIButtonInfo)) + info->num_buttons + mask_len; info->sourceid = dev->button->sourceid; - bits = (unsigned char *) &info[1]; memset(bits, 0, mask_len * 4); if (reportState) @@ -267,8 +278,7 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, Bool reportState) if (BitIsOn(dev->button->down, i)) SetBit(bits, i); - bits += mask_len * 4; - memcpy(bits, dev->button->labels, dev->button->numButtons * sizeof(Atom)); + memcpy(labels, dev->button->labels, dev->button->numButtons * sizeof(Atom)); return info->length * 4; } @@ -277,13 +287,17 @@ static void SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info) { Atom *btn; + int mask_len; + unsigned char *mask; + int i; + ButtonInfoData(info, &mask_len, &mask, &btn); swaps(&info->type); swaps(&info->length); swaps(&info->sourceid); - for (i = 0, btn = (Atom *) &info[1]; i < info->num_buttons; i++, btn++) + for (i = 0 ; i < info->num_buttons; i++, btn++) swapl(btn); swaps(&info->num_buttons); @@ -369,6 +383,9 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info) swapl(&info->min.frac); swapl(&info->max.integral); swapl(&info->max.frac); + swapl(&info->value.integral); + swapl(&info->value.frac); + swapl(&info->resolution); swaps(&info->number); swaps(&info->sourceid); } diff --git a/xserver/Xi/xiquerypointer.c b/xserver/Xi/xiquerypointer.c index c5b0ba7b6..5b77b1a44 100644 --- a/xserver/Xi/xiquerypointer.c +++ b/xserver/Xi/xiquerypointer.c @@ -59,7 +59,7 @@ * */ -int +int _X_COLD SProcXIQueryPointer(ClientPtr client) { REQUEST(xXIQueryPointerReq); diff --git a/xserver/Xi/xiqueryversion.c b/xserver/Xi/xiqueryversion.c index c705f788f..111f1d61a 100644 --- a/xserver/Xi/xiqueryversion.c +++ b/xserver/Xi/xiqueryversion.c @@ -130,7 +130,7 @@ ProcXIQueryVersion(ClientPtr client) /* Swapping routines */ -int +int _X_COLD SProcXIQueryVersion(ClientPtr client) { REQUEST(xXIQueryVersionReq); @@ -141,7 +141,7 @@ SProcXIQueryVersion(ClientPtr client) return (ProcXIQueryVersion(client)); } -void +void _X_COLD SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep) { swaps(&rep->sequenceNumber); diff --git a/xserver/Xi/xiselectev.c b/xserver/Xi/xiselectev.c index 168579f5b..0498e0188 100644 --- a/xserver/Xi/xiselectev.c +++ b/xserver/Xi/xiselectev.c @@ -110,7 +110,7 @@ XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) return Success; } -int +int _X_COLD SProcXISelectEvents(ClientPtr client) { int i; @@ -275,7 +275,7 @@ ProcXISelectEvents(ClientPtr client) return Success; } -int +int _X_COLD SProcXIGetSelectedEvents(ClientPtr client) { REQUEST(xXIGetSelectedEventsReq); diff --git a/xserver/Xi/xisetclientpointer.c b/xserver/Xi/xisetclientpointer.c index 24d4a5379..e02eac4bc 100644 --- a/xserver/Xi/xisetclientpointer.c +++ b/xserver/Xi/xisetclientpointer.c @@ -47,7 +47,7 @@ #include "xisetclientpointer.h" -int +int _X_COLD SProcXISetClientPointer(ClientPtr client) { REQUEST(xXISetClientPointerReq); diff --git a/xserver/Xi/xisetdevfocus.c b/xserver/Xi/xisetdevfocus.c index 96a9a16e4..2ed445cca 100644 --- a/xserver/Xi/xisetdevfocus.c +++ b/xserver/Xi/xisetdevfocus.c @@ -40,7 +40,7 @@ #include "exglobals.h" /* BadDevice */ #include "xisetdevfocus.h" -int +int _X_COLD SProcXISetFocus(ClientPtr client) { REQUEST(xXISetFocusReq); @@ -54,7 +54,7 @@ SProcXISetFocus(ClientPtr client) return ProcXISetFocus(client); } -int +int _X_COLD SProcXIGetFocus(ClientPtr client) { REQUEST(xXIGetFocusReq); diff --git a/xserver/Xi/xiwarppointer.c b/xserver/Xi/xiwarppointer.c index 8426443fa..955fdb965 100644 --- a/xserver/Xi/xiwarppointer.c +++ b/xserver/Xi/xiwarppointer.c @@ -52,7 +52,7 @@ * */ -int +int _X_COLD SProcXIWarpPointer(ClientPtr client) { REQUEST(xXIWarpPointerReq); diff --git a/xserver/aclocal.m4 b/xserver/aclocal.m4 index ed42cb62c..8d238a646 100644 --- a/xserver/aclocal.m4 +++ b/xserver/aclocal.m4 @@ -3789,6 +3789,9 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_DEFINE(LOCALCONN,1,[Support os-specific local connections]) fi + # Other functions Xtrans may need + AC_CHECK_FUNCS([strcasecmp strlcpy]) + ]) # XTRANS_CONNECTION_FLAGS diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in index 4446f1151..88391ed47 100644 --- a/xserver/composite/Makefile.in +++ b/xserver/composite/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -339,6 +339,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -357,15 +358,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -373,6 +377,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -444,8 +450,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c index 433dc820a..3e2f14fb0 100644 --- a/xserver/composite/compalloc.c +++ b/xserver/composite/compalloc.c @@ -47,24 +47,18 @@ #include "compint.h" -static void -compScreenUpdate(ScreenPtr pScreen) -{ - compCheckTree(pScreen); - compPaintChildrenToWindow(pScreen->root); -} - -static void -compBlockHandler(ScreenPtr pScreen, void *pTimeout) +static Bool +compScreenUpdate(ClientPtr pClient, void *closure) { + ScreenPtr pScreen = closure; CompScreenPtr cs = GetCompScreen(pScreen); - pScreen->BlockHandler = cs->BlockHandler; - compScreenUpdate(pScreen); - (*pScreen->BlockHandler) (pScreen, pTimeout); + compCheckTree(pScreen); + compPaintChildrenToWindow(pScreen->root); - /* Next damage will restore the block handler */ - cs->BlockHandler = NULL; + /* Next damage will restore the worker */ + cs->pendingScreenUpdate = FALSE; + return TRUE; } void @@ -87,9 +81,9 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure) CompScreenPtr cs = GetCompScreen(pScreen); CompWindowPtr cw = GetCompWindow(pWin); - if (!cs->BlockHandler) { - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + if (!cs->pendingScreenUpdate) { + QueueWorkProc(compScreenUpdate, serverClient, pScreen); + cs->pendingScreenUpdate = TRUE; } cw->damaged = TRUE; diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c index 5b17dae53..34a2a5363 100644 --- a/xserver/composite/compext.c +++ b/xserver/composite/compext.c @@ -375,7 +375,7 @@ ProcCompositeDispatch(ClientPtr client) return BadRequest; } -static int +static int _X_COLD SProcCompositeQueryVersion(ClientPtr client) { REQUEST(xCompositeQueryVersionReq); @@ -387,7 +387,7 @@ SProcCompositeQueryVersion(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeRedirectWindow(ClientPtr client) { REQUEST(xCompositeRedirectWindowReq); @@ -398,7 +398,7 @@ SProcCompositeRedirectWindow(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeRedirectSubwindows(ClientPtr client) { REQUEST(xCompositeRedirectSubwindowsReq); @@ -409,7 +409,7 @@ SProcCompositeRedirectSubwindows(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeUnredirectWindow(ClientPtr client) { REQUEST(xCompositeUnredirectWindowReq); @@ -420,7 +420,7 @@ SProcCompositeUnredirectWindow(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeUnredirectSubwindows(ClientPtr client) { REQUEST(xCompositeUnredirectSubwindowsReq); @@ -431,7 +431,7 @@ SProcCompositeUnredirectSubwindows(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeCreateRegionFromBorderClip(ClientPtr client) { REQUEST(xCompositeCreateRegionFromBorderClipReq); @@ -443,7 +443,7 @@ SProcCompositeCreateRegionFromBorderClip(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeNameWindowPixmap(ClientPtr client) { REQUEST(xCompositeNameWindowPixmapReq); @@ -455,7 +455,7 @@ SProcCompositeNameWindowPixmap(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeGetOverlayWindow(ClientPtr client) { REQUEST(xCompositeGetOverlayWindowReq); @@ -466,7 +466,7 @@ SProcCompositeGetOverlayWindow(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int +static int _X_COLD SProcCompositeReleaseOverlayWindow(ClientPtr client) { REQUEST(xCompositeReleaseOverlayWindowReq); @@ -477,17 +477,20 @@ SProcCompositeReleaseOverlayWindow(ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -static int (*SProcCompositeVector[CompositeNumberRequests]) (ClientPtr) = { -SProcCompositeQueryVersion, - SProcCompositeRedirectWindow, - SProcCompositeRedirectSubwindows, - SProcCompositeUnredirectWindow, - SProcCompositeUnredirectSubwindows, - SProcCompositeCreateRegionFromBorderClip, - SProcCompositeNameWindowPixmap, - SProcCompositeGetOverlayWindow, SProcCompositeReleaseOverlayWindow,}; - static int +(*SProcCompositeVector[CompositeNumberRequests]) (ClientPtr) = { + SProcCompositeQueryVersion, + SProcCompositeRedirectWindow, + SProcCompositeRedirectSubwindows, + SProcCompositeUnredirectWindow, + SProcCompositeUnredirectSubwindows, + SProcCompositeCreateRegionFromBorderClip, + SProcCompositeNameWindowPixmap, + SProcCompositeGetOverlayWindow, + SProcCompositeReleaseOverlayWindow, +}; + +static int _X_COLD SProcCompositeDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c index 791fec922..6ea33ea4e 100644 --- a/xserver/composite/compinit.c +++ b/xserver/composite/compinit.c @@ -284,9 +284,6 @@ static CompAlternateVisual altVisuals[] = { {32, PICT_a8r8g8b8}, }; -static const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) / - sizeof(CompAlternateVisual); - static Bool compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs, CompAlternateVisual * alt) @@ -362,7 +359,7 @@ compAddAlternateVisuals(ScreenPtr pScreen, CompScreenPtr cs) { int alt, ret = 0; - for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++) + for (alt = 0; alt < ARRAY_SIZE(altVisuals); alt++) ret |= compAddAlternateVisual(pScreen, cs, altVisuals + alt); return ! !ret; @@ -390,6 +387,8 @@ compScreenInit(ScreenPtr pScreen) cs->pOverlayWin = NULL; cs->pOverlayClients = NULL; + cs->pendingScreenUpdate = FALSE; + cs->numAlternateVisuals = 0; cs->alternateVisuals = NULL; cs->numImplicitRedirectExceptions = 0; @@ -445,8 +444,6 @@ compScreenInit(ScreenPtr pScreen) cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; pScreen->ChangeWindowAttributes = compChangeWindowAttributes; - cs->BlockHandler = NULL; - cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h index 89f6507b9..d501bad65 100644 --- a/xserver/composite/compint.h +++ b/xserver/composite/compint.h @@ -156,7 +156,8 @@ typedef struct _CompScreen { */ ChangeWindowAttributesProcPtr ChangeWindowAttributes; - ScreenBlockHandlerProcPtr BlockHandler; + Bool pendingScreenUpdate; + CloseScreenProcPtr CloseScreen; int numAlternateVisuals; VisualID *alternateVisuals; diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c index e74ce661a..54b4e6ac4 100644 --- a/xserver/composite/compwindow.c +++ b/xserver/composite/compwindow.c @@ -432,7 +432,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) { ScreenPtr pScreen = pWin->drawable.pScreen; CompScreenPtr cs = GetCompScreen(pScreen); - CompWindowPtr cw = GetCompWindow(pWin); + CompWindowPtr cw; pScreen->ReparentWindow = cs->ReparentWindow; /* @@ -471,6 +471,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) cs->ReparentWindow = pScreen->ReparentWindow; pScreen->ReparentWindow = compReparentWindow; + cw = GetCompWindow(pWin); if (pWin->damagedDescendants || (cw && cw->damaged)) compMarkAncestors(pWin); diff --git a/xserver/config/Makefile.in b/xserver/config/Makefile.in index 0f92a4ab6..ef8b0cffd 100644 --- a/xserver/config/Makefile.in +++ b/xserver/config/Makefile.in @@ -79,7 +79,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -360,6 +360,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -378,15 +379,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -394,6 +398,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -465,8 +471,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/configure b/xserver/configure index e68eead19..98691730c 100644 --- a/xserver/configure +++ b/xserver/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xorg-server 1.19.7. +# Generated by GNU Autoconf 2.69 for xorg-server 1.20.5. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.19.7' -PACKAGE_STRING='xorg-server 1.19.7' +PACKAGE_VERSION='1.20.5' +PACKAGE_STRING='xorg-server 1.20.5' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/xserver/issues' PACKAGE_URL='' @@ -703,32 +703,24 @@ BUILD_DATE RELEASE_DATE SYSCONFDIR PROJECTROOT +XWAYLAND_EGLSTREAM_FALSE +XWAYLAND_EGLSTREAM_TRUE WAYLAND_PROTOCOLS_DATADIR +SCANNER_ARG +WAYLAND_SCANNER_LIBS +WAYLAND_SCANNER_CFLAGS WAYLAND_SCANNER XWAYLAND_SYS_LIBS XWAYLAND_LIBS +WAYLAND_EGLSTREAM_DATADIR +WAYLAND_EGLSTREAM_LIBS +WAYLAND_EGLSTREAM_CFLAGS XWAYLAND_FALSE XWAYLAND_TRUE XWAYLANDMODULES_LIBS XWAYLANDMODULES_CFLAGS -XFAKESERVER_FALSE -XFAKESERVER_TRUE -BUILD_KDRIVEFBDEVLIB_FALSE -BUILD_KDRIVEFBDEVLIB_TRUE XEPHYR_FALSE XEPHYR_TRUE -KDRIVEFBDEV_FALSE -KDRIVEFBDEV_TRUE -TSLIB_FALSE -TSLIB_TRUE -KDRIVE_MOUSE_FALSE -KDRIVE_MOUSE_TRUE -KDRIVE_KBD_FALSE -KDRIVE_KBD_TRUE -KDRIVE_EVDEV_FALSE -KDRIVE_EVDEV_TRUE -KDRIVELINUX_FALSE -KDRIVELINUX_TRUE KDRIVE_LIBS KDRIVE_LOCAL_LIBS KDRIVE_MAIN_LIB @@ -739,14 +731,10 @@ KDRIVE_INCS XEPHYR_INCS XEPHYR_LIBS XEPHYR_CFLAGS -TSLIB_LIBS -TSLIB_CFLAGS KDRIVE_FALSE KDRIVE_TRUE DMX_BUILD_USB_FALSE DMX_BUILD_USB_TRUE -DMX_BUILD_LNX_FALSE -DMX_BUILD_LNX_TRUE X11EXAMPLES_DEP_LIBS X11EXAMPLES_DEP_CFLAGS XRESEXAMPLES_DEP_LIBS @@ -786,20 +774,12 @@ PSEUDORAMIX_TRUE XPBPROXY_LIBS XPBPROXY_CFLAGS XQUARTZ_LIBS -XWIN_XV_FALSE -XWIN_XV_TRUE -XWIN_RANDR_FALSE -XWIN_RANDR_TRUE XWIN_WINDOWS_DRI_FALSE XWIN_WINDOWS_DRI_TRUE XWIN_GLX_WINDOWS_FALSE XWIN_GLX_WINDOWS_TRUE -XWIN_CLIPBOARD_FALSE -XWIN_CLIPBOARD_TRUE XWIN_MULTIWINDOWEXTWM_FALSE XWIN_MULTIWINDOWEXTWM_TRUE -XWIN_MULTIWINDOW_FALSE -XWIN_MULTIWINDOW_TRUE XWIN_FALSE XWIN_TRUE KHRONOS_SPEC_DIR @@ -836,8 +816,6 @@ LNXAPM_FALSE LNXAPM_TRUE LNXACPI_FALSE LNXACPI_TRUE -LINUX_ALPHA_FALSE -LINUX_ALPHA_TRUE XORG_BUS_SPARC_FALSE XORG_BUS_SPARC_TRUE XORG_BUS_BSDPCI_FALSE @@ -862,9 +840,9 @@ DEFAULT_LOGPREFIX DEFAULT_LOGDIR DEFAULT_LIBRARY_PATH DEFAULT_MODULE_PATH -__XCONFIGDIR__ +XCONFIGDIR XF86CONFIGFILE -__XCONFIGFILE__ +XCONFIGFILE XF86CONFIGDIR XORG_CFLAGS XORG_OS_SUBDIR @@ -1376,7 +1354,6 @@ enable_xf86vidmode enable_xace enable_xselinux enable_xcsecurity -enable_tslib enable_dbe enable_xf86bigfont enable_dpms @@ -1404,16 +1381,12 @@ enable_xvfb enable_xnest enable_xquartz enable_xwayland +enable_xwayland_eglstream enable_standalone_xpbproxy enable_xwin enable_glamor enable_kdrive enable_xephyr -enable_xfake -enable_xfbdev -enable_kdrive_kbd -enable_kdrive_mouse -enable_kdrive_evdev enable_libunwind enable_xshmfence enable_install_setuid @@ -1525,12 +1498,14 @@ XRESEXAMPLES_DEP_CFLAGS XRESEXAMPLES_DEP_LIBS X11EXAMPLES_DEP_CFLAGS X11EXAMPLES_DEP_LIBS -TSLIB_CFLAGS -TSLIB_LIBS XEPHYR_CFLAGS XEPHYR_LIBS XWAYLANDMODULES_CFLAGS -XWAYLANDMODULES_LIBS' +XWAYLANDMODULES_LIBS +WAYLAND_EGLSTREAM_CFLAGS +WAYLAND_EGLSTREAM_LIBS +WAYLAND_SCANNER_CFLAGS +WAYLAND_SCANNER_LIBS' # Initialize some variables set by options. @@ -2071,7 +2046,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xorg-server 1.19.7 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.20.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2141,7 +2116,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.19.7:";; + short | recursive ) echo "Configuration of xorg-server 1.20.5:";; esac cat <<\_ACEOF @@ -2204,8 +2179,6 @@ Optional Features: --disable-xace Build X-ACE extension (default: enabled) --enable-xselinux Build SELinux extension (default: disabled) --enable-xcsecurity Build Security extension (default: disabled) - --enable-tslib Build kdrive tslib touchscreen support (default: - disabled) --disable-dbe Build DBE extension (default: enabled) --enable-xf86bigfont Build XF86 Big Font extension (default: disabled) --disable-dpms Build DPMS extension (default: enabled) @@ -2239,6 +2212,8 @@ Optional Features: --enable-xnest Build Xnest server (default: auto) --enable-xquartz Build Xquartz server for OS-X (default: auto) --enable-xwayland Build Xwayland server (default: auto) + --enable-xwayland-eglstream + Build Xwayland eglstream support (default: no) --enable-standalone-xpbproxy Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) @@ -2247,12 +2222,6 @@ Optional Features: --enable-glamor Build glamor dix module (default: auto) --enable-kdrive Build kdrive servers (default: no) --enable-xephyr Build the kdrive Xephyr server (default: auto) - --enable-xfake Build the kdrive 'fake' server (default: auto) - --enable-xfbdev Build the kdrive framebuffer device server (default: - auto) - --enable-kdrive-kbd Build kbd driver for kdrive (default: auto) - --enable-kdrive-mouse Build mouse driver for kdrive (default: auto) - --enable-kdrive-evdev Build evdev driver for kdrive (default: auto) --enable-libunwind Use libunwind for backtracing (default: auto) --disable-xshmfence Disable xshmfence (default: auto) --enable-install-setuid Install Xorg server as owned by root with setuid bit @@ -2316,7 +2285,7 @@ Optional Packages: Path to 100dpi files [FONTROOTDIR/100dpi] --with-default-font-path=PATH Comma separated list of font dirs - --with-xkb-path=PATH Path to XKB base dir (default: ${datadir}/X11/xkb) + --with-xkb-path=PATH Path to XKB base dir (default: auto) --with-xkb-output=PATH Path to XKB output dir (default: ${datadir}/X11/xkb/compiled) --with-default-xkb-rules=RULES @@ -2342,10 +2311,10 @@ Optional Packages: org.x) --with-bundle-version=VERSION Version to use for X11.app's CFBundleVersion - (default: 1.19.7) + (default: 1.20.5) --with-bundle-version-string=VERSION Version to use for X11.app's - CFBundleShortVersionString (default: 1.19.7) + CFBundleShortVersionString (default: 1.20.5) --with-sparkle-feed-url=URL URL for the Sparkle feed (default: https://www.xquartz.org/releases/sparkle/release.xml) @@ -2358,8 +2327,7 @@ Optional Packages: directory for anonymous shared memory (default: auto) --with-xkb-bin-directory=DIR - Directory containing xkbcomp program (default: - ${bindir}) + Directory containing xkbcomp program (default: auto) --with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI choose SHA1 implementation @@ -2523,9 +2491,6 @@ Some influential environment variables: C compiler flags for X11EXAMPLES_DEP, overriding pkg-config X11EXAMPLES_DEP_LIBS linker flags for X11EXAMPLES_DEP, overriding pkg-config - TSLIB_CFLAGS - C compiler flags for TSLIB, overriding pkg-config - TSLIB_LIBS linker flags for TSLIB, overriding pkg-config XEPHYR_CFLAGS C compiler flags for XEPHYR, overriding pkg-config XEPHYR_LIBS linker flags for XEPHYR, overriding pkg-config @@ -2533,6 +2498,14 @@ Some influential environment variables: C compiler flags for XWAYLANDMODULES, overriding pkg-config XWAYLANDMODULES_LIBS linker flags for XWAYLANDMODULES, overriding pkg-config + WAYLAND_EGLSTREAM_CFLAGS + C compiler flags for WAYLAND_EGLSTREAM, overriding pkg-config + WAYLAND_EGLSTREAM_LIBS + linker flags for WAYLAND_EGLSTREAM, overriding pkg-config + WAYLAND_SCANNER_CFLAGS + C compiler flags for WAYLAND_SCANNER, overriding pkg-config + WAYLAND_SCANNER_LIBS + linker flags for WAYLAND_SCANNER, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -2600,7 +2573,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.19.7 +xorg-server configure 1.20.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3309,7 +3282,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xorg-server $as_me 1.19.7, which was +It was created by xorg-server $as_me 1.20.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3657,8 +3630,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2019-03-02" -RELEASE_NAME="Clemson Hamberder" +RELEASE_DATE="2019-05-30" +RELEASE_NAME="Red Lentil Dal" am__api_version='1.12' @@ -4137,7 +4110,7 @@ fi # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.19.7' + VERSION='1.20.5' cat >>confdefs.h <<_ACEOF @@ -12932,7 +12905,7 @@ ac_config_headers="$ac_config_headers include/xkb-config.h" ac_config_headers="$ac_config_headers include/xwin-config.h" -ac_config_headers="$ac_config_headers include/kdrive-config.h" +ac_config_headers="$ac_config_headers include/xwayland-config.h" ac_config_headers="$ac_config_headers include/version-config.h" @@ -21912,132 +21885,6 @@ _ACEOF fi -# Checks for headers/macros for byte swapping -# Known variants: -# bswap_16, bswap_32, bswap_64 (glibc) -# __swap16, __swap32, __swap64 (OpenBSD) -# bswap16, bswap32, bswap64 (other BSD's) -# and a fallback to local macros if none of the above are found - -# if is found, assume it's the correct version -for ac_header in byteswap.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" -if test "x$ac_cv_header_byteswap_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BYTESWAP_H 1 -_ACEOF - -fi - -done - - -# if is found, have to check which version -ac_fn_c_check_header_mongrel "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_endian_h" = xyes; then : - HAVE_SYS_ENDIAN_H="yes" -else - HAVE_SYS_ENDIAN_H="no" -fi - - - -if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __swap16 variant of byteswapping macros" >&5 -$as_echo_n "checking for __swap16 variant of byteswapping macros... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - -int a = 1, b; -b = __swap16(a); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - SYS_ENDIAN__SWAP='yes' -else - SYS_ENDIAN__SWAP='no' -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYS_ENDIAN__SWAP" >&5 -$as_echo "$SYS_ENDIAN__SWAP" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap16 variant of byteswapping macros" >&5 -$as_echo_n "checking for bswap16 variant of byteswapping macros... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - -int a = 1, b; -b = bswap16(a); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - SYS_ENDIAN_BSWAP='yes' -else - SYS_ENDIAN_BSWAP='no' -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYS_ENDIAN_BSWAP" >&5 -$as_echo "$SYS_ENDIAN_BSWAP" >&6; } - - if test "$SYS_ENDIAN_BSWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=bswap - else - if test "$SYS_ENDIAN__SWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=__swap - else - USE_SYS_ENDIAN_H=no - fi - fi - - if test "$USE_SYS_ENDIAN_H" = "yes" ; then - -$as_echo "#define USE_SYS_ENDIAN_H 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define bswap_16 ${BSWAP}16 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define bswap_32 ${BSWAP}32 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define bswap_64 ${BSWAP}64 -_ACEOF - - fi -fi - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : @@ -22086,10 +21933,10 @@ fi -for ac_func in backtrace ffs geteuid getuid issetugid getresuid \ +for ac_func in backtrace geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext setitimer poll epoll_create1 + walkcontext setitimer poll epoll_create1 mkostemp do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -22363,20 +22210,6 @@ fi done -for ac_header in ndbm.h dbm.h rpcsvc/dbm.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - for ac_header in linux/agpgart.h sys/agpio.h sys/agpgart.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -23111,7 +22944,7 @@ $as_echo "$FONTPATH" >&6; } if test "${with_xkb_path+set}" = set; then : withval=$with_xkb_path; XKBPATH="$withval" else - XKBPATH="${datadir}/X11/xkb" + XKBPATH="auto" fi @@ -23206,7 +23039,7 @@ _ACEOF if test "${with_bundle_version+set}" = set; then : withval=$with_bundle_version; BUNDLE_VERSION="${withval}" else - BUNDLE_VERSION="1.19.7" + BUNDLE_VERSION="1.20.5" fi @@ -23412,13 +23245,6 @@ else XCSECURITY=no fi -# Check whether --enable-tslib was given. -if test "${enable_tslib+set}" = set; then : - enableval=$enable_tslib; TSLIB=$enableval -else - TSLIB=no -fi - # Check whether --enable-dbe was given. if test "${enable_dbe+set}" = set; then : enableval=$enable_dbe; DBE=$enableval @@ -23609,6 +23435,13 @@ else XWAYLAND=auto fi +# Check whether --enable-xwayland-eglstream was given. +if test "${enable_xwayland_eglstream+set}" = set; then : + enableval=$enable_xwayland_eglstream; XWAYLAND_EGLSTREAM=$enableval +else + XWAYLAND_EGLSTREAM=no +fi + # Check whether --enable-standalone-xpbproxy was given. if test "${enable_standalone_xpbproxy+set}" = set; then : enableval=$enable_standalone_xpbproxy; STANDALONE_XPBPROXY=$enableval @@ -23644,41 +23477,6 @@ else XEPHYR=auto fi -# Check whether --enable-xfake was given. -if test "${enable_xfake+set}" = set; then : - enableval=$enable_xfake; XFAKE=$enableval -else - XFAKE=auto -fi - -# Check whether --enable-xfbdev was given. -if test "${enable_xfbdev+set}" = set; then : - enableval=$enable_xfbdev; XFBDEV=$enableval -else - XFBDEV=auto -fi - -# Check whether --enable-kdrive-kbd was given. -if test "${enable_kdrive_kbd+set}" = set; then : - enableval=$enable_kdrive_kbd; KDRIVE_KBD=$enableval -else - KDRIVE_KBD=auto -fi - -# Check whether --enable-kdrive-mouse was given. -if test "${enable_kdrive_mouse+set}" = set; then : - enableval=$enable_kdrive_mouse; KDRIVE_MOUSE=$enableval -else - KDRIVE_MOUSE=auto -fi - -# Check whether --enable-kdrive-evdev was given. -if test "${enable_kdrive_evdev+set}" = set; then : - enableval=$enable_kdrive_evdev; KDRIVE_EVDEV=$enableval -else - KDRIVE_EVDEV=auto -fi - # Check whether --enable-libunwind was given. if test "${enable_libunwind+set}" = set; then : enableval=$enable_libunwind; LIBUNWIND="$enableval" @@ -24055,6 +23853,20 @@ $as_echo "#define LOCALCONN 1" >>confdefs.h fi + # Other functions Xtrans may need + for ac_func in strcasecmp strlcpy +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + # Secure RPC detection macro from xtrans.m4 @@ -24206,7 +24018,6 @@ case $host_os in XF86UTILS=no XF86VIDMODE=no XSELINUX=no - XV=no SYMBOL_VISIBILITY=no ;; darwin*) @@ -24288,7 +24099,7 @@ SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" DRI2PROTO="dri2proto >= 2.8" -DRI3PROTO="dri3proto >= 1.0" +DRI3PROTO="dri3proto >= 1.2" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" @@ -24300,7 +24111,7 @@ APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" XPROTO="xproto >= 7.0.31" -RANDRPROTO="randrproto >= 1.5.0" +RANDRPROTO="randrproto >= 1.6.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" @@ -24311,12 +24122,12 @@ DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" XTRANS="xtrans >= 1.3.5" -PRESENTPROTO="presentproto >= 1.0" +PRESENTPROTO="presentproto >= 1.1" LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.1" +LIBDRM="libdrm >= 2.4.89" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" @@ -26224,6 +26035,7 @@ fi case "$DRI3,$HAVE_DRI3PROTO" in yes,yes | auto,yes) + REQUIRED_MODULES="$REQUIRED_MODULES dri3proto" ;; yes,no) as_fn_error $? "DRI3 requested, but dri3proto not found." "$LINENO" 5 @@ -26697,7 +26509,7 @@ fi $as_echo "#define GLXEXT 1" >>confdefs.h - GLX_LIBS='$(top_builddir)/glx/libglx.la' + GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la' GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" else GLX=no @@ -27077,6 +26889,10 @@ fi $as_echo "#define SHAPE 1" >>confdefs.h +if test "x$XKBPATH" = "xauto"; then + XKBPATH=$(pkg-config --variable datadir xkbcomp || echo ${datadir})/X11/xkb +fi + prefix_NONE= exec_prefix_NONE= @@ -27099,10 +26915,14 @@ _ACEOF if test "${with_xkb_bin_directory+set}" = set; then : withval=$with_xkb_bin_directory; XKB_BIN_DIRECTORY="$withval" else - XKB_BIN_DIRECTORY="$bindir" + XKB_BIN_DIRECTORY="auto" fi +if test "x$XKB_BIN_DIRECTORY" = "xauto"; then + XKB_BIN_DIRECTORY=$(pkg-config --variable bindir xkbcomp || echo ${bindir}) +fi + prefix_NONE= exec_prefix_NONE= @@ -27263,50 +27083,6 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libxdmcp="yes" -fi -if test "x$have_libxdmcp" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XdmcpWrap in -lXdmcp" >&5 -$as_echo_n "checking for XdmcpWrap in -lXdmcp... " >&6; } -if ${ac_cv_lib_Xdmcp_XdmcpWrap+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXdmcp $XDMCP_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XdmcpWrap (); -int -main () -{ -return XdmcpWrap (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xdmcp_XdmcpWrap=yes -else - ac_cv_lib_Xdmcp_XdmcpWrap=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdmcp_XdmcpWrap" >&5 -$as_echo "$ac_cv_lib_Xdmcp_XdmcpWrap" >&6; } -if test "x$ac_cv_lib_Xdmcp_XdmcpWrap" = xyes; then : - have_xdmcpwrap="yes" -else - have_xdmcpwrap="no" -fi - fi if test "x$XDMCP" = xauto; then if test "x$have_libxdmcp" = xyes; then @@ -27316,7 +27092,7 @@ if test "x$XDMCP" = xauto; then fi fi if test "x$XDMAUTH" = xauto; then - if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then + if test "x$have_libxdmcp" = xyes; then XDMAUTH=yes else XDMAUTH=no @@ -27463,11 +27239,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -cat >>confdefs.h <<_ACEOF -#define XORG_DATE "$RELEASE_DATE" -_ACEOF - - cat >>confdefs.h <<_ACEOF #define XORG_MAN_VERSION "$VENDOR_MAN_VERSION" _ACEOF @@ -28793,9 +28564,6 @@ $as_echo "$XSERVER_PLATFORM_BUS" >&6; } XORG_OS_SUBDIR="linux" linux_acpi="no" case $host_cpu in - alpha*) - linux_alpha=yes - ;; i*86|amd64*|x86_64*|ia64*) linux_acpi=$enable_linux_acpi ;; @@ -29193,16 +28961,7 @@ fi fi if test "x$DRM" = xyes; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm >= 2.4.46\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm >= 2.4.46") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - XORG_DRIVER_MODESETTING=yes -else - XORG_DRIVER_MODESETTING=no -fi + XORG_DRIVER_MODESETTING=yes fi @@ -29248,11 +29007,11 @@ $as_echo "#define __XSERVERNAME__ \"Xorg\"" >>confdefs.h test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XF86CONFIGFILE\"" eval ac_define_dir="\"$ac_define_dir\"" - __XCONFIGFILE__="$ac_define_dir" + XCONFIGFILE="$ac_define_dir" cat >>confdefs.h <<_ACEOF -#define __XCONFIGFILE__ "$ac_define_dir" +#define XCONFIGFILE "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE @@ -29282,11 +29041,11 @@ _ACEOF test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XF86CONFIGDIR\"" eval ac_define_dir="\"$ac_define_dir\"" - __XCONFIGDIR__="$ac_define_dir" + XCONFIGDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF -#define __XCONFIGDIR__ "$ac_define_dir" +#define XCONFIGDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE @@ -29461,14 +29220,6 @@ else XORG_BUS_SPARC_FALSE= fi - if test "x$linux_alpha" = xyes; then - LINUX_ALPHA_TRUE= - LINUX_ALPHA_FALSE='#' -else - LINUX_ALPHA_TRUE='#' - LINUX_ALPHA_FALSE= -fi - if test "x$linux_acpi" = xyes; then LNXACPI_TRUE= LNXACPI_FALSE='#' @@ -29519,10 +29270,7 @@ fi if test "x$GLAMOR" = xauto; then - if test "x$XORG" = xyes; then - GLAMOR=yes - fi - if test "x$XEPHYR" = xyes; then + if echo "$XORG" "$XEPHYR" "$XWAYLAND" | grep -q yes ; then GLAMOR=yes fi fi @@ -29630,6 +29378,17 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"epoxy >= 1.4.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "epoxy >= 1.4.4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + +$as_echo "#define GLAMOR_HAS_EGL_QUERY_DMABUF 1" >>confdefs.h + fi @@ -29716,6 +29475,16 @@ $as_echo "#define GLAMOR_HAS_GBM_LINEAR 1" >>confdefs.h fi + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gbm >= 17.1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gbm >= 17.1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + +$as_echo "#define GBM_BO_WITH_MODIFIERS 1" >>confdefs.h + +fi else if test "x$XORG" = xyes; then as_fn_error $? "Glamor for Xorg requires $LIBGBM" "$LINENO" 5 @@ -30372,14 +30141,6 @@ else XWIN_FALSE= fi - if test "x$XWIN" = xyes; then - XWIN_MULTIWINDOW_TRUE= - XWIN_MULTIWINDOW_FALSE='#' -else - XWIN_MULTIWINDOW_TRUE='#' - XWIN_MULTIWINDOW_FALSE= -fi - if test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes; then XWIN_MULTIWINDOWEXTWM_TRUE= XWIN_MULTIWINDOWEXTWM_FALSE='#' @@ -30388,14 +30149,6 @@ else XWIN_MULTIWINDOWEXTWM_FALSE= fi - if test "x$XWIN" = xyes; then - XWIN_CLIPBOARD_TRUE= - XWIN_CLIPBOARD_FALSE='#' -else - XWIN_CLIPBOARD_TRUE='#' - XWIN_CLIPBOARD_FALSE= -fi - if test "x$XWIN" = xyes && test "x$GLX" = xyes; then XWIN_GLX_WINDOWS_TRUE= XWIN_GLX_WINDOWS_FALSE='#' @@ -30412,22 +30165,6 @@ else XWIN_WINDOWS_DRI_FALSE= fi - if test "x$XWIN" = xyes; then - XWIN_RANDR_TRUE= - XWIN_RANDR_FALSE='#' -else - XWIN_RANDR_TRUE='#' - XWIN_RANDR_FALSE= -fi - - if test "x$XWIN" = xyes && test "x$XV" = xyes; then - XWIN_XV_TRUE= - XWIN_XV_FALSE='#' -else - XWIN_XV_TRUE='#' - XWIN_XV_FALSE= -fi - if test "x$XQUARTZ" = xyes; then @@ -30928,7 +30665,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $PRESENT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" @@ -30942,14 +30679,6 @@ else fi - ac_fn_c_check_header_mongrel "$LINENO" "linux/keyboard.h" "ac_cv_header_linux_keyboard_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_keyboard_h" = xyes; then : - DMX_BUILD_LNX="yes" -else - DMX_BUILD_LNX="no" -fi - - @@ -31506,14 +31235,6 @@ fi fi - if test "x$DMX_BUILD_LNX" = xyes; then - DMX_BUILD_LNX_TRUE= - DMX_BUILD_LNX_FALSE='#' -else - DMX_BUILD_LNX_TRUE='#' - DMX_BUILD_LNX_FALSE= -fi - if test "x$DMX_BUILD_USB" = xyes; then DMX_BUILD_USB_TRUE= DMX_BUILD_USB_FALSE='#' @@ -31537,212 +31258,7 @@ fi if test "$KDRIVE" = yes; then - -$as_echo "#define KDRIVESERVER 1" >>confdefs.h - - -$as_echo "#define KDRIVEDDXACTIONS /**/" >>confdefs.h - - - for ac_header in linux/fb.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "linux/fb.h" "ac_cv_header_linux_fb_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_fb_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_FB_H 1 -_ACEOF - -fi - -done - - if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then - XFBDEV=yes - fi - - if test "x$XFBDEV" = xyes; then - KDRIVEFBDEVLIB=yes - -$as_echo "#define KDRIVEFBDEV 1" >>confdefs.h - - fi - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TSLIB" >&5 -$as_echo_n "checking for TSLIB... " >&6; } - -if test -n "$TSLIB_CFLAGS"; then - pkg_cv_TSLIB_CFLAGS="$TSLIB_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TSLIB_CFLAGS=`$PKG_CONFIG --cflags "tslib-0.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$TSLIB_LIBS"; then - pkg_cv_TSLIB_LIBS="$TSLIB_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TSLIB_LIBS=`$PKG_CONFIG --libs "tslib-0.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - TSLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "tslib-0.0" 2>&1` - else - TSLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "tslib-0.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$TSLIB_PKG_ERRORS" >&5 - - HAVE_TSLIB="no" -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - HAVE_TSLIB="no" -else - TSLIB_CFLAGS=$pkg_cv_TSLIB_CFLAGS - TSLIB_LIBS=$pkg_cv_TSLIB_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_TSLIB="yes" -fi - if test "x$HAVE_TSLIB" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ts_open in -lts" >&5 -$as_echo_n "checking for ts_open in -lts... " >&6; } -if ${ac_cv_lib_ts_ts_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lts $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ts_open (); -int -main () -{ -return ts_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ts_ts_open=yes -else - ac_cv_lib_ts_ts_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ts_ts_open" >&5 -$as_echo "$ac_cv_lib_ts_ts_open" >&6; } -if test "x$ac_cv_lib_ts_ts_open" = xyes; then : - - HAVE_TSLIB="yes" - TSLIB_LIBS="-lts" - -fi - - fi - - if test "xTSLIB" = xauto; then - TSLIB="$HAVE_TSLIB" - fi - - if test "x$TSLIB" = xyes; then - if ! test "x$HAVE_TSLIB" = xyes; then - as_fn_error $? "tslib must be installed to build the tslib driver. See http://tslib.berlios.de/" "$LINENO" 5 - else - -$as_echo "#define TSLIB 1" >>confdefs.h - - fi - fi - - case $host_os in - *linux*) - KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' - KDRIVELINUX=yes - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=yes - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=yes - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=yes - fi - ;; - *) - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=no - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=no - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=no - fi - ;; - esac - - if test "x$KDRIVE_KBD" = xyes; then - -$as_echo "#define KDRIVE_KBD 1" >>confdefs.h - - fi - if test "x$KDRIVE_EVDEV" = xyes; then - -$as_echo "#define KDRIVE_EVDEV 1" >>confdefs.h - - fi - if test "x$KDRIVE_MOUSE" = xyes; then - -$as_echo "#define KDRIVE_MOUSE 1" >>confdefs.h - - fi - - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr xcb-xkb" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm >= 1.9.3 xcb-keysyms xcb-randr xcb-xkb" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi @@ -31973,7 +31489,7 @@ fi KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" - KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" + KDRIVE_CFLAGS="$XSERVER_CFLAGS" KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' @@ -31981,7 +31497,7 @@ fi KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" - KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" @@ -31993,54 +31509,6 @@ fi - if test "x$KDRIVELINUX" = xyes; then - KDRIVELINUX_TRUE= - KDRIVELINUX_FALSE='#' -else - KDRIVELINUX_TRUE='#' - KDRIVELINUX_FALSE= -fi - - if test "x$KDRIVE_EVDEV" = xyes; then - KDRIVE_EVDEV_TRUE= - KDRIVE_EVDEV_FALSE='#' -else - KDRIVE_EVDEV_TRUE='#' - KDRIVE_EVDEV_FALSE= -fi - - if test "x$KDRIVE_KBD" = xyes; then - KDRIVE_KBD_TRUE= - KDRIVE_KBD_FALSE='#' -else - KDRIVE_KBD_TRUE='#' - KDRIVE_KBD_FALSE= -fi - - if test "x$KDRIVE_MOUSE" = xyes; then - KDRIVE_MOUSE_TRUE= - KDRIVE_MOUSE_FALSE='#' -else - KDRIVE_MOUSE_TRUE='#' - KDRIVE_MOUSE_FALSE= -fi - - if test "x$HAVE_TSLIB" = xyes; then - TSLIB_TRUE= - TSLIB_FALSE='#' -else - TSLIB_TRUE='#' - TSLIB_FALSE= -fi - - if test "x$XFBDEV" = xyes; then - KDRIVEFBDEV_TRUE= - KDRIVEFBDEV_FALSE='#' -else - KDRIVEFBDEV_TRUE='#' - KDRIVEFBDEV_FALSE= -fi - if test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes; then XEPHYR_TRUE= XEPHYR_FALSE='#' @@ -32049,25 +31517,9 @@ else XEPHYR_FALSE= fi - if test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes; then - BUILD_KDRIVEFBDEVLIB_TRUE= - BUILD_KDRIVEFBDEVLIB_FALSE='#' -else - BUILD_KDRIVEFBDEVLIB_TRUE='#' - BUILD_KDRIVEFBDEVLIB_FALSE= -fi - - if test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes; then - XFAKESERVER_TRUE= - XFAKESERVER_FALSE='#' -else - XFAKESERVER_TRUE='#' - XFAKESERVER_FALSE= -fi - -XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.10 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -32163,6 +31615,106 @@ if test "x$XWAYLAND" = xyes; then as_fn_error $? "Xwayland build explicitly requested, but required modules not found." "$LINENO" 5 fi + if test "x$GLAMOR" = xyes && test "x$GBM" = xyes; then + +$as_echo "#define XWL_HAS_GLAMOR 1" >>confdefs.h + + fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND_EGLSTREAM" >&5 +$as_echo_n "checking for WAYLAND_EGLSTREAM... " >&6; } + +if test -n "$WAYLAND_EGLSTREAM_CFLAGS"; then + pkg_cv_WAYLAND_EGLSTREAM_CFLAGS="$WAYLAND_EGLSTREAM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-eglstream-protocols >= 1.0.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-eglstream-protocols >= 1.0.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_EGLSTREAM_CFLAGS=`$PKG_CONFIG --cflags "wayland-eglstream-protocols >= 1.0.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAYLAND_EGLSTREAM_LIBS"; then + pkg_cv_WAYLAND_EGLSTREAM_LIBS="$WAYLAND_EGLSTREAM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-eglstream-protocols >= 1.0.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-eglstream-protocols >= 1.0.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_EGLSTREAM_LIBS=`$PKG_CONFIG --libs "wayland-eglstream-protocols >= 1.0.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAYLAND_EGLSTREAM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-eglstream-protocols >= 1.0.2" 2>&1` + else + WAYLAND_EGLSTREAM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-eglstream-protocols >= 1.0.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAYLAND_EGLSTREAM_PKG_ERRORS" >&5 + + have_wl_eglstream=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_wl_eglstream=no +else + WAYLAND_EGLSTREAM_CFLAGS=$pkg_cv_WAYLAND_EGLSTREAM_CFLAGS + WAYLAND_EGLSTREAM_LIBS=$pkg_cv_WAYLAND_EGLSTREAM_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_wl_eglstream=yes +fi + + if test "x$XWAYLAND_EGLSTREAM" = xauto; then + if test "x$have_wl_eglstream" = xyes && test "x$GLAMOR" = xyes; then + XWAYLAND_EGLSTREAM=yes + fi + fi + + if test "x$XWAYLAND_EGLSTREAM" = xyes; then + if test "x$GLAMOR" != xyes; then + as_fn_error $? "Xwayland eglstream support explicitly requested, but required modules not found." "$LINENO" 5 + fi + + if test "x$have_wl_eglstream" = xno; then + as_fn_error $? "Xwayland eglstream support requires wayland-eglstream-protocols >= 1.0.2" "$LINENO" 5 + fi + + WAYLAND_EGLSTREAM_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-eglstream-protocols` + + +$as_echo "#define XWL_HAS_EGLSTREAM 1" >>confdefs.h + + fi + XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS" @@ -32172,7 +31724,6 @@ if test "x$XWAYLAND" = xyes; then as_fn_error $? "Xwayland requires CLOCK_MONOTONIC support." "$LINENO" 5 fi - WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` # Extract the first word of "wayland-scanner", so it can be a program name with args. set dummy wayland-scanner; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -32186,7 +31737,7 @@ else ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in ${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -32213,10 +31764,188 @@ $as_echo "no" >&6; } fi + if test "x$WAYLAND_SCANNER" = x; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND_SCANNER" >&5 +$as_echo_n "checking for WAYLAND_SCANNER... " >&6; } + +if test -n "$WAYLAND_SCANNER_CFLAGS"; then + pkg_cv_WAYLAND_SCANNER_CFLAGS="$WAYLAND_SCANNER_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-scanner") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_SCANNER_CFLAGS=`$PKG_CONFIG --cflags "wayland-scanner" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAYLAND_SCANNER_LIBS"; then + pkg_cv_WAYLAND_SCANNER_LIBS="$WAYLAND_SCANNER_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-scanner") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_SCANNER_LIBS=`$PKG_CONFIG --libs "wayland-scanner" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-scanner" 2>&1` + else + WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-scanner" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAYLAND_SCANNER_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (wayland-scanner) were not met: + +$WAYLAND_SCANNER_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables WAYLAND_SCANNER_CFLAGS +and WAYLAND_SCANNER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables WAYLAND_SCANNER_CFLAGS +and WAYLAND_SCANNER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + WAYLAND_SCANNER_CFLAGS=$pkg_cv_WAYLAND_SCANNER_CFLAGS + WAYLAND_SCANNER_LIBS=$pkg_cv_WAYLAND_SCANNER_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` + + fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND_SCANNER" >&5 +$as_echo_n "checking for WAYLAND_SCANNER... " >&6; } + +if test -n "$WAYLAND_SCANNER_CFLAGS"; then + pkg_cv_WAYLAND_SCANNER_CFLAGS="$WAYLAND_SCANNER_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner >= 1.14.91\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-scanner >= 1.14.91") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_SCANNER_CFLAGS=`$PKG_CONFIG --cflags "wayland-scanner >= 1.14.91" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAYLAND_SCANNER_LIBS"; then + pkg_cv_WAYLAND_SCANNER_LIBS="$WAYLAND_SCANNER_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner >= 1.14.91\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-scanner >= 1.14.91") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_SCANNER_LIBS=`$PKG_CONFIG --libs "wayland-scanner >= 1.14.91" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-scanner >= 1.14.91" 2>&1` + else + WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-scanner >= 1.14.91" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAYLAND_SCANNER_PKG_ERRORS" >&5 + + SCANNER_ARG='code' + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SCANNER_ARG='code' + +else + WAYLAND_SCANNER_CFLAGS=$pkg_cv_WAYLAND_SCANNER_CFLAGS + WAYLAND_SCANNER_LIBS=$pkg_cv_WAYLAND_SCANNER_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SCANNER_ARG='private-code' + +fi WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols` fi + if test "x$XWAYLAND_EGLSTREAM" = "xyes"; then + XWAYLAND_EGLSTREAM_TRUE= + XWAYLAND_EGLSTREAM_FALSE='#' +else + XWAYLAND_EGLSTREAM_TRUE='#' + XWAYLAND_EGLSTREAM_FALSE= +fi + @@ -32279,9 +32008,15 @@ _ACEOF -BUILD_DATE="`date +'%Y%m%d'`" +DATE_FMT="%Y%m%d" +TIME_FMT="1%H%M%S" +BUILD_DATE="`date "+$DATE_FMT"`" +BUILD_TIME="`date "+$TIME_FMT"`" +if test "x$SOURCE_DATE_EPOCH" != "x"; then + BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`" + BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`" +fi -BUILD_TIME="`date +'1%H%M%S'`" DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" @@ -32308,7 +32043,7 @@ $as_echo "$as_me: WARNING: ***********************************************" >&2;} fi -ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xkb/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" +ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xkb/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile xserver.ent xorg-server.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -32780,10 +32515,6 @@ if test -z "${XORG_BUS_SPARC_TRUE}" && test -z "${XORG_BUS_SPARC_FALSE}"; then as_fn_error $? "conditional \"XORG_BUS_SPARC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${LINUX_ALPHA_TRUE}" && test -z "${LINUX_ALPHA_FALSE}"; then - as_fn_error $? "conditional \"LINUX_ALPHA\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${LNXACPI_TRUE}" && test -z "${LNXACPI_FALSE}"; then as_fn_error $? "conditional \"LNXACPI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32820,18 +32551,10 @@ if test -z "${XWIN_TRUE}" && test -z "${XWIN_FALSE}"; then as_fn_error $? "conditional \"XWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XWIN_MULTIWINDOW_TRUE}" && test -z "${XWIN_MULTIWINDOW_FALSE}"; then - as_fn_error $? "conditional \"XWIN_MULTIWINDOW\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${XWIN_MULTIWINDOWEXTWM_TRUE}" && test -z "${XWIN_MULTIWINDOWEXTWM_FALSE}"; then as_fn_error $? "conditional \"XWIN_MULTIWINDOWEXTWM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XWIN_CLIPBOARD_TRUE}" && test -z "${XWIN_CLIPBOARD_FALSE}"; then - as_fn_error $? "conditional \"XWIN_CLIPBOARD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${XWIN_GLX_WINDOWS_TRUE}" && test -z "${XWIN_GLX_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"XWIN_GLX_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32840,14 +32563,6 @@ if test -z "${XWIN_WINDOWS_DRI_TRUE}" && test -z "${XWIN_WINDOWS_DRI_FALSE}"; th as_fn_error $? "conditional \"XWIN_WINDOWS_DRI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XWIN_RANDR_TRUE}" && test -z "${XWIN_RANDR_FALSE}"; then - as_fn_error $? "conditional \"XWIN_RANDR\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${XWIN_XV_TRUE}" && test -z "${XWIN_XV_FALSE}"; then - as_fn_error $? "conditional \"XWIN_XV\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${PSEUDORAMIX_TRUE}" && test -z "${PSEUDORAMIX_FALSE}"; then as_fn_error $? "conditional \"PSEUDORAMIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32872,10 +32587,6 @@ if test -z "${DMX_TRUE}" && test -z "${DMX_FALSE}"; then as_fn_error $? "conditional \"DMX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DMX_BUILD_LNX_TRUE}" && test -z "${DMX_BUILD_LNX_FALSE}"; then - as_fn_error $? "conditional \"DMX_BUILD_LNX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${DMX_BUILD_USB_TRUE}" && test -z "${DMX_BUILD_USB_FALSE}"; then as_fn_error $? "conditional \"DMX_BUILD_USB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32884,46 +32595,18 @@ if test -z "${KDRIVE_TRUE}" && test -z "${KDRIVE_FALSE}"; then as_fn_error $? "conditional \"KDRIVE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${KDRIVELINUX_TRUE}" && test -z "${KDRIVELINUX_FALSE}"; then - as_fn_error $? "conditional \"KDRIVELINUX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${KDRIVE_EVDEV_TRUE}" && test -z "${KDRIVE_EVDEV_FALSE}"; then - as_fn_error $? "conditional \"KDRIVE_EVDEV\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${KDRIVE_KBD_TRUE}" && test -z "${KDRIVE_KBD_FALSE}"; then - as_fn_error $? "conditional \"KDRIVE_KBD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${KDRIVE_MOUSE_TRUE}" && test -z "${KDRIVE_MOUSE_FALSE}"; then - as_fn_error $? "conditional \"KDRIVE_MOUSE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${TSLIB_TRUE}" && test -z "${TSLIB_FALSE}"; then - as_fn_error $? "conditional \"TSLIB\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${KDRIVEFBDEV_TRUE}" && test -z "${KDRIVEFBDEV_FALSE}"; then - as_fn_error $? "conditional \"KDRIVEFBDEV\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${XEPHYR_TRUE}" && test -z "${XEPHYR_FALSE}"; then as_fn_error $? "conditional \"XEPHYR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_KDRIVEFBDEVLIB_TRUE}" && test -z "${BUILD_KDRIVEFBDEVLIB_FALSE}"; then - as_fn_error $? "conditional \"BUILD_KDRIVEFBDEVLIB\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${XFAKESERVER_TRUE}" && test -z "${XFAKESERVER_FALSE}"; then - as_fn_error $? "conditional \"XFAKESERVER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${XWAYLAND_TRUE}" && test -z "${XWAYLAND_FALSE}"; then as_fn_error $? "conditional \"XWAYLAND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${XWAYLAND_EGLSTREAM_TRUE}" && test -z "${XWAYLAND_EGLSTREAM_FALSE}"; then + as_fn_error $? "conditional \"XWAYLAND_EGLSTREAM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -33321,7 +33004,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xorg-server $as_me 1.19.7, which was +This file was extended by xorg-server $as_me 1.20.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33387,7 +33070,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xorg-server config.status 1.19.7 +xorg-server config.status 1.20.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -33802,7 +33485,7 @@ do "include/xorg-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xorg-config.h" ;; "include/xkb-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xkb-config.h" ;; "include/xwin-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xwin-config.h" ;; - "include/kdrive-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/kdrive-config.h" ;; + "include/xwayland-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xwayland-config.h" ;; "include/version-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/version-config.h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "sdksyms") CONFIG_COMMANDS="$CONFIG_COMMANDS sdksyms" ;; @@ -33908,14 +33591,9 @@ do "hw/kdrive/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/Makefile" ;; "hw/kdrive/ephyr/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/ephyr/Makefile" ;; "hw/kdrive/ephyr/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/ephyr/man/Makefile" ;; - "hw/kdrive/fake/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/fake/Makefile" ;; - "hw/kdrive/fbdev/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/fbdev/Makefile" ;; - "hw/kdrive/linux/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/linux/Makefile" ;; "hw/kdrive/src/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/src/Makefile" ;; "hw/xwayland/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwayland/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - "test/xi1/Makefile") CONFIG_FILES="$CONFIG_FILES test/xi1/Makefile" ;; - "test/xi2/Makefile") CONFIG_FILES="$CONFIG_FILES test/xi2/Makefile" ;; "xserver.ent") CONFIG_FILES="$CONFIG_FILES xserver.ent" ;; "xorg-server.pc") CONFIG_FILES="$CONFIG_FILES xorg-server.pc" ;; diff --git a/xserver/configure.ac b/xserver/configure.ac index 5b964ecf8..d611a1f35 100644 --- a/xserver/configure.ac +++ b/xserver/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.19.7, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server) -RELEASE_DATE="2019-03-02" -RELEASE_NAME="Clemson Hamberder" +AC_INIT([xorg-server], 1.20.5, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server) +RELEASE_DATE="2019-05-30" +RELEASE_NAME="Red Lentil Dal" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -67,8 +67,8 @@ dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. AC_CONFIG_HEADERS(include/xkb-config.h) dnl xwin-config.h covers the XWin DDX. AC_CONFIG_HEADERS(include/xwin-config.h) -dnl kdrive-config.h covers the kdrive DDX -AC_CONFIG_HEADERS(include/kdrive-config.h) +dnl xwayland-config.h covers Xwayland. +AC_CONFIG_HEADERS(include/xwayland-config.h) dnl version-config.h covers the version numbers so they can be bumped without dnl forcing an entire recompile.x AC_CONFIG_HEADERS(include/version-config.h) @@ -149,66 +149,6 @@ fi AC_TYPE_PID_T -# Checks for headers/macros for byte swapping -# Known variants: -# bswap_16, bswap_32, bswap_64 (glibc) -# __swap16, __swap32, __swap64 (OpenBSD) -# bswap16, bswap32, bswap64 (other BSD's) -# and a fallback to local macros if none of the above are found - -# if is found, assume it's the correct version -AC_CHECK_HEADERS([byteswap.h]) - -# if is found, have to check which version -AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) - -if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then - AC_MSG_CHECKING([for __swap16 variant of byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include -#include - ], [ -int a = 1, b; -b = __swap16(a); - ]) -], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) - - AC_MSG_CHECKING([for bswap16 variant of byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include -#include - ], [ -int a = 1, b; -b = bswap16(a); - ]) -], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) - - if test "$SYS_ENDIAN_BSWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=bswap - else - if test "$SYS_ENDIAN__SWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=__swap - else - USE_SYS_ENDIAN_H=no - fi - fi - - if test "$USE_SYS_ENDIAN_H" = "yes" ; then - AC_DEFINE([USE_SYS_ENDIAN_H], 1, - [Define to use byteswap macros from ]) - AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, - [Define to 16-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, - [Define to 32-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, - [Define to 64-bit byteswap macro]) - fi -fi - dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], @@ -216,10 +156,10 @@ AC_CHECK_FUNC([dlopen], [], AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. -AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ +AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext setitimer poll epoll_create1]) + walkcontext setitimer poll epoll_create1 mkostemp]) AC_CONFIG_LIBOBJ_DIR([os]) AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\ timingsafe_memcmp]) @@ -252,8 +192,6 @@ dnl Find the math libary, then check for cbrt function in it. AC_CHECK_LIB(m, sqrt) AC_CHECK_FUNCS([cbrt]) -AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) - dnl AGPGART headers AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) @@ -561,9 +499,9 @@ AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [ AC_MSG_CHECKING([for default font path]) AC_MSG_RESULT([$FONTPATH]) -AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), +AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: auto)]), [ XKBPATH="$withval" ], - [ XKBPATH="${datadir}/X11/xkb" ]) + [ XKBPATH="auto" ]) AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), [ XKBOUTPUT="$withval" ], [ XKBOUTPUT="compiled" ]) @@ -660,7 +598,6 @@ AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF8 AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) -AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) @@ -690,18 +627,14 @@ AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto]) +AC_ARG_ENABLE(xwayland-eglstream, AS_HELP_STRING([--enable-xwayland-eglstream], [Build Xwayland eglstream support (default: no)]), [XWAYLAND_EGLSTREAM=$enableval], [XWAYLAND_EGLSTREAM=no]) AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: auto)]), [GLAMOR=$enableval], [GLAMOR=auto]) dnl kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) -AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) -AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) dnl kdrive options -AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) -AC_ARG_ENABLE(kdrive-mouse, AS_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) -AC_ARG_ENABLE(kdrive-evdev, AS_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"]) AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xshmfence (default: auto)]), [XSHMFENCE="$enableval"], [XSHMFENCE="auto"]) @@ -771,7 +704,6 @@ case $host_os in XF86UTILS=no XF86VIDMODE=no XSELINUX=no - XV=no SYMBOL_VISIBILITY=no ;; darwin*) @@ -837,7 +769,7 @@ SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" DRI2PROTO="dri2proto >= 2.8" -DRI3PROTO="dri3proto >= 1.0" +DRI3PROTO="dri3proto >= 1.2" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" @@ -850,7 +782,7 @@ LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules XPROTO="xproto >= 7.0.31" -RANDRPROTO="randrproto >= 1.5.0" +RANDRPROTO="randrproto >= 1.6.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" @@ -861,13 +793,13 @@ DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" XTRANS="xtrans >= 1.3.5" -PRESENTPROTO="presentproto >= 1.0" +PRESENTPROTO="presentproto >= 1.1" dnl List of libraries that require a specific version LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.1" +LIBDRM="libdrm >= 2.4.89" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" @@ -1314,6 +1246,7 @@ PKG_CHECK_MODULES([DRI3PROTO], $DRI3PROTO, case "$DRI3,$HAVE_DRI3PROTO" in yes,yes | auto,yes) + REQUIRED_MODULES="$REQUIRED_MODULES dri3proto" ;; yes,no) AC_MSG_ERROR([DRI3 requested, but dri3proto not found.]) @@ -1401,7 +1334,7 @@ if test "x$GLX" = xyes; then PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) - GLX_LIBS='$(top_builddir)/glx/libglx.la' + GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la' GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" else GLX=no @@ -1511,11 +1444,19 @@ AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) +if test "x$XKBPATH" = "xauto"; then + XKBPATH=$(pkg-config --variable datadir xkbcomp || echo ${datadir})/X11/xkb +fi + AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) AC_ARG_WITH(xkb-bin-directory, - AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: ${bindir})]), + AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: auto)]), [XKB_BIN_DIRECTORY="$withval"], - [XKB_BIN_DIRECTORY="$bindir"]) + [XKB_BIN_DIRECTORY="auto"]) + +if test "x$XKB_BIN_DIRECTORY" = "xauto"; then + XKB_BIN_DIRECTORY=$(pkg-config --variable bindir xkbcomp || echo ${bindir}) +fi AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) @@ -1560,9 +1501,6 @@ XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) -if test "x$have_libxdmcp" = xyes; then - AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) -fi if test "x$XDMCP" = xauto; then if test "x$have_libxdmcp" = xyes; then XDMCP=yes @@ -1571,7 +1509,7 @@ if test "x$XDMCP" = xauto; then fi fi if test "x$XDMAUTH" = xauto; then - if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then + if test "x$have_libxdmcp" = xyes; then XDMAUTH=yes else XDMAUTH=no @@ -1609,7 +1547,6 @@ dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path]) AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) -AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) @@ -2040,9 +1977,6 @@ if test "x$XORG" = xyes; then XORG_OS_SUBDIR="linux" linux_acpi="no" case $host_cpu in - alpha*) - linux_alpha=yes - ;; i*86|amd64*|x86_64*|ia64*) linux_acpi=$enable_linux_acpi ;; @@ -2141,8 +2075,7 @@ if test "x$XORG" = xyes; then fi if test "x$DRM" = xyes; then - dnl 2.4.46 is required for cursor hotspot support. - PKG_CHECK_EXISTS(libdrm >= 2.4.46, XORG_DRIVER_MODESETTING=yes, XORG_DRIVER_MODESETTING=no) + XORG_DRIVER_MODESETTING=yes fi AC_SUBST([XORG_LIBS]) @@ -2166,9 +2099,9 @@ if test "x$XORG" = xyes; then AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) - AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) + AC_DEFINE_DIR(XCONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) - AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) + AC_DEFINE_DIR(XCONFIGDIR, XF86CONFIGDIR, [Name of configuration directory]) AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) @@ -2208,7 +2141,6 @@ AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes]) AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) -AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes]) AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes]) @@ -2218,10 +2150,7 @@ AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xy dnl glamor if test "x$GLAMOR" = xauto; then - if test "x$XORG" = xyes; then - GLAMOR=yes - fi - if test "x$XEPHYR" = xyes; then + if echo "$XORG" "$XEPHYR" "$XWAYLAND" | grep -q yes ; then GLAMOR=yes fi fi @@ -2232,6 +2161,10 @@ if test "x$GLAMOR" = xyes; then AC_DEFINE(GLAMOR, 1, [Build glamor]) PKG_CHECK_MODULES([GLAMOR], [epoxy]) + PKG_CHECK_EXISTS(epoxy >= 1.4.4, + [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])], + []) + PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) if test "x$GBM" = xyes; then AC_DEFINE(GLAMOR_HAS_GBM, 1, @@ -2240,6 +2173,10 @@ if test "x$GLAMOR" = xyes; then [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [], [#include #include ]) + dnl 17.1.0 is required for gbm_bo_create_with_modifiers + PKG_CHECK_EXISTS(gbm >= 17.1.0, + [AC_DEFINE(GBM_BO_WITH_MODIFIERS, 1, [Have gbm_bo_create_with_modifiers])], + []) else if test "x$XORG" = xyes; then AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM]) @@ -2333,13 +2270,9 @@ dnl XWin requires OpenGL spec files in order to generate wrapper code for native fi AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) -AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes]) AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes]) -AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) dnl Darwin / OS X DDX if test "x$XQUARTZ" = xyes; then @@ -2410,7 +2343,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $PRESENT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) @@ -2419,9 +2352,6 @@ if test "x$DMX" = xyes; then dnl USB sources in DMX require AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", DMX_BUILD_USB="no") -dnl Linux sources in DMX require - AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes", - DMX_BUILD_LNX="no") AC_SUBST(XDMXCONFIG_DEP_CFLAGS) AC_SUBST(XDMXCONFIG_DEP_LIBS) PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11]) @@ -2438,7 +2368,6 @@ dnl Linux sources in DMX require AC_SUBST(X11EXAMPLES_DEP_LIBS) fi -AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes]) AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes]) dnl kdrive DDX @@ -2449,78 +2378,7 @@ XEPHYR_INCS= AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) if test "$KDRIVE" = yes; then - AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) - AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) - - AC_CHECK_HEADERS([linux/fb.h]) - if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then - XFBDEV=yes - fi - - if test "x$XFBDEV" = xyes; then - KDRIVEFBDEVLIB=yes - AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) - fi - - - PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) - if test "x$HAVE_TSLIB" = xno; then - AC_CHECK_LIB(ts, ts_open, [ - HAVE_TSLIB="yes" - TSLIB_LIBS="-lts" - ]) - fi - - if test "xTSLIB" = xauto; then - TSLIB="$HAVE_TSLIB" - fi - - if test "x$TSLIB" = xyes; then - if ! test "x$HAVE_TSLIB" = xyes; then - AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/]) - else - AC_DEFINE(TSLIB, 1, [Have tslib support]) - fi - fi - - case $host_os in - *linux*) - KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' - KDRIVELINUX=yes - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=yes - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=yes - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=yes - fi - ;; - *) - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=no - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=no - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=no - fi - ;; - esac - - if test "x$KDRIVE_KBD" = xyes; then - AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) - fi - if test "x$KDRIVE_EVDEV" = xyes; then - AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver]) - fi - if test "x$KDRIVE_MOUSE" = xyes; then - AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) - fi - - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr xcb-xkb" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm >= 1.9.3 xcb-keysyms xcb-randr xcb-xkb" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi @@ -2547,7 +2405,7 @@ if test "$KDRIVE" = yes; then KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" - KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" + KDRIVE_CFLAGS="$XSERVER_CFLAGS" KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' @@ -2555,7 +2413,7 @@ if test "$KDRIVE" = yes; then KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" - KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" AC_SUBST([XEPHYR_LIBS]) AC_SUBST([XEPHYR_INCS]) @@ -2567,19 +2425,11 @@ AC_SUBST([KDRIVE_PURE_LIBS]) AC_SUBST([KDRIVE_MAIN_LIB]) AC_SUBST([KDRIVE_LOCAL_LIBS]) AC_SUBST([KDRIVE_LIBS]) -AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) -AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) -AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) -AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes]) -AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) -AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) -AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) -AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) dnl Xwayland DDX -XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.10 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -2596,6 +2446,33 @@ if test "x$XWAYLAND" = xyes; then AC_MSG_ERROR([Xwayland build explicitly requested, but required modules not found.]) fi + if test "x$GLAMOR" = xyes && test "x$GBM" = xyes; then + AC_DEFINE(XWL_HAS_GLAMOR, 1, + [Build xwayland with glamor support]) + fi + + PKG_CHECK_MODULES(WAYLAND_EGLSTREAM, [wayland-eglstream-protocols >= 1.0.2], [have_wl_eglstream=yes], [have_wl_eglstream=no]) + + if test "x$XWAYLAND_EGLSTREAM" = xauto; then + if test "x$have_wl_eglstream" = xyes && test "x$GLAMOR" = xyes; then + XWAYLAND_EGLSTREAM=yes + fi + fi + + if test "x$XWAYLAND_EGLSTREAM" = xyes; then + if test "x$GLAMOR" != xyes; then + AC_MSG_ERROR([Xwayland eglstream support explicitly requested, but required modules not found.]) + fi + + if test "x$have_wl_eglstream" = xno; then + AC_MSG_ERROR([Xwayland eglstream support requires wayland-eglstream-protocols >= 1.0.2]) + fi + + AC_SUBST(WAYLAND_EGLSTREAM_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-eglstream-protocols`) + AC_DEFINE(XWL_HAS_EGLSTREAM, 1, + [Build xwayland with eglstream support]) + fi + XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XWAYLAND_LIBS]) @@ -2605,12 +2482,19 @@ if test "x$XWAYLAND" = xyes; then AC_MSG_ERROR([Xwayland requires CLOCK_MONOTONIC support.]) fi - WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` - AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, - [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) + AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner]) + if test "x$WAYLAND_SCANNER" = x; then + PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner]) + AC_SUBST(WAYLAND_SCANNER, `$PKG_CONFIG --variable=wayland_scanner wayland-scanner`) + fi + + PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner >= 1.14.91], + AC_SUBST(SCANNER_ARG, 'private-code'), + AC_SUBST(SCANNER_ARG, 'code')) AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) fi +AM_CONDITIONAL(XWAYLAND_EGLSTREAM, [test "x$XWAYLAND_EGLSTREAM" = "xyes"]) dnl and the rest of these are generic, so they're in config.h @@ -2631,9 +2515,15 @@ AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [sysconfdir]) AC_SUBST([RELEASE_DATE]) -BUILD_DATE="`date +'%Y%m%d'`" +DATE_FMT="%Y%m%d" +TIME_FMT="1%H%M%S" +BUILD_DATE="`date "+$DATE_FMT"`" +BUILD_TIME="`date "+$TIME_FMT"`" +if test "x$SOURCE_DATE_EPOCH" != "x"; then + BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`" + BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`" +fi AC_SUBST([BUILD_DATE]) -BUILD_TIME="`date +'1%H%M%S'`" AC_SUBST([BUILD_TIME]) DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" @@ -2757,14 +2647,9 @@ hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile -hw/kdrive/fake/Makefile -hw/kdrive/fbdev/Makefile -hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile -test/xi1/Makefile -test/xi2/Makefile xserver.ent xorg-server.pc ]) diff --git a/xserver/damageext/Makefile.in b/xserver/damageext/Makefile.in index ac19f4161..afe52b09a 100644 --- a/xserver/damageext/Makefile.in +++ b/xserver/damageext/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -307,6 +307,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -325,15 +326,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -341,6 +345,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -412,8 +418,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/damageext/damageext.c b/xserver/damageext/damageext.c index 86b54eef4..ce490cbf2 100644 --- a/xserver/damageext/damageext.c +++ b/xserver/damageext/damageext.c @@ -464,8 +464,6 @@ static const int version_requests[] = { X_DamageAdd, /* Version 1 */ }; -#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) - static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { /*************** Version 1 ******************/ ProcDamageQueryVersion, @@ -482,14 +480,14 @@ ProcDamageDispatch(ClientPtr client) REQUEST(xDamageReq); DamageClientPtr pDamageClient = GetDamageClient(client); - if (pDamageClient->major_version >= NUM_VERSION_REQUESTS) + 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); } -static int +static int _X_COLD SProcDamageQueryVersion(ClientPtr client) { REQUEST(xDamageQueryVersionReq); @@ -501,7 +499,7 @@ SProcDamageQueryVersion(ClientPtr client) return (*ProcDamageVector[stuff->damageReqType]) (client); } -static int +static int _X_COLD SProcDamageCreate(ClientPtr client) { REQUEST(xDamageCreateReq); @@ -513,7 +511,7 @@ SProcDamageCreate(ClientPtr client) return (*ProcDamageVector[stuff->damageReqType]) (client); } -static int +static int _X_COLD SProcDamageDestroy(ClientPtr client) { REQUEST(xDamageDestroyReq); @@ -524,7 +522,7 @@ SProcDamageDestroy(ClientPtr client) return (*ProcDamageVector[stuff->damageReqType]) (client); } -static int +static int _X_COLD SProcDamageSubtract(ClientPtr client) { REQUEST(xDamageSubtractReq); @@ -537,7 +535,7 @@ SProcDamageSubtract(ClientPtr client) return (*ProcDamageVector[stuff->damageReqType]) (client); } -static int +static int _X_COLD SProcDamageAdd(ClientPtr client) { REQUEST(xDamageAddReq); @@ -559,7 +557,7 @@ static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { SProcDamageAdd, }; -static int +static int _X_COLD SProcDamageDispatch(ClientPtr client) { REQUEST(xDamageReq); @@ -584,7 +582,7 @@ FreeDamageExt(void *value, XID did) return Success; } -static void +static void _X_COLD SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to) { to->type = from->type; diff --git a/xserver/dbe/Makefile.in b/xserver/dbe/Makefile.in index e805ad42e..fc49b0ba4 100644 --- a/xserver/dbe/Makefile.in +++ b/xserver/dbe/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -338,6 +338,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -356,15 +357,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -372,6 +376,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -443,8 +449,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/dbe/dbe.c b/xserver/dbe/dbe.c index f31766f31..292a22366 100644 --- a/xserver/dbe/dbe.c +++ b/xserver/dbe/dbe.c @@ -814,7 +814,7 @@ ProcDbeDispatch(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeGetVersion(ClientPtr client) { REQUEST(xDbeGetVersionReq); @@ -847,7 +847,7 @@ SProcDbeGetVersion(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); @@ -880,7 +880,7 @@ SProcDbeAllocateBackBufferName(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST(xDbeDeallocateBackBufferNameReq); @@ -915,7 +915,7 @@ SProcDbeDeallocateBackBufferName(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); @@ -963,7 +963,7 @@ SProcDbeSwapBuffers(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); @@ -994,7 +994,7 @@ SProcDbeGetVisualInfo(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); @@ -1018,7 +1018,7 @@ SProcDbeGetBackBufferAttributes(ClientPtr client) * *****************************************************************************/ -static int +static int _X_COLD SProcDbeDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/dix/Makefile.am b/xserver/dix/Makefile.am index a4171d7e1..b96da08f9 100644 --- a/xserver/dix/Makefile.am +++ b/xserver/dix/Makefile.am @@ -21,7 +21,6 @@ libdix_la_SOURCES = \ events.c \ eventconvert.c \ extension.c \ - ffs.c \ gc.c \ getevents.c \ globals.c \ diff --git a/xserver/dix/Makefile.in b/xserver/dix/Makefile.in index d650ccb7b..ea78d5ff6 100644 --- a/xserver/dix/Makefile.in +++ b/xserver/dix/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -79,11 +79,11 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libdix_la_LIBADD = am_libdix_la_OBJECTS = atom.lo colormap.lo cursor.lo devices.lo \ dispatch.lo dixfonts.lo main.lo dixutils.lo enterleave.lo \ - events.lo eventconvert.lo extension.lo ffs.lo gc.lo \ - getevents.lo globals.lo glyphcurs.lo grabs.lo initatoms.lo \ - inpututils.lo pixmap.lo privates.lo property.lo ptrveloc.lo \ - region.lo registry.lo resource.lo selection.lo swaprep.lo \ - swapreq.lo tables.lo touch.lo window.lo + events.lo eventconvert.lo extension.lo gc.lo getevents.lo \ + globals.lo glyphcurs.lo grabs.lo initatoms.lo inpututils.lo \ + pixmap.lo privates.lo property.lo ptrveloc.lo region.lo \ + registry.lo resource.lo selection.lo swaprep.lo swapreq.lo \ + tables.lo touch.lo window.lo libdix_la_OBJECTS = $(am_libdix_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -353,6 +353,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -371,15 +372,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -387,6 +391,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -458,8 +464,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -545,7 +549,6 @@ libdix_la_SOURCES = \ events.c \ eventconvert.c \ extension.c \ - ffs.c \ gc.c \ getevents.c \ globals.c \ @@ -657,7 +660,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventconvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extension.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getevents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ diff --git a/xserver/dix/Xserver.d b/xserver/dix/Xserver.d index f4f229d84..4a233e1f6 100644 --- a/xserver/dix/Xserver.d +++ b/xserver/dix/Xserver.d @@ -27,6 +27,8 @@ #define string char * #define pid_t uint32_t #define zoneid_t uint32_t +#elif defined(__FreeBSD__) +#define zoneid_t id_t #else #include #endif diff --git a/xserver/dix/devices.c b/xserver/dix/devices.c index 4a628afb0..1b18b168e 100644 --- a/xserver/dix/devices.c +++ b/xserver/dix/devices.c @@ -1177,6 +1177,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); ret = Success; + break; } } @@ -1193,6 +1194,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) prev->next = next; ret = Success; + break; } } diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c index 0fdfe117e..176c7a0dd 100644 --- a/xserver/dix/dispatch.c +++ b/xserver/dix/dispatch.c @@ -222,8 +222,7 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_MAX_SLICE 15 #ifdef HAVE_SETITIMER -#define SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE HAVE_SETITIMER -Bool SmartScheduleSignalEnable = SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE; +Bool SmartScheduleSignalEnable = TRUE; #endif long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c index cca92ed27..0ea8678bb 100644 --- a/xserver/dix/dixfonts.c +++ b/xserver/dix/dixfonts.c @@ -2015,6 +2015,11 @@ _remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handle RemoveFontWakeup(fpe); } +static uint32_t wrap_time_in_millis(void) +{ + return GetTimeInMillis(); +} + static const xfont2_client_funcs_rec xfont2_client_funcs = { .version = XFONT2_CLIENT_FUNCS_VERSION, .client_auth_generation = _client_auth_generation, @@ -2025,7 +2030,7 @@ static const xfont2_client_funcs_rec xfont2_client_funcs = { .get_client_resolutions = get_client_resolutions, .get_default_point_size = get_default_point_size, .get_new_font_client_id = get_new_font_client_id, - .get_time_in_millis = GetTimeInMillis, + .get_time_in_millis = wrap_time_in_millis, .init_fs_handlers = _init_fs_handlers, .register_fpe_funcs = register_fpe_funcs, .remove_fs_handlers = _remove_fs_handlers, diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c index 540023cbd..2983174a1 100644 --- a/xserver/dix/dixutils.c +++ b/xserver/dix/dixutils.c @@ -507,6 +507,19 @@ InitBlockAndWakeupHandlers(void) WorkQueuePtr workQueue; static WorkQueuePtr *workQueueLast = &workQueue; +void +ClearWorkQueue(void) +{ + WorkQueuePtr q, *p; + + p = &workQueue; + while ((q = *p)) { + *p = q->next; + free(q); + } + workQueueLast = p; +} + void ProcessWorkQueue(void) { diff --git a/xserver/dix/enterleave.c b/xserver/dix/enterleave.c index 1b341f2de..a2f625bc9 100644 --- a/xserver/dix/enterleave.c +++ b/xserver/dix/enterleave.c @@ -1562,7 +1562,7 @@ DoFocusEvents(DeviceIntPtr pDev, WindowPtr from, WindowPtr to, int mode) if (!IsKeyboardDevice(pDev)) return; - if (from == to) + if (from == to && mode != NotifyGrab && mode != NotifyUngrab) return; CoreFocusEvents(pDev, from, to, mode); diff --git a/xserver/dix/eventconvert.c b/xserver/dix/eventconvert.c index f7ecdba77..4a07b6b6f 100644 --- a/xserver/dix/eventconvert.c +++ b/xserver/dix/eventconvert.c @@ -655,9 +655,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) btlen = bytes_to_int32(bits_to_bytes(MAX_BUTTONS)); len += btlen * 4; /* buttonmask len */ - vallen = - count_bits(ev->valuators.mask, - sizeof(ev->valuators.mask) / sizeof(ev->valuators.mask[0])); + vallen = count_bits(ev->valuators.mask, ARRAY_SIZE(ev->valuators.mask)); len += vallen * 2 * sizeof(uint32_t); /* axisvalues */ vallen = bytes_to_int32(bits_to_bytes(MAX_VALUATORS)); len += vallen * 4; /* valuators mask */ diff --git a/xserver/dix/events.c b/xserver/dix/events.c index 3faad53a8..d3a33ea3f 100644 --- a/xserver/dix/events.c +++ b/xserver/dix/events.c @@ -3575,7 +3575,7 @@ ProcWarpPointer(ClientPtr client) winX + stuff->srcX + (int) stuff->srcWidth < x) || (stuff->srcHeight != 0 && winY + stuff->srcY + (int) stuff->srcHeight < y) || - !PointInWindowIsVisible(source, x, y)) + (source->parent && !PointInWindowIsVisible(source, x, y))) return Success; } if (dest) { diff --git a/xserver/dix/extension.c b/xserver/dix/extension.c index e81f673b2..9c158ba93 100644 --- a/xserver/dix/extension.c +++ b/xserver/dix/extension.c @@ -95,8 +95,6 @@ AddExtension(const char *name, int NumEvents, int NumErrors, return NULL; } ext->name = strdup(name); - ext->num_aliases = 0; - ext->aliases = (const char **) NULL; if (!ext->name) { dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION); free(ext); @@ -144,42 +142,15 @@ AddExtension(const char *name, int NumEvents, int NumErrors, return ext; } -Bool -AddExtensionAlias(const char *alias, ExtensionEntry * ext) -{ - char *name; - const char **aliases; - - if (!ext) - return FALSE; - aliases = reallocarray(ext->aliases, ext->num_aliases + 1, sizeof(char *)); - if (!aliases) - return FALSE; - ext->aliases = aliases; - name = strdup(alias); - if (!name) - return FALSE; - ext->aliases[ext->num_aliases] = name; - ext->num_aliases++; - return TRUE; -} - static int FindExtension(const char *extname, int len) { - int i, j; + int i; for (i = 0; i < NumExtensions; i++) { if ((strlen(extensions[i]->name) == len) && !strncmp(extname, extensions[i]->name, len)) break; - for (j = extensions[i]->num_aliases; --j >= 0;) { - if ((strlen(extensions[i]->aliases[j]) == len) && - !strncmp(extname, extensions[i]->aliases[j], len)) - break; - } - if (j >= 0) - break; } return ((i == NumExtensions) ? -1 : i); } @@ -223,16 +194,13 @@ StandardMinorOpcode(ClientPtr client) void CloseDownExtensions(void) { - int i, j; + int i; for (i = NumExtensions - 1; i >= 0; i--) { if (extensions[i]->CloseDown) extensions[i]->CloseDown(extensions[i]); NumExtensions = i; free((void *) extensions[i]->name); - for (j = extensions[i]->num_aliases; --j >= 0;) - free((void *) extensions[i]->aliases[j]); - free(extensions[i]->aliases); dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION); free(extensions[i]); } @@ -242,6 +210,16 @@ CloseDownExtensions(void) lastError = FirstExtensionError; } +static Bool +ExtensionAvailable(ClientPtr client, ExtensionEntry *ext) +{ + if (XaceHook(XACE_EXT_ACCESS, client, ext) != Success) + return FALSE; + if (!ext->base) + return FALSE; + return TRUE; +} + int ProcQueryExtension(ClientPtr client) { @@ -263,7 +241,7 @@ ProcQueryExtension(ClientPtr client) reply.present = xFalse; else { i = FindExtension((char *) &stuff[1], stuff->nbytes); - if (i < 0 || XaceHook(XACE_EXT_ACCESS, client, extensions[i])) + if (i < 0 || !ExtensionAvailable(client, extensions[i])) reply.present = xFalse; else { reply.present = xTrue; @@ -294,17 +272,15 @@ ProcListExtensions(ClientPtr client) buffer = NULL; if (NumExtensions) { - int i, j; + int i; for (i = 0; i < NumExtensions; i++) { /* call callbacks to find out whether to show extension */ - if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success) + if (!ExtensionAvailable(client, extensions[i])) continue; total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1 + extensions[i]->num_aliases; - for (j = extensions[i]->num_aliases; --j >= 0;) - total_length += strlen(extensions[i]->aliases[j]) + 1; + reply.nExtensions += 1; } reply.length = bytes_to_int32(total_length); buffer = bufptr = malloc(total_length); @@ -313,17 +289,12 @@ ProcListExtensions(ClientPtr client) for (i = 0; i < NumExtensions; i++) { int len; - if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success) + if (!ExtensionAvailable(client, extensions[i])) continue; *bufptr++ = len = strlen(extensions[i]->name); memmove(bufptr, extensions[i]->name, len); bufptr += len; - for (j = extensions[i]->num_aliases; --j >= 0;) { - *bufptr++ = len = strlen(extensions[i]->aliases[j]); - memmove(bufptr, extensions[i]->aliases[j], len); - bufptr += len; - } } } WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); diff --git a/xserver/dix/ffs.c b/xserver/dix/ffs.c deleted file mode 100644 index f0400cbd1..000000000 --- a/xserver/dix/ffs.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - -Copyright 1996, 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 MERCHANTABIL- -ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL- -ITY, 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. - -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef HAVE_FFS - -#include "dix.h" - -int -ffs(int i) -{ - int j; - - if (i == 0) - return 0; - for (j = 1; (i & 1) == 0; j++) - i >>= 1; - return j; -} - -#endif diff --git a/xserver/dix/gc.c b/xserver/dix/gc.c index 78f3be29d..4ccbd3b54 100644 --- a/xserver/dix/gc.c +++ b/xserver/dix/gc.c @@ -439,7 +439,7 @@ ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) } for (i = Ones(mask); i--;) vals[i].val = pC32[i]; - for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i) { + for (i = 0; i < ARRAY_SIZE(xidfields); ++i) { int offset, rc; if (!(mask & xidfields[i].mask)) @@ -504,7 +504,7 @@ NewGCObject(ScreenPtr pScreen, int depth) pGC->font = defaultFont; if (pGC->font) /* necessary, because open of default font could fail */ pGC->font->refcnt++; - pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; + pGC->stipple = pGC->pScreen->defaultStipple; if (pGC->stipple) pGC->stipple->refcnt++; @@ -811,6 +811,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) FreeGC(pGC, (XID) 0); pGC = (GCPtr) NULL; } + pGC->graphicsExposures = FALSE; return pGC; } @@ -843,7 +844,6 @@ CreateGCperDepth(int screenNum) /* do depth 1 separately because it's not included in list */ if (!(ppGC[0] = CreateScratchGC(pScreen, 1))) return FALSE; - ppGC[0]->graphicsExposures = FALSE; /* Make sure we don't overflow GCperDepth[] */ if (pScreen->numDepths > MAXFORMATS) return FALSE; @@ -855,7 +855,6 @@ CreateGCperDepth(int screenNum) (void) FreeGC(ppGC[i], (XID) 0); return FALSE; } - ppGC[i + 1]->graphicsExposures = FALSE; } return TRUE; } @@ -874,8 +873,7 @@ CreateDefaultStipple(int screenNum) w = 16; h = 16; (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); - if (!(pScreen->PixmapPerDepth[0] = - (*pScreen->CreatePixmap) (pScreen, w, h, 1, 0))) + if (!(pScreen->defaultStipple = pScreen->CreatePixmap(pScreen, w, h, 1, 0))) return FALSE; /* fill stipple with 1 */ tmpval[0].val = GXcopy; @@ -883,17 +881,17 @@ CreateDefaultStipple(int screenNum) tmpval[2].val = FillSolid; pgcScratch = GetScratchGC(1, pScreen); if (!pgcScratch) { - (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); + (*pScreen->DestroyPixmap) (pScreen->defaultStipple); return FALSE; } (void) ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval); - ValidateGC((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch); + ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch); rect.x = 0; rect.y = 0; rect.width = w; rect.height = h; - (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->PixmapPerDepth[0], + (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->defaultStipple, pgcScratch, 1, &rect); FreeScratchGC(pgcScratch); return TRUE; @@ -904,7 +902,7 @@ FreeDefaultStipple(int screenNum) { ScreenPtr pScreen = screenInfo.screens[screenNum]; - (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); + (*pScreen->DestroyPixmap) (pScreen->defaultStipple); } int @@ -1073,10 +1071,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen) } } /* if we make it this far, need to roll our own */ - pGC = CreateScratchGC(pScreen, depth); - if (pGC) - pGC->graphicsExposures = FALSE; - return pGC; + return CreateScratchGC(pScreen, depth); } /* diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c index 0d87453e5..f83dac709 100644 --- a/xserver/dix/getevents.c +++ b/xserver/dix/getevents.c @@ -331,9 +331,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to, static void updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) { - int i; - DeviceIntPtr lastSlave; - /* master->last.valuators[0]/[1] is in desktop-wide coords and the actual * position of the pointer */ pDev->last.valuators[0] = master->last.valuators[0]; @@ -358,27 +355,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) screenInfo.height); } - /* calculate the other axis as well based on info from the old - * slave-device. If the old slave had less axes than this one, - * last.valuators is reset to 0. - */ - if ((lastSlave = master->last.slave) && lastSlave->valuator) { - for (i = 2; i < pDev->valuator->numAxes; i++) { - if (i >= lastSlave->valuator->numAxes) { - pDev->last.valuators[i] = 0; - valuator_mask_set_double(pDev->last.scroll, i, 0); - } - else { - double val = pDev->last.valuators[i]; - - val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i, - pDev->valuator->axes + i, 0, 0); - pDev->last.valuators[i] = val; - valuator_mask_set_double(pDev->last.scroll, i, val); - } - } - } - + /* other axes are left as-is */ } /** @@ -1231,7 +1208,7 @@ transformRelative(DeviceIntPtr dev, ValuatorMask *mask) static void transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) { - double x, y, ox, oy; + double x, y, ox = 0.0, oy = 0.0; int has_x, has_y; has_x = valuator_mask_isset(mask, 0); diff --git a/xserver/dix/globals.c b/xserver/dix/globals.c index 673260176..9965f5ddb 100644 --- a/xserver/dix/globals.c +++ b/xserver/dix/globals.c @@ -93,16 +93,6 @@ CARD32 ScreenSaverInterval; int ScreenSaverBlanking; int ScreenSaverAllowExposures; -#ifdef DPMSExtension -CARD16 DPMSPowerLevel = 0; -Bool DPMSDisabledSwitch = FALSE; -Bool DPMSCapableFlag = FALSE; -CARD32 DPMSStandbyTime; -CARD32 DPMSSuspendTime; -CARD32 DPMSOffTime; -Bool DPMSEnabled; -#endif - CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL; int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING; diff --git a/xserver/dix/inpututils.c b/xserver/dix/inpututils.c index 6bff9efab..c51c83547 100644 --- a/xserver/dix/inpututils.c +++ b/xserver/dix/inpututils.c @@ -282,7 +282,7 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap, else if (!IsFloating(dev) && GetMaster(dev, MASTER_KEYBOARD)->lastSlave == dev) { /* If this fails, expect the results to be weird. */ - if (check_modmap_change(client, dev->master, modmap)) + if (check_modmap_change(client, dev->master, modmap) == Success) do_modmap_change(client, dev->master, modmap); } diff --git a/xserver/dix/main.c b/xserver/dix/main.c index 4947062a5..b228d9c28 100644 --- a/xserver/dix/main.c +++ b/xserver/dix/main.c @@ -148,11 +148,7 @@ dix_main(int argc, char *argv[], char *envp[]) ScreenSaverInterval = defaultScreenSaverInterval; ScreenSaverBlanking = defaultScreenSaverBlanking; ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; -#ifdef DPMSExtension - DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime; - DPMSEnabled = TRUE; - DPMSPowerLevel = 0; -#endif + InitBlockAndWakeupHandlers(); /* Perform any operating system dependent initializations you'd like */ OsInit(); @@ -239,13 +235,6 @@ dix_main(int argc, char *argv[], char *envp[]) defaultCursorFont); } -#ifdef DPMSExtension - /* check all screens, looking for DPMS Capabilities */ - DPMSCapableFlag = DPMSSupported(); - if (!DPMSCapableFlag) - DPMSEnabled = FALSE; -#endif - #ifdef PANORAMIX /* * Consolidate window and colourmap information for each screen @@ -353,6 +342,8 @@ dix_main(int argc, char *argv[], char *envp[]) DeleteCallbackManager(); + ClearWorkQueue(); + if (dispatchException & DE_TERMINATE) { CloseWellKnownConnections(); } diff --git a/xserver/dix/pixmap.c b/xserver/dix/pixmap.c index 7a6402411..81ac5e2d8 100644 --- a/xserver/dix/pixmap.c +++ b/xserver/dix/pixmap.c @@ -181,12 +181,12 @@ PixmapDirtyDamageDestroy(DamagePtr damage, void *closure) } Bool -PixmapStartDirtyTracking(PixmapPtr src, +PixmapStartDirtyTracking(DrawablePtr src, PixmapPtr slave_dst, int x, int y, int dst_x, int dst_y, Rotation rotation) { - ScreenPtr screen = src->drawable.pScreen; + ScreenPtr screen = src->pScreen; PixmapDirtyUpdatePtr dirty_update; RegionPtr damageregion; RegionRec dstregion; @@ -204,8 +204,7 @@ PixmapStartDirtyTracking(PixmapPtr src, dirty_update->dst_y = dst_y; dirty_update->rotation = rotation; dirty_update->damage = DamageCreate(NULL, PixmapDirtyDamageDestroy, - DamageReportNone, - TRUE, src->drawable.pScreen, + DamageReportNone, TRUE, screen, dirty_update); if (rotation != RR_Rotate_0) { @@ -241,15 +240,15 @@ PixmapStartDirtyTracking(PixmapPtr src, RegionUnion(damageregion, damageregion, &dstregion); RegionUninit(&dstregion); - DamageRegister(&src->drawable, dirty_update->damage); + DamageRegister(src, dirty_update->damage); xorg_list_add(&dirty_update->ent, &screen->pixmap_dirty_list); return TRUE; } Bool -PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst) +PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr slave_dst) { - ScreenPtr screen = src->drawable.pScreen; + ScreenPtr screen = src->pScreen; PixmapDirtyUpdatePtr ent, safe; xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { @@ -268,7 +267,8 @@ PixmapDirtyCopyArea(PixmapPtr dst, PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region) { - ScreenPtr pScreen = dirty->src->drawable.pScreen; + DrawablePtr src = dirty->src; + ScreenPtr pScreen = src->pScreen; int n; BoxPtr b; GCPtr pGC; @@ -276,7 +276,13 @@ PixmapDirtyCopyArea(PixmapPtr dst, n = RegionNumRects(dirty_region); b = RegionRects(dirty_region); - pGC = GetScratchGC(dirty->src->drawable.depth, pScreen); + pGC = GetScratchGC(src->depth, pScreen); + if (pScreen->root) { + ChangeGCVal subWindowMode; + + subWindowMode.val = IncludeInferiors; + ChangeGC(NullClient, pGC, GCSubwindowMode, &subWindowMode); + } ValidateGC(&dst->drawable, pGC); while (n--) { @@ -287,7 +293,7 @@ PixmapDirtyCopyArea(PixmapPtr dst, w = dst_box.x2 - dst_box.x1; h = dst_box.y2 - dst_box.y1; - pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC, + pGC->ops->CopyArea(src, &dst->drawable, pGC, dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dirty->dst_x + dst_box.x1, dirty->dst_y + dst_box.y1); @@ -301,7 +307,7 @@ PixmapDirtyCompositeRotate(PixmapPtr dst_pixmap, PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region) { - ScreenPtr pScreen = dirty->src->drawable.pScreen; + ScreenPtr pScreen = dirty->src->pScreen; PictFormatPtr format = PictureWindowFormat(pScreen->root); PicturePtr src, dst; XID include_inferiors = IncludeInferiors; @@ -310,7 +316,7 @@ PixmapDirtyCompositeRotate(PixmapPtr dst_pixmap, int error; src = CreatePicture(None, - &dirty->src->drawable, + dirty->src, format, CPSubwindowMode, &include_inferiors, serverClient, &error); @@ -359,7 +365,7 @@ PixmapDirtyCompositeRotate(PixmapPtr dst_pixmap, */ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty) { - ScreenPtr pScreen = dirty->src->drawable.pScreen; + ScreenPtr pScreen = dirty->src->pScreen; RegionPtr region = DamageRegion(dirty->damage); PixmapPtr dst; SourceValidateProcPtr SourceValidate; diff --git a/xserver/dix/privates.c b/xserver/dix/privates.c index 478f52cbe..9ca80f0b6 100644 --- a/xserver/dix/privates.c +++ b/xserver/dix/privates.c @@ -105,7 +105,6 @@ static const char *key_names[PRIVATE_LAST] = { [PRIVATE_CURSOR_BITS] = "CURSOR_BITS", /* extension privates */ - [PRIVATE_DAMAGE] = "DAMAGE", [PRIVATE_GLYPH] = "GLYPH", [PRIVATE_GLYPHSET] = "GLYPHSET", [PRIVATE_PICTURE] = "PICTURE", @@ -572,8 +571,6 @@ static const int offsets[] = { offsetof(ColormapRec, devPrivates), /* RT_COLORMAP */ }; -#define NUM_OFFSETS (sizeof (offsets) / sizeof (offsets[0])) - int dixLookupPrivateOffset(RESTYPE type) { @@ -588,7 +585,7 @@ dixLookupPrivateOffset(RESTYPE type) return offsets[RT_PIXMAP & TypeMask]; } type = type & TypeMask; - if (type < NUM_OFFSETS) + if (type < ARRAY_SIZE(offsets)) return offsets[type]; return -1; } diff --git a/xserver/dix/property.c b/xserver/dix/property.c index fa4da2d42..ff1d6693b 100644 --- a/xserver/dix/property.c +++ b/xserver/dix/property.c @@ -105,18 +105,27 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, return rc; } +CallbackListPtr PropertyStateCallback; + static void -deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) +deliverPropertyNotifyEvent(WindowPtr pWin, int state, PropertyPtr pProp) { xEvent event; + PropertyStateRec rec = { + .win = pWin, + .prop = pProp, + .state = state + }; UpdateCurrentTimeIf(); event = (xEvent) { .u.property.window = pWin->drawable.id, .u.property.state = state, - .u.property.atom = atom, + .u.property.atom = pProp->propertyName, .u.property.time = currentTime.milliseconds, }; event.u.u.type = PropertyNotify; + + CallCallbacks(&PropertyStateCallback, &rec); DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); } @@ -175,7 +184,7 @@ ProcRotateProperties(ClientPtr client) delta += stuff->nAtoms; for (i = 0; i < stuff->nAtoms; i++) { j = (i + delta) % stuff->nAtoms; - deliverPropertyNotifyEvent(pWin, PropertyNewValue, atoms[i]); + deliverPropertyNotifyEvent(pWin, PropertyNewValue, props[i]); /* Preserve name and devPrivates */ props[j]->type = saved[i].type; @@ -351,7 +360,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, return rc; if (sendevent) - deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName); + deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp); return Success; } @@ -380,7 +389,7 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName) prevProp->next = pProp->next; } - deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); + deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp); free(pProp->data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); } @@ -394,7 +403,7 @@ DeleteAllWindowProperties(WindowPtr pWin) pProp = wUserProps(pWin); while (pProp) { - deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); + deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp); pNextProp = pProp->next; free(pProp->data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); @@ -517,7 +526,7 @@ ProcGetProperty(ClientPtr client) }; if (stuff->delete && (reply.bytesAfter == 0)) - deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); + deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp); WriteReplyToClient(client, sizeof(xGenericReply), &reply); if (len) { diff --git a/xserver/dix/protocol.txt b/xserver/dix/protocol.txt index 244556a08..a1bf93652 100644 --- a/xserver/dix/protocol.txt +++ b/xserver/dix/protocol.txt @@ -149,6 +149,7 @@ R031 GLX:CreateWindow R032 GLX:DeleteWindow R033 GLX:SetClientInfoARB R034 GLX:CreateContextAttribsARB +R035 GLX:SetClientInfo2ARB R101 GLX:NewList R102 GLX:EndList R103 GLX:DeleteLists diff --git a/xserver/dix/swaprep.c b/xserver/dix/swaprep.c index 905fef710..08344d7f7 100644 --- a/xserver/dix/swaprep.c +++ b/xserver/dix/swaprep.c @@ -68,7 +68,7 @@ static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs); * * \param size size in bytes */ -void +void _X_COLD Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int i; @@ -87,7 +87,7 @@ Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) * * \param size size in bytes */ -void +void _X_COLD CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int bufsize = size; @@ -134,7 +134,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) * * \param size size in bytes */ -void +void _X_COLD CopySwap16Write(ClientPtr pClient, int size, short *pbuf) { int bufsize = size; @@ -178,7 +178,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) } /* Extra-small reply */ -void +void _X_COLD SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) { swaps(&pRep->sequenceNumber); @@ -186,7 +186,7 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) } /* Extra-large reply */ -void +void _X_COLD SGetWindowAttributesReply(ClientPtr pClient, int size, xGetWindowAttributesReply * pRep) { @@ -203,7 +203,7 @@ SGetWindowAttributesReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep) { swaps(&pRep->sequenceNumber); @@ -216,7 +216,7 @@ SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep) { swaps(&pRep->sequenceNumber); @@ -227,7 +227,7 @@ SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) { swaps(&pRep->sequenceNumber); @@ -235,7 +235,7 @@ SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) { swaps(&pRep->sequenceNumber); @@ -244,7 +244,7 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep) { swaps(&pRep->sequenceNumber); @@ -255,7 +255,7 @@ SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep) { swaps(&pRep->sequenceNumber); @@ -264,7 +264,7 @@ SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetSelectionOwnerReply(ClientPtr pClient, int size, xGetSelectionOwnerReply * pRep) { @@ -273,7 +273,7 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep) { swaps(&pRep->sequenceNumber); @@ -287,7 +287,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep) WriteToClient(pClient, size, pRep); } -static void +static void _X_COLD SwapTimecoord(xTimecoord * pCoord) { swapl(&pCoord->time); @@ -295,7 +295,7 @@ SwapTimecoord(xTimecoord * pCoord) swaps(&pCoord->y); } -void +void _X_COLD SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep) { int i, n; @@ -311,7 +311,7 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep) } -void +void _X_COLD SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -320,7 +320,7 @@ SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -330,7 +330,7 @@ STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep) { swaps(&pRep->sequenceNumber); @@ -339,7 +339,7 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep) } /* extra long reply */ -void +void _X_COLD SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep) { swaps(&pRep->sequenceNumber); @@ -347,7 +347,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep) WriteToClient(pClient, size, pRep); } -static void +static void _X_COLD SwapCharInfo(xCharInfo * pInfo) { swaps(&pInfo->leftSideBearing); @@ -358,7 +358,7 @@ SwapCharInfo(xCharInfo * pInfo) swaps(&pInfo->attributes); } -static void +static void _X_COLD SwapFontInfo(xQueryFontReply * pr) { swaps(&pr->minCharOrByte2); @@ -372,7 +372,7 @@ SwapFontInfo(xQueryFontReply * pr) swapl(&pr->nCharInfos); } -static void +static void _X_COLD SwapFont(xQueryFontReply * pr, Bool hasGlyphs) { unsigned i; @@ -401,14 +401,14 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs) } } -void +void _X_COLD SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep) { SwapFont(pRep, TRUE); WriteToClient(pClient, size, pRep); } -void +void _X_COLD SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply * pRep) { @@ -423,7 +423,7 @@ SQueryTextExtentsReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -432,7 +432,7 @@ SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SListFontsWithInfoReply(ClientPtr pClient, int size, xListFontsWithInfoReply * pRep) { @@ -440,7 +440,7 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep) { swaps(&pRep->sequenceNumber); @@ -449,7 +449,7 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep) { swaps(&pRep->sequenceNumber); @@ -459,7 +459,7 @@ SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep) /* Fortunately, image doesn't need swapping */ } -void +void _X_COLD SListInstalledColormapsReply(ClientPtr pClient, int size, xListInstalledColormapsReply * pRep) { @@ -469,7 +469,7 @@ SListInstalledColormapsReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep) { swaps(&pRep->sequenceNumber); @@ -480,7 +480,7 @@ SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep) { swaps(&pRep->sequenceNumber); @@ -494,7 +494,7 @@ SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -504,7 +504,7 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply * pRep) { @@ -517,7 +517,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -static void +static void _X_COLD SwapRGB(xrgb * prgb) { swaps(&prgb->red); @@ -525,7 +525,7 @@ SwapRGB(xrgb * prgb) swaps(&prgb->blue); } -void +void _X_COLD SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb) { int i, n; @@ -540,7 +540,7 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb) WriteToClient(pClient, size, prgb); } -void +void _X_COLD SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -549,7 +549,7 @@ SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep) { swaps(&pRep->sequenceNumber); @@ -562,7 +562,7 @@ SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep) { swaps(&pRep->sequenceNumber); @@ -571,7 +571,7 @@ SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -579,7 +579,7 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetKeyboardMappingReply(ClientPtr pClient, int size, xGetKeyboardMappingReply * pRep) { @@ -588,7 +588,7 @@ SGetKeyboardMappingReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetPointerMappingReply(ClientPtr pClient, int size, xGetPointerMappingReply * pRep) { @@ -597,7 +597,7 @@ SGetPointerMappingReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetModifierMappingReply(ClientPtr pClient, int size, xGetModifierMappingReply * pRep) { @@ -606,7 +606,7 @@ SGetModifierMappingReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply * pRep) { @@ -618,7 +618,7 @@ SGetKeyboardControlReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply * pRep) { @@ -629,7 +629,7 @@ SGetPointerControlReply(ClientPtr pClient, int size, WriteToClient(pClient, size, pRep); } -void +void _X_COLD SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep) { swaps(&pRep->sequenceNumber); @@ -638,7 +638,7 @@ SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SLHostsExtend(ClientPtr pClient, int size, char *buf) { char *bufT = buf; @@ -654,7 +654,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) WriteToClient(pClient, size, buf); } -void +void _X_COLD SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep) { swaps(&pRep->sequenceNumber); @@ -663,7 +663,7 @@ SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep) WriteToClient(pClient, size, pRep); } -void +void _X_COLD SErrorEvent(xError * from, xError * to) { to->type = X_Error; @@ -674,7 +674,7 @@ SErrorEvent(xError * from, xError * to) to->majorCode = from->majorCode; } -void +void _X_COLD SKeyButtonPtrEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -692,7 +692,7 @@ SKeyButtonPtrEvent(xEvent *from, xEvent *to) to->u.keyButtonPointer.sameScreen = from->u.keyButtonPointer.sameScreen; } -void +void _X_COLD SEnterLeaveEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -711,7 +711,7 @@ SEnterLeaveEvent(xEvent *from, xEvent *to) to->u.enterLeave.flags = from->u.enterLeave.flags; } -void +void _X_COLD SFocusEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -721,7 +721,7 @@ SFocusEvent(xEvent *from, xEvent *to) to->u.focus.mode = from->u.focus.mode; } -void +void _X_COLD SExposeEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -734,7 +734,7 @@ SExposeEvent(xEvent *from, xEvent *to) cpswaps(from->u.expose.count, to->u.expose.count); } -void +void _X_COLD SGraphicsExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -750,7 +750,7 @@ SGraphicsExposureEvent(xEvent *from, xEvent *to) to->u.graphicsExposure.majorEvent = from->u.graphicsExposure.majorEvent; } -void +void _X_COLD SNoExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -760,7 +760,7 @@ SNoExposureEvent(xEvent *from, xEvent *to) to->u.noExposure.majorEvent = from->u.noExposure.majorEvent; } -void +void _X_COLD SVisibilityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -769,7 +769,7 @@ SVisibilityEvent(xEvent *from, xEvent *to) to->u.visibility.state = from->u.visibility.state; } -void +void _X_COLD SCreateNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -784,7 +784,7 @@ SCreateNotifyEvent(xEvent *from, xEvent *to) to->u.createNotify.override = from->u.createNotify.override; } -void +void _X_COLD SDestroyNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -793,7 +793,7 @@ SDestroyNotifyEvent(xEvent *from, xEvent *to) cpswapl(from->u.destroyNotify.window, to->u.destroyNotify.window); } -void +void _X_COLD SUnmapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -803,7 +803,7 @@ SUnmapNotifyEvent(xEvent *from, xEvent *to) to->u.unmapNotify.fromConfigure = from->u.unmapNotify.fromConfigure; } -void +void _X_COLD SMapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -813,7 +813,7 @@ SMapNotifyEvent(xEvent *from, xEvent *to) to->u.mapNotify.override = from->u.mapNotify.override; } -void +void _X_COLD SMapRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -822,7 +822,7 @@ SMapRequestEvent(xEvent *from, xEvent *to) cpswapl(from->u.mapRequest.window, to->u.mapRequest.window); } -void +void _X_COLD SReparentEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -835,7 +835,7 @@ SReparentEvent(xEvent *from, xEvent *to) to->u.reparent.override = from->u.reparent.override; } -void +void _X_COLD SConfigureNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -853,7 +853,7 @@ SConfigureNotifyEvent(xEvent *from, xEvent *to) to->u.configureNotify.override = from->u.configureNotify.override; } -void +void _X_COLD SConfigureRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -872,7 +872,7 @@ SConfigureRequestEvent(xEvent *from, xEvent *to) to->u.configureRequest.valueMask); } -void +void _X_COLD SGravityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -883,7 +883,7 @@ SGravityEvent(xEvent *from, xEvent *to) cpswaps(from->u.gravity.y, to->u.gravity.y); } -void +void _X_COLD SResizeRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -893,7 +893,7 @@ SResizeRequestEvent(xEvent *from, xEvent *to) cpswaps(from->u.resizeRequest.height, to->u.resizeRequest.height); } -void +void _X_COLD SCirculateEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -905,7 +905,7 @@ SCirculateEvent(xEvent *from, xEvent *to) to->u.circulate.place = from->u.circulate.place; } -void +void _X_COLD SPropertyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -916,7 +916,7 @@ SPropertyEvent(xEvent *from, xEvent *to) to->u.property.state = from->u.property.state; } -void +void _X_COLD SSelectionClearEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -926,7 +926,7 @@ SSelectionClearEvent(xEvent *from, xEvent *to) cpswapl(from->u.selectionClear.atom, to->u.selectionClear.atom); } -void +void _X_COLD SSelectionRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -941,7 +941,7 @@ SSelectionRequestEvent(xEvent *from, xEvent *to) cpswapl(from->u.selectionRequest.property, to->u.selectionRequest.property); } -void +void _X_COLD SSelectionNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -953,7 +953,7 @@ SSelectionNotifyEvent(xEvent *from, xEvent *to) cpswapl(from->u.selectionNotify.property, to->u.selectionNotify.property); } -void +void _X_COLD SColormapEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -964,7 +964,7 @@ SColormapEvent(xEvent *from, xEvent *to) to->u.colormap.state = from->u.colormap.state; } -void +void _X_COLD SMappingEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -974,7 +974,7 @@ SMappingEvent(xEvent *from, xEvent *to) to->u.mappingNotify.count = from->u.mappingNotify.count; } -void +void _X_COLD SClientMessageEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; @@ -1024,7 +1024,7 @@ SClientMessageEvent(xEvent *from, xEvent *to) } } -void +void _X_COLD SKeymapNotifyEvent(xEvent *from, xEvent *to) { /* Keymap notify events are special; they have no @@ -1032,7 +1032,7 @@ SKeymapNotifyEvent(xEvent *from, xEvent *to) *to = *from; } -static void +static void _X_COLD SwapConnSetup(xConnSetup * pConnSetup, xConnSetup * pConnSetupT) { cpswapl(pConnSetup->release, pConnSetupT->release); @@ -1051,7 +1051,7 @@ SwapConnSetup(xConnSetup * pConnSetup, xConnSetup * pConnSetupT) pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad; } -static void +static void _X_COLD SwapWinRoot(xWindowRoot * pRoot, xWindowRoot * pRootT) { cpswapl(pRoot->windowId, pRootT->windowId); @@ -1072,7 +1072,7 @@ SwapWinRoot(xWindowRoot * pRoot, xWindowRoot * pRootT) pRootT->nDepths = pRoot->nDepths; } -static void +static void _X_COLD SwapVisual(xVisualType * pVis, xVisualType * pVisT) { cpswapl(pVis->visualID, pVisT->visualID); @@ -1084,7 +1084,7 @@ SwapVisual(xVisualType * pVis, xVisualType * pVisT) cpswapl(pVis->blueMask, pVisT->blueMask); } -void +void _X_COLD SwapConnSetupInfo(char *pInfo, char *pInfoT) { int i, j, k; @@ -1129,7 +1129,7 @@ SwapConnSetupInfo(char *pInfo, char *pInfoT) } } -void +void _X_COLD WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { char *pInfoTBase; @@ -1144,7 +1144,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) free(pInfoTBase); } -void +void _X_COLD SwapConnSetupPrefix(xConnSetupPrefix * pcspFrom, xConnSetupPrefix * pcspTo) { pcspTo->success = pcspFrom->success; @@ -1154,7 +1154,7 @@ SwapConnSetupPrefix(xConnSetupPrefix * pcspFrom, xConnSetupPrefix * pcspTo) cpswaps(pcspFrom->length, pcspTo->length); } -void +void _X_COLD WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix * pcsp) { xConnSetupPrefix cspT; @@ -1167,7 +1167,7 @@ WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix * pcsp) * Dummy entry for ReplySwapVector[] */ -void +void _X_COLD ReplyNotSwappd(ClientPtr pClient, int size, void *pbuf) { FatalError("Not implemented"); diff --git a/xserver/dix/swapreq.c b/xserver/dix/swapreq.c index 8cc64b6ed..67850593b 100644 --- a/xserver/dix/swapreq.c +++ b/xserver/dix/swapreq.c @@ -116,7 +116,7 @@ SwapShorts(short *list, unsigned long count) /* The following is used for all requests that have no fields to be swapped (except "length") */ -int +int _X_COLD SProcSimpleReq(ClientPtr client) { REQUEST(xReq); @@ -127,7 +127,7 @@ SProcSimpleReq(ClientPtr client) /* The following is used for all requests that have only a single 32-bit field to be swapped, coming right after the "length" field */ -int +int _X_COLD SProcResourceReq(ClientPtr client) { REQUEST(xResourceReq); @@ -137,7 +137,7 @@ SProcResourceReq(ClientPtr client) return (*ProcVector[stuff->reqType]) (client); } -int +int _X_COLD SProcCreateWindow(ClientPtr client) { REQUEST(xCreateWindowReq); @@ -157,7 +157,7 @@ SProcCreateWindow(ClientPtr client) return ((*ProcVector[X_CreateWindow]) (client)); } -int +int _X_COLD SProcChangeWindowAttributes(ClientPtr client) { REQUEST(xChangeWindowAttributesReq); @@ -169,7 +169,7 @@ SProcChangeWindowAttributes(ClientPtr client) return ((*ProcVector[X_ChangeWindowAttributes]) (client)); } -int +int _X_COLD SProcReparentWindow(ClientPtr client) { REQUEST(xReparentWindowReq); @@ -182,7 +182,7 @@ SProcReparentWindow(ClientPtr client) return ((*ProcVector[X_ReparentWindow]) (client)); } -int +int _X_COLD SProcConfigureWindow(ClientPtr client) { REQUEST(xConfigureWindowReq); @@ -195,7 +195,7 @@ SProcConfigureWindow(ClientPtr client) } -int +int _X_COLD SProcInternAtom(ClientPtr client) { REQUEST(xInternAtomReq); @@ -205,7 +205,7 @@ SProcInternAtom(ClientPtr client) return ((*ProcVector[X_InternAtom]) (client)); } -int +int _X_COLD SProcChangeProperty(ClientPtr client) { REQUEST(xChangePropertyReq); @@ -228,7 +228,7 @@ SProcChangeProperty(ClientPtr client) return ((*ProcVector[X_ChangeProperty]) (client)); } -int +int _X_COLD SProcDeleteProperty(ClientPtr client) { REQUEST(xDeletePropertyReq); @@ -240,7 +240,7 @@ SProcDeleteProperty(ClientPtr client) } -int +int _X_COLD SProcGetProperty(ClientPtr client) { REQUEST(xGetPropertyReq); @@ -254,7 +254,7 @@ SProcGetProperty(ClientPtr client) return ((*ProcVector[X_GetProperty]) (client)); } -int +int _X_COLD SProcSetSelectionOwner(ClientPtr client) { REQUEST(xSetSelectionOwnerReq); @@ -266,7 +266,7 @@ SProcSetSelectionOwner(ClientPtr client) return ((*ProcVector[X_SetSelectionOwner]) (client)); } -int +int _X_COLD SProcConvertSelection(ClientPtr client) { REQUEST(xConvertSelectionReq); @@ -280,7 +280,7 @@ SProcConvertSelection(ClientPtr client) return ((*ProcVector[X_ConvertSelection]) (client)); } -int +int _X_COLD SProcSendEvent(ClientPtr client) { xEvent eventT = { .u.u.type = 0 }; @@ -309,7 +309,7 @@ SProcSendEvent(ClientPtr client) return ((*ProcVector[X_SendEvent]) (client)); } -int +int _X_COLD SProcGrabPointer(ClientPtr client) { REQUEST(xGrabPointerReq); @@ -323,7 +323,7 @@ SProcGrabPointer(ClientPtr client) return ((*ProcVector[X_GrabPointer]) (client)); } -int +int _X_COLD SProcGrabButton(ClientPtr client) { REQUEST(xGrabButtonReq); @@ -337,7 +337,7 @@ SProcGrabButton(ClientPtr client) return ((*ProcVector[X_GrabButton]) (client)); } -int +int _X_COLD SProcUngrabButton(ClientPtr client) { REQUEST(xUngrabButtonReq); @@ -348,7 +348,7 @@ SProcUngrabButton(ClientPtr client) return ((*ProcVector[X_UngrabButton]) (client)); } -int +int _X_COLD SProcChangeActivePointerGrab(ClientPtr client) { REQUEST(xChangeActivePointerGrabReq); @@ -360,7 +360,7 @@ SProcChangeActivePointerGrab(ClientPtr client) return ((*ProcVector[X_ChangeActivePointerGrab]) (client)); } -int +int _X_COLD SProcGrabKeyboard(ClientPtr client) { REQUEST(xGrabKeyboardReq); @@ -371,7 +371,7 @@ SProcGrabKeyboard(ClientPtr client) return ((*ProcVector[X_GrabKeyboard]) (client)); } -int +int _X_COLD SProcGrabKey(ClientPtr client) { REQUEST(xGrabKeyReq); @@ -382,7 +382,7 @@ SProcGrabKey(ClientPtr client) return ((*ProcVector[X_GrabKey]) (client)); } -int +int _X_COLD SProcUngrabKey(ClientPtr client) { REQUEST(xUngrabKeyReq); @@ -393,7 +393,7 @@ SProcUngrabKey(ClientPtr client) return ((*ProcVector[X_UngrabKey]) (client)); } -int +int _X_COLD SProcGetMotionEvents(ClientPtr client) { REQUEST(xGetMotionEventsReq); @@ -405,7 +405,7 @@ SProcGetMotionEvents(ClientPtr client) return ((*ProcVector[X_GetMotionEvents]) (client)); } -int +int _X_COLD SProcTranslateCoords(ClientPtr client) { REQUEST(xTranslateCoordsReq); @@ -418,7 +418,7 @@ SProcTranslateCoords(ClientPtr client) return ((*ProcVector[X_TranslateCoords]) (client)); } -int +int _X_COLD SProcWarpPointer(ClientPtr client) { REQUEST(xWarpPointerReq); @@ -435,7 +435,7 @@ SProcWarpPointer(ClientPtr client) return ((*ProcVector[X_WarpPointer]) (client)); } -int +int _X_COLD SProcSetInputFocus(ClientPtr client) { REQUEST(xSetInputFocusReq); @@ -446,7 +446,7 @@ SProcSetInputFocus(ClientPtr client) return ((*ProcVector[X_SetInputFocus]) (client)); } -int +int _X_COLD SProcOpenFont(ClientPtr client) { REQUEST(xOpenFontReq); @@ -457,7 +457,7 @@ SProcOpenFont(ClientPtr client) return ((*ProcVector[X_OpenFont]) (client)); } -int +int _X_COLD SProcListFonts(ClientPtr client) { REQUEST(xListFontsReq); @@ -468,7 +468,7 @@ SProcListFonts(ClientPtr client) return ((*ProcVector[X_ListFonts]) (client)); } -int +int _X_COLD SProcListFontsWithInfo(ClientPtr client) { REQUEST(xListFontsWithInfoReq); @@ -479,7 +479,7 @@ SProcListFontsWithInfo(ClientPtr client) return ((*ProcVector[X_ListFontsWithInfo]) (client)); } -int +int _X_COLD SProcSetFontPath(ClientPtr client) { REQUEST(xSetFontPathReq); @@ -489,7 +489,7 @@ SProcSetFontPath(ClientPtr client) return ((*ProcVector[X_SetFontPath]) (client)); } -int +int _X_COLD SProcCreatePixmap(ClientPtr client) { REQUEST(xCreatePixmapReq); @@ -503,7 +503,7 @@ SProcCreatePixmap(ClientPtr client) return ((*ProcVector[X_CreatePixmap]) (client)); } -int +int _X_COLD SProcCreateGC(ClientPtr client) { REQUEST(xCreateGCReq); @@ -516,7 +516,7 @@ SProcCreateGC(ClientPtr client) return ((*ProcVector[X_CreateGC]) (client)); } -int +int _X_COLD SProcChangeGC(ClientPtr client) { REQUEST(xChangeGCReq); @@ -528,7 +528,7 @@ SProcChangeGC(ClientPtr client) return ((*ProcVector[X_ChangeGC]) (client)); } -int +int _X_COLD SProcCopyGC(ClientPtr client) { REQUEST(xCopyGCReq); @@ -540,7 +540,7 @@ SProcCopyGC(ClientPtr client) return ((*ProcVector[X_CopyGC]) (client)); } -int +int _X_COLD SProcSetDashes(ClientPtr client) { REQUEST(xSetDashesReq); @@ -553,7 +553,7 @@ SProcSetDashes(ClientPtr client) } -int +int _X_COLD SProcSetClipRectangles(ClientPtr client) { REQUEST(xSetClipRectanglesReq); @@ -566,7 +566,7 @@ SProcSetClipRectangles(ClientPtr client) return ((*ProcVector[X_SetClipRectangles]) (client)); } -int +int _X_COLD SProcClearToBackground(ClientPtr client) { REQUEST(xClearAreaReq); @@ -580,7 +580,7 @@ SProcClearToBackground(ClientPtr client) return ((*ProcVector[X_ClearArea]) (client)); } -int +int _X_COLD SProcCopyArea(ClientPtr client) { REQUEST(xCopyAreaReq); @@ -598,7 +598,7 @@ SProcCopyArea(ClientPtr client) return ((*ProcVector[X_CopyArea]) (client)); } -int +int _X_COLD SProcCopyPlane(ClientPtr client) { REQUEST(xCopyPlaneReq); @@ -619,7 +619,7 @@ SProcCopyPlane(ClientPtr client) /* The following routine is used for all Poly drawing requests (except FillPoly, which uses a different request format) */ -int +int _X_COLD SProcPoly(ClientPtr client) { REQUEST(xPolyPointReq); @@ -634,7 +634,7 @@ SProcPoly(ClientPtr client) /* cannot use SProcPoly for this one, because xFillPolyReq is longer than xPolyPointReq, and we don't want to swap the difference as shorts! */ -int +int _X_COLD SProcFillPoly(ClientPtr client) { REQUEST(xFillPolyReq); @@ -646,7 +646,7 @@ SProcFillPoly(ClientPtr client) return ((*ProcVector[X_FillPoly]) (client)); } -int +int _X_COLD SProcPutImage(ClientPtr client) { REQUEST(xPutImageReq); @@ -663,7 +663,7 @@ SProcPutImage(ClientPtr client) } -int +int _X_COLD SProcGetImage(ClientPtr client) { REQUEST(xGetImageReq); @@ -680,7 +680,7 @@ SProcGetImage(ClientPtr client) /* ProcPolyText used for both PolyText8 and PolyText16 */ -int +int _X_COLD SProcPolyText(ClientPtr client) { REQUEST(xPolyTextReq); @@ -695,7 +695,7 @@ SProcPolyText(ClientPtr client) /* ProcImageText used for both ImageText8 and ImageText16 */ -int +int _X_COLD SProcImageText(ClientPtr client) { REQUEST(xImageTextReq); @@ -708,7 +708,7 @@ SProcImageText(ClientPtr client) return ((*ProcVector[stuff->reqType]) (client)); } -int +int _X_COLD SProcCreateColormap(ClientPtr client) { REQUEST(xCreateColormapReq); @@ -720,7 +720,7 @@ SProcCreateColormap(ClientPtr client) return ((*ProcVector[X_CreateColormap]) (client)); } -int +int _X_COLD SProcCopyColormapAndFree(ClientPtr client) { REQUEST(xCopyColormapAndFreeReq); @@ -732,7 +732,7 @@ SProcCopyColormapAndFree(ClientPtr client) } -int +int _X_COLD SProcAllocColor(ClientPtr client) { REQUEST(xAllocColorReq); @@ -745,7 +745,7 @@ SProcAllocColor(ClientPtr client) return ((*ProcVector[X_AllocColor]) (client)); } -int +int _X_COLD SProcAllocNamedColor(ClientPtr client) { REQUEST(xAllocNamedColorReq); @@ -756,7 +756,7 @@ SProcAllocNamedColor(ClientPtr client) return ((*ProcVector[X_AllocNamedColor]) (client)); } -int +int _X_COLD SProcAllocColorCells(ClientPtr client) { REQUEST(xAllocColorCellsReq); @@ -768,7 +768,7 @@ SProcAllocColorCells(ClientPtr client) return ((*ProcVector[X_AllocColorCells]) (client)); } -int +int _X_COLD SProcAllocColorPlanes(ClientPtr client) { REQUEST(xAllocColorPlanesReq); @@ -782,7 +782,7 @@ SProcAllocColorPlanes(ClientPtr client) return ((*ProcVector[X_AllocColorPlanes]) (client)); } -int +int _X_COLD SProcFreeColors(ClientPtr client) { REQUEST(xFreeColorsReq); @@ -795,7 +795,7 @@ SProcFreeColors(ClientPtr client) } -void +void _X_COLD SwapColorItem(xColorItem * pItem) { swapl(&pItem->pixel); @@ -804,7 +804,7 @@ SwapColorItem(xColorItem * pItem) swaps(&pItem->blue); } -int +int _X_COLD SProcStoreColors(ClientPtr client) { long count; @@ -820,7 +820,7 @@ SProcStoreColors(ClientPtr client) return ((*ProcVector[X_StoreColors]) (client)); } -int +int _X_COLD SProcStoreNamedColor(ClientPtr client) { REQUEST(xStoreNamedColorReq); @@ -832,7 +832,7 @@ SProcStoreNamedColor(ClientPtr client) return ((*ProcVector[X_StoreNamedColor]) (client)); } -int +int _X_COLD SProcQueryColors(ClientPtr client) { REQUEST(xQueryColorsReq); @@ -843,7 +843,7 @@ SProcQueryColors(ClientPtr client) return ((*ProcVector[X_QueryColors]) (client)); } -int +int _X_COLD SProcLookupColor(ClientPtr client) { REQUEST(xLookupColorReq); @@ -854,7 +854,7 @@ SProcLookupColor(ClientPtr client) return ((*ProcVector[X_LookupColor]) (client)); } -int +int _X_COLD SProcCreateCursor(ClientPtr client) { REQUEST(xCreateCursorReq); @@ -874,7 +874,7 @@ SProcCreateCursor(ClientPtr client) return ((*ProcVector[X_CreateCursor]) (client)); } -int +int _X_COLD SProcCreateGlyphCursor(ClientPtr client) { REQUEST(xCreateGlyphCursorReq); @@ -894,7 +894,7 @@ SProcCreateGlyphCursor(ClientPtr client) return ((*ProcVector[X_CreateGlyphCursor]) (client)); } -int +int _X_COLD SProcRecolorCursor(ClientPtr client) { REQUEST(xRecolorCursorReq); @@ -910,7 +910,7 @@ SProcRecolorCursor(ClientPtr client) return ((*ProcVector[X_RecolorCursor]) (client)); } -int +int _X_COLD SProcQueryBestSize(ClientPtr client) { REQUEST(xQueryBestSizeReq); @@ -923,7 +923,7 @@ SProcQueryBestSize(ClientPtr client) } -int +int _X_COLD SProcQueryExtension(ClientPtr client) { REQUEST(xQueryExtensionReq); @@ -933,7 +933,7 @@ SProcQueryExtension(ClientPtr client) return ((*ProcVector[X_QueryExtension]) (client)); } -int +int _X_COLD SProcChangeKeyboardMapping(ClientPtr client) { REQUEST(xChangeKeyboardMappingReq); @@ -943,7 +943,7 @@ SProcChangeKeyboardMapping(ClientPtr client) return ((*ProcVector[X_ChangeKeyboardMapping]) (client)); } -int +int _X_COLD SProcChangeKeyboardControl(ClientPtr client) { REQUEST(xChangeKeyboardControlReq); @@ -954,7 +954,7 @@ SProcChangeKeyboardControl(ClientPtr client) return ((*ProcVector[X_ChangeKeyboardControl]) (client)); } -int +int _X_COLD SProcChangePointerControl(ClientPtr client) { REQUEST(xChangePointerControlReq); @@ -966,7 +966,7 @@ SProcChangePointerControl(ClientPtr client) return ((*ProcVector[X_ChangePointerControl]) (client)); } -int +int _X_COLD SProcSetScreenSaver(ClientPtr client) { REQUEST(xSetScreenSaverReq); @@ -977,7 +977,7 @@ SProcSetScreenSaver(ClientPtr client) return ((*ProcVector[X_SetScreenSaver]) (client)); } -int +int _X_COLD SProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); @@ -988,7 +988,7 @@ SProcChangeHosts(ClientPtr client) } -int +int _X_COLD SProcRotateProperties(ClientPtr client) { REQUEST(xRotatePropertiesReq); @@ -1001,7 +1001,7 @@ SProcRotateProperties(ClientPtr client) return ((*ProcVector[X_RotateProperties]) (client)); } -int +int _X_COLD SProcNoOperation(ClientPtr client) { REQUEST(xReq); @@ -1009,7 +1009,7 @@ SProcNoOperation(ClientPtr client) return ((*ProcVector[X_NoOperation]) (client)); } -void +void _X_COLD SwapConnClientPrefix(xConnClientPrefix * pCCP) { swaps(&pCCP->majorVersion); diff --git a/xserver/dix/window.c b/xserver/dix/window.c index ead4dc27f..8789a5ece 100644 --- a/xserver/dix/window.c +++ b/xserver/dix/window.c @@ -456,9 +456,9 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void *data) /***** * WalkTree - * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on + * Walk the window tree, for SCREEN, performing FUNC(pWin, data) on * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, - * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING + * if it returns WT_DONTWALKCHILDREN, don't. If it returns WT_STOPWALKING, * exit WalkTree. Does depth-first traverse. *****/ diff --git a/xserver/doc/Makefile.in b/xserver/doc/Makefile.in index 9a398f806..858e09eb3 100644 --- a/xserver/doc/Makefile.in +++ b/xserver/doc/Makefile.in @@ -87,7 +87,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -336,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -354,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -370,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -441,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/doc/Xserver-spec.xml b/xserver/doc/Xserver-spec.xml index 7867544e4..3dde65178 100644 --- a/xserver/doc/Xserver-spec.xml +++ b/xserver/doc/Xserver-spec.xml @@ -600,7 +600,7 @@ are: REQUEST, REQUEST_SIZE_MATCH, REQUEST_AT_LEAST_SIZE, REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, and VALIDATE_DRAWABLE_AND_GC. Useful byte swapping macros can be found in Xserver/include/dix.h: WriteReplyToClient and WriteSwappedDataToClient; and -in Xserver/include/misc.h: lswapl, lswaps, LengthRestB, LengthRestS, +in Xserver/include/misc.h: bswap_64, bswap_32, bswap_16, LengthRestB, LengthRestS, LengthRestL, SwapRestS, SwapRestL, swapl, swaps, cpswapl, and cpswaps. diff --git a/xserver/doc/dtrace/Makefile.in b/xserver/doc/dtrace/Makefile.in index f1f2d1351..3118136f3 100644 --- a/xserver/doc/dtrace/Makefile.in +++ b/xserver/doc/dtrace/Makefile.in @@ -90,7 +90,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -327,6 +327,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -345,15 +346,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -361,6 +365,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -432,8 +438,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/dri3/Makefile.in b/xserver/dri3/Makefile.in index 322d840cf..86cad69bd 100644 --- a/xserver/dri3/Makefile.in +++ b/xserver/dri3/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -337,6 +337,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -355,15 +356,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -371,6 +375,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -442,8 +448,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/dri3/dri3.c b/xserver/dri3/dri3.c index d042b8b7d..ba32facd7 100644 --- a/xserver/dri3/dri3.c +++ b/xserver/dri3/dri3.c @@ -26,6 +26,8 @@ #include "dri3_priv.h" +#include + static int dri3_request; DevPrivateKeyRec dri3_screen_private_key; @@ -43,7 +45,7 @@ dri3_close_screen(ScreenPtr screen) } Bool -dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info) +dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info) { dri3_screen_generation = serverGeneration; @@ -99,3 +101,20 @@ dri3_extension_init(void) bail: FatalError("Cannot initialize DRI3 extension"); } + +uint32_t +drm_format_for_depth(uint32_t depth, uint32_t bpp) +{ + switch (bpp) { + case 16: + return DRM_FORMAT_RGB565; + case 24: + return DRM_FORMAT_XRGB8888; + case 30: + return DRM_FORMAT_XRGB2101010; + case 32: + return DRM_FORMAT_ARGB8888; + default: + return 0; + } +} diff --git a/xserver/dri3/dri3.h b/xserver/dri3/dri3.h index 7562352ff..02d3b03ee 100644 --- a/xserver/dri3/dri3.h +++ b/xserver/dri3/dri3.h @@ -28,7 +28,7 @@ #include #include -#define DRI3_SCREEN_INFO_VERSION 1 +#define DRI3_SCREEN_INFO_VERSION 2 typedef int (*dri3_open_proc)(ScreenPtr screen, RRProviderPtr provider, @@ -47,11 +47,43 @@ typedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen, CARD8 depth, CARD8 bpp); +typedef PixmapPtr (*dri3_pixmap_from_fds_proc) (ScreenPtr screen, + CARD8 num_fds, + const int *fds, + CARD16 width, + CARD16 height, + const CARD32 *strides, + const CARD32 *offsets, + CARD8 depth, + CARD8 bpp, + CARD64 modifier); + typedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); +typedef int (*dri3_fds_from_pixmap_proc) (ScreenPtr screen, + PixmapPtr pixmap, + int *fds, + uint32_t *strides, + uint32_t *offsets, + uint64_t *modifier); + +typedef int (*dri3_get_formats_proc) (ScreenPtr screen, + CARD32 *num_formats, + CARD32 **formats); + +typedef int (*dri3_get_modifiers_proc) (ScreenPtr screen, + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); + +typedef int (*dri3_get_drawable_modifiers_proc) (DrawablePtr draw, + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); + typedef struct dri3_screen_info { uint32_t version; @@ -62,14 +94,24 @@ typedef struct dri3_screen_info { /* Version 1 */ dri3_open_client_proc open_client; + /* Version 2 */ + dri3_pixmap_from_fds_proc pixmap_from_fds; + dri3_fds_from_pixmap_proc fds_from_pixmap; + dri3_get_formats_proc get_formats; + dri3_get_modifiers_proc get_modifiers; + dri3_get_drawable_modifiers_proc get_drawable_modifiers; + } dri3_screen_info_rec, *dri3_screen_info_ptr; extern _X_EXPORT Bool -dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info); +dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info); extern _X_EXPORT int dri3_send_open_reply(ClientPtr client, int fd); +extern _X_EXPORT uint32_t +drm_format_for_depth(uint32_t depth, uint32_t bpp); + #endif #endif /* _DRI3_H_ */ diff --git a/xserver/dri3/dri3_priv.h b/xserver/dri3/dri3_priv.h index e61ef226c..b087a9529 100644 --- a/xserver/dri3/dri3_priv.h +++ b/xserver/dri3/dri3_priv.h @@ -34,12 +34,22 @@ extern DevPrivateKeyRec dri3_screen_private_key; +typedef struct dri3_dmabuf_format { + uint32_t format; + uint32_t num_modifiers; + uint64_t *modifiers; +} dri3_dmabuf_format_rec, *dri3_dmabuf_format_ptr; + typedef struct dri3_screen_priv { CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; DestroyWindowProcPtr DestroyWindow; - dri3_screen_info_ptr info; + Bool formats_cached; + CARD32 num_formats; + dri3_dmabuf_format_ptr formats; + + const dri3_screen_info_rec *info; } dri3_screen_priv_rec, *dri3_screen_priv_ptr; #define wrap(priv,real,mem,func) {\ @@ -69,10 +79,26 @@ int dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd); int -dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, - CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp); +dri3_pixmap_from_fds(PixmapPtr *ppixmap, ScreenPtr screen, + CARD8 num_fds, const int *fds, + CARD16 width, CARD16 height, + const CARD32 *strides, const CARD32 *offsets, + CARD8 depth, CARD8 bpp, CARD64 modifier); int -dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); +dri3_fd_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size); + +int +dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier); + +int +dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable, + CARD8 depth, CARD8 bpp, + CARD32 *num_drawable_modifiers, + CARD64 **drawable_modifiers, + CARD32 *num_screen_modifiers, + CARD64 **screen_modifiers); #endif /* _DRI3PRIV_H_ */ diff --git a/xserver/dri3/dri3_request.c b/xserver/dri3/dri3_request.c index 8c15dbe16..958877efa 100644 --- a/xserver/dri3/dri3_request.c +++ b/xserver/dri3/dri3_request.c @@ -30,6 +30,21 @@ #include #include "../Xext/syncsdk.h" #include +#include + +static Bool +dri3_screen_can_one_point_two(ScreenPtr screen) +{ + dri3_screen_priv_ptr dri3 = dri3_screen_priv(screen); + + if (dri3 && dri3->info && dri3->info->version >= 2 && + dri3->info->pixmap_from_fds && dri3->info->fds_from_pixmap && + dri3->info->get_formats && dri3->info->get_modifiers && + dri3->info->get_drawable_modifiers) + return TRUE; + + return FALSE; +} static int proc_dri3_query_version(ClientPtr client) @@ -44,7 +59,35 @@ proc_dri3_query_version(ClientPtr client) }; REQUEST_SIZE_MATCH(xDRI3QueryVersionReq); - (void) stuff; + + for (int i = 0; i < screenInfo.numScreens; i++) { + if (!dri3_screen_can_one_point_two(screenInfo.screens[i])) { + rep.minorVersion = 0; + break; + } + } + + for (int i = 0; i < screenInfo.numGPUScreens; i++) { + if (!dri3_screen_can_one_point_two(screenInfo.gpuscreens[i])) { + rep.minorVersion = 0; + break; + } + } + + /* From DRI3 proto: + * + * The client sends the highest supported version to the server + * and the server sends the highest version it supports, but no + * higher than the requested version. + */ + + if (rep.majorVersion > stuff->majorVersion || + (rep.majorVersion == stuff->majorVersion && + rep.minorVersion > stuff->minorVersion)) { + rep.majorVersion = stuff->majorVersion; + rep.minorVersion = stuff->minorVersion; + } + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -92,7 +135,7 @@ proc_dri3_open(ClientPtr client) REQUEST_SIZE_MATCH(xDRI3OpenReq); - status = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); + status = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixGetAttrAccess); if (status != Success) return status; @@ -124,6 +167,7 @@ proc_dri3_pixmap_from_buffer(ClientPtr client) int fd; DrawablePtr drawable; PixmapPtr pixmap; + CARD32 stride, offset; int rc; SetReqFds(client, 1); @@ -159,11 +203,14 @@ proc_dri3_pixmap_from_buffer(ClientPtr client) if (fd < 0) return BadValue; - rc = dri3_pixmap_from_fd(&pixmap, - drawable->pScreen, fd, - stuff->width, stuff->height, - stuff->stride, stuff->depth, - stuff->bpp); + offset = 0; + stride = stuff->stride; + rc = dri3_pixmap_from_fds(&pixmap, + drawable->pScreen, 1, &fd, + stuff->width, stuff->height, + &stride, &offset, + stuff->depth, stuff->bpp, + DRM_FORMAT_MOD_INVALID); close (fd); if (rc != Success) return rc; @@ -211,9 +258,9 @@ proc_dri3_buffer_from_pixmap(ClientPtr client) rep.depth = pixmap->drawable.depth; rep.bpp = pixmap->drawable.bitsPerPixel; - rc = dri3_fd_from_pixmap(&fd, pixmap, &rep.stride, &rep.size); - if (rc != Success) - return rc; + fd = dri3_fd_from_pixmap(pixmap, &rep.stride, &rep.size); + if (fd < 0) + return BadPixmap; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -299,6 +346,218 @@ proc_dri3_fd_from_fence(ClientPtr client) return Success; } +static int +proc_dri3_get_supported_modifiers(ClientPtr client) +{ + REQUEST(xDRI3GetSupportedModifiersReq); + xDRI3GetSupportedModifiersReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + }; + WindowPtr window; + ScreenPtr pScreen; + CARD64 *window_modifiers = NULL; + CARD64 *screen_modifiers = NULL; + CARD32 nwindowmodifiers = 0; + CARD32 nscreenmodifiers = 0; + int status; + int i; + + REQUEST_SIZE_MATCH(xDRI3GetSupportedModifiersReq); + + status = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); + if (status != Success) + return status; + pScreen = window->drawable.pScreen; + + dri3_get_supported_modifiers(pScreen, &window->drawable, + stuff->depth, stuff->bpp, + &nwindowmodifiers, &window_modifiers, + &nscreenmodifiers, &screen_modifiers); + + rep.numWindowModifiers = nwindowmodifiers; + rep.numScreenModifiers = nscreenmodifiers; + rep.length = bytes_to_int32(rep.numWindowModifiers * sizeof(CARD64)) + + bytes_to_int32(rep.numScreenModifiers * sizeof(CARD64)); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.numWindowModifiers); + swapl(&rep.numScreenModifiers); + for (i = 0; i < nwindowmodifiers; i++) + swapll(&window_modifiers[i]); + for (i = 0; i < nscreenmodifiers; i++) + swapll(&screen_modifiers[i]); + } + + WriteToClient(client, sizeof(rep), &rep); + WriteToClient(client, nwindowmodifiers * sizeof(CARD64), window_modifiers); + WriteToClient(client, nscreenmodifiers * sizeof(CARD64), screen_modifiers); + + free(window_modifiers); + free(screen_modifiers); + + return Success; +} + +static int +proc_dri3_pixmap_from_buffers(ClientPtr client) +{ + REQUEST(xDRI3PixmapFromBuffersReq); + int fds[4]; + CARD32 strides[4], offsets[4]; + ScreenPtr screen; + WindowPtr window; + PixmapPtr pixmap; + int rc; + int i; + + SetReqFds(client, stuff->num_buffers); + REQUEST_SIZE_MATCH(xDRI3PixmapFromBuffersReq); + LEGAL_NEW_RESOURCE(stuff->pixmap, client); + rc = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); + if (rc != Success) { + client->errorValue = stuff->window; + return rc; + } + screen = window->drawable.pScreen; + + if (!stuff->width || !stuff->height || !stuff->bpp || !stuff->depth) { + client->errorValue = 0; + return BadValue; + } + + if (stuff->width > 32767 || stuff->height > 32767) + return BadAlloc; + + if (stuff->depth != 1) { + DepthPtr depth = screen->allowedDepths; + int j; + for (j = 0; j < screen->numDepths; j++, depth++) + if (depth->depth == stuff->depth) + break; + if (j == screen->numDepths) { + client->errorValue = stuff->depth; + return BadValue; + } + } + + if (!stuff->num_buffers || stuff->num_buffers > 4) { + client->errorValue = stuff->num_buffers; + return BadValue; + } + + for (i = 0; i < stuff->num_buffers; i++) { + fds[i] = ReadFdFromClient(client); + if (fds[i] < 0) { + while (--i >= 0) + close(fds[i]); + return BadValue; + } + } + + strides[0] = stuff->stride0; + strides[1] = stuff->stride1; + strides[2] = stuff->stride2; + strides[3] = stuff->stride3; + offsets[0] = stuff->offset0; + offsets[1] = stuff->offset1; + offsets[2] = stuff->offset2; + offsets[3] = stuff->offset3; + + rc = dri3_pixmap_from_fds(&pixmap, screen, + stuff->num_buffers, fds, + stuff->width, stuff->height, + strides, offsets, + stuff->depth, stuff->bpp, + stuff->modifier); + + for (i = 0; i < stuff->num_buffers; i++) + close (fds[i]); + + if (rc != Success) + return rc; + + pixmap->drawable.id = stuff->pixmap; + + /* security creation/labeling check */ + rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP, + pixmap, RT_NONE, NULL, DixCreateAccess); + + if (rc != Success) { + (*screen->DestroyPixmap) (pixmap); + return rc; + } + if (!AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) + return BadAlloc; + + return Success; +} + +static int +proc_dri3_buffers_from_pixmap(ClientPtr client) +{ + REQUEST(xDRI3BuffersFromPixmapReq); + xDRI3BuffersFromPixmapReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + }; + int rc; + int fds[4]; + int num_fds; + uint32_t strides[4], offsets[4]; + uint64_t modifier; + int i; + PixmapPtr pixmap; + + REQUEST_SIZE_MATCH(xDRI3BuffersFromPixmapReq); + rc = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP, + client, DixWriteAccess); + if (rc != Success) { + client->errorValue = stuff->pixmap; + return rc; + } + + num_fds = dri3_fds_from_pixmap(pixmap, fds, strides, offsets, &modifier); + if (num_fds == 0) + return BadPixmap; + + rep.nfd = num_fds; + rep.length = bytes_to_int32(num_fds * 2 * sizeof(CARD32)); + rep.width = pixmap->drawable.width; + rep.height = pixmap->drawable.height; + rep.depth = pixmap->drawable.depth; + rep.bpp = pixmap->drawable.bitsPerPixel; + rep.modifier = modifier; + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.width); + swaps(&rep.height); + swapll(&rep.modifier); + for (i = 0; i < num_fds; i++) { + swapl(&strides[i]); + swapl(&offsets[i]); + } + } + + for (i = 0; i < num_fds; i++) { + if (WriteFdToClient(client, fds[i], TRUE) < 0) { + while (i--) + close(fds[i]); + return BadAlloc; + } + } + + WriteToClient(client, sizeof(rep), &rep); + WriteToClient(client, num_fds * sizeof(CARD32), strides); + WriteToClient(client, num_fds * sizeof(CARD32), offsets); + + return Success; +} + int (*proc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { proc_dri3_query_version, /* 0 */ proc_dri3_open, /* 1 */ @@ -306,6 +565,9 @@ int (*proc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { proc_dri3_buffer_from_pixmap, /* 3 */ proc_dri3_fence_from_fd, /* 4 */ proc_dri3_fd_from_fence, /* 5 */ + proc_dri3_get_supported_modifiers, /* 6 */ + proc_dri3_pixmap_from_buffers, /* 7 */ + proc_dri3_buffers_from_pixmap, /* 8 */ }; int @@ -319,7 +581,7 @@ proc_dri3_dispatch(ClientPtr client) return (*proc_dri3_vector[stuff->data]) (client); } -static int +static int _X_COLD sproc_dri3_query_version(ClientPtr client) { REQUEST(xDRI3QueryVersionReq); @@ -331,7 +593,7 @@ sproc_dri3_query_version(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } -static int +static int _X_COLD sproc_dri3_open(ClientPtr client) { REQUEST(xDRI3OpenReq); @@ -343,7 +605,7 @@ sproc_dri3_open(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } -static int +static int _X_COLD sproc_dri3_pixmap_from_buffer(ClientPtr client) { REQUEST(xDRI3PixmapFromBufferReq); @@ -359,7 +621,7 @@ sproc_dri3_pixmap_from_buffer(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } -static int +static int _X_COLD sproc_dri3_buffer_from_pixmap(ClientPtr client) { REQUEST(xDRI3BufferFromPixmapReq); @@ -370,7 +632,7 @@ sproc_dri3_buffer_from_pixmap(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } -static int +static int _X_COLD sproc_dri3_fence_from_fd(ClientPtr client) { REQUEST(xDRI3FenceFromFDReq); @@ -382,7 +644,7 @@ sproc_dri3_fence_from_fd(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } -static int +static int _X_COLD sproc_dri3_fd_from_fence(ClientPtr client) { REQUEST(xDRI3FDFromFenceReq); @@ -394,6 +656,51 @@ sproc_dri3_fd_from_fence(ClientPtr client) return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } +static int _X_COLD +sproc_dri3_get_supported_modifiers(ClientPtr client) +{ + REQUEST(xDRI3GetSupportedModifiersReq); + REQUEST_SIZE_MATCH(xDRI3GetSupportedModifiersReq); + + swaps(&stuff->length); + swapl(&stuff->window); + return (*proc_dri3_vector[stuff->dri3ReqType]) (client); +} + +static int _X_COLD +sproc_dri3_pixmap_from_buffers(ClientPtr client) +{ + REQUEST(xDRI3PixmapFromBuffersReq); + REQUEST_SIZE_MATCH(xDRI3PixmapFromBuffersReq); + + swaps(&stuff->length); + swapl(&stuff->pixmap); + swapl(&stuff->window); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->stride0); + swapl(&stuff->offset0); + swapl(&stuff->stride1); + swapl(&stuff->offset1); + swapl(&stuff->stride2); + swapl(&stuff->offset2); + swapl(&stuff->stride3); + swapl(&stuff->offset3); + swapll(&stuff->modifier); + return (*proc_dri3_vector[stuff->dri3ReqType]) (client); +} + +static int _X_COLD +sproc_dri3_buffers_from_pixmap(ClientPtr client) +{ + REQUEST(xDRI3BuffersFromPixmapReq); + REQUEST_SIZE_MATCH(xDRI3BuffersFromPixmapReq); + + swaps(&stuff->length); + swapl(&stuff->pixmap); + return (*proc_dri3_vector[stuff->dri3ReqType]) (client); +} + int (*sproc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { sproc_dri3_query_version, /* 0 */ sproc_dri3_open, /* 1 */ @@ -401,9 +708,12 @@ int (*sproc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { sproc_dri3_buffer_from_pixmap, /* 3 */ sproc_dri3_fence_from_fd, /* 4 */ sproc_dri3_fd_from_fence, /* 5 */ + sproc_dri3_get_supported_modifiers, /* 6 */ + sproc_dri3_pixmap_from_buffers, /* 7 */ + sproc_dri3_buffers_from_pixmap, /* 8 */ }; -int +int _X_COLD sproc_dri3_dispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/dri3/dri3_screen.c b/xserver/dri3/dri3_screen.c index 6c0c60cbf..b98259753 100644 --- a/xserver/dri3/dri3_screen.c +++ b/xserver/dri3/dri3_screen.c @@ -29,48 +29,50 @@ #include #include #include - -static inline Bool has_open(dri3_screen_info_ptr info) { - if (info == NULL) - return FALSE; - - return info->open != NULL || - (info->version >= 1 && info->open_client != NULL); -} +#include +#include int dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd) { dri3_screen_priv_ptr ds = dri3_screen_priv(screen); - dri3_screen_info_ptr info = ds->info; - int rc; + const dri3_screen_info_rec *info = ds->info; - if (!has_open(info)) + if (info == NULL) return BadMatch; if (info->version >= 1 && info->open_client != NULL) - rc = (*info->open_client) (client, screen, provider, fd); - else - rc = (*info->open) (screen, provider, fd); + return (*info->open_client) (client, screen, provider, fd); + if (info->open != NULL) + return (*info->open) (screen, provider, fd); - if (rc != Success) - return rc; - - return Success; + return BadMatch; } int -dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, - CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) +dri3_pixmap_from_fds(PixmapPtr *ppixmap, ScreenPtr screen, + CARD8 num_fds, const int *fds, + CARD16 width, CARD16 height, + const CARD32 *strides, const CARD32 *offsets, + CARD8 depth, CARD8 bpp, CARD64 modifier) { dri3_screen_priv_ptr ds = dri3_screen_priv(screen); - dri3_screen_info_ptr info = ds->info; + const dri3_screen_info_rec *info = ds->info; PixmapPtr pixmap; - if (!info || !info->pixmap_from_fd) + if (!info) return BadImplementation; - pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp); + if (info->version >= 2 && info->pixmap_from_fds != NULL) { + pixmap = (*info->pixmap_from_fds) (screen, num_fds, fds, width, height, + strides, offsets, depth, bpp, modifier); + } else if (info->pixmap_from_fd != NULL && num_fds == 1) { + pixmap = (*info->pixmap_from_fd) (screen, fds[0], width, height, + strides[0], depth, bpp); + } else { + return BadImplementation; + } + if (!pixmap) return BadAlloc; @@ -79,20 +81,230 @@ dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, } int -dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) { ScreenPtr screen = pixmap->drawable.pScreen; dri3_screen_priv_ptr ds = dri3_screen_priv(screen); - dri3_screen_info_ptr info = ds->info; - int fd; + const dri3_screen_info_rec *info = ds->info; - if (!info || !info->fd_from_pixmap) + if (!info) + return 0; + + if (info->version >= 2 && info->fds_from_pixmap != NULL) { + return (*info->fds_from_pixmap)(screen, pixmap, fds, strides, offsets, + modifier); + } else if (info->fd_from_pixmap != NULL) { + CARD16 stride; + CARD32 size; + + fds[0] = (*info->fd_from_pixmap)(screen, pixmap, &stride, &size); + if (fds[0] < 0) + return 0; + + strides[0] = stride; + offsets[0] = 0; + *modifier = DRM_FORMAT_MOD_INVALID; + return 1; + } else { + return 0; + } +} + +int +dri3_fd_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +{ + ScreenPtr screen = pixmap->drawable.pScreen; + dri3_screen_priv_ptr ds = dri3_screen_priv(screen); + const dri3_screen_info_rec *info = ds->info; + uint32_t strides[4]; + uint32_t offsets[4]; + uint64_t modifier; + int fds[4]; + int num_fds; + + if (!info) + return -1; + + /* Preferentially use the old interface, allowing the implementation to + * ensure the buffer is in a single-plane format which doesn't need + * modifiers. */ + if (info->fd_from_pixmap != NULL) + return (*info->fd_from_pixmap)(screen, pixmap, stride, size); + + if (info->version < 2 || info->fds_from_pixmap == NULL) + return -1; + + /* If using the new interface, make sure that it's a single plane starting + * at 0 within the BO. We don't check the modifier, as the client may + * have an auxiliary mechanism for determining the modifier itself. */ + num_fds = info->fds_from_pixmap(screen, pixmap, fds, strides, offsets, + &modifier); + if (num_fds != 1 || offsets[0] != 0) { + int i; + for (i = 0; i < num_fds; i++) + close(fds[i]); + return -1; + } + + *stride = strides[0]; + *size = size[0]; + return fds[0]; +} + +static int +cache_formats_and_modifiers(ScreenPtr screen) +{ + dri3_screen_priv_ptr ds = dri3_screen_priv(screen); + const dri3_screen_info_rec *info = ds->info; + CARD32 num_formats; + CARD32 *formats; + uint32_t num_modifiers; + uint64_t *modifiers; + int i; + + if (ds->formats_cached) + return Success; + + if (!info) return BadImplementation; - fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size); - if (fd < 0) + if (info->version < 2 || !info->get_formats || !info->get_modifiers) { + ds->formats = NULL; + ds->num_formats = 0; + ds->formats_cached = TRUE; + return Success; + } + + if (!info->get_formats(screen, &num_formats, &formats)) return BadAlloc; - *pfd = fd; + + if (!num_formats) { + ds->num_formats = 0; + ds->formats_cached = TRUE; + return Success; + } + + ds->formats = calloc(num_formats, sizeof(dri3_dmabuf_format_rec)); + if (!ds->formats) + return BadAlloc; + + for (i = 0; i < num_formats; i++) { + dri3_dmabuf_format_ptr iter = &ds->formats[i]; + + if (!info->get_modifiers(screen, formats[i], + &num_modifiers, + &modifiers)) + continue; + + if (!num_modifiers) + continue; + + iter->format = formats[i]; + iter->num_modifiers = num_modifiers; + iter->modifiers = modifiers; + } + + ds->num_formats = i; + ds->formats_cached = TRUE; + return Success; } +int +dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable, + CARD8 depth, CARD8 bpp, + CARD32 *num_intersect_modifiers, + CARD64 **intersect_modifiers, + CARD32 *num_screen_modifiers, + CARD64 **screen_modifiers) +{ + dri3_screen_priv_ptr ds = dri3_screen_priv(screen); + const dri3_screen_info_rec *info = ds->info; + int i, j; + int ret; + uint32_t num_drawable_mods; + uint64_t *drawable_mods; + CARD64 *intersect_mods = NULL; + CARD64 *screen_mods = NULL; + CARD32 format; + dri3_dmabuf_format_ptr screen_format = NULL; + + ret = cache_formats_and_modifiers(screen); + if (ret != Success) + return ret; + + format = drm_format_for_depth(depth, bpp); + if (format == 0) + return BadValue; + + /* Find screen-global modifiers from cache + */ + for (i = 0; i < ds->num_formats; i++) { + if (ds->formats[i].format == format) { + screen_format = &ds->formats[i]; + break; + } + } + if (screen_format == NULL) + return BadMatch; + + if (screen_format->num_modifiers == 0) { + *num_screen_modifiers = 0; + *num_intersect_modifiers = 0; + return Success; + } + + if (!info->get_drawable_modifiers || + !info->get_drawable_modifiers(drawable, format, + &num_drawable_mods, + &drawable_mods)) { + num_drawable_mods = 0; + drawable_mods = NULL; + } + + /* We're allocating slightly more memory than necessary but it reduces + * the complexity of finding the intersection set. + */ + screen_mods = malloc(screen_format->num_modifiers * sizeof(CARD64)); + if (!screen_mods) + return BadAlloc; + if (num_drawable_mods > 0) { + intersect_mods = malloc(screen_format->num_modifiers * sizeof(CARD64)); + if (!intersect_mods) { + free(screen_mods); + return BadAlloc; + } + } + + *num_screen_modifiers = 0; + *num_intersect_modifiers = 0; + for (i = 0; i < screen_format->num_modifiers; i++) { + CARD64 modifier = screen_format->modifiers[i]; + Bool intersect = FALSE; + + for (j = 0; j < num_drawable_mods; j++) { + if (drawable_mods[j] == modifier) { + intersect = TRUE; + break; + } + } + + if (intersect) { + intersect_mods[*num_intersect_modifiers] = modifier; + *num_intersect_modifiers += 1; + } else { + screen_mods[*num_screen_modifiers] = modifier; + *num_screen_modifiers += 1; + } + } + + assert(*num_intersect_modifiers + *num_screen_modifiers == screen_format->num_modifiers); + + *intersect_modifiers = intersect_mods; + *screen_modifiers = screen_mods; + free(drawable_mods); + + return Success; +} diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in index 3b44caac9..4b0a93c75 100644 --- a/xserver/exa/Makefile.in +++ b/xserver/exa/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -340,6 +340,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -358,15 +359,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -374,6 +378,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -445,8 +451,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/exa/exa.c b/xserver/exa/exa.c index 7266b71f9..d6ff19796 100644 --- a/xserver/exa/exa.c +++ b/xserver/exa/exa.c @@ -505,29 +505,14 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) ExaScreenPriv(pScreen); ExaGCPriv(pGC); PixmapPtr pTile = NULL; - Bool finish_current_tile = FALSE; - /* Either of these conditions is enough to trigger access to a tile pixmap. */ - /* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */ + /* Either of these conditions is enough to trigger access to a tile pixmap. + * With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid + * tile pixmap pointer. + */ if (pGC->fillStyle == FillTiled || ((changes & GCTile) && !pGC->tileIsPixel)) { pTile = pGC->tile.pixmap; - - /* Sometimes tile pixmaps are swapped, you need access to: - * - The current tile if it depth matches. - * - Or the rotated tile if that one matches depth and !(changes & GCTile). - * - Or the current tile pixmap and a newly created one. - */ - if (pTile && pTile->drawable.depth != pDrawable->depth && - !(changes & GCTile)) { - PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC); - - if (pRotatedTile && - pRotatedTile->drawable.depth == pDrawable->depth) - pTile = pRotatedTile; - else - finish_current_tile = TRUE; /* CreatePixmap will be called. */ - } } if (pGC->stipple) @@ -544,8 +529,6 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) if (pTile) exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC); - if (finish_current_tile && pGC->tile.pixmap) - exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_AUX_DEST); if (pGC->stipple) exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); } diff --git a/xserver/exa/exa_priv.h b/xserver/exa/exa_priv.h index ca4db720f..912e21478 100644 --- a/xserver/exa/exa_priv.h +++ b/xserver/exa/exa_priv.h @@ -244,7 +244,7 @@ extern DevPrivateKeyRec exaScreenPrivateKeyRec; } #else #define swap(priv, real, mem) {\ - void *tmp = priv->Saved##mem; \ + const void *tmp = priv->Saved##mem; \ priv->Saved##mem = real->mem; \ real->mem = tmp; \ } diff --git a/xserver/exa/exa_render.c b/xserver/exa/exa_render.c index b24bec052..9fbfdfca2 100644 --- a/xserver/exa/exa_render.c +++ b/xserver/exa/exa_render.c @@ -291,7 +291,10 @@ exaTryDriverSolidFill(PicturePtr pSrc, pixel = exaGetPixmapFirstPixel(pSrcPix); } else - pixel = pSrc->pSourcePict->solidFill.color; + miRenderColorToPixel(PictureMatchFormat(pDst->pDrawable->pScreen, 32, + pSrc->format), + &pSrc->pSourcePict->solidFill.fullcolor, + &pixel); if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha, pSrc->pFormat, pSrc->format) || diff --git a/xserver/exa/exa_unaccel.c b/xserver/exa/exa_unaccel.c index 2d3e2ffe6..73eada9c2 100644 --- a/xserver/exa/exa_unaccel.c +++ b/xserver/exa/exa_unaccel.c @@ -703,7 +703,6 @@ exaGetPixmapFirstPixel(PixmapPtr pPixmap) { switch (pPixmap->drawable.bitsPerPixel) { case 32: - case 24: { CARD32 pixel; diff --git a/xserver/fb/Makefile.am b/xserver/fb/Makefile.am index 65b5d9432..333aa06a9 100644 --- a/xserver/fb/Makefile.am +++ b/xserver/fb/Makefile.am @@ -14,8 +14,6 @@ libwfb_la_LIBADD = $(PIXMAN_LIBS) libfb_la_SOURCES = \ fb.h \ - fb24_32.c \ - fb24_32.h \ fballpriv.c \ fbarc.c \ fbbits.c \ diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in index 5905022f7..b722a17fb 100644 --- a/xserver/fb/Makefile.in +++ b/xserver/fb/Makefile.in @@ -69,23 +69,23 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libfb_la_OBJECTS = libfb_la-fb24_32.lo libfb_la-fballpriv.lo \ - libfb_la-fbarc.lo libfb_la-fbbits.lo libfb_la-fbblt.lo \ - libfb_la-fbbltone.lo libfb_la-fbcmap_mi.lo libfb_la-fbcopy.lo \ - libfb_la-fbfill.lo libfb_la-fbfillrect.lo libfb_la-fbfillsp.lo \ - libfb_la-fbgc.lo libfb_la-fbgetsp.lo libfb_la-fbglyph.lo \ - libfb_la-fbimage.lo libfb_la-fbline.lo libfb_la-fboverlay.lo \ - libfb_la-fbpict.lo libfb_la-fbpixmap.lo libfb_la-fbpoint.lo \ - libfb_la-fbpush.lo libfb_la-fbscreen.lo libfb_la-fbseg.lo \ - libfb_la-fbsetsp.lo libfb_la-fbsolid.lo libfb_la-fbtrap.lo \ - libfb_la-fbutil.lo libfb_la-fbwindow.lo +am_libfb_la_OBJECTS = libfb_la-fballpriv.lo libfb_la-fbarc.lo \ + libfb_la-fbbits.lo libfb_la-fbblt.lo libfb_la-fbbltone.lo \ + libfb_la-fbcmap_mi.lo libfb_la-fbcopy.lo libfb_la-fbfill.lo \ + libfb_la-fbfillrect.lo libfb_la-fbfillsp.lo libfb_la-fbgc.lo \ + libfb_la-fbgetsp.lo libfb_la-fbglyph.lo libfb_la-fbimage.lo \ + libfb_la-fbline.lo libfb_la-fboverlay.lo libfb_la-fbpict.lo \ + libfb_la-fbpixmap.lo libfb_la-fbpoint.lo libfb_la-fbpush.lo \ + libfb_la-fbscreen.lo libfb_la-fbseg.lo libfb_la-fbsetsp.lo \ + libfb_la-fbsolid.lo libfb_la-fbtrap.lo libfb_la-fbutil.lo \ + libfb_la-fbwindow.lo libfb_la_OBJECTS = $(am_libfb_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -95,10 +95,9 @@ libfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ libwfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__objects_1 = libwfb_la-fb24_32.lo libwfb_la-fballpriv.lo \ - libwfb_la-fbarc.lo libwfb_la-fbbits.lo libwfb_la-fbblt.lo \ - libwfb_la-fbbltone.lo libwfb_la-fbcmap_mi.lo \ - libwfb_la-fbcopy.lo libwfb_la-fbfill.lo \ +am__objects_1 = libwfb_la-fballpriv.lo libwfb_la-fbarc.lo \ + libwfb_la-fbbits.lo libwfb_la-fbblt.lo libwfb_la-fbbltone.lo \ + libwfb_la-fbcmap_mi.lo libwfb_la-fbcopy.lo libwfb_la-fbfill.lo \ libwfb_la-fbfillrect.lo libwfb_la-fbfillsp.lo \ libwfb_la-fbgc.lo libwfb_la-fbgetsp.lo libwfb_la-fbglyph.lo \ libwfb_la-fbimage.lo libwfb_la-fbline.lo \ @@ -369,6 +368,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -387,15 +387,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -403,6 +406,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -474,8 +479,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -549,8 +552,6 @@ libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libwfb_la_LIBADD = $(PIXMAN_LIBS) libfb_la_SOURCES = \ fb.h \ - fb24_32.c \ - fb24_32.h \ fballpriv.c \ fbarc.c \ fbbits.c \ @@ -640,7 +641,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fb24_32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fballpriv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbits.Plo@am__quote@ @@ -668,7 +668,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbtrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbwindow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fb24_32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fballpriv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbits.Plo@am__quote@ @@ -718,13 +717,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libfb_la-fb24_32.lo: fb24_32.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fb24_32.lo -MD -MP -MF $(DEPDIR)/libfb_la-fb24_32.Tpo -c -o libfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fb24_32.Tpo $(DEPDIR)/libfb_la-fb24_32.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fb24_32.c' object='libfb_la-fb24_32.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c - libfb_la-fballpriv.lo: fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fballpriv.lo -MD -MP -MF $(DEPDIR)/libfb_la-fballpriv.Tpo -c -o libfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fballpriv.Tpo $(DEPDIR)/libfb_la-fballpriv.Plo @@ -914,13 +906,6 @@ libfb_la-fbwindow.lo: fbwindow.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbwindow.lo `test -f 'fbwindow.c' || echo '$(srcdir)/'`fbwindow.c -libwfb_la-fb24_32.lo: fb24_32.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fb24_32.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fb24_32.Tpo -c -o libwfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fb24_32.Tpo $(DEPDIR)/libwfb_la-fb24_32.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fb24_32.c' object='libwfb_la-fb24_32.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c - libwfb_la-fballpriv.lo: fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fballpriv.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fballpriv.Tpo -c -o libwfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fballpriv.Tpo $(DEPDIR)/libwfb_la-fballpriv.Plo diff --git a/xserver/fb/fb.h b/xserver/fb/fb.h index c687aa7a0..8ab050d0f 100644 --- a/xserver/fb/fb.h +++ b/xserver/fb/fb.h @@ -89,9 +89,6 @@ #if GLYPHPADBYTES != 4 #error "GLYPHPADBYTES must be 4" #endif -/* for driver compat - intel UXA needs the second one at least */ -#define FB_24BIT -#define FB_24_32BIT #define FB_STIP_SHIFT LOG2_BITMAP_PAD #define FB_STIP_UNIT (1 << FB_STIP_SHIFT) #define FB_STIP_MASK (FB_STIP_UNIT - 1) @@ -331,32 +328,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); #define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0) -/* Rotate a filled pixel value to the specified alignement */ -#define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b))) -#define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b))) - -/* step a filled pixel value to the next/previous FB_UNIT alignment */ -#define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24))) -#define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24)) -#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24))) -#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24)) - -/* step a rotation value to the next/previous rotation value */ -#define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8) -#define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define FbFirst24Rot(x) (((x) + 16) % 24) -#else -#define FbFirst24Rot(x) ((x) % 24) -#endif - -#define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8) -#define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8) - -/* Whether 24-bit specific code is needed for this filled pixel value */ -#define FbCheck24Pix(p) ((p) == FbNext24Pix(p)) - /* Macros for dealing with dashing */ #define FbDashDeclare \ @@ -433,8 +404,6 @@ fbGetScreenPrivateKey(void); /* private field of a screen */ typedef struct { - unsigned char win32bpp; /* window bpp for 32-bpp images */ - unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */ #ifdef FB_ACCESS_WRAPPER SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */ FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */ @@ -452,7 +421,6 @@ typedef struct { FbBits bgand, bgxor; /* for stipples */ FbBits fg, bg, pm; /* expanded and filled */ unsigned int dashLength; /* total of all dash elements */ - unsigned char bpp; /* current drawable bpp */ } FbGCPrivRec, *FbGCPrivPtr; #define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec) @@ -462,8 +430,6 @@ typedef struct { #define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip) #define fbGetExpose(pGC) ((pGC)->fExpose) -#define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip) -#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap) #define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate) @@ -528,7 +494,7 @@ typedef struct { */ #define fbWindowEnabled(pWin) \ - RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip) + RegionNotEmpty(&(pWin)->borderClip) #define fbDrawableEnabled(pDrawable) \ ((pDrawable)->type == DRAWABLE_PIXMAP ? \ @@ -540,64 +506,6 @@ typedef struct { */ #define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w)) -/* - * fb24_32.c - */ -extern _X_EXPORT void - -fb24_32GetSpans(DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart); - -extern _X_EXPORT void - -fb24_32SetSpans(DrawablePtr pDrawable, - GCPtr pGC, - char *src, - DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); - -extern _X_EXPORT void - -fb24_32PutZImage(DrawablePtr pDrawable, - RegionPtr pClip, - int alu, - FbBits pm, - int x, - int y, int width, int height, CARD8 *src, FbStride srcStride); - -extern _X_EXPORT void - -fb24_32GetImage(DrawablePtr pDrawable, - int x, - int y, - int w, - int h, unsigned int format, unsigned long planeMask, char *d); - -extern _X_EXPORT void - -fb24_32CopyMtoN(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - BoxPtr pbox, - int nbox, - int dx, - int dy, - Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); - -extern _X_EXPORT PixmapPtr - fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel); - -extern _X_EXPORT Bool - fb24_32CreateScreenResources(ScreenPtr pScreen); - -extern _X_EXPORT Bool - -fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, - int width, - int height, - int depth, - int bitsPerPixel, int devKind, void *pPixData); - /* * fballpriv.c */ @@ -712,47 +620,6 @@ extern _X_EXPORT void extern _X_EXPORT void -fbBresSolid24(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, - int axis, int x, int y, int e, int e1, int e3, int len); - -extern _X_EXPORT void - -fbBresDash24(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, - int axis, int x, int y, int e, int e1, int e3, int len); - -extern _X_EXPORT void - -fbDots24(FbBits * dst, - FbStride dstStride, - int dstBpp, - BoxPtr pBox, - xPoint * pts, - int npt, - int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); - -extern _X_EXPORT void - -fbArc24(FbBits * dst, - FbStride dstStride, - int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); - -extern _X_EXPORT void -fbPolyline24(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); - -extern _X_EXPORT void - fbPolySegment24(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); - -extern _X_EXPORT void - fbBresSolid32(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -812,17 +679,6 @@ fbBlt(FbBits * src, int width, int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown); -extern _X_EXPORT void - -fbBlt24(FbBits * srcLine, - FbStride srcStride, - int srcX, - FbBits * dstLine, - FbStride dstStride, - int dstX, - int width, - int height, int alu, FbBits pm, Bool reverse, Bool upsidedown); - extern _X_EXPORT void fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */ @@ -843,17 +699,6 @@ fbBltOne(FbStip * src, int width, int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor); -extern _X_EXPORT void - fbBltOne24(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ - int srcX, /* bit position of source */ - FbBits * dst, FbStride dstStride, /* FbBits units per scanline */ - int dstX, /* bit position of dest */ - int dstBpp, /* bits per destination unit */ - int width, /* width in bits of destination */ - int height, /* height in scanlines */ - FbBits fgand, /* rrop values */ - FbBits fgxor, FbBits bgand, FbBits bgxor); - extern _X_EXPORT void fbBltPlane(FbBits * src, @@ -900,14 +745,10 @@ extern _X_EXPORT Bool extern _X_EXPORT void fbClearVisualTypes(void); -extern _X_EXPORT Bool - fbHasVisualTypes(int depth); - extern _X_EXPORT Bool fbSetVisualTypes(int depth, int visuals, int bitsPerRGB); extern _X_EXPORT Bool - fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, Pixel redMask, Pixel greenMask, Pixel blueMask); @@ -1119,12 +960,6 @@ fbDestroyGlyphCache(void); */ extern _X_EXPORT PixmapPtr - -fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, - unsigned usage_hint); - -extern _X_EXPORT PixmapPtr - fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint); @@ -1192,8 +1027,8 @@ extern _X_EXPORT Bool int dpiy, int width, /* pixel width of frame buffer */ int bpp); /* bits per pixel of frame buffer */ +#ifdef FB_ACCESS_WRAPPER extern _X_EXPORT Bool - wfbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, @@ -1205,7 +1040,6 @@ wfbFinishScreenInit(ScreenPtr pScreen, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); extern _X_EXPORT Bool - wfbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, @@ -1215,9 +1049,9 @@ wfbScreenInit(ScreenPtr pScreen, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); +#endif extern _X_EXPORT Bool - fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, @@ -1263,12 +1097,6 @@ fbSolid(FbBits * dst, FbStride dstStride, int dstX, int bpp, int width, int height, FbBits and, FbBits xor); -extern _X_EXPORT void - -fbSolid24(FbBits * dst, - FbStride dstStride, - int dstX, int width, int height, FbBits and, FbBits xor); - /* * fbutil.c */ diff --git a/xserver/fb/fb24_32.c b/xserver/fb/fb24_32.c deleted file mode 100644 index b95019eb6..000000000 --- a/xserver/fb/fb24_32.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright © 2000 SuSE, Inc. - * - * 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, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * 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. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "fb.h" - -/* X apps don't like 24bpp images, this code exposes 32bpp images */ - -/* - * These two functions do a full CopyArea while reformatting - * the data between 24 and 32bpp. They try to go a bit faster - * by reading/writing aligned CARD32s where it's easy - */ - -#define Get8(a) ((CARD32) READ(a)) - -#if BITMAP_BIT_ORDER == MSBFirst -#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2)) -#define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \ - (WRITE((a+1), (CARD8) ((p) >> 8))), \ - (WRITE((a+2), (CARD8) (p)))) -#else -#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16)) -#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \ - (WRITE((a+1), (CARD8) ((p) >> 8))), \ - (WRITE((a+2), (CARD8) ((p) >> 16)))) -#endif - -typedef void (*fb24_32BltFunc) (CARD8 *srcLine, - FbStride srcStride, - int srcX, - CARD8 *dstLine, - FbStride dstStride, - int dstX, - int width, int height, int alu, FbBits pm); - -static void -fb24_32BltDown(CARD8 *srcLine, - FbStride srcStride, - int srcX, - CARD8 *dstLine, - FbStride dstStride, - int dstX, int width, int height, int alu, FbBits pm) -{ - CARD32 *src; - CARD8 *dst; - int w; - Bool destInvarient; - CARD32 pixel, dpixel; - - FbDeclareMergeRop(); - - srcLine += srcX * 4; - dstLine += dstX * 3; - - FbInitializeMergeRop(alu, (pm | ~(FbBits) 0xffffff)); - destInvarient = FbDestInvarientMergeRop(); - - while (height--) { - src = (CARD32 *) srcLine; - dst = dstLine; - srcLine += srcStride; - dstLine += dstStride; - w = width; - if (destInvarient) { - while (((long) dst & 3) && w) { - w--; - pixel = READ(src++); - pixel = FbDoDestInvarientMergeRop(pixel); - Put24(dst, pixel); - dst += 3; - } - /* Do four aligned pixels at a time */ - while (w >= 4) { - CARD32 s0, s1; - - s0 = READ(src++); - s0 = FbDoDestInvarientMergeRop(s0); - s1 = READ(src++); - s1 = FbDoDestInvarientMergeRop(s1); -#if BITMAP_BIT_ORDER == LSBFirst - WRITE((CARD32 *) dst, (s0 & 0xffffff) | (s1 << 24)); -#else - WRITE((CARD32 *) dst, (s0 << 8) | ((s1 & 0xffffff) >> 16)); -#endif - s0 = READ(src++); - s0 = FbDoDestInvarientMergeRop(s0); -#if BITMAP_BIT_ORDER == LSBFirst - WRITE((CARD32 *) (dst + 4), - ((s1 & 0xffffff) >> 8) | (s0 << 16)); -#else - WRITE((CARD32 *) (dst + 4), - (s1 << 16) | ((s0 & 0xffffff) >> 8)); -#endif - s1 = READ(src++); - s1 = FbDoDestInvarientMergeRop(s1); -#if BITMAP_BIT_ORDER == LSBFirst - WRITE((CARD32 *) (dst + 8), - ((s0 & 0xffffff) >> 16) | (s1 << 8)); -#else - WRITE((CARD32 *) (dst + 8), (s0 << 24) | (s1 & 0xffffff)); -#endif - dst += 12; - w -= 4; - } - while (w--) { - pixel = READ(src++); - pixel = FbDoDestInvarientMergeRop(pixel); - Put24(dst, pixel); - dst += 3; - } - } - else { - while (w--) { - pixel = READ(src++); - dpixel = Get24(dst); - pixel = FbDoMergeRop(pixel, dpixel); - Put24(dst, pixel); - dst += 3; - } - } - } -} - -static void -fb24_32BltUp(CARD8 *srcLine, - FbStride srcStride, - int srcX, - CARD8 *dstLine, - FbStride dstStride, - int dstX, int width, int height, int alu, FbBits pm) -{ - CARD8 *src; - CARD32 *dst; - int w; - Bool destInvarient; - CARD32 pixel; - - FbDeclareMergeRop(); - - FbInitializeMergeRop(alu, (pm | (~(FbBits) 0xffffff))); - destInvarient = FbDestInvarientMergeRop(); - - srcLine += srcX * 3; - dstLine += dstX * 4; - - while (height--) { - w = width; - src = srcLine; - dst = (CARD32 *) dstLine; - srcLine += srcStride; - dstLine += dstStride; - if (destInvarient) { - while (((long) src & 3) && w) { - w--; - pixel = Get24(src); - src += 3; - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); - } - /* Do four aligned pixels at a time */ - while (w >= 4) { - CARD32 s0, s1; - - s0 = READ((CARD32 *) src); -#if BITMAP_BIT_ORDER == LSBFirst - pixel = s0 & 0xffffff; -#else - pixel = s0 >> 8; -#endif - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); - s1 = READ((CARD32 *) (src + 4)); -#if BITMAP_BIT_ORDER == LSBFirst - pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff); -#else - pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16); -#endif - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); - s0 = READ((CARD32 *) (src + 8)); -#if BITMAP_BIT_ORDER == LSBFirst - pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff); -#else - pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24); -#endif - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); -#if BITMAP_BIT_ORDER == LSBFirst - pixel = s0 >> 8; -#else - pixel = s0 & 0xffffff; -#endif - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); - src += 12; - w -= 4; - } - while (w) { - w--; - pixel = Get24(src); - src += 3; - WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); - } - } - else { - while (w--) { - pixel = Get24(src); - src += 3; - WRITE(dst, FbDoMergeRop(pixel, READ(dst))); - dst++; - } - } - } -} - -/* - * Spans functions; probably unused. - */ -void -fb24_32GetSpans(DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart) -{ - FbBits *srcBits; - CARD8 *src; - FbStride srcStride; - int srcBpp; - int srcXoff, srcYoff; - CARD8 *dst; - - fbGetDrawable(pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); - src = (CARD8 *) srcBits; - srcStride *= sizeof(FbBits); - - while (nspans--) { - dst = (CARD8 *) pchardstStart; - fb24_32BltUp(src + (ppt->y + srcYoff) * srcStride, srcStride, - ppt->x + srcXoff, - dst, 1, 0, *pwidth, 1, GXcopy, FB_ALLONES); - - pchardstStart += PixmapBytePad(*pwidth, pDrawable->depth); - ppt++; - pwidth++; - } - - fbFinishAccess(pDrawable); -} - -void -fb24_32SetSpans(DrawablePtr pDrawable, - GCPtr pGC, - char *src, - DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) -{ - FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); - RegionPtr pClip = fbGetCompositeClip(pGC); - FbBits *dstBits; - CARD8 *dst, *d, *s; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - BoxPtr pbox; - int n; - int x1, x2; - - fbGetDrawable(pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); - dst = (CARD8 *) dstBits; - dstStride *= sizeof(FbBits); - while (nspans--) { - d = dst + (ppt->y + dstYoff) * dstStride; - s = (CARD8 *) src; - n = RegionNumRects(pClip); - pbox = RegionRects(pClip); - while (n--) { - if (pbox->y1 > ppt->y) - break; - if (pbox->y2 > ppt->y) { - x1 = ppt->x; - x2 = x1 + *pwidth; - if (pbox->x1 > x1) - x1 = pbox->x1; - if (pbox->x2 < x2) - x2 = pbox->x2; - if (x1 < x2) - fb24_32BltDown(s, - 0, - (x1 - ppt->x), - d, - dstStride, - x1 + dstXoff, - (x2 - x1), 1, pGC->alu, pPriv->pm); - } - } - src += PixmapBytePad(*pwidth, pDrawable->depth); - ppt++; - pwidth++; - } - - fbFinishAccess(pDrawable); -} - -/* - * Clip and put 32bpp Z-format images to a 24bpp drawable - */ -void -fb24_32PutZImage(DrawablePtr pDrawable, - RegionPtr pClip, - int alu, - FbBits pm, - int x, - int y, int width, int height, CARD8 *src, FbStride srcStride) -{ - FbBits *dstBits; - CARD8 *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - int nbox; - BoxPtr pbox; - int x1, y1, x2, y2; - - fbGetDrawable(pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); - dstStride *= sizeof(FbBits); - dst = (CARD8 *) dstBits; - - for (nbox = RegionNumRects(pClip), - pbox = RegionRects(pClip); nbox--; pbox++) { - x1 = x; - y1 = y; - x2 = x + width; - y2 = y + height; - if (x1 < pbox->x1) - x1 = pbox->x1; - if (y1 < pbox->y1) - y1 = pbox->y1; - if (x2 > pbox->x2) - x2 = pbox->x2; - if (y2 > pbox->y2) - y2 = pbox->y2; - if (x1 >= x2 || y1 >= y2) - continue; - fb24_32BltDown(src + (y1 - y) * srcStride, - srcStride, - (x1 - x), - dst + (y1 + dstYoff) * dstStride, - dstStride, x1 + dstXoff, (x2 - x1), (y2 - y1), alu, pm); - } - - fbFinishAccess(pDrawable); -} - -void -fb24_32GetImage(DrawablePtr pDrawable, - int x, - int y, - int w, - int h, unsigned int format, unsigned long planeMask, char *d) -{ - FbBits *srcBits; - CARD8 *src; - FbStride srcStride; - int srcBpp; - int srcXoff, srcYoff; - FbStride dstStride; - FbBits pm; - - fbGetDrawable(pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); - src = (CARD8 *) srcBits; - srcStride *= sizeof(FbBits); - - x += pDrawable->x; - y += pDrawable->y; - - pm = fbReplicatePixel(planeMask, 32); - dstStride = PixmapBytePad(w, pDrawable->depth); - if (pm != FB_ALLONES) - memset(d, 0, dstStride * h); - fb24_32BltUp(src + (y + srcYoff) * srcStride, srcStride, x + srcXoff, - (CARD8 *) d, dstStride, 0, w, h, GXcopy, pm); - - fbFinishAccess(pDrawable); -} - -void -fb24_32CopyMtoN(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - BoxPtr pbox, - int nbox, - int dx, - int dy, - Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) -{ - FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); - FbBits *srcBits; - CARD8 *src; - FbStride srcStride; - int srcBpp; - FbBits *dstBits; - CARD8 *dst; - FbStride dstStride; - int dstBpp; - fb24_32BltFunc blt; - int srcXoff, srcYoff; - int dstXoff, dstYoff; - - fbGetDrawable(pSrcDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); - src = (CARD8 *) srcBits; - srcStride *= sizeof(FbBits); - fbGetDrawable(pDstDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); - dst = (CARD8 *) dstBits; - dstStride *= sizeof(FbBits); - if (srcBpp == 24) - blt = fb24_32BltUp; - else - blt = fb24_32BltDown; - - while (nbox--) { - (*blt) (src + (pbox->y1 + dy + srcYoff) * srcStride, - srcStride, - (pbox->x1 + dx + srcXoff), - dst + (pbox->y1 + dstYoff) * dstStride, - dstStride, - (pbox->x1 + dstXoff), - (pbox->x2 - pbox->x1), - (pbox->y2 - pbox->y1), pGC->alu, pPriv->pm); - pbox++; - } - - fbFinishAccess(pSrcDrawable); - fbFinishAccess(pDstDrawable); -} - -PixmapPtr -fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) -{ - ScreenPtr pScreen = pOldTile->drawable.pScreen; - PixmapPtr pNewTile; - FbBits *old, *new; - FbStride oldStride, newStride; - int oldBpp, newBpp; - fb24_32BltFunc blt; - _X_UNUSED int oldXoff, oldYoff; - _X_UNUSED int newXoff, newYoff; - - pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width, - pOldTile->drawable.height, - pOldTile->drawable.depth, - pOldTile->usage_hint); - if (!pNewTile) - return 0; - fbGetDrawable(&pOldTile->drawable, - old, oldStride, oldBpp, oldXoff, oldYoff); - fbGetDrawable(&pNewTile->drawable, - new, newStride, newBpp, newXoff, newYoff); - if (oldBpp == 24) - blt = fb24_32BltUp; - else - blt = fb24_32BltDown; - - (*blt) ((CARD8 *) old, - oldStride * sizeof(FbBits), - 0, - (CARD8 *) new, - newStride * sizeof(FbBits), - 0, - pOldTile->drawable.width, - pOldTile->drawable.height, GXcopy, FB_ALLONES); - - fbFinishAccess(&pOldTile->drawable); - fbFinishAccess(&pNewTile->drawable); - - return pNewTile; -} - -typedef struct { - void *pbits; - int width; -} miScreenInitParmsRec, *miScreenInitParmsPtr; - -Bool -fb24_32CreateScreenResources(ScreenPtr pScreen) -{ - miScreenInitParmsPtr pScrInitParms; - int pitch; - Bool retval; - - /* get the pitch before mi destroys it */ - pScrInitParms = (miScreenInitParmsPtr) pScreen->devPrivate; - pitch = BitmapBytePad(pScrInitParms->width * 24); - - if ((retval = miCreateScreenResources(pScreen))) { - /* fix the screen pixmap */ - PixmapPtr pPix = (PixmapPtr) pScreen->devPrivate; - - pPix->drawable.bitsPerPixel = 24; - pPix->devKind = pitch; - } - - return retval; -} - -Bool -fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, - int width, - int height, - int depth, - int bitsPerPixel, int devKind, void *pPixData) -{ - int bpp, w; - - if (!pPixmap) - return FALSE; - bpp = bitsPerPixel; - if (bpp <= 0) - bpp = pPixmap->drawable.bitsPerPixel; - if (bpp == 24) { - if (devKind < 0) { - w = width; - if (w <= 0) - w = pPixmap->drawable.width; - devKind = BitmapBytePad(w * 24); - } - } - return miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, - devKind, pPixData); -} diff --git a/xserver/fb/fb24_32.h b/xserver/fb/fb24_32.h deleted file mode 100644 index 77eef2339..000000000 --- a/xserver/fb/fb24_32.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright © 2000 SuSE, Inc. - * - * 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, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * 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. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _FB24_32_H_ -#define _FB24_32_H_ - -Bool - -fb24_32FinishScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, - int ysize, int dpix, int dpiy, int width, int bpp); - -Bool - -fb24_32ScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, int ysize, int dpix, int dpiy, int width, int bpp); - -#endif diff --git a/xserver/fb/fbarc.c b/xserver/fb/fbarc.c index c1b7f7785..fe14aed61 100644 --- a/xserver/fb/fbarc.c +++ b/xserver/fb/fbarc.c @@ -48,9 +48,6 @@ fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs) case 16: arc = fbArc16; break; - case 24: - arc = fbArc24; - break; case 32: arc = fbArc32; break; diff --git a/xserver/fb/fbbits.c b/xserver/fb/fbbits.c index d7d089c17..7435ad56a 100644 --- a/xserver/fb/fbbits.c +++ b/xserver/fb/fbbits.c @@ -83,64 +83,6 @@ #undef BITS #undef BITS2 -#define BRESSOLID fbBresSolid24 -#define BRESDASH fbBresDash24 -#define DOTS fbDots24 -#define ARC fbArc24 -#define POLYLINE fbPolyline24 -#define POLYSEGMENT fbPolySegment24 - -#define BITS CARD32 -#define BITSUNIT BYTE -#define BITSMUL 3 - -#define FbDoTypeStore(b,t,x,s) WRITE(((t *) (b)), (x) >> (s)) -#define FbDoTypeRRop(b,t,a,x,s) WRITE((t *) (b), FbDoRRop(READ((t *) (b)),\ - (a) >> (s), \ - (x) >> (s))) -#define FbDoTypeMaskRRop(b,t,a,x,m,s) WRITE((t *) (b), FbDoMaskRRop(READ((t *) (b)),\ - (a) >> (s), \ - (x) >> (s), \ - (m) >> (s))) -#if BITMAP_BIT_ORDER == LSBFirst -#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \ - (FbDoTypeStore (b, CARD8, x, 0), \ - FbDoTypeStore ((b) + 1, CARD16, x, 8)) : \ - (FbDoTypeStore (b, CARD16, x, 0), \ - FbDoTypeStore ((b) + 2, CARD8, x, 16))) -#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \ - (FbDoTypeRRop(b,CARD8,a,x,0), \ - FbDoTypeRRop((b)+1,CARD16,a,x,8)) : \ - (FbDoTypeRRop(b,CARD16,a,x,0), \ - FbDoTypeRRop((b)+2,CARD8,a,x,16))) -#else -#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \ - (FbDoTypeStore (b, CARD8, x, 16), \ - FbDoTypeStore ((b) + 1, CARD16, x, 0)) : \ - (FbDoTypeStore (b, CARD16, x, 8), \ - FbDoTypeStore ((b) + 2, CARD8, x, 0))) -#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \ - (FbDoTypeRRop (b, CARD8, a, x, 16), \ - FbDoTypeRRop ((b) + 1, CARD16, a, x, 0)) : \ - (FbDoTypeRRop (b, CARD16, a, x, 8), \ - FbDoTypeRRop ((b) + 2, CARD8, a, x, 0))) -#endif - -#include "fbbits.h" - -#undef BITSSTORE -#undef BITSRROP -#undef BITSMUL -#undef BITSUNIT -#undef BITS - -#undef BRESSOLID -#undef BRESDASH -#undef DOTS -#undef ARC -#undef POLYLINE -#undef POLYSEGMENT - #define BRESSOLID fbBresSolid32 #define BRESDASH fbBresDash32 #define DOTS fbDots32 diff --git a/xserver/fb/fbbits.h b/xserver/fb/fbbits.h index be32d8cf0..d99ead8f8 100644 --- a/xserver/fb/fbbits.h +++ b/xserver/fb/fbbits.h @@ -31,12 +31,6 @@ #include #endif -#ifdef BITSMUL -#define MUL BITSMUL -#else -#define MUL 1 -#endif - #ifdef BITSSTORE #define STORE(b,x) BITSSTORE(b,x) #else @@ -86,17 +80,17 @@ BRESSOLID(DrawablePtr pDrawable, fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bits = - ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL; + ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); if (signdy < 0) bitsStride = -bitsStride; if (axis == X_AXIS) { - majorStep = signdx * MUL; + majorStep = signdx; minorStep = bitsStride; } else { majorStep = bitsStride; - minorStep = signdx * MUL; + minorStep = signdx; } while (len--) { STORE(bits, xor); @@ -143,17 +137,17 @@ BRESDASH(DrawablePtr pDrawable, FbDashInit(pGC, pPriv, dashOffset, dashlen, even); bits = - ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL; + ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); if (signdy < 0) bitsStride = -bitsStride; if (axis == X_AXIS) { - majorStep = signdx * MUL; + majorStep = signdx; minorStep = bitsStride; } else { majorStep = bitsStride; - minorStep = signdx * MUL; + minorStep = signdx; } if (dashlen >= len) dashlen = len; @@ -260,13 +254,13 @@ DOTS(FbBits * dst, ul = coordToInt(pBox->x1 - xorg, pBox->y1 - yorg); lr = coordToInt(pBox->x2 - xorg - 1, pBox->y2 - yorg - 1); - bits += bitsStride * (yorg + yoff) + (xorg + xoff) * MUL; + bits += bitsStride * (yorg + yoff) + (xorg + xoff); if (and == 0) { while (npt--) { pt = *pts++; if (!isClipped(pt, ul, lr)) { - point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL; + point = bits + intToY(pt) * bitsStride + intToX(pt); STORE(point, bxor); } } @@ -275,7 +269,7 @@ DOTS(FbBits * dst, while (npt--) { pt = *pts++; if (!isClipped(pt, ul, lr)) { - point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL; + point = bits + intToY(pt) * bitsStride + intToX(pt); RROP(point, band, bxor); } } @@ -311,8 +305,8 @@ ARC(FbBits * dst, do360 = miZeroArcSetup(arc, &info, TRUE); yorgp = bits + ((info.yorg + drawY) * bitsStride); yorgop = bits + ((info.yorgo + drawY) * bitsStride); - info.xorg = (info.xorg + drawX) * MUL; - info.xorgo = (info.xorgo + drawX) * MUL; + info.xorg = (info.xorg + drawX); + info.xorgo = (info.xorgo + drawX); MIARCSETUP(); yoffset = y ? bitsStride : 0; dyoffset = 0; @@ -339,37 +333,37 @@ ARC(FbBits * dst, if (do360 && (arc->width == arc->height) && !(arc->width & 1)) { int xoffset = bitsStride; UNIT *yorghb = yorgp + (info.h * bitsStride) + info.xorg; - UNIT *yorgohb = yorghb - info.h * MUL; + UNIT *yorgohb = yorghb - info.h; yorgp += info.xorg; yorgop += info.xorg; - yorghb += info.h * MUL; + yorghb += info.h; while (1) { if (andBits == 0) { - ARCCOPY(yorgp + yoffset + x * MUL); - ARCCOPY(yorgp + yoffset - x * MUL); - ARCCOPY(yorgop - yoffset - x * MUL); - ARCCOPY(yorgop - yoffset + x * MUL); + ARCCOPY(yorgp + yoffset + x); + ARCCOPY(yorgp + yoffset - x); + ARCCOPY(yorgop - yoffset - x); + ARCCOPY(yorgop - yoffset + x); } else { - ARCRROP(yorgp + yoffset + x * MUL); - ARCRROP(yorgp + yoffset - x * MUL); - ARCRROP(yorgop - yoffset - x * MUL); - ARCRROP(yorgop - yoffset + x * MUL); + ARCRROP(yorgp + yoffset + x); + ARCRROP(yorgp + yoffset - x); + ARCRROP(yorgop - yoffset - x); + ARCRROP(yorgop - yoffset + x); } if (a < 0) break; if (andBits == 0) { - ARCCOPY(yorghb - xoffset - y * MUL); - ARCCOPY(yorgohb - xoffset + y * MUL); - ARCCOPY(yorgohb + xoffset + y * MUL); - ARCCOPY(yorghb + xoffset - y * MUL); + ARCCOPY(yorghb - xoffset - y); + ARCCOPY(yorgohb - xoffset + y); + ARCCOPY(yorgohb + xoffset + y); + ARCCOPY(yorghb + xoffset - y); } else { - ARCRROP(yorghb - xoffset - y * MUL); - ARCRROP(yorgohb - xoffset + y * MUL); - ARCRROP(yorgohb + xoffset + y * MUL); - ARCRROP(yorghb + xoffset - y * MUL); + ARCRROP(yorghb - xoffset - y); + ARCRROP(yorgohb - xoffset + y); + ARCRROP(yorgohb + xoffset + y); + ARCRROP(yorghb + xoffset - y); } xoffset += bitsStride; MIARCCIRCLESTEP(yoffset += bitsStride; @@ -385,16 +379,16 @@ ARC(FbBits * dst, MIARCOCTANTSHIFT(dyoffset = bitsStride; ); if (andBits == 0) { - ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); - ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); - ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); - ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); + ARCCOPY(yorgp + yoffset + info.xorg + x); + ARCCOPY(yorgp + yoffset + info.xorgo - x); + ARCCOPY(yorgop - yoffset + info.xorgo - x); + ARCCOPY(yorgop - yoffset + info.xorg + x); } else { - ARCRROP(yorgp + yoffset + info.xorg + x * MUL); - ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); - ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); - ARCRROP(yorgop - yoffset + info.xorg + x * MUL); + ARCRROP(yorgp + yoffset + info.xorg + x); + ARCRROP(yorgp + yoffset + info.xorgo - x); + ARCRROP(yorgop - yoffset + info.xorgo - x); + ARCRROP(yorgop - yoffset + info.xorg + x); } MIARCSTEP(yoffset += dyoffset; , yoffset += bitsStride; @@ -411,23 +405,23 @@ ARC(FbBits * dst, } if (andBits == 0) { if (mask & 1) - ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); + ARCCOPY(yorgp + yoffset + info.xorg + x); if (mask & 2) - ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); + ARCCOPY(yorgp + yoffset + info.xorgo - x); if (mask & 4) - ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); + ARCCOPY(yorgop - yoffset + info.xorgo - x); if (mask & 8) - ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); + ARCCOPY(yorgop - yoffset + info.xorg + x); } else { if (mask & 1) - ARCRROP(yorgp + yoffset + info.xorg + x * MUL); + ARCRROP(yorgp + yoffset + info.xorg + x); if (mask & 2) - ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); + ARCRROP(yorgp + yoffset + info.xorgo - x); if (mask & 4) - ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); + ARCRROP(yorgop - yoffset + info.xorgo - x); if (mask & 8) - ARCRROP(yorgop - yoffset + info.xorg + x * MUL); + ARCRROP(yorgop - yoffset + info.xorg + x); } if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; @@ -442,26 +436,26 @@ ARC(FbBits * dst, mask = info.start.mask; if (andBits == 0) { if (mask & 1) - ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); + ARCCOPY(yorgp + yoffset + info.xorg + x); if (mask & 4) - ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); + ARCCOPY(yorgop - yoffset + info.xorgo - x); if (arc->height & 1) { if (mask & 2) - ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); + ARCCOPY(yorgp + yoffset + info.xorgo - x); if (mask & 8) - ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); + ARCCOPY(yorgop - yoffset + info.xorg + x); } } else { if (mask & 1) - ARCRROP(yorgp + yoffset + info.xorg + x * MUL); + ARCRROP(yorgp + yoffset + info.xorg + x); if (mask & 4) - ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); + ARCRROP(yorgop - yoffset + info.xorgo - x); if (arc->height & 1) { if (mask & 2) - ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); + ARCRROP(yorgp + yoffset + info.xorgo - x); if (mask & 8) - ARCRROP(yorgop - yoffset + info.xorg + x * MUL); + ARCRROP(yorgop - yoffset + info.xorg + x); } } } @@ -626,7 +620,7 @@ POLYLINE(DrawablePtr pDrawable, fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); bitsBase = - ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL; + ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff); ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); @@ -649,13 +643,12 @@ POLYLINE(DrawablePtr pDrawable, npt--; } else { - bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL; + bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1); for (;;) { CalcLineDeltas(intToX(pt1), intToY(pt1), intToX(pt2), intToY(pt2), len, e1, stepmajor, stepminor, 1, bitsStride, octant); - stepmajor *= MUL; if (len < e1) { e3 = len; len = e1; @@ -747,7 +740,7 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); bitsBase = - ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL; + ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff); ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); @@ -767,11 +760,7 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) intToX(pt2), intToY(pt2), len, e1, stepmajor, stepminor, 1, bitsStride, octant); - if (e1 == 0 && len > 3 -#if MUL != 1 - && FbCheck24Pix(and) && FbCheck24Pix(xor) -#endif - ) { + if (e1 == 0 && len > 3) { int x1, x2; FbBits *dstLine; int dstX, width; @@ -790,8 +779,8 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) if (!capNotLast) x2++; } - dstX = (x1 + xoff + dstXoff) * (sizeof(UNIT) * 8 * MUL); - width = (x2 - x1) * (sizeof(UNIT) * 8 * MUL); + dstX = (x1 + xoff + dstXoff) * (sizeof(UNIT) * 8); + width = (x2 - x1) * (sizeof(UNIT) * 8); dstLine = dst + (intToY(pt1) + yoff + dstYoff) * dstStride; dstLine += dstX >> FB_SHIFT; @@ -818,8 +807,7 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) endmask)); } else { - stepmajor *= MUL; - bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL; + bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1); if (len < e1) { e3 = len; len = e1; @@ -866,7 +854,6 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) } #endif -#undef MUL #undef STORE #undef RROP #undef UNIT diff --git a/xserver/fb/fbblt.c b/xserver/fb/fbblt.c index b4123656a..c1730ab6a 100644 --- a/xserver/fb/fbblt.c +++ b/xserver/fb/fbblt.c @@ -92,12 +92,6 @@ fbBlt(FbBits * srcLine, } } - if (bpp == 24 && !FbCheck24Pix(pm)) { - fbBlt24(srcLine, srcStride, srcX, dstLine, dstStride, dstX, - width, height, alu, pm, reverse, upsidedown); - return; - } - FbInitializeMergeRop(alu, pm); destInvarient = FbDestInvarientMergeRop(); if (upsidedown) { @@ -298,228 +292,6 @@ fbBlt(FbBits * srcLine, } } -#undef DEBUG_BLT24 -#ifdef DEBUG_BLT24 - -static unsigned long -getPixel(char *src, int x) -{ - unsigned long l; - - l = 0; - memcpy(&l, src + x * 3, 3); - return l; -} -#endif - -static void -fbBlt24Line(FbBits * src, - int srcX, - FbBits * dst, int dstX, int width, int alu, FbBits pm, Bool reverse) -{ -#ifdef DEBUG_BLT24 - char *origDst = (char *) dst; - FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1); - int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3; - int origX = dstX / 24; -#endif - - int leftShift, rightShift; - FbBits startmask, endmask; - int n; - - FbBits bits, bits1; - FbBits mask; - - int rot; - - FbDeclareMergeRop(); - - FbInitializeMergeRop(alu, FB_ALLONES); - FbMaskBits(dstX, width, startmask, n, endmask); -#ifdef DEBUG_BLT24 - ErrorF("dstX %d width %d reverse %d\n", dstX, width, reverse); -#endif - if (reverse) { - src += ((srcX + width - 1) >> FB_SHIFT) + 1; - dst += ((dstX + width - 1) >> FB_SHIFT) + 1; - rot = FbFirst24Rot(((dstX + width - 8) & FB_MASK)); - rot = FbPrev24Rot(rot); -#ifdef DEBUG_BLT24 - ErrorF("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK, - rot); -#endif - srcX = (srcX + width - 1) & FB_MASK; - dstX = (dstX + width - 1) & FB_MASK; - } - else { - src += srcX >> FB_SHIFT; - dst += dstX >> FB_SHIFT; - srcX &= FB_MASK; - dstX &= FB_MASK; - rot = FbFirst24Rot(dstX); -#ifdef DEBUG_BLT24 - ErrorF("dstX: %d rot: %d\n", dstX, rot); -#endif - } - mask = FbRot24(pm, rot); -#ifdef DEBUG_BLT24 - ErrorF("pm 0x%x mask 0x%x\n", pm, mask); -#endif - if (srcX == dstX) { - if (reverse) { - if (endmask) { - bits = READ(--src); - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); - mask = FbPrev24Pix(mask); - } - while (n--) { - bits = READ(--src); - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); - mask = FbPrev24Pix(mask); - } - if (startmask) { - bits = READ(--src); - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); - } - } - else { - if (startmask) { - bits = READ(src++); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); - dst++; - mask = FbNext24Pix(mask); - } - while (n--) { - bits = READ(src++); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); - dst++; - mask = FbNext24Pix(mask); - } - if (endmask) { - bits = READ(src); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); - } - } - } - else { - if (srcX > dstX) { - leftShift = srcX - dstX; - rightShift = FB_UNIT - leftShift; - } - else { - rightShift = dstX - srcX; - leftShift = FB_UNIT - rightShift; - } - - bits1 = 0; - if (reverse) { - if (srcX < dstX) - bits1 = READ(--src); - if (endmask) { - bits = FbScrRight(bits1, rightShift); - if (FbScrRight(endmask, leftShift)) { - bits1 = READ(--src); - bits |= FbScrLeft(bits1, leftShift); - } - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); - mask = FbPrev24Pix(mask); - } - while (n--) { - bits = FbScrRight(bits1, rightShift); - bits1 = READ(--src); - bits |= FbScrLeft(bits1, leftShift); - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); - mask = FbPrev24Pix(mask); - } - if (startmask) { - bits = FbScrRight(bits1, rightShift); - if (FbScrRight(startmask, leftShift)) { - bits1 = READ(--src); - bits |= FbScrLeft(bits1, leftShift); - } - --dst; - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); - } - } - else { - if (srcX > dstX) - bits1 = READ(src++); - if (startmask) { - bits = FbScrLeft(bits1, leftShift); - bits1 = READ(src++); - bits |= FbScrRight(bits1, rightShift); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); - dst++; - mask = FbNext24Pix(mask); - } - while (n--) { - bits = FbScrLeft(bits1, leftShift); - bits1 = READ(src++); - bits |= FbScrRight(bits1, rightShift); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); - dst++; - mask = FbNext24Pix(mask); - } - if (endmask) { - bits = FbScrLeft(bits1, leftShift); - if (FbScrLeft(endmask, rightShift)) { - bits1 = READ(src); - bits |= FbScrRight(bits1, rightShift); - } - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); - } - } - } -#ifdef DEBUG_BLT24 - { - int firstx, lastx, x; - - firstx = origX; - if (firstx) - firstx--; - lastx = origX + width / 24 + 1; - for (x = firstx; x <= lastx; x++) - ErrorF("%06x ", getPixel(origDst, x)); - ErrorF("\n"); - while (origNlw--) - ErrorF("%08x ", *origLine++); - ErrorF("\n"); - } -#endif -} - -void -fbBlt24(FbBits * srcLine, - FbStride srcStride, - int srcX, - FbBits * dstLine, - FbStride dstStride, - int dstX, - int width, - int height, int alu, FbBits pm, Bool reverse, Bool upsidedown) -{ - if (upsidedown) { - srcLine += (height - 1) * srcStride; - dstLine += (height - 1) * dstStride; - srcStride = -srcStride; - dstStride = -dstStride; - } - while (height--) { - fbBlt24Line(srcLine, srcX, dstLine, dstX, width, alu, pm, reverse); - srcLine += srcStride; - dstLine += dstStride; - } -#ifdef DEBUG_BLT24 - ErrorF("\n"); -#endif -} - void fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */ diff --git a/xserver/fb/fbbltone.c b/xserver/fb/fbbltone.c index d089a433c..811bbc533 100644 --- a/xserver/fb/fbbltone.c +++ b/xserver/fb/fbbltone.c @@ -187,13 +187,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ Bool endNeedsLoad = FALSE; /* need load for endmask */ int startbyte, endbyte; - if (dstBpp == 24) { - fbBltOne24(src, srcStride, srcX, - dst, dstStride, dstX, dstBpp, - width, height, fgand, fgxor, bgand, bgxor); - return; - } - /* * Do not read past the end of the buffer! */ @@ -376,266 +369,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ } } -/* - * Crufty macros to initialize the mask array, most of this - * is to avoid compile-time warnings about shift overflow - */ - -#if BITMAP_BIT_ORDER == MSBFirst -#define Mask24Pos(x,r) ((x)*24-(r)) -#else -#define Mask24Pos(x,r) ((x)*24-((r) ? 24 - (r) : 0)) -#endif - -#define Mask24Neg(x,r) (Mask24Pos(x,r) < 0 ? -Mask24Pos(x,r) : 0) -#define Mask24Check(x,r) (Mask24Pos(x,r) < 0 ? 0 : \ - Mask24Pos(x,r) >= FB_UNIT ? 0 : Mask24Pos(x,r)) - -#define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \ - (Mask24Pos(x,r) < 0 ? \ - 0xffffffU >> Mask24Neg (x,r) : \ - 0xffffffU << Mask24Check(x,r)) : 0) - -#define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r)) - -#define C2_24(b,r) \ - (SelMask24(b,0,r) | \ - SelMask24(b,1,r)) - -#define FbStip24Len 2 -#if BITMAP_BIT_ORDER == MSBFirst -#define FbStip24New(rot) (1 + (rot == 0)) -#else -#define FbStip24New(rot) (1 + (rot == 8)) -#endif - -const FbBits fbStipple24Bits[3][1 << FbStip24Len] = { - /* rotate 0 */ - { - C2_24(0, 0), C2_24(1, 0), C2_24(2, 0), C2_24(3, 0), - }, - /* rotate 8 */ - { - C2_24(0, 8), C2_24(1, 8), C2_24(2, 8), C2_24(3, 8), - }, - /* rotate 16 */ - { - C2_24(0, 16), C2_24(1, 16), C2_24(2, 16), C2_24(3, 16), - } -}; - -#if BITMAP_BIT_ORDER == LSBFirst - -#define FbMergeStip24Bits(left, right, new) \ - (FbStipLeft (left, new) | FbStipRight ((right), (FbStip24Len - (new)))) - -#define FbMergePartStip24Bits(left, right, llen, rlen) \ - (left | FbStipRight(right, llen)) - -#else - -#define FbMergeStip24Bits(left, right, new) \ - ((FbStipLeft (left, new) & ((1 << FbStip24Len) - 1)) | right) - -#define FbMergePartStip24Bits(left, right, llen, rlen) \ - (FbStipLeft(left, rlen) | right) - -#endif - -#define fbFirstStipBits(len,stip) {\ - int __len = (len); \ - if (len <= remain) { \ - stip = FbLeftStipBits(bits, len); \ - } else { \ - stip = FbLeftStipBits(bits, remain); \ - bits = (src < srcEnd ? READ(src++) : 0); \ - __len = (len) - remain; \ - stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \ - remain, __len); \ - remain = FB_STIP_UNIT; \ - } \ - bits = FbStipLeft (bits, __len); \ - remain -= __len; \ -} - -#define fbInitStipBits(offset,len,stip) {\ - bits = FbStipLeft (READ(src++),offset); \ - remain = FB_STIP_UNIT - offset; \ - fbFirstStipBits(len,stip); \ - stip = FbMergeStip24Bits (0, stip, len); \ -} - -#define fbNextStipBits(rot,stip) {\ - int __new = FbStip24New(rot); \ - FbStip __right; \ - fbFirstStipBits(__new, __right); \ - stip = FbMergeStip24Bits (stip, __right, __new); \ - rot = FbNext24Rot (rot); \ -} - -/* - * Use deep mask tables that incorporate rotation, pull - * a variable number of bits out of the stipple and - * reuse the right bits as needed for the next write - * - * Yes, this is probably too much code, but most 24-bpp screens - * have no acceleration so this code is used for stipples, copyplane - * and text - */ -void -fbBltOne24(FbStip * srcLine, FbStride srcStride, /* FbStip units per scanline */ - int srcX, /* bit position of source */ - FbBits * dst, FbStride dstStride, /* FbBits units per scanline */ - int dstX, /* bit position of dest */ - int dstBpp, /* bits per destination unit */ - int width, /* width in bits of destination */ - int height, /* height in scanlines */ - FbBits fgand, /* rrop values */ - FbBits fgxor, FbBits bgand, FbBits bgxor) -{ - FbStip *src, *srcEnd; - FbBits leftMask, rightMask, mask; - int nlMiddle, nl; - FbStip stip, bits; - int remain; - int dstS; - int firstlen; - int rot0, rot; - int nDst; - - /* - * Do not read past the end of the buffer! - */ - srcEnd = srcLine + height * srcStride; - - srcLine += srcX >> FB_STIP_SHIFT; - dst += dstX >> FB_SHIFT; - srcX &= FB_STIP_MASK; - dstX &= FB_MASK; - rot0 = FbFirst24Rot(dstX); - - FbMaskBits(dstX, width, leftMask, nlMiddle, rightMask); - - dstS = (dstX + 23) / 24; - firstlen = FbStip24Len - dstS; - - nDst = nlMiddle; - if (leftMask) - nDst++; - dstStride -= nDst; - - /* opaque copy */ - if (bgand == 0 && fgand == 0) { - while (height--) { - rot = rot0; - src = srcLine; - srcLine += srcStride; - fbInitStipBits(srcX, firstlen, stip); - if (leftMask) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, (READ(dst) & ~leftMask) | - (FbOpaqueStipple(mask, - FbRot24(fgxor, rot), FbRot24(bgxor, rot)) - & leftMask)); - dst++; - fbNextStipBits(rot, stip); - } - nl = nlMiddle; - while (nl--) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, FbOpaqueStipple(mask, - FbRot24(fgxor, rot), - FbRot24(bgxor, rot))); - dst++; - fbNextStipBits(rot, stip); - } - if (rightMask) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, (READ(dst) & ~rightMask) | - (FbOpaqueStipple(mask, - FbRot24(fgxor, rot), FbRot24(bgxor, rot)) - & rightMask)); - } - dst += dstStride; - src += srcStride; - } - } - /* transparent copy */ - else if (bgand == FB_ALLONES && bgxor == 0 && fgand == 0) { - while (height--) { - rot = rot0; - src = srcLine; - srcLine += srcStride; - fbInitStipBits(srcX, firstlen, stip); - if (leftMask) { - if (stip) { - mask = fbStipple24Bits[rot >> 3][stip] & leftMask; - WRITE(dst, - (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); - } - dst++; - fbNextStipBits(rot, stip); - } - nl = nlMiddle; - while (nl--) { - if (stip) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, - (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); - } - dst++; - fbNextStipBits(rot, stip); - } - if (rightMask) { - if (stip) { - mask = fbStipple24Bits[rot >> 3][stip] & rightMask; - WRITE(dst, - (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); - } - } - dst += dstStride; - } - } - else { - while (height--) { - rot = rot0; - src = srcLine; - srcLine += srcStride; - fbInitStipBits(srcX, firstlen, stip); - if (leftMask) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, FbStippleRRopMask(READ(dst), mask, - FbRot24(fgand, rot), - FbRot24(fgxor, rot), - FbRot24(bgand, rot), - FbRot24(bgxor, rot), leftMask)); - dst++; - fbNextStipBits(rot, stip); - } - nl = nlMiddle; - while (nl--) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, FbStippleRRop(READ(dst), mask, - FbRot24(fgand, rot), - FbRot24(fgxor, rot), - FbRot24(bgand, rot), - FbRot24(bgxor, rot))); - dst++; - fbNextStipBits(rot, stip); - } - if (rightMask) { - mask = fbStipple24Bits[rot >> 3][stip]; - WRITE(dst, FbStippleRRopMask(READ(dst), mask, - FbRot24(fgand, rot), - FbRot24(fgxor, rot), - FbRot24(bgand, rot), - FbRot24(bgxor, rot), rightMask)); - } - dst += dstStride; - } - } -} - /* * Not very efficient, but simple -- copy a single plane * from an N bit image to a 1 bit image @@ -668,7 +401,6 @@ fbBltPlane(FbBits * src, FbStip dstUnion; int w; int wt; - int rot0; if (!width) return; @@ -682,19 +414,8 @@ fbBltPlane(FbBits * src, w = width / srcBpp; pm = fbReplicatePixel(planeMask, srcBpp); - if (srcBpp == 24) { - int tmpw = 24; - - rot0 = FbFirst24Rot(srcX); - if (srcX + tmpw > FB_UNIT) - tmpw = FB_UNIT - srcX; - srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, tmpw); - } - else { - rot0 = 0; - srcMaskFirst = pm & FbBitsMask(srcX, srcBpp); - srcMask0 = pm & FbBitsMask(0, srcBpp); - } + srcMaskFirst = pm & FbBitsMask(srcX, srcBpp); + srcMask0 = pm & FbBitsMask(0, srcBpp); dstMaskFirst = FbStipMask(dstX, 1); while (height--) { @@ -704,8 +425,6 @@ fbBltPlane(FbBits * src, src += srcStride; srcMask = srcMaskFirst; - if (srcBpp == 24) - srcMask0 = FbRot24(pm, rot0) & FbBitsMask(0, srcBpp); srcBits = READ(s++); dstMask = dstMaskFirst; @@ -717,8 +436,6 @@ fbBltPlane(FbBits * src, while (wt--) { if (!srcMask) { srcBits = READ(s++); - if (srcBpp == 24) - srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0, 24); srcMask = srcMask0; } if (!dstMask) { diff --git a/xserver/fb/fbcopy.c b/xserver/fb/fbcopy.c index 6af10ccf7..3af128ada 100644 --- a/xserver/fb/fbcopy.c +++ b/xserver/fb/fbcopy.c @@ -241,14 +241,8 @@ fbCopyArea(DrawablePtr pSrcDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut) { - miCopyProc copy; - - if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel) - copy = fb24_32CopyMtoN; - else - copy = fbCopyNtoN; return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, - widthSrc, heightSrc, xOut, yOut, copy, 0, 0); + widthSrc, heightSrc, xOut, yOut, fbCopyNtoN, 0, 0); } RegionPtr diff --git a/xserver/fb/fbgc.c b/xserver/fb/fbgc.c index 19c613158..2ab9ecad1 100644 --- a/xserver/fb/fbgc.c +++ b/xserver/fb/fbgc.c @@ -71,7 +71,6 @@ fbCreateGC(GCPtr pGC) pGC->miTranslate = 1; pGC->fExpose = 1; - fbGetGCPrivate(pGC)->bpp = BitsPerPixel(pGC->depth); return TRUE; } @@ -129,35 +128,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) miComputeCompositeClip(pGC, pDrawable); } - if (pPriv->bpp != pDrawable->bitsPerPixel) { - changes |= GCStipple | GCForeground | GCBackground | GCPlaneMask; - pPriv->bpp = pDrawable->bitsPerPixel; - } - if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) { - (*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC)); - fbGetRotatedPixmap(pGC) = 0; - } - - if (pGC->fillStyle == FillTiled) { - PixmapPtr pOldTile, pNewTile; - - pOldTile = pGC->tile.pixmap; - if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { - pNewTile = fbGetRotatedPixmap(pGC); - if (!pNewTile || - pNewTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { - if (pNewTile) - (*pGC->pScreen->DestroyPixmap) (pNewTile); - pNewTile = - fb24_32ReformatTile(pOldTile, pDrawable->bitsPerPixel); - } - if (pNewTile) { - fbGetRotatedPixmap(pGC) = pOldTile; - pGC->tile.pixmap = pNewTile; - changes |= GCTile; - } - } - } if (changes & GCTile) { if (!pGC->tileIsPixel && FbEvenTile(pGC->tile.pixmap->drawable.width * diff --git a/xserver/fb/fbgetsp.c b/xserver/fb/fbgetsp.c index 9a163b27e..445a4e385 100644 --- a/xserver/fb/fbgetsp.c +++ b/xserver/fb/fbgetsp.c @@ -44,11 +44,6 @@ fbGetSpans(DrawablePtr pDrawable, if (!fbDrawableEnabled(pDrawable)) return; - if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { - fb24_32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart); - return; - } - fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); while (nspans--) { diff --git a/xserver/fb/fbglyph.c b/xserver/fb/fbglyph.c index 61cb8de33..1bdc2d4fd 100644 --- a/xserver/fb/fbglyph.c +++ b/xserver/fb/fbglyph.c @@ -53,185 +53,6 @@ fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) return RegionContainsRect(pRegion, &box) == rgnIN; } -#define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg) -#define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg) -#define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg) -#define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB) - -/* - * This is a bit tricky, but it's brief. Write 12 bytes worth - * of dest, which is four pixels, at a time. This gives constant - * code for each pattern as they're always aligned the same - * - * a b c d a b c d a b c d bytes - * A B C A B C A B C A B C pixels - * - * f0 f1 f2 - * A B C A B C A B C A B C pixels LSB - * C A B C A B C A B C A B pixels MSB - * - * LSB MSB - * A f0 f1 - * B f1 f2 - * C f2 f0 - * A B f0 f2 - * B C f1 f0 - * C A f2 f1 - * A B C A f0 f1 - * B C A B f1 f2 - * C A B C f2 f0 - */ - -#undef _A -#undef _B -#undef _C -#undef _AB -#undef _BC -#undef _CA -#undef _ABCA -#undef _BCAB -#undef _CABC - -#if IMAGE_BYTE_ORDER == MSBFirst -#define _A f1 -#define _B f2 -#define _C f0 -#define _AB f2 -#define _BC f0 -#define _CA f1 -#define _ABCA f1 -#define _BCAB f2 -#define _CABC f0 -#define CASE(a,b,c,d) ((a << 3) | (b << 2) | (c << 1) | d) -#else -#define _A f0 -#define _B f1 -#define _C f2 -#define _AB f0 -#define _BC f1 -#define _CA f2 -#define _ABCA f0 -#define _BCAB f1 -#define _CABC f2 -#define CASE(a,b,c,d) (a | (b << 1) | (c << 2) | (d << 3)) -#endif - -static void -fbGlyph24(FbBits * dstBits, - FbStride dstStride, - int dstBpp, FbStip * stipple, FbBits fg, int x, int height) -{ - int lshift; - FbStip bits; - CARD8 *dstLine; - CARD8 *dst; - FbStip f0, f1, f2; - int n; - int shift; - - f0 = fg; - f1 = FbRot24(f0, 16); - f2 = FbRot24(f0, 8); - - dstLine = (CARD8 *) dstBits; - dstLine += (x & ~3) * 3; - dstStride *= (sizeof(FbBits) / sizeof(CARD8)); - shift = x & 3; - lshift = 4 - shift; - while (height--) { - bits = READ(stipple++); - n = lshift; - dst = dstLine; - while (bits) { - switch (FbStipMoveLsb(FbLeftStipBits(bits, n), 4, n)) { - case CASE(0, 0, 0, 0): - break; - case CASE(1, 0, 0, 0): - WRITE2(dst, 0, _AB); - WRITE1(dst, 2, _C); - break; - case CASE(0, 1, 0, 0): - WRITE1(dst, 3, _A); - WRITE2(dst, 4, _BC); - break; - case CASE(1, 1, 0, 0): - WRITE4(dst, 0, _ABCA); - WRITE2(dst, 4, _BC); - break; - case CASE(0, 0, 1, 0): - WRITE2(dst, 6, _AB); - WRITE1(dst, 8, _C); - break; - case CASE(1, 0, 1, 0): - WRITE2(dst, 0, _AB); - WRITE1(dst, 2, _C); - - WRITE2(dst, 6, _AB); - WRITE1(dst, 8, _C); - break; - case CASE(0, 1, 1, 0): - WRITE1(dst, 3, _A); - WRITE4(dst, 4, _BCAB); - WRITE1(dst, 8, _C); - break; - case CASE(1, 1, 1, 0): - WRITE8(dst); - WRITE1(dst, 8, _C); - break; - case CASE(0, 0, 0, 1): - WRITE1(dst, 9, _A); - WRITE2(dst, 10, _BC); - break; - case CASE(1, 0, 0, 1): - WRITE2(dst, 0, _AB); - WRITE1(dst, 2, _C); - - WRITE1(dst, 9, _A); - WRITE2(dst, 10, _BC); - break; - case CASE(0, 1, 0, 1): - WRITE1(dst, 3, _A); - WRITE2(dst, 4, _BC); - - WRITE1(dst, 9, _A); - WRITE2(dst, 10, _BC); - break; - case CASE(1, 1, 0, 1): - WRITE4(dst, 0, _ABCA); - WRITE2(dst, 4, _BC); - - WRITE1(dst, 9, _A); - WRITE2(dst, 10, _BC); - break; - case CASE(0, 0, 1, 1): - WRITE2(dst, 6, _AB); - WRITE4(dst, 8, _CABC); - break; - case CASE(1, 0, 1, 1): - WRITE2(dst, 0, _AB); - WRITE1(dst, 2, _C); - - WRITE2(dst, 6, _AB); - WRITE4(dst, 8, _CABC); - break; - case CASE(0, 1, 1, 1): - WRITE1(dst, 3, _A); - WRITE4(dst, 4, _BCAB); - WRITE4(dst, 8, _CABC); - break; - case CASE(1, 1, 1, 1): - WRITE8(dst); - WRITE4(dst, 8, _CABC); - break; - } - bits = FbStipLeft(bits, n); - n = 4; - dst += 12; - } - dstLine += dstStride; - } -} - void fbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, @@ -261,9 +82,6 @@ fbPolyGlyphBlt(DrawablePtr pDrawable, case 16: glyph = fbGlyph16; break; - case 24: - glyph = fbGlyph24; - break; case 32: glyph = fbGlyph32; break; @@ -332,9 +150,6 @@ fbImageGlyphBlt(DrawablePtr pDrawable, case 16: glyph = fbGlyph16; break; - case 24: - glyph = fbGlyph24; - break; case 32: glyph = fbGlyph32; break; diff --git a/xserver/fb/fbimage.c b/xserver/fb/fbimage.c index bac5de655..bd24728fd 100644 --- a/xserver/fb/fbimage.c +++ b/xserver/fb/fbimage.c @@ -68,20 +68,9 @@ fbPutImage(DrawablePtr pDrawable, } break; case ZPixmap: - if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { - srcStride = PixmapBytePad(w, pDrawable->depth); - fb24_32PutZImage(pDrawable, - fbGetCompositeClip(pGC), - pGC->alu, - (FbBits) pGC->planemask, - x, y, w, h, (CARD8 *) pImage, srcStride); - } - else { - srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof(FbStip); - fbPutZImage(pDrawable, - fbGetCompositeClip(pGC), - pGC->alu, pPriv->pm, x, y, w, h, src, srcStride); - } + srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof(FbStip); + fbPutZImage(pDrawable, fbGetCompositeClip(pGC), + pGC->alu, pPriv->pm, x, y, w, h, src, srcStride); } } @@ -233,12 +222,6 @@ fbGetImage(DrawablePtr pDrawable, if (!fbDrawableEnabled(pDrawable)) return; - if (format == ZPixmap && - pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { - fb24_32GetImage(pDrawable, x, y, w, h, format, planeMask, d); - return; - } - fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); x += pDrawable->x; @@ -250,13 +233,16 @@ fbGetImage(DrawablePtr pDrawable, pm = fbReplicatePixel(planeMask, srcBpp); dstStride = PixmapBytePad(w, pDrawable->depth); - if (pm != FB_ALLONES) - memset(d, 0, dstStride * h); dstStride /= sizeof(FbStip); fbBltStip((FbStip *) (src + (y + srcYoff) * srcStride), FbBitsStrideToStipStride(srcStride), (x + srcXoff) * srcBpp, - dst, dstStride, 0, w * srcBpp, h, GXcopy, pm, srcBpp); + dst, dstStride, 0, w * srcBpp, h, GXcopy, FB_ALLONES, srcBpp); + + if (pm != FB_ALLONES) { + for (int i = 0; i < dstStride * h; i++) + dst[i] &= pm; + } } else { dstStride = BitmapBytePad(w) / sizeof(FbStip); diff --git a/xserver/fb/fbline.c b/xserver/fb/fbline.c index 3e582e6fd..38c3c6c16 100644 --- a/xserver/fb/fbline.c +++ b/xserver/fb/fbline.c @@ -104,9 +104,6 @@ fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) case 16: line = fbPolyline16; break; - case 24: - line = fbPolyline24; - break; case 32: line = fbPolyline32; break; @@ -139,9 +136,6 @@ fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) case 16: seg = fbPolySegment16; break; - case 24: - seg = fbPolySegment24; - break; case 32: seg = fbPolySegment32; break; diff --git a/xserver/fb/fboverlay.c b/xserver/fb/fboverlay.c index 1e5e6b3be..d47a7c67b 100644 --- a/xserver/fb/fboverlay.c +++ b/xserver/fb/fboverlay.c @@ -56,10 +56,6 @@ fbOverlayCreateWindow(WindowPtr pWin) if (pWin->drawable.class != InputOutput) return TRUE; - if (pWin->drawable.bitsPerPixel == 32) - pWin->drawable.bitsPerPixel = - fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; - for (i = 0; i < pScrPriv->nlayers; i++) { pPixmap = pScrPriv->layer[i].u.run.pixmap; if (pWin->drawable.depth == pPixmap->drawable.depth) { @@ -260,30 +256,6 @@ fbOverlaySetupScreen(ScreenPtr pScreen, pbits1, xsize, ysize, dpix, dpiy, width1, bpp1); } -static Bool -fb24_32OverlayCreateScreenResources(ScreenPtr pScreen) -{ - FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); - int pitch; - Bool retval; - int i; - - if ((retval = fbOverlayCreateScreenResources(pScreen))) { - for (i = 0; i < pScrPriv->nlayers; i++) { - /* fix the screen pixmap */ - PixmapPtr pPix = (PixmapPtr) pScrPriv->layer[i].u.run.pixmap; - - if (pPix->drawable.bitsPerPixel == 32) { - pPix->drawable.bitsPerPixel = 24; - pitch = BitmapBytePad(pPix->drawable.width * 24); - pPix->devKind = pitch; - } - } - } - - return retval; -} - Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, void *pbits1, @@ -300,7 +272,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, DepthPtr depths; int nvisuals; int ndepths; - int bpp = 0, imagebpp = 32; VisualID defaultVisual; FbOverlayScrPrivPtr pScrPriv; @@ -308,40 +279,13 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, (&fbOverlayScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; + if (bpp1 == 24 || bpp2 == 24) + return FALSE; + pScrPriv = malloc(sizeof(FbOverlayScrPrivRec)); if (!pScrPriv) return FALSE; - if (bpp1 == 32 || bpp2 == 32) - bpp = 32; - else if (bpp1 == 24 || bpp2 == 24) - bpp = 24; - - if (bpp == 24) { - int f; - - imagebpp = 32; - /* - * Check to see if we're advertising a 24bpp image format, - * in which case windows will use it in preference to a 32 bit - * format. - */ - for (f = 0; f < screenInfo.numPixmapFormats; f++) { - if (screenInfo.formats[f].bitsPerPixel == 24) { - imagebpp = 24; - break; - } - } - } - if (imagebpp == 32) { - fbGetScreenPrivate(pScreen)->win32bpp = bpp; - fbGetScreenPrivate(pScreen)->pix32bpp = bpp; - } - else { - fbGetScreenPrivate(pScreen)->win32bpp = 32; - fbGetScreenPrivate(pScreen)->pix32bpp = 32; - } - if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &depth1, &defaultVisual, ((unsigned long) 1 << (bpp1 - 1)) | ((unsigned long) 1 << (bpp2 - 1)), 8)) { @@ -379,10 +323,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->CopyWindow = fbOverlayCopyWindow; - if (bpp == 24 && imagebpp == 32) { - pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; - pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources; - } return TRUE; } diff --git a/xserver/fb/fbpict.c b/xserver/fb/fbpict.c index 7ea0b668f..9797447b4 100644 --- a/xserver/fb/fbpict.c +++ b/xserver/fb/fbpict.c @@ -220,20 +220,10 @@ static pixman_image_t * create_solid_fill_image(PicturePtr pict) { PictSolidFill *solid = &pict->pSourcePict->solidFill; - pixman_color_t color; - CARD32 a, r, g, b; + /* pixman_color_t and xRenderColor have the same layout */ + pixman_color_t *color = (pixman_color_t *)&solid->fullcolor; - a = (solid->color & 0xff000000) >> 24; - r = (solid->color & 0x00ff0000) >> 16; - g = (solid->color & 0x0000ff00) >> 8; - b = (solid->color & 0x000000ff) >> 0; - - color.alpha = (a << 8) | a; - color.red = (r << 8) | r; - color.green = (g << 8) | g; - color.blue = (b << 8) | b; - - return pixman_image_create_solid_fill(&color); + return pixman_image_create_solid_fill(color); } static pixman_image_t * diff --git a/xserver/fb/fbpict.h b/xserver/fb/fbpict.h index 5cb866368..201ea092e 100644 --- a/xserver/fb/fbpict.h +++ b/xserver/fb/fbpict.h @@ -30,7 +30,6 @@ /* fbpict.c */ extern _X_EXPORT void - fbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, @@ -43,21 +42,17 @@ fbComposite(CARD8 op, /* fbtrap.c */ extern _X_EXPORT void - fbAddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntrap, xTrap * traps); extern _X_EXPORT void - fbRasterizeTrapezoid(PicturePtr alpha, xTrapezoid * trap, int x_off, int y_off); extern _X_EXPORT void - fbAddTriangles(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntri, xTriangle * tris); extern _X_EXPORT void - fbTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, diff --git a/xserver/fb/fbpixmap.c b/xserver/fb/fbpixmap.c index 951a92574..a524200dc 100644 --- a/xserver/fb/fbpixmap.c +++ b/xserver/fb/fbpixmap.c @@ -29,14 +29,15 @@ #include "fb.h" PixmapPtr -fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, - unsigned usage_hint) +fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) { PixmapPtr pPixmap; size_t datasize; size_t paddedWidth; int adjust; int base; + int bpp = BitsPerPixel(depth); paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || height > 32767) @@ -85,18 +86,6 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, return pPixmap; } -PixmapPtr -fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, - unsigned usage_hint) -{ - int bpp; - - bpp = BitsPerPixel(depth); - if (bpp == 32 && depth <= 24) - bpp = fbGetScreenPrivate(pScreen)->pix32bpp; - return fbCreatePixmapBpp(pScreen, width, height, depth, bpp, usage_hint); -} - Bool fbDestroyPixmap(PixmapPtr pPixmap) { diff --git a/xserver/fb/fbpoint.c b/xserver/fb/fbpoint.c index be7c801d5..d4c95eea7 100644 --- a/xserver/fb/fbpoint.c +++ b/xserver/fb/fbpoint.c @@ -61,33 +61,13 @@ fbDots(FbBits * dstOrig, y = pts->y + yorg; pts++; if (x1 <= x && x < x2 && y1 <= y && y < y2) { + FbStip mask; x = (x + xoff) * dstBpp; d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT); x &= FB_STIP_MASK; - if (dstBpp == 24) { - FbStip leftMask, rightMask; - int n, rot; - FbStip andT, xorT; - rot = FbFirst24Rot(x); - andT = FbRot24Stip(and, rot); - xorT = FbRot24Stip(xor, rot); - FbMaskStip(x, 24, leftMask, n, rightMask); - if (leftMask) { - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); - andT = FbNext24Stip(andT); - xorT = FbNext24Stip(xorT); - d++; - } - if (rightMask) - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); - } - else { - FbStip mask; - - mask = FbStipMask(x, dstBpp); - WRITE(d, FbDoMaskRRop(READ(d), and, xor, mask)); - } + mask = FbStipMask(x, dstBpp); + WRITE(d, FbDoMaskRRop(READ(d), and, xor, mask)); } } } @@ -131,9 +111,6 @@ fbPolyPoint(DrawablePtr pDrawable, case 16: dots = fbDots16; break; - case 24: - dots = fbDots24; - break; case 32: dots = fbDots32; break; diff --git a/xserver/fb/fbscreen.c b/xserver/fb/fbscreen.c index 71bcc5d30..4ab807ab5 100644 --- a/xserver/fb/fbscreen.c +++ b/xserver/fb/fbscreen.c @@ -135,20 +135,13 @@ fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ #ifdef FB_ACCESS_WRAPPER Bool -wfbFinishScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, - int ysize, - int dpix, - int dpiy, - int width, - int bpp, +wfbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, + int dpix, int dpiy, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap) #else Bool -fbFinishScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, int ysize, int dpix, int dpiy, int width, int bpp) +fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, + int dpix, int dpiy, int width, int bpp) #endif { VisualPtr visuals; @@ -157,7 +150,6 @@ fbFinishScreenInit(ScreenPtr pScreen, int ndepths; int rootdepth; VisualID defaultVisual; - int imagebpp = bpp; #ifdef FB_DEBUG int stride; @@ -169,43 +161,16 @@ fbFinishScreenInit(ScreenPtr pScreen, fbSetBits((FbStip *) ((char *) pbits + stride * ysize), stride / sizeof(FbStip), FB_TAIL_BITS); #endif - /* - * By default, a 24bpp screen will use 32bpp images, this avoids - * problems with many applications which just can't handle packed - * pixels. If you want real 24bit images, include a 24bpp - * format in the pixmap formats - */ - if (bpp == 24) { - int f; - - imagebpp = 32; - /* - * Check to see if we're advertising a 24bpp image format, - * in which case windows will use it in preference to a 32 bit - * format. - */ - for (f = 0; f < screenInfo.numPixmapFormats; f++) { - if (screenInfo.formats[f].bitsPerPixel == 24) { - imagebpp = 24; - break; - } - } - } - if (imagebpp == 32) { - fbGetScreenPrivate(pScreen)->win32bpp = bpp; - fbGetScreenPrivate(pScreen)->pix32bpp = bpp; - } - else { - fbGetScreenPrivate(pScreen)->win32bpp = 32; - fbGetScreenPrivate(pScreen)->pix32bpp = 32; - } + /* fb requires power-of-two bpp */ + if (Ones(bpp) != 1) + return FALSE; #ifdef FB_ACCESS_WRAPPER fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; #endif rootdepth = 0; if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth, - &defaultVisual, ((unsigned long) 1 << (imagebpp - 1)), + &defaultVisual, ((unsigned long) 1 << (bpp - 1)), 8)) return FALSE; if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, @@ -214,24 +179,15 @@ fbFinishScreenInit(ScreenPtr pScreen, return FALSE; /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbCloseScreen; - if (bpp == 24 && imagebpp == 32) { - pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; - pScreen->CreateScreenResources = fb24_32CreateScreenResources; - } return TRUE; } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ #ifdef FB_ACCESS_WRAPPER Bool -wfbScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, - int ysize, - int dpix, - int dpiy, - int width, - int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap) +wfbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, + int dpix, int dpiy, int width, int bpp, + SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap) { if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) return FALSE; @@ -242,9 +198,8 @@ wfbScreenInit(ScreenPtr pScreen, } #else Bool -fbScreenInit(ScreenPtr pScreen, - void *pbits, - int xsize, int ysize, int dpix, int dpiy, int width, int bpp) +fbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, + int dpix, int dpiy, int width, int bpp) { if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) return FALSE; diff --git a/xserver/fb/fbseg.c b/xserver/fb/fbseg.c index c3c196ab4..6c3d69363 100644 --- a/xserver/fb/fbseg.c +++ b/xserver/fb/fbseg.c @@ -279,157 +279,6 @@ fbBresFillDash(DrawablePtr pDrawable, fbSetFg(pDrawable, pGC, fg); } -static void -fbBresSolid24RRop(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, - int axis, int x1, int y1, int e, int e1, int e3, int len) -{ - FbStip *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); - FbStip and = pPriv->and; - FbStip xor = pPriv->xor; - FbStip leftMask, rightMask; - int nl; - FbStip *d; - int x; - int rot; - FbStip andT, xorT; - - fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - dst += ((y1 + dstYoff) * dstStride); - x1 = (x1 + dstXoff) * 24; - if (signdy < 0) - dstStride = -dstStride; - signdx *= 24; - while (len--) { - d = dst + (x1 >> FB_STIP_SHIFT); - x = x1 & FB_STIP_MASK; - rot = FbFirst24Rot(x); - andT = FbRot24Stip(and, rot); - xorT = FbRot24Stip(xor, rot); - FbMaskStip(x, 24, leftMask, nl, rightMask); - if (leftMask) { - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); - d++; - andT = FbNext24Stip(andT); - xorT = FbNext24Stip(xorT); - } - if (rightMask) - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); - if (axis == X_AXIS) { - x1 += signdx; - e += e1; - if (e >= 0) { - e += e3; - dst += dstStride; - } - } - else { - dst += dstStride; - e += e1; - if (e >= 0) { - e += e3; - x1 += signdx; - } - } - } - - fbFinishAccess(pDrawable); -} - -static void -fbBresDash24RRop(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, - int axis, int x1, int y1, int e, int e1, int e3, int len) -{ - FbStip *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); - FbStip andT, xorT; - FbStip fgand = pPriv->and; - FbStip fgxor = pPriv->xor; - FbStip bgand = pPriv->bgand; - FbStip bgxor = pPriv->bgxor; - FbStip leftMask, rightMask; - int nl; - FbStip *d; - int x; - int rot; - - FbDashDeclare; - int dashlen; - Bool even; - Bool doOdd; - - fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - doOdd = pGC->lineStyle == LineDoubleDash; - - /* compute current dash position */ - FbDashInit(pGC, pPriv, dashOffset, dashlen, even); - - dst += ((y1 + dstYoff) * dstStride); - x1 = (x1 + dstXoff) * 24; - if (signdy < 0) - dstStride = -dstStride; - signdx *= 24; - while (len--) { - if (even || doOdd) { - if (even) { - andT = fgand; - xorT = fgxor; - } - else { - andT = bgand; - xorT = bgxor; - } - d = dst + (x1 >> FB_STIP_SHIFT); - x = x1 & FB_STIP_MASK; - rot = FbFirst24Rot(x); - andT = FbRot24Stip(andT, rot); - xorT = FbRot24Stip(xorT, rot); - FbMaskStip(x, 24, leftMask, nl, rightMask); - if (leftMask) { - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); - d++; - andT = FbNext24Stip(andT); - xorT = FbNext24Stip(xorT); - } - if (rightMask) - WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); - } - if (axis == X_AXIS) { - x1 += signdx; - e += e1; - if (e >= 0) { - e += e3; - dst += dstStride; - } - } - else { - dst += dstStride; - e += e1; - if (e >= 0) { - e += e3; - x1 += signdx; - } - } - FbDashStep(dashlen, even); - } - - fbFinishAccess(pDrawable); -} - /* * For drivers that want to bail drawing some lines, this * function takes care of selecting the appropriate rasterizer @@ -447,8 +296,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) bres = fbBresFill; if (pGC->fillStyle == FillSolid) { bres = fbBresSolid; - if (dstBpp == 24) - bres = fbBresSolid24RRop; if (pPriv->and == 0) { switch (dstBpp) { case 8: @@ -457,9 +304,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) case 16: bres = fbBresSolid16; break; - case 24: - bres = fbBresSolid24; - break; case 32: bres = fbBresSolid32; break; @@ -471,8 +315,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) bres = fbBresFillDash; if (pGC->fillStyle == FillSolid) { bres = fbBresDash; - if (dstBpp == 24) - bres = fbBresDash24RRop; if (pPriv->and == 0 && (pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0)) { switch (dstBpp) { @@ -482,9 +324,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) case 16: bres = fbBresDash16; break; - case 24: - bres = fbBresDash24; - break; case 32: bres = fbBresDash32; break; diff --git a/xserver/fb/fbsetsp.c b/xserver/fb/fbsetsp.c index e09d2e3f3..fe94e283c 100644 --- a/xserver/fb/fbsetsp.c +++ b/xserver/fb/fbsetsp.c @@ -42,10 +42,6 @@ fbSetSpans(DrawablePtr pDrawable, int xoff; int x1, x2; - if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { - fb24_32SetSpans(pDrawable, pGC, src, ppt, pwidth, nspans, fSorted); - return; - } fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nspans--) { d = dst + (ppt->y + dstYoff) * dstStride; diff --git a/xserver/fb/fbsolid.c b/xserver/fb/fbsolid.c index cad286a43..1ee165950 100644 --- a/xserver/fb/fbsolid.c +++ b/xserver/fb/fbsolid.c @@ -37,10 +37,6 @@ fbSolid(FbBits * dst, int n, nmiddle; int startbyte, endbyte; - if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor))) { - fbSolid24(dst, dstStride, dstX, width, height, and, xor); - return; - } dst += dstX >> FB_SHIFT; dstX &= FB_MASK; FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte, @@ -67,113 +63,3 @@ fbSolid(FbBits * dst, dst += dstStride; } } - -void -fbSolid24(FbBits * dst, - FbStride dstStride, - int dstX, int width, int height, FbBits and, FbBits xor) -{ - FbBits startmask, endmask; - FbBits xor0 = 0, xor1 = 0, xor2 = 0; - FbBits and0 = 0, and1 = 0, and2 = 0; - FbBits xorS = 0, andS = 0, xorE = 0, andE = 0; - int n, nmiddle; - int rotS, rot; - - dst += dstX >> FB_SHIFT; - dstX &= FB_MASK; - /* - * Rotate pixel values this far across the word to align on - * screen pixel boundaries - */ - rot = FbFirst24Rot(dstX); - FbMaskBits(dstX, width, startmask, nmiddle, endmask); - if (startmask) - dstStride--; - dstStride -= nmiddle; - - /* - * Precompute rotated versions of the rasterop values - */ - rotS = rot; - xor = FbRot24(xor, rotS); - and = FbRot24(and, rotS); - if (startmask) { - xorS = xor; - andS = and; - xor = FbNext24Pix(xor); - and = FbNext24Pix(and); - } - - if (nmiddle) { - xor0 = xor; - and0 = and; - xor1 = FbNext24Pix(xor0); - and1 = FbNext24Pix(and0); - xor2 = FbNext24Pix(xor1); - and2 = FbNext24Pix(and1); - } - - if (endmask) { - switch (nmiddle % 3) { - case 0: - xorE = xor; - andE = and; - break; - case 1: - xorE = xor1; - andE = and1; - break; - case 2: - xorE = xor2; - andE = and2; - break; - } - } - - while (height--) { - if (startmask) { - WRITE(dst, FbDoMaskRRop(READ(dst), andS, xorS, startmask)); - dst++; - } - n = nmiddle; - if (!and0) { - while (n >= 3) { - WRITE(dst++, xor0); - WRITE(dst++, xor1); - WRITE(dst++, xor2); - n -= 3; - } - if (n) { - WRITE(dst++, xor0); - n--; - if (n) { - WRITE(dst++, xor1); - } - } - } - else { - while (n >= 3) { - WRITE(dst, FbDoRRop(READ(dst), and0, xor0)); - dst++; - WRITE(dst, FbDoRRop(READ(dst), and1, xor1)); - dst++; - WRITE(dst, FbDoRRop(READ(dst), and2, xor2)); - dst++; - n -= 3; - } - if (n) { - WRITE(dst, FbDoRRop(READ(dst), and0, xor0)); - dst++; - n--; - if (n) { - WRITE(dst, FbDoRRop(READ(dst), and1, xor1)); - dst++; - } - } - } - if (endmask) - WRITE(dst, FbDoMaskRRop(READ(dst), andE, xorE, endmask)); - dst += dstStride; - } -} diff --git a/xserver/fb/fbwindow.c b/xserver/fb/fbwindow.c index 7a5fac869..fca871d62 100644 --- a/xserver/fb/fbwindow.c +++ b/xserver/fb/fbwindow.c @@ -33,9 +33,6 @@ fbCreateWindow(WindowPtr pWin) { dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin), fbGetScreenPixmap(pWin->drawable.pScreen)); - if (pWin->drawable.bitsPerPixel == 32 && pWin->drawable.depth <= 24) - pWin->drawable.bitsPerPixel = - fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; return TRUE; } @@ -136,13 +133,6 @@ fbFixupWindowPixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap) { PixmapPtr pPixmap = *ppPixmap; - if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { - pPixmap = fb24_32ReformatTile(pPixmap, pDrawable->bitsPerPixel); - if (!pPixmap) - return; - (*pDrawable->pScreen->DestroyPixmap) (*ppPixmap); - *ppPixmap = pPixmap; - } if (FbEvenTile(pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel)) fbPadPixmap(pPixmap); } diff --git a/xserver/fb/wfbrename.h b/xserver/fb/wfbrename.h index baa80f8bb..ffdcbed96 100644 --- a/xserver/fb/wfbrename.h +++ b/xserver/fb/wfbrename.h @@ -1,35 +1,22 @@ -#define fb24_32CopyMtoN wfb24_32CopyMtoN -#define fb24_32CreateScreenResources wfb24_32CreateScreenResources -#define fb24_32GetImage wfb24_32GetImage -#define fb24_32GetSpans wfb24_32GetSpans -#define fb24_32ModifyPixmapHeader wfb24_32ModifyPixmapHeader -#define fb24_32PutZImage wfb24_32PutZImage -#define fb24_32ReformatTile wfb24_32ReformatTile -#define fb24_32SetSpans wfb24_32SetSpans #define fbAddTraps wfbAddTraps #define fbAddTriangles wfbAddTriangles #define fbAllocatePrivates wfbAllocatePrivates #define fbArc16 wfbArc16 -#define fbArc24 wfbArc24 #define fbArc32 wfbArc32 #define fbArc8 wfbArc8 #define fbBlt wfbBlt -#define fbBlt24 wfbBlt24 #define fbBltOne wfbBltOne -#define fbBltOne24 wfbBltOne24 #define fbBltPlane wfbBltPlane #define fbBltStip wfbBltStip #define fbBres wfbBres #define fbBresDash wfbBresDash #define fbBresDash16 wfbBresDash16 -#define fbBresDash24 wfbBresDash24 #define fbBresDash32 wfbBresDash32 #define fbBresDash8 wfbBresDash8 #define fbBresFill wfbBresFill #define fbBresFillDash wfbBresFillDash #define fbBresSolid wfbBresSolid #define fbBresSolid16 wfbBresSolid16 -#define fbBresSolid24 wfbBresSolid24 #define fbBresSolid32 wfbBresSolid32 #define fbBresSolid8 wfbBresSolid8 #define fbChangeWindowAttributes wfbChangeWindowAttributes @@ -47,7 +34,6 @@ #define fbCreateDefColormap wfbCreateDefColormap #define fbCreateGC wfbCreateGC #define fbCreatePixmap wfbCreatePixmap -#define fbCreatePixmapBpp wfbCreatePixmapBpp #define fbCreateWindow wfbCreateWindow #define fbDestroyGlyphCache wfbDestroyGlyphCache #define fbDestroyPixmap wfbDestroyPixmap @@ -55,7 +41,6 @@ #define fbDoCopy wfbDoCopy #define fbDots wfbDots #define fbDots16 wfbDots16 -#define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 #define fbExpandDirectColors wfbExpandDirectColors @@ -71,10 +56,9 @@ #define fbGetSpans wfbGetSpans #define _fbGetWindowPixmap _wfbGetWindowPixmap #define fbGlyph16 wfbGlyph16 -#define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 #define fbGlyph8 wfbGlyph8 -#define fbHasVisualTypes wfbHasVisualTypes +#define fbGlyphs wfbGlyphs #define fbImageGlyphBlt wfbImageGlyphBlt #define fbIn wfbIn #define fbInitializeColormap wfbInitializeColormap @@ -82,7 +66,6 @@ #define fbListInstalledColormaps wfbListInstalledColormaps #define FbMergeRopBits wFbMergeRopBits #define fbOver wfbOver -#define fbOver24 wfbOver24 #define fbOverlayCloseScreen wfbOverlayCloseScreen #define fbOverlayCopyWindow wfbOverlayCopyWindow #define fbOverlayCreateScreenResources wfbOverlayCreateScreenResources @@ -103,13 +86,11 @@ #define fbPolyGlyphBlt wfbPolyGlyphBlt #define fbPolyLine wfbPolyLine #define fbPolyline16 wfbPolyline16 -#define fbPolyline24 wfbPolyline24 #define fbPolyline32 wfbPolyline32 #define fbPolyline8 wfbPolyline8 #define fbPolyPoint wfbPolyPoint #define fbPolySegment wfbPolySegment #define fbPolySegment16 wfbPolySegment16 -#define fbPolySegment24 wfbPolySegment24 #define fbPolySegment32 wfbPolySegment32 #define fbPolySegment8 wfbPolySegment8 #define fbPositionWindow wfbPositionWindow @@ -134,7 +115,6 @@ #define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks #define _fbSetWindowPixmap _wfbSetWindowPixmap #define fbSolid wfbSolid -#define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles diff --git a/xserver/glamor/Makefile.am b/xserver/glamor/Makefile.am index 8c79994e0..aaf0aab17 100644 --- a/xserver/glamor/Makefile.am +++ b/xserver/glamor/Makefile.am @@ -56,6 +56,7 @@ endif libglamor_egl_stubs_la_SOURCES = \ glamor_egl_stubs.c \ + glamor_egl_ext.h \ glamor_egl.h sdk_HEADERS = glamor.h diff --git a/xserver/glamor/Makefile.in b/xserver/glamor/Makefile.in index aad01ca4c..21bdbc6e8 100644 --- a/xserver/glamor/Makefile.in +++ b/xserver/glamor/Makefile.in @@ -72,7 +72,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -371,6 +371,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -389,15 +390,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -405,6 +409,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -476,8 +482,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -561,6 +565,7 @@ libglamor_la_SOURCES = glamor.c glamor_context.h glamor_copy.c \ glamor_sync.c glamor.h $(am__append_1) libglamor_egl_stubs_la_SOURCES = \ glamor_egl_stubs.c \ + glamor_egl_ext.h \ glamor_egl.h sdk_HEADERS = glamor.h diff --git a/xserver/glamor/glamor.c b/xserver/glamor/glamor.c index 2467443e0..b1c7d9f13 100644 --- a/xserver/glamor/glamor.c +++ b/xserver/glamor/glamor.c @@ -32,6 +32,7 @@ */ #include +#include #include "glamor_priv.h" #include "mipict.h" @@ -40,6 +41,19 @@ DevPrivateKeyRec glamor_screen_private_key; DevPrivateKeyRec glamor_pixmap_private_key; DevPrivateKeyRec glamor_gc_private_key; +glamor_screen_private * +glamor_get_screen_private(ScreenPtr screen) +{ + return (glamor_screen_private *) + dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); +} + +void +glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) +{ + dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); +} + /** * glamor_get_drawable_pixmap() returns a backing pixmap for a given drawable. * @@ -114,20 +128,6 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) glamor_pixmap_attach_fbo(pixmap, fbo); } -void -glamor_set_screen_pixmap(PixmapPtr screen_pixmap, PixmapPtr *back_pixmap) -{ - glamor_pixmap_private *pixmap_priv; - glamor_screen_private *glamor_priv; - - glamor_priv = glamor_get_screen_private(screen_pixmap->drawable.pScreen); - pixmap_priv = glamor_get_pixmap_private(screen_pixmap); - glamor_priv->screen_fbo = pixmap_priv->fbo->fb; - - pixmap_priv->fbo->width = screen_pixmap->drawable.width; - pixmap_priv->fbo->height = screen_pixmap->drawable.height; -} - uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap) { @@ -136,6 +136,9 @@ glamor_get_pixmap_texture(PixmapPtr pixmap) if (!pixmap_priv) return 0; + if (!pixmap_priv->fbo) + return 0; + if (pixmap_priv->type != GLAMOR_TEXTURE_ONLY) return 0; @@ -197,9 +200,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, w <= glamor_priv->glyph_max_dim && h <= glamor_priv->glyph_max_dim) || (w == 0 && h == 0) - || !glamor_check_pixmap_fbo_depth(depth)) - || (!GLAMOR_TEXTURED_LARGE_PIXMAP && - !glamor_check_fbo_size(glamor_priv, w, h))) + || !glamor_check_pixmap_fbo_depth(depth))) return fbCreatePixmap(screen, w, h, depth, usage); else pixmap = fbCreatePixmap(screen, 0, 0, depth, usage); @@ -349,25 +350,6 @@ fallback: } -/** - * Creates any pixmaps used internally by glamor, since those can't be - * allocated at ScreenInit time. - */ -static Bool -glamor_create_screen_resources(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - Bool ret = TRUE; - - screen->CreateScreenResources = - glamor_priv->saved_procs.create_screen_resources; - if (screen->CreateScreenResources) - ret = screen->CreateScreenResources(screen); - screen->CreateScreenResources = glamor_create_screen_resources; - - return ret; -} - static Bool glamor_check_instruction_count(int gl_version) { @@ -584,6 +566,14 @@ glamor_init(ScreenPtr screen, unsigned int flags) if (!glamor_check_instruction_count(gl_version)) goto fail; + + /* Glamor rendering assumes that platforms with GLSL 130+ + * have instanced arrays, but this is not always the case. + * etnaviv offers GLSL 140 with OpenGL 2.1. + */ + if (glamor_priv->glsl_version >= 130 && + !epoxy_has_gl_extension("GL_ARB_instanced_arrays")) + glamor_priv->glsl_version = 120; } else { if (gl_version < 20) { ErrorF("Require Open GLES2.0 or later.\n"); @@ -601,6 +591,12 @@ glamor_init(ScreenPtr screen, unsigned int flags) } } + if (!epoxy_has_gl_extension("GL_ARB_vertex_array_object") && + !epoxy_has_gl_extension("GL_OES_vertex_array_object")) { + ErrorF("GL_{ARB,OES}_vertex_array_object required\n"); + goto fail; + } + glamor_priv->has_rw_pbo = FALSE; if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) glamor_priv->has_rw_pbo = TRUE; @@ -615,6 +611,8 @@ glamor_init(ScreenPtr screen, unsigned int flags) epoxy_has_gl_extension("GL_EXT_map_buffer_range"); glamor_priv->has_buffer_storage = epoxy_has_gl_extension("GL_ARB_buffer_storage"); + glamor_priv->has_mesa_tile_raster_order = + epoxy_has_gl_extension("GL_MESA_tile_raster_order"); glamor_priv->has_nv_texture_barrier = epoxy_has_gl_extension("GL_NV_texture_barrier"); glamor_priv->has_unpack_subimage = @@ -625,8 +623,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP || epoxy_gl_version() >= 30 || epoxy_has_gl_extension("GL_NV_pack_subimage"); - glamor_priv->has_vertex_array_object = - epoxy_has_gl_extension("GL_ARB_vertex_array_object"); glamor_priv->has_dual_blend = epoxy_has_gl_extension("GL_ARB_blend_func_extended"); @@ -666,10 +662,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_set_debug_level(&glamor_debug_level); - glamor_priv->saved_procs.create_screen_resources = - screen->CreateScreenResources; - screen->CreateScreenResources = glamor_create_screen_resources; - if (!glamor_font_init(screen)) goto fail; @@ -722,10 +714,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) ps->Glyphs = glamor_composite_glyphs; glamor_init_vbo(screen); - -#ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); -#endif glamor_pixmap_init(screen); glamor_sync_init(screen); @@ -768,8 +757,6 @@ glamor_close_screen(ScreenPtr screen) glamor_sync_close(screen); glamor_composite_glyphs_fini(screen); screen->CloseScreen = glamor_priv->saved_procs.close_screen; - screen->CreateScreenResources = - glamor_priv->saved_procs.create_screen_resources; screen->CreateGC = glamor_priv->saved_procs.create_gc; screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap; @@ -817,29 +804,91 @@ glamor_supports_pixmap_import_export(ScreenPtr screen) return glamor_priv->dri3_enabled; } -_X_EXPORT int -glamor_fd_from_pixmap(ScreenPtr screen, - PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +_X_EXPORT void +glamor_set_drawable_modifiers_func(ScreenPtr screen, + GetDrawableModifiersFuncPtr func) +{ + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + + glamor_priv->get_drawable_modifiers = func; +} + +_X_EXPORT Bool +glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ + struct glamor_screen_private *glamor_priv = + glamor_get_screen_private(draw->pScreen); + + if (glamor_priv->get_drawable_modifiers) { + return glamor_priv->get_drawable_modifiers(draw, format, + num_modifiers, modifiers); + } + *num_modifiers = 0; + *modifiers = NULL; + return TRUE; +} + +static int +_glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + CARD32 *size, uint64_t *modifier) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); if (!glamor_priv->dri3_enabled) - return -1; + return 0; switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: - if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) - return -1; - return glamor_egl_dri3_fd_name_from_tex(screen, - pixmap, - pixmap_priv->fbo->tex, - FALSE, stride, size); + if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? + GL_RGB10_A2 : GL_RGBA, 0)) + return 0; + + if (modifier) { + return glamor_egl_fds_from_pixmap(screen, pixmap, fds, + strides, offsets, + modifier); + } else { + CARD16 stride; + + fds[0] = glamor_egl_fd_from_pixmap(screen, pixmap, &stride, size); + strides[0] = stride; + + return fds[0] >= 0; + } default: break; } - return -1; + return 0; +} + +_X_EXPORT int +glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) +{ + return _glamor_fds_from_pixmap(screen, pixmap, fds, strides, offsets, + NULL, modifier); +} + +_X_EXPORT int +glamor_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +{ + int fd; + int ret; + uint32_t stride32; + + ret = _glamor_fds_from_pixmap(screen, pixmap, &fd, &stride32, NULL, size, + NULL); + if (ret != 1) + return -1; + + *stride = stride32; + return fd; } _X_EXPORT int @@ -856,9 +905,10 @@ glamor_shareable_fd_from_pixmap(ScreenPtr screen, * 2 of those calls are also exported API, so we cannot just add a flag. */ pixmap->usage_hint = CREATE_PIXMAP_USAGE_SHARED; - ret = glamor_fd_from_pixmap(screen, pixmap, stride, size); - pixmap->usage_hint = orig_usage_hint; + ret = glamor_fd_from_pixmap(screen, pixmap, stride, size); + + pixmap->usage_hint = orig_usage_hint; return ret; } @@ -870,12 +920,11 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: - if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) + if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? + GL_RGB10_A2 : GL_RGBA, 0)) return -1; - return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen, - pixmap, - pixmap_priv->fbo->tex, - TRUE, stride, size); + return glamor_egl_fd_name_from_pixmap(pixmap->drawable.pScreen, + pixmap, stride, size); default: break; } diff --git a/xserver/glamor/glamor.h b/xserver/glamor/glamor.h index bdd2374cf..09e9c895c 100644 --- a/xserver/glamor/glamor.h +++ b/xserver/glamor/glamor.h @@ -60,6 +60,11 @@ typedef enum glamor_pixmap_type { GLAMOR_TEXTURE_ONLY, } glamor_pixmap_type_t; +typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw, + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); + #define GLAMOR_EGL_EXTERNAL_BUFFER 3 #define GLAMOR_USE_EGL_SCREEN (1 << 0) #define GLAMOR_NO_DRI3 (1 << 1) @@ -103,12 +108,6 @@ extern _X_EXPORT void glamor_fini(ScreenPtr screen); * Otherwise, the glamor internal structure will not be freed.*/ extern _X_EXPORT Bool glamor_close_screen(ScreenPtr screen); -/* Let glamor to know the screen's fbo. The low level - * driver should already assign a tex - * to this pixmap through the set_pixmap_texture. */ -extern _X_EXPORT void glamor_set_screen_pixmap(PixmapPtr screen_pixmap, - PixmapPtr *back_pixmap); - extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap); extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, @@ -142,17 +141,20 @@ extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back); -/* The DDX is not supposed to call these three functions */ +/* The DDX is not supposed to call these four functions */ extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen); -extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, - unsigned int, Bool, - CARD16 *, CARD32 *); +extern _X_EXPORT int glamor_egl_fds_from_pixmap(ScreenPtr, PixmapPtr, int *, + uint32_t *, uint32_t *, + uint64_t *); +extern _X_EXPORT int glamor_egl_fd_name_from_pixmap(ScreenPtr, PixmapPtr, + CARD16 *, CARD32 *); extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen); +extern _X_EXPORT int glamor_egl_fd_from_pixmap(ScreenPtr, PixmapPtr, CARD16 *, CARD32 *); /* @glamor_supports_pixmap_import_export: Returns whether - * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and - * glamor_pixmap_from_fd() are supported. + * glamor_fds_from_pixmap(), glamor_name_from_pixmap(), and + * glamor_pixmap_from_fds() are supported. * * @screen: Current screen pointer. * @@ -161,11 +163,27 @@ extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen); * * The EGL layer needs to have the following extensions working: * - * .EGL_KHR_gl_texture_2D_image - * .EGL_EXT_image_dma_buf_import + * .EGL_KHR_surfaceless_context * */ extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen); +/* @glamor_fds_from_pixmap: Get a dma-buf fd from a pixmap. + * + * @screen: Current screen pointer. + * @pixmap: The pixmap from which we want the fd. + * @fds, @strides, @offsets: Pointers to fill info of each plane. + * @modifier: Pointer to fill the modifier of the buffer. + * + * the pixmap and the buffer associated by the fds will share the same + * content. The caller is responsible to close the returned file descriptors. + * Returns the number of planes, -1 on error. + * */ +extern _X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier); + /* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap. * * @screen: Current screen pointer. @@ -231,6 +249,31 @@ extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap, extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap); +/* @glamor_pixmap_from_fds: Creates a pixmap to wrap a dma-buf fds. + * + * @screen: Current screen pointer. + * @num_fds: Number of fds to import + * @fds: The dma-buf fds to import. + * @width: The width of the buffers. + * @height: The height of the buffers. + * @stride: The stride of the buffers. + * @depth: The depth of the buffers. + * @bpp: The bpp of the buffers. + * @modifier: The modifier of the buffers. + * + * Returns a valid pixmap if the import succeeded, else NULL. + * */ +extern _X_EXPORT PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen, + CARD8 num_fds, + const int *fds, + CARD16 width, + CARD16 height, + const CARD32 *strides, + const CARD32 *offsets, + CARD8 depth, + CARD8 bpp, + uint64_t modifier); + /* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd. * * @screen: Current screen pointer. @@ -239,7 +282,7 @@ extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen, * @height: The height of the buffer. * @stride: The stride of the buffer. * @depth: The depth of the buffer. - * @bpp: The number of bpp of the buffer. + * @bpp: The bpp of the buffer. * * Returns a valid pixmap if the import succeeded, else NULL. * */ @@ -270,6 +313,24 @@ extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap, CARD16 stride, CARD8 depth, CARD8 bpp); + +extern _X_EXPORT Bool glamor_get_formats(ScreenPtr screen, + CARD32 *num_formats, + CARD32 **formats); + +extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen, + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); + +extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw, + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); + +extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen, + GetDrawableModifiersFuncPtr func); + #ifdef GLAMOR_FOR_XORG #define GLAMOR_EGL_MODULE_NAME "glamoregl" @@ -299,17 +360,11 @@ extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen); extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride); -/* @glamor_egl_create_textured_screen_ext: - * - * extent one parameter to track the pointer of the DDX layer's back pixmap. - * We need this pointer during the closing screen stage. As before back to - * the DDX's close screen, we have to free all the glamor related resources. +/* Obsolete entrypoint, temporarily left here for API compatibility + * for xf86-video-ati. */ -extern _X_EXPORT Bool glamor_egl_create_textured_screen_ext(ScreenPtr screen, - int handle, - int stride, - PixmapPtr - *back_pixmap); +#define glamor_egl_create_textured_screen_ext(a, b, c, d) \ + glamor_egl_create_textured_screen(a, b, c) /* * @glamor_egl_create_textured_pixmap: Try to create a textured pixmap from @@ -337,7 +392,8 @@ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, */ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, - struct gbm_bo *bo); + struct gbm_bo *bo, + Bool used_modifiers); #endif diff --git a/xserver/glamor/glamor_copy.c b/xserver/glamor/glamor_copy.c index ed96b2b1e..e050c0220 100644 --- a/xserver/glamor/glamor_copy.c +++ b/xserver/glamor/glamor_copy.c @@ -78,6 +78,15 @@ use_copyplane(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg) /* XXX handle 2 10 10 10 and 1555 formats; presumably the pixmap private knows this? */ switch (args->src_pixmap->drawable.depth) { + case 30: + glUniform4ui(prog->bitplane_uniform, + (args->bitplane >> 20) & 0x3ff, + (args->bitplane >> 10) & 0x3ff, + (args->bitplane ) & 0x3ff, + 0); + + glUniform4f(prog->bitmul_uniform, 0x3ff, 0x3ff, 0x3ff, 0); + break; case 24: glUniform4ui(prog->bitplane_uniform, (args->bitplane >> 16) & 0xff, @@ -180,7 +189,7 @@ glamor_copy_bail(DrawablePtr src, } /** - * Implements CopyPlane and CopyArea from the GPU to the GPU by using + * Implements CopyPlane and CopyArea from the CPU to the GPU by using * the source as a texture and painting that into the destination. * * This requires that source and dest are different textures, or that @@ -203,10 +212,6 @@ glamor_copy_cpu_fbo(DrawablePtr src, ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); - FbBits *src_bits; - FbStride src_stride; - int src_bpp; - int src_xoff, src_yoff; int dst_xoff, dst_yoff; if (gc && gc->alu != GXcopy) @@ -221,33 +226,43 @@ glamor_copy_cpu_fbo(DrawablePtr src, glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); if (bitplane) { - PixmapPtr src_pix = fbCreatePixmap(screen, dst_pixmap->drawable.width, + FbBits *tmp_bits; + FbStride tmp_stride; + int tmp_bpp; + int tmp_xoff, tmp_yoff; + + PixmapPtr tmp_pix = fbCreatePixmap(screen, dst_pixmap->drawable.width, dst_pixmap->drawable.height, dst->depth, 0); - if (!src_pix) { + if (!tmp_pix) { glamor_finish_access(src); goto bail; } - src_pix->drawable.x = dst_xoff; - src_pix->drawable.y = dst_yoff; + tmp_pix->drawable.x = dst_xoff; + tmp_pix->drawable.y = dst_yoff; - fbGetDrawable(&src_pix->drawable, src_bits, src_stride, src_bpp, src_xoff, - src_yoff); + fbGetDrawable(&tmp_pix->drawable, tmp_bits, tmp_stride, tmp_bpp, tmp_xoff, + tmp_yoff); if (src->bitsPerPixel > 1) - fbCopyNto1(src, &src_pix->drawable, gc, box, nbox, dx, dy, + fbCopyNto1(src, &tmp_pix->drawable, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); else - fbCopy1toN(src, &src_pix->drawable, gc, box, nbox, dx, dy, + fbCopy1toN(src, &tmp_pix->drawable, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); - glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff, src_yoff, - dst_xoff, dst_yoff, (uint8_t *) src_bits, - src_stride * sizeof(FbBits)); - fbDestroyPixmap(src_pix); + glamor_upload_boxes(dst_pixmap, box, nbox, tmp_xoff, tmp_yoff, + dst_xoff, dst_yoff, (uint8_t *) tmp_bits, + tmp_stride * sizeof(FbBits)); + fbDestroyPixmap(tmp_pix); } else { + FbBits *src_bits; + FbStride src_stride; + int src_bpp; + int src_xoff, src_yoff; + fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, dst_xoff, dst_yoff, @@ -311,6 +326,13 @@ bail: return FALSE; } +/* Include the enums here for the moment, to keep from needing to bump epoxy. */ +#ifndef GL_TILE_RASTER_ORDER_FIXED_MESA +#define GL_TILE_RASTER_ORDER_FIXED_MESA 0x8BB8 +#define GL_TILE_RASTER_ORDER_INCREASING_X_MESA 0x8BB9 +#define GL_TILE_RASTER_ORDER_INCREASING_Y_MESA 0x8BBA +#endif + /* * Copy from GPU to GPU by using the source * as a texture and painting that into the destination @@ -345,6 +367,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, const glamor_facet *copy_facet; int n; Bool ret = FALSE; + BoxRec bounds = glamor_no_rendering_bounds(); glamor_make_current(glamor_priv); @@ -381,15 +404,34 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, v = glamor_get_vbo_space(dst->pScreen, nbox * 8 * sizeof (int16_t), &vbo_offset); + if (src_pixmap == dst_pixmap && glamor_priv->has_mesa_tile_raster_order) { + glEnable(GL_TILE_RASTER_ORDER_FIXED_MESA); + if (dx >= 0) + glEnable(GL_TILE_RASTER_ORDER_INCREASING_X_MESA); + else + glDisable(GL_TILE_RASTER_ORDER_INCREASING_X_MESA); + if (dy >= 0) + glEnable(GL_TILE_RASTER_ORDER_INCREASING_Y_MESA); + else + glDisable(GL_TILE_RASTER_ORDER_INCREASING_Y_MESA); + } + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 2 * sizeof (GLshort), vbo_offset); + if (nbox < 100) { + bounds = glamor_start_rendering_bounds(); + for (int i = 0; i < nbox; i++) + glamor_bounds_union_box(&bounds, &box[i]); + } + for (n = 0; n < nbox; n++) { v[0] = box->x1; v[1] = box->y1; v[2] = box->x1; v[3] = box->y2; v[4] = box->x2; v[5] = box->y2; v[6] = box->x2; v[7] = box->y1; + v += 8; box++; } @@ -411,15 +453,24 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, goto bail_ctx; glamor_pixmap_loop(dst_priv, dst_box_index) { + BoxRec scissor = { + .x1 = max(-args.dx, bounds.x1), + .y1 = max(-args.dy, bounds.y1), + .x2 = min(-args.dx + src_box->x2 - src_box->x1, bounds.x2), + .y2 = min(-args.dy + src_box->y2 - src_box->y1, bounds.y2), + }; + if (scissor.x1 >= scissor.x2 || scissor.y1 >= scissor.y2) + continue; + if (!glamor_set_destination_drawable(dst, dst_box_index, FALSE, FALSE, prog->matrix_uniform, &dst_off_x, &dst_off_y)) goto bail_ctx; - glScissor(dst_off_x - args.dx, - dst_off_y - args.dy, - src_box->x2 - src_box->x1, - src_box->y2 - src_box->y1); + glScissor(scissor.x1 + dst_off_x, + scissor.y1 + dst_off_y, + scissor.x2 - scissor.x1, + scissor.y2 - scissor.y1); glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox); } @@ -428,6 +479,9 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, ret = TRUE; bail_ctx: + if (src_pixmap == dst_pixmap && glamor_priv->has_mesa_tile_raster_order) { + glDisable(GL_TILE_RASTER_ORDER_FIXED_MESA); + } glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); @@ -588,34 +642,36 @@ glamor_copy_needs_temp(DrawablePtr src, if (!glamor_priv->has_nv_texture_barrier) return TRUE; - glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y); - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_off_x, &dst_off_y); + if (!glamor_priv->has_mesa_tile_raster_order) { + glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y); + glamor_get_drawable_deltas(dst, dst_pixmap, &dst_off_x, &dst_off_y); - bounds = box[0]; - for (n = 1; n < nbox; n++) { - bounds.x1 = min(bounds.x1, box[n].x1); - bounds.y1 = min(bounds.y1, box[n].y1); + bounds = box[0]; + for (n = 1; n < nbox; n++) { + bounds.x1 = min(bounds.x1, box[n].x1); + bounds.y1 = min(bounds.y1, box[n].y1); - bounds.x2 = max(bounds.x2, box[n].x2); - bounds.y2 = max(bounds.y2, box[n].y2); - } + bounds.x2 = max(bounds.x2, box[n].x2); + bounds.y2 = max(bounds.y2, box[n].y2); + } - /* Check to see if the pixmap-relative boxes overlap in both X and Y, - * in which case we can't rely on NV_texture_barrier and must - * make a temporary copy - * - * dst.x1 < src.x2 && - * src.x1 < dst.x2 && - * - * dst.y1 < src.y2 && - * src.y1 < dst.y2 - */ - if (bounds.x1 + dst_off_x < bounds.x2 + dx + src_off_x && - bounds.x1 + dx + src_off_x < bounds.x2 + dst_off_x && + /* Check to see if the pixmap-relative boxes overlap in both X and Y, + * in which case we can't rely on NV_texture_barrier and must + * make a temporary copy + * + * dst.x1 < src.x2 && + * src.x1 < dst.x2 && + * + * dst.y1 < src.y2 && + * src.y1 < dst.y2 + */ + if (bounds.x1 + dst_off_x < bounds.x2 + dx + src_off_x && + bounds.x1 + dx + src_off_x < bounds.x2 + dst_off_x && - bounds.y1 + dst_off_y < bounds.y2 + dy + src_off_y && - bounds.y1 + dy + src_off_y < bounds.y2 + dst_off_y) { - return TRUE; + bounds.y1 + dst_off_y < bounds.y2 + dy + src_off_y && + bounds.y1 + dy + src_off_y < bounds.y2 + dst_off_y) { + return TRUE; + } } glTextureBarrierNV(); diff --git a/xserver/glamor/glamor_core.c b/xserver/glamor/glamor_core.c index 7b2b39633..cb315e2d1 100644 --- a/xserver/glamor/glamor_core.c +++ b/xserver/glamor/glamor_core.c @@ -40,12 +40,9 @@ glamor_get_drawable_location(const DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_screen_private *glamor_priv = - glamor_get_screen_private(drawable->pScreen); + if (pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) return 'm'; - if (pixmap_priv->fbo->fb == glamor_priv->screen_fbo) - return 's'; else return 'f'; } @@ -200,43 +197,6 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable) * Preempt fbValidateGC by doing its work and masking the change out, so * that we can do the Prepare/finish_access. */ -#ifdef FB_24_32BIT - if ((changes & GCTile) && fbGetRotatedPixmap(gc)) { - gc->pScreen->DestroyPixmap(fbGetRotatedPixmap(gc)); - fbGetRotatedPixmap(gc) = 0; - } - - if (gc->fillStyle == FillTiled) { - PixmapPtr old_tile, new_tile; - - old_tile = gc->tile.pixmap; - if (old_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) { - new_tile = fbGetRotatedPixmap(gc); - if (!new_tile || - new_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) { - if (new_tile) - gc->pScreen->DestroyPixmap(new_tile); - /* fb24_32ReformatTile will do direct access of a newly- - * allocated pixmap. - */ - glamor_fallback - ("GC %p tile FB_24_32 transformat %p.\n", gc, old_tile); - - if (glamor_prepare_access - (&old_tile->drawable, GLAMOR_ACCESS_RO)) { - new_tile = - fb24_32ReformatTile(old_tile, drawable->bitsPerPixel); - glamor_finish_access(&old_tile->drawable); - } - } - if (new_tile) { - fbGetRotatedPixmap(gc) = old_tile; - gc->tile.pixmap = new_tile; - changes |= GCTile; - } - } - } -#endif if (changes & GCTile) { if (!gc->tileIsPixel) { glamor_pixmap_private *pixmap_priv = diff --git a/xserver/glamor/glamor_debug.h b/xserver/glamor/glamor_debug.h index 638bee20c..f64c44832 100644 --- a/xserver/glamor/glamor_debug.h +++ b/xserver/glamor/glamor_debug.h @@ -29,8 +29,6 @@ #ifndef __GLAMOR_DEBUG_H__ #define __GLAMOR_DEBUG_H__ -#define GLAMOR_DELAYED_STRING_MAX 64 - #define GLAMOR_DEBUG_NONE 0 #define GLAMOR_DEBUG_UNIMPL 0 #define GLAMOR_DEBUG_FALLBACK 1 @@ -72,33 +70,6 @@ AbortServer(void) "Glamor fallback", \ ##__VA_ARGS__);} while(0) -#define glamor_delayed_fallback(_screen_, _format_,...) \ - do { \ - if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ - glamor_screen_private *_glamor_priv_; \ - _glamor_priv_ = glamor_get_screen_private(_screen_); \ - _glamor_priv_->delayed_fallback_pending = 1; \ - snprintf(_glamor_priv_->delayed_fallback_string, \ - GLAMOR_DELAYED_STRING_MAX, \ - "glamor delayed fallback: \t%s " _format_ , \ - __FUNCTION__, ##__VA_ARGS__); } } while(0) - -#define glamor_clear_delayed_fallbacks(_screen_) \ - do { \ - if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ - glamor_screen_private *_glamor_priv_; \ - _glamor_priv_ = glamor_get_screen_private(_screen_); \ - _glamor_priv_->delayed_fallback_pending = 0; } } while(0) - -#define glamor_report_delayed_fallbacks(_screen_) \ - do { \ - if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ - glamor_screen_private *_glamor_priv_; \ - _glamor_priv_ = glamor_get_screen_private(_screen_); \ - LogMessageVerb(X_INFO, 0, "%s", \ - _glamor_priv_->delayed_fallback_string); \ - _glamor_priv_->delayed_fallback_pending = 0; } } while(0) - #define DEBUGF(str, ...) do {} while(0) //#define DEBUGF(str, ...) ErrorF(str, ##__VA_ARGS__) #define DEBUGRegionPrint(x) do {} while (0) diff --git a/xserver/glamor/glamor_egl.c b/xserver/glamor/glamor_egl.c index c9955e89b..a78e7104b 100644 --- a/xserver/glamor/glamor_egl.c +++ b/xserver/glamor/glamor_egl.c @@ -35,13 +35,12 @@ #include #include #include +#include #include #define EGL_DISPLAY_NO_X_MESA -#ifdef GLAMOR_HAS_GBM #include #include -#endif #include "glamor_egl.h" @@ -49,31 +48,16 @@ #include "glamor_priv.h" #include "dri3.h" -static const char glamor_name[] = "glamor"; - -static void -glamor_identify(int flags) -{ - xf86Msg(X_INFO, "%s: OpenGL accelerated X.org driver based.\n", - glamor_name); -} - struct glamor_egl_screen_private { EGLDisplay display; EGLContext context; - EGLint major, minor; char *device_path; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; int fd; - int cpp; -#ifdef GLAMOR_HAS_GBM struct gbm_device *gbm; -#endif - int has_gem; - int gl_context_depth; - int dri3_capable; + int dmabuf_capable; CloseScreenProcPtr saved_close_screen; DestroyPixmapProcPtr saved_destroy_pixmap; @@ -109,46 +93,24 @@ glamor_egl_make_current(struct glamor_context *glamor_ctx) } } -static EGLImageKHR -_glamor_egl_create_image(struct glamor_egl_screen_private *glamor_egl, - int width, int height, int stride, int name, int depth) -{ - EGLImageKHR image; - - EGLint attribs[] = { - EGL_WIDTH, 0, - EGL_HEIGHT, 0, - EGL_DRM_BUFFER_STRIDE_MESA, 0, - EGL_DRM_BUFFER_FORMAT_MESA, - EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, - EGL_DRM_BUFFER_USE_MESA, - EGL_DRM_BUFFER_USE_SHARE_MESA | EGL_DRM_BUFFER_USE_SCANOUT_MESA, - EGL_NONE - }; - attribs[1] = width; - attribs[3] = height; - attribs[5] = stride; - if (depth != 32 && depth != 24) - return EGL_NO_IMAGE_KHR; - image = eglCreateImageKHR(glamor_egl->display, - glamor_egl->context, - EGL_DRM_BUFFER_MESA, - (void *) (uintptr_t) name, - attribs); - if (image == EGL_NO_IMAGE_KHR) - return EGL_NO_IMAGE_KHR; - - return image; -} - static int glamor_get_flink_name(int fd, int handle, int *name) { struct drm_gem_flink flink; flink.handle = handle; - if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) - return FALSE; + if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) { + + /* + * Assume non-GEM kernels have names identical to the handle + */ + if (errno == ENODEV) { + *name = handle; + return TRUE; + } else { + return FALSE; + } + } *name = flink.name; return TRUE; } @@ -176,13 +138,9 @@ glamor_create_texture_from_image(ScreenPtr screen, struct gbm_device * glamor_egl_get_gbm_device(ScreenPtr screen) { -#ifdef GLAMOR_HAS_GBM struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); return glamor_egl->gbm; -#else - return NULL; -#endif } Bool @@ -198,33 +156,12 @@ glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) "Failed to create textured screen."); return FALSE; } - glamor_set_screen_pixmap(screen_pixmap, NULL); return TRUE; } -Bool -glamor_egl_create_textured_screen_ext(ScreenPtr screen, - int handle, - int stride, PixmapPtr *back_pixmap) -{ - return glamor_egl_create_textured_screen(screen, handle, stride); -} - -static Bool -glamor_egl_check_has_gem(int fd) -{ - struct drm_gem_flink flink; - - flink.handle = 0; - - ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - if (errno == ENOENT || errno == EINVAL) - return TRUE; - return FALSE; -} - static void -glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image) +glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image, + Bool used_modifiers) { struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); @@ -239,6 +176,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image) eglDestroyImageKHR(glamor_egl->display, old); } pixmap_priv->image = image; + pixmap_priv->used_modifiers = used_modifiers; } Bool @@ -246,52 +184,40 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_screen_private *glamor_priv = - glamor_get_screen_private(screen); - struct glamor_egl_screen_private *glamor_egl; - EGLImageKHR image; - GLuint texture; - int name; - Bool ret = FALSE; + struct glamor_egl_screen_private *glamor_egl = + glamor_egl_get_screen_private(scrn); + int ret, fd; - glamor_egl = glamor_egl_get_screen_private(scrn); - - glamor_make_current(glamor_priv); - if (glamor_egl->has_gem) { - if (!glamor_get_flink_name(glamor_egl->fd, handle, &name)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Couldn't flink pixmap handle\n"); - glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); - assert(0); - return FALSE; - } + /* GBM doesn't have an import path from handles, so we make a + * dma-buf fd from it and then go through that. + */ + ret = drmPrimeHandleToFD(glamor_egl->fd, handle, O_CLOEXEC, &fd); + if (ret) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to make prime FD for handle: %d\n", errno); + return FALSE; } - else - name = handle; - image = _glamor_egl_create_image(glamor_egl, - pixmap->drawable.width, - pixmap->drawable.height, - ((stride * 8 + - 7) / pixmap->drawable.bitsPerPixel), - name, pixmap->drawable.depth); - if (image == EGL_NO_IMAGE_KHR) { - glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); - goto done; + if (!glamor_back_pixmap_from_fd(pixmap, fd, + pixmap->drawable.width, + pixmap->drawable.height, + stride, + pixmap->drawable.depth, + pixmap->drawable.bitsPerPixel)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to make import prime FD as pixmap: %d\n", errno); + close(fd); + return FALSE; } - glamor_create_texture_from_image(screen, image, &texture); - glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); - glamor_set_pixmap_texture(pixmap, texture); - glamor_egl_set_pixmap_image(pixmap, image); - ret = TRUE; - done: - return ret; + close(fd); + return TRUE; } Bool glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, - struct gbm_bo *bo) + struct gbm_bo *bo, + Bool used_modifiers) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -316,14 +242,13 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); - glamor_egl_set_pixmap_image(pixmap, image); + glamor_egl_set_pixmap_image(pixmap, image, used_modifiers); ret = TRUE; done: return ret; } -#ifdef GLAMOR_HAS_GBM static void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) { @@ -333,12 +258,10 @@ glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) if (!glamor_get_flink_name(gbm_fd, handle.u32, name)) *name = -1; } -#endif static Bool -glamor_make_pixmap_exportable(PixmapPtr pixmap) +glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) { -#ifdef GLAMOR_HAS_GBM ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl = @@ -347,11 +270,14 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap) glamor_get_pixmap_private(pixmap); unsigned width = pixmap->drawable.width; unsigned height = pixmap->drawable.height; - struct gbm_bo *bo; + uint32_t format; + struct gbm_bo *bo = NULL; + Bool used_modifiers = FALSE; PixmapPtr exported; GCPtr scratch_gc; - if (pixmap_priv->image) + if (pixmap_priv->image && + (modifiers_ok || !pixmap_priv->used_modifiers)) return TRUE; if (pixmap->drawable.bitsPerPixel != 32) { @@ -361,13 +287,36 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap) return FALSE; } - bo = gbm_bo_create(glamor_egl->gbm, width, height, - GBM_FORMAT_ARGB8888, -#ifdef GLAMOR_HAS_GBM_LINEAR - (pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ? - GBM_BO_USE_LINEAR : 0) | + if (pixmap->drawable.depth == 30) + format = GBM_FORMAT_ARGB2101010; + else + format = GBM_FORMAT_ARGB8888; + +#ifdef GBM_BO_WITH_MODIFIERS + if (modifiers_ok && glamor_egl->dmabuf_capable) { + uint32_t num_modifiers; + uint64_t *modifiers = NULL; + + glamor_get_modifiers(screen, format, &num_modifiers, &modifiers); + + bo = gbm_bo_create_with_modifiers(glamor_egl->gbm, width, height, + format, modifiers, num_modifiers); + if (bo) + used_modifiers = TRUE; + free(modifiers); + } #endif - GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); + + if (!bo) + { + bo = gbm_bo_create(glamor_egl->gbm, width, height, format, +#ifdef GLAMOR_HAS_GBM_LINEAR + (pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ? + GBM_BO_USE_LINEAR : 0) | +#endif + GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); + } + if (!bo) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to make %dx%dx%dbpp GBM bo\n", @@ -378,7 +327,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap) exported = screen->CreatePixmap(screen, 0, 0, pixmap->drawable.depth, 0); screen->ModifyPixmapHeader(exported, width, height, 0, 0, gbm_bo_get_stride(bo), NULL); - if (!glamor_egl_create_textured_pixmap_from_gbm_bo(exported, bo)) { + if (!glamor_egl_create_textured_pixmap_from_gbm_bo(exported, bo, + used_modifiers)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to make %dx%dx%dbpp pixmap from GBM bo\n", width, height, pixmap->drawable.bitsPerPixel); @@ -403,9 +353,6 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap) screen->DestroyPixmap(exported); return TRUE; -#else - return FALSE; -#endif } struct gbm_bo * @@ -416,7 +363,7 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - if (!glamor_make_pixmap_exportable(pixmap)) + if (!pixmap_priv->image) return NULL; return gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, @@ -424,40 +371,100 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) } int -glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, - PixmapPtr pixmap, - unsigned int tex, - Bool want_name, CARD16 *stride, CARD32 *size) +glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) { #ifdef GLAMOR_HAS_GBM + struct gbm_bo *bo; + int num_fds; +#ifdef GBM_BO_WITH_MODIFIERS + int i; +#endif + + if (!glamor_make_pixmap_exportable(pixmap, TRUE)) + return 0; + + bo = glamor_gbm_bo_from_pixmap(screen, pixmap); + if (!bo) + return 0; + +#ifdef GBM_BO_WITH_MODIFIERS + num_fds = gbm_bo_get_plane_count(bo); + for (i = 0; i < num_fds; i++) { + fds[i] = gbm_bo_get_fd(bo); + strides[i] = gbm_bo_get_stride_for_plane(bo, i); + offsets[i] = gbm_bo_get_offset(bo, i); + } + *modifier = gbm_bo_get_modifier(bo); +#else + num_fds = 1; + fds[0] = gbm_bo_get_fd(bo); + strides[0] = gbm_bo_get_stride(bo); + offsets[0] = 0; + *modifier = DRM_FORMAT_MOD_INVALID; +#endif + + gbm_bo_destroy(bo); + return num_fds; +#else + return 0; +#endif +} + +_X_EXPORT int +glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ +#ifdef GLAMOR_HAS_GBM + struct gbm_bo *bo; + int fd; + + if (!glamor_make_pixmap_exportable(pixmap, FALSE)) + return -1; + + bo = glamor_gbm_bo_from_pixmap(screen, pixmap); + if (!bo) + return -1; + + fd = gbm_bo_get_fd(bo); + *stride = gbm_bo_get_stride(bo); + *size = *stride * gbm_bo_get_height(bo); + gbm_bo_destroy(bo); + + return fd; +#else + return -1; +#endif +} + +int +glamor_egl_fd_name_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ struct glamor_egl_screen_private *glamor_egl; struct gbm_bo *bo; int fd = -1; glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + if (!glamor_make_pixmap_exportable(pixmap, FALSE)) + goto failure; + bo = glamor_gbm_bo_from_pixmap(screen, pixmap); if (!bo) goto failure; pixmap->devKind = gbm_bo_get_stride(bo); - if (want_name) { - if (glamor_egl->has_gem) - glamor_get_name_from_bo(glamor_egl->fd, bo, &fd); - } - else { - fd = gbm_bo_get_fd(bo); - } + glamor_get_name_from_bo(glamor_egl->fd, bo, &fd); *stride = pixmap->devKind; *size = pixmap->devKind * gbm_bo_get_height(bo); gbm_bo_destroy(bo); failure: return fd; -#else - return -1; -#endif } _X_EXPORT Bool @@ -467,7 +474,6 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) { -#ifdef GLAMOR_HAS_GBM ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl; @@ -477,29 +483,97 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap, glamor_egl = glamor_egl_get_screen_private(scrn); - if (!glamor_egl->dri3_capable) - return FALSE; - - if (bpp != 32 || !(depth == 24 || depth == 32) || width == 0 || height == 0) + if (bpp != 32 || !(depth == 24 || depth == 32 || depth == 30) || width == 0 || height == 0) return FALSE; import_data.fd = fd; import_data.width = width; import_data.height = height; import_data.stride = stride; - import_data.format = GBM_FORMAT_ARGB8888; + if (depth == 30) + import_data.format = GBM_FORMAT_ARGB2101010; + else + import_data.format = GBM_FORMAT_ARGB8888; bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD, &import_data, 0); if (!bo) return FALSE; screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL); - ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo); + ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo, FALSE); gbm_bo_destroy(bo); return ret; -#else - return FALSE; +} + +static uint32_t +gbm_format_for_depth(CARD8 depth) +{ + switch (depth) { + case 16: + return GBM_FORMAT_RGB565; + case 24: + return GBM_FORMAT_XRGB8888; + case 30: + return GBM_FORMAT_ARGB2101010; + default: + ErrorF("unexpected depth: %d\n", depth); + case 32: + return GBM_FORMAT_ARGB8888; + } +} + +_X_EXPORT PixmapPtr +glamor_pixmap_from_fds(ScreenPtr screen, + CARD8 num_fds, const int *fds, + CARD16 width, CARD16 height, + const CARD32 *strides, const CARD32 *offsets, + CARD8 depth, CARD8 bpp, + uint64_t modifier) +{ + PixmapPtr pixmap; + struct glamor_egl_screen_private *glamor_egl; + Bool ret = FALSE; + int i; + + glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + + pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); + +#ifdef GBM_BO_WITH_MODIFIERS + if (glamor_egl->dmabuf_capable && modifier != DRM_FORMAT_MOD_INVALID) { + struct gbm_import_fd_modifier_data import_data = { 0 }; + struct gbm_bo *bo; + + import_data.width = width; + import_data.height = height; + import_data.num_fds = num_fds; + import_data.modifier = modifier; + for (i = 0; i < num_fds; i++) { + import_data.fds[i] = fds[i]; + import_data.strides[i] = strides[i]; + import_data.offsets[i] = offsets[i]; + } + import_data.format = gbm_format_for_depth(depth); + bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD_MODIFIER, &import_data, 0); + if (bo) { + screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, strides[0], NULL); + ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo, TRUE); + gbm_bo_destroy(bo); + } + } else #endif + { + if (num_fds == 1) { + ret = glamor_back_pixmap_from_fd(pixmap, fds[0], width, height, + strides[0], depth, bpp); + } + } + + if (ret == FALSE) { + screen->DestroyPixmap(pixmap); + return NULL; + } + return pixmap; } _X_EXPORT PixmapPtr @@ -509,20 +583,99 @@ glamor_pixmap_from_fd(ScreenPtr screen, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) { -#ifdef GLAMOR_HAS_GBM PixmapPtr pixmap; Bool ret; pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); + ret = glamor_back_pixmap_from_fd(pixmap, fd, width, height, stride, depth, bpp); + if (ret == FALSE) { screen->DestroyPixmap(pixmap); return NULL; } return pixmap; +} + +_X_EXPORT Bool +glamor_get_formats(ScreenPtr screen, + CARD32 *num_formats, CARD32 **formats) +{ +#ifdef GLAMOR_HAS_EGL_QUERY_DMABUF + struct glamor_egl_screen_private *glamor_egl; + EGLint num; + + /* Explicitly zero the count as the caller may ignore the return value */ + *num_formats = 0; + + glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + + if (!glamor_egl->dmabuf_capable) + return TRUE; + + if (!eglQueryDmaBufFormatsEXT(glamor_egl->display, 0, NULL, &num)) + return FALSE; + + if (num == 0) + return TRUE; + + *formats = calloc(num, sizeof(CARD32)); + if (*formats == NULL) + return FALSE; + + if (!eglQueryDmaBufFormatsEXT(glamor_egl->display, num, + (EGLint *) *formats, &num)) { + free(*formats); + return FALSE; + } + + *num_formats = num; + return TRUE; #else - return NULL; + *num_formats = 0; + return TRUE; +#endif +} + +_X_EXPORT Bool +glamor_get_modifiers(ScreenPtr screen, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ +#ifdef GLAMOR_HAS_EGL_QUERY_DMABUF + struct glamor_egl_screen_private *glamor_egl; + EGLint num; + + /* Explicitly zero the count as the caller may ignore the return value */ + *num_modifiers = 0; + + glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + + if (!glamor_egl->dmabuf_capable) + return FALSE; + + if (!eglQueryDmaBufModifiersEXT(glamor_egl->display, format, 0, NULL, + NULL, &num)) + return FALSE; + + if (num == 0) + return TRUE; + + *modifiers = calloc(num, sizeof(uint64_t)); + if (*modifiers == NULL) + return FALSE; + + if (!eglQueryDmaBufModifiersEXT(glamor_egl->display, format, num, + (EGLuint64KHR *) *modifiers, NULL, &num)) { + free(*modifiers); + return FALSE; + } + + *num_modifiers = num; + return TRUE; +#else + *num_modifiers = 0; + return TRUE; #endif } @@ -554,7 +707,8 @@ glamor_egl_destroy_pixmap(PixmapPtr pixmap) _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) { - EGLImageKHR temp; + EGLImageKHR temp_img; + Bool temp_mod; struct glamor_pixmap_private *front_priv = glamor_get_pixmap_private(front); struct glamor_pixmap_private *back_priv = @@ -562,9 +716,12 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_pixmap_exchange_fbos(front, back); - temp = back_priv->image; + temp_img = back_priv->image; + temp_mod = back_priv->used_modifiers; back_priv->image = front_priv->image; - front_priv->image = temp; + back_priv->used_modifiers = front_priv->used_modifiers; + front_priv->image = temp_img; + front_priv->used_modifiers = temp_mod; glamor_set_pixmap_type(front, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); @@ -646,11 +803,15 @@ glamor_dri3_open_client(ClientPtr client, return Success; } -static dri3_screen_info_rec glamor_dri3_info = { - .version = 1, +static const dri3_screen_info_rec glamor_dri3_info = { + .version = 2, .open_client = glamor_dri3_open_client, - .pixmap_from_fd = glamor_pixmap_from_fd, - .fd_from_pixmap = glamor_fd_from_pixmap, + .pixmap_from_fds = glamor_pixmap_from_fds, + .fd_from_pixmap = glamor_egl_fd_from_pixmap, + .fds_from_pixmap = glamor_egl_fds_from_pixmap, + .get_formats = glamor_get_formats, + .get_modifiers = glamor_get_modifiers, + .get_drawable_modifiers = glamor_get_drawable_modifiers, }; #endif /* DRI3 */ @@ -660,6 +821,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); +#ifdef DRI3 + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); +#endif glamor_egl->saved_close_screen = screen->CloseScreen; screen->CloseScreen = glamor_egl_close_screen; @@ -673,28 +837,25 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) glamor_ctx->make_current = glamor_egl_make_current; #ifdef DRI3 - if (glamor_egl->dri3_capable) { - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - /* Tell the core that we have the interfaces for import/export - * of pixmaps. - */ - glamor_enable_dri3(screen); + /* Tell the core that we have the interfaces for import/export + * of pixmaps. + */ + glamor_enable_dri3(screen); - /* If the driver wants to do its own auth dance (e.g. Xwayland - * on pre-3.15 kernels that don't have render nodes and thus - * has the wayland compositor as a master), then it needs us - * to stay out of the way and let it init DRI3 on its own. + /* If the driver wants to do its own auth dance (e.g. Xwayland + * on pre-3.15 kernels that don't have render nodes and thus + * has the wayland compositor as a master), then it needs us + * to stay out of the way and let it init DRI3 on its own. + */ + if (!(glamor_priv->flags & GLAMOR_NO_DRI3)) { + /* To do DRI3 device FD generation, we need to open a new fd + * to the same device we were handed in originally. */ - if (!(glamor_priv->flags & GLAMOR_NO_DRI3)) { - /* To do DRI3 device FD generation, we need to open a new fd - * to the same device we were handed in originally. - */ - glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd); + glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd); - if (!dri3_screen_init(screen, &glamor_dri3_info)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to initialize DRI3.\n"); - } + if (!dri3_screen_init(screen, &glamor_dri3_info)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to initialize DRI3.\n"); } } #endif @@ -712,10 +873,8 @@ static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl) lastGLContext = NULL; eglTerminate(glamor_egl->display); } -#ifdef GLAMOR_HAS_GBM if (glamor_egl->gbm) gbm_device_destroy(glamor_egl->gbm); -#endif free(glamor_egl->device_path); free(glamor_egl); } @@ -737,25 +896,8 @@ Bool glamor_egl_init(ScrnInfoPtr scrn, int fd) { struct glamor_egl_screen_private *glamor_egl; - const char *version; + const GLubyte *renderer; - EGLint config_attribs[] = { -#ifdef GLAMOR_GLES2 - EGL_CONTEXT_CLIENT_VERSION, 2, -#endif - EGL_NONE - }; - static const EGLint config_attribs_core[] = { - EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, - EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, - EGL_CONTEXT_MAJOR_VERSION_KHR, - GLAMOR_GL_CORE_VER_MAJOR, - EGL_CONTEXT_MINOR_VERSION_KHR, - GLAMOR_GL_CORE_VER_MINOR, - EGL_NONE - }; - - glamor_identify(0); glamor_egl = calloc(sizeof(*glamor_egl), 1); if (glamor_egl == NULL) return FALSE; @@ -764,7 +906,6 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) scrn->privates[xf86GlamorEGLPrivateIndex].ptr = glamor_egl; glamor_egl->fd = fd; -#ifdef GLAMOR_HAS_GBM glamor_egl->gbm = gbm_create_device(glamor_egl->fd); if (glamor_egl->gbm == NULL) { ErrorF("couldn't get display device\n"); @@ -777,28 +918,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n"); goto error; } -#else - glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); -#endif - glamor_egl->has_gem = glamor_egl_check_has_gem(fd); - - if (!eglInitialize - (glamor_egl->display, &glamor_egl->major, &glamor_egl->minor)) { + if (!eglInitialize(glamor_egl->display, NULL, NULL)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglInitialize() failed\n"); glamor_egl->display = EGL_NO_DISPLAY; goto error; } -#ifndef GLAMOR_GLES2 - eglBindAPI(EGL_OPENGL_API); -#else - eglBindAPI(EGL_OPENGL_ES_API); -#endif - - version = eglQueryString(glamor_egl->display, EGL_VERSION); - xf86Msg(X_INFO, "%s: EGL version %s:\n", glamor_name, version); - #define GLAMOR_CHECK_EGL_EXTENSION(EXT) \ if (!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT)) { \ ErrorF("EGL_" #EXT " required.\n"); \ @@ -812,30 +938,51 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) goto error; \ } - GLAMOR_CHECK_EGL_EXTENSION(MESA_drm_image); - GLAMOR_CHECK_EGL_EXTENSION(KHR_gl_renderbuffer_image); -#ifdef GLAMOR_GLES2 - GLAMOR_CHECK_EGL_EXTENSIONS(KHR_surfaceless_context, KHR_surfaceless_gles2); -#else - GLAMOR_CHECK_EGL_EXTENSIONS(KHR_surfaceless_context, - KHR_surfaceless_opengl); -#endif + GLAMOR_CHECK_EGL_EXTENSION(KHR_surfaceless_context); + + if (eglBindAPI(EGL_OPENGL_API)) { + static const EGLint config_attribs_core[] = { + EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, + EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, + EGL_CONTEXT_MAJOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MAJOR, + EGL_CONTEXT_MINOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MINOR, + EGL_NONE + }; + static const EGLint config_attribs[] = { + EGL_NONE + }; + + glamor_egl->context = eglCreateContext(glamor_egl->display, + NULL, EGL_NO_CONTEXT, + config_attribs_core); + + if (glamor_egl->context == EGL_NO_CONTEXT) + glamor_egl->context = eglCreateContext(glamor_egl->display, + NULL, EGL_NO_CONTEXT, + config_attribs); + } + + if (glamor_egl->context == EGL_NO_CONTEXT) { + static const EGLint config_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + if (!eglBindAPI(EGL_OPENGL_ES_API)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glamor: Failed to bind either GL or GLES APIs.\n"); + goto error; + } -#ifndef GLAMOR_GLES2 - glamor_egl->context = eglCreateContext(glamor_egl->display, - NULL, EGL_NO_CONTEXT, - config_attribs_core); -#else - glamor_egl->context = NULL; -#endif - if (!glamor_egl->context) { glamor_egl->context = eglCreateContext(glamor_egl->display, NULL, EGL_NO_CONTEXT, config_attribs); - if (glamor_egl->context == EGL_NO_CONTEXT) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n"); - goto error; - } + } + if (glamor_egl->context == EGL_NO_CONTEXT) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glamor: Failed to create GL or GLES2 contexts\n"); + goto error; } if (!eglMakeCurrent(glamor_egl->display, @@ -844,26 +991,49 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) "Failed to make EGL context current\n"); goto error; } + + renderer = glGetString(GL_RENDERER); + if (!renderer) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glGetString() returned NULL, your GL is broken\n"); + goto error; + } + if (strstr((const char *)renderer, "llvmpipe")) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Refusing to try glamor on llvmpipe\n"); + goto error; + } + /* * Force the next glamor_make_current call to set the right context * (in case of multiple GPUs using glamor) */ lastGLContext = NULL; -#ifdef GLAMOR_HAS_GBM + + if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glamor acceleration requires GL_OES_EGL_image\n"); + goto error; + } + + xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n", + renderer); + +#ifdef GBM_BO_WITH_MODIFIERS if (epoxy_has_egl_extension(glamor_egl->display, - "EGL_KHR_gl_texture_2D_image") && - epoxy_has_gl_extension("GL_OES_EGL_image")) - glamor_egl->dri3_capable = TRUE; + "EGL_EXT_image_dma_buf_import") && + epoxy_has_egl_extension(glamor_egl->display, + "EGL_EXT_image_dma_buf_import_modifiers")) { + if (xf86Info.debug != NULL) + glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug, + "dmabuf_capable"); + else + glamor_egl->dmabuf_capable = FALSE; + } #endif glamor_egl->saved_free_screen = scrn->FreeScreen; scrn->FreeScreen = glamor_egl_free_screen; -#ifdef GLAMOR_GLES2 - xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using GLES2.\n"); - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Glamor is using GLES2 but GLX needs GL. " - "Indirect GLX may not work correctly.\n"); -#endif return TRUE; error: diff --git a/xserver/glamor/glamor_egl.h b/xserver/glamor/glamor_egl.h index 6bb1185bf..2f7566b24 100644 --- a/xserver/glamor/glamor_egl.h +++ b/xserver/glamor/glamor_egl.h @@ -30,6 +30,7 @@ #define MESA_EGL_NO_X11_HEADERS #include #include +#include /* * Create an EGLDisplay from a native display type. This is a little quirky diff --git a/xserver/glamor/glamor_egl_ext.h b/xserver/glamor/glamor_egl_ext.h new file mode 100644 index 000000000..436e52137 --- /dev/null +++ b/xserver/glamor/glamor_egl_ext.h @@ -0,0 +1,65 @@ +/* + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS + * 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. + */ +/* Extensions used by Glamor, copied from Mesa's eglmesaext.h, */ + +#ifndef GLAMOR_EGL_EXT_H +#define GLAMOR_EGL_EXT_H + +/* Define needed tokens from EGL_EXT_image_dma_buf_import extension + * here to avoid having to add ifdefs everywhere.*/ +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#endif + +/* Define tokens from EGL_EXT_image_dma_buf_import_modifiers */ +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); +#endif + +#endif /* GLAMOR_EGL_EXT_H */ diff --git a/xserver/glamor/glamor_egl_stubs.c b/xserver/glamor/glamor_egl_stubs.c index 40f7fcc01..91ab9a7ae 100644 --- a/xserver/glamor/glamor_egl_stubs.c +++ b/xserver/glamor/glamor_egl_stubs.c @@ -36,10 +36,25 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) } int -glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, - PixmapPtr pixmap, - unsigned int tex, - Bool want_name, CARD16 *stride, CARD32 *size) +glamor_egl_fd_name_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ + return -1; +} + + +int +glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *offsets, uint32_t *strides, + uint64_t *modifier) { return 0; } + +int +glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ + return -1; +} diff --git a/xserver/glamor/glamor_eglmodule.c b/xserver/glamor/glamor_eglmodule.c index dd4664b22..326af3aa6 100644 --- a/xserver/glamor/glamor_eglmodule.c +++ b/xserver/glamor/glamor_eglmodule.c @@ -40,7 +40,7 @@ static XF86ModuleVersionInfo VersRec = { MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, - 1, 0, 0, /* version */ + 1, 0, 1, /* version */ ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, diff --git a/xserver/glamor/glamor_fbo.c b/xserver/glamor/glamor_fbo.c index 9f1288c60..e8c4330b3 100644 --- a/xserver/glamor/glamor_fbo.c +++ b/xserver/glamor/glamor_fbo.c @@ -123,7 +123,10 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, int w, int h, GLenum format) { unsigned int tex; + GLenum iformat = format; + if (format == GL_RGB10_A2) + format = GL_RGBA; glamor_make_current(glamor_priv); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); @@ -132,7 +135,7 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, if (format == glamor_priv->one_channel_format && format == GL_RED) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED); glamor_priv->suppress_gl_out_of_memory_logging = true; - glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, + glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, format, GL_UNSIGNED_BYTE, NULL); glamor_priv->suppress_gl_out_of_memory_logging = false; diff --git a/xserver/glamor/glamor_gradient.c b/xserver/glamor/glamor_gradient.c index f0b7d129c..eef078860 100644 --- a/xserver/glamor/glamor_gradient.c +++ b/xserver/glamor/glamor_gradient.c @@ -38,9 +38,7 @@ #define RADIAL_SMALL_STOPS (6 + 2) #define RADIAL_LARGE_STOPS (16 + 2) -#ifdef GLAMOR_GRADIENT_SHADER - -static const char * +static char * _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count, int use_array) { @@ -312,7 +310,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, "}\n"\ "\n"\ "%s\n" /* fs_getcolor_source */ - const char *fs_getcolor_source; + char *fs_getcolor_source; glamor_priv = glamor_get_screen_private(screen); @@ -345,6 +343,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs); free(gradient_fs); + free(fs_getcolor_source); glAttachShader(gradient_prog, vs_prog); glAttachShader(gradient_prog, fs_prog); @@ -495,7 +494,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, "}\n"\ "\n"\ "%s" /* fs_getcolor_source */ - const char *fs_getcolor_source; + char *fs_getcolor_source; glamor_priv = glamor_get_screen_private(screen); @@ -524,6 +523,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs); free(gradient_fs); + free(fs_getcolor_source); glAttachShader(gradient_prog, vs_prog); glAttachShader(gradient_prog, fs_prog); @@ -1440,5 +1440,3 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return NULL; } - -#endif /* End of GLAMOR_GRADIENT_SHADER */ diff --git a/xserver/glamor/glamor_image.c b/xserver/glamor/glamor_image.c index 315874995..453ef79ba 100644 --- a/xserver/glamor/glamor_image.c +++ b/xserver/glamor/glamor_image.c @@ -116,7 +116,7 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - if (format != ZPixmap || !glamor_pm_is_solid(drawable->depth, plane_mask)) + if (format != ZPixmap) goto bail; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); @@ -128,6 +128,16 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, drawable->x + off_x, drawable->y + off_y, -x, -y, (uint8_t *) d, byte_stride); + + if (!glamor_pm_is_solid(drawable->depth, plane_mask)) { + FbStip pm = fbReplicatePixel(plane_mask, drawable->bitsPerPixel); + FbStip *dst = (void *)d; + uint32_t dstStride = byte_stride / sizeof(FbStip); + + for (int i = 0; i < dstStride * h; i++) + dst[i] &= pm; + } + return TRUE; bail: return FALSE; diff --git a/xserver/glamor/glamor_priv.h b/xserver/glamor/glamor_priv.h index 27f95521d..7d9a7d4fb 100644 --- a/xserver/glamor/glamor_priv.h +++ b/xserver/glamor/glamor_priv.h @@ -38,7 +38,7 @@ #endif #include -#if GLAMOR_HAS_GBM +#ifdef GLAMOR_HAS_GBM #define MESA_EGL_NO_X11_HEADERS #include #endif @@ -163,7 +163,6 @@ enum glamor_gl_flavor { struct glamor_saved_procs { CloseScreenProcPtr close_screen; - CreateScreenResourcesProcPtr create_screen_resources; CreateGCProcPtr create_gc; CreatePixmapProcPtr create_pixmap; DestroyPixmapProcPtr destroy_pixmap; @@ -192,12 +191,12 @@ typedef struct glamor_screen_private { Bool has_map_buffer_range; Bool has_buffer_storage; Bool has_khr_debug; + Bool has_mesa_tile_raster_order; Bool has_nv_texture_barrier; Bool has_pack_subimage; Bool has_unpack_subimage; Bool has_rw_pbo; Bool use_quads; - Bool has_vertex_array_object; Bool has_dual_blend; Bool has_texture_swizzle; Bool is_core_profile; @@ -281,10 +280,8 @@ typedef struct glamor_screen_private { int linear_max_nstops; int radial_max_nstops; - int screen_fbo; struct glamor_saved_procs saved_procs; - char delayed_fallback_string[GLAMOR_DELAYED_STRING_MAX + 1]; - int delayed_fallback_pending; + GetDrawableModifiersFuncPtr get_drawable_modifiers; int flags; ScreenPtr screen; int dri3_enabled; @@ -342,8 +339,9 @@ typedef struct glamor_pixmap_private { GLuint pbo; RegionRec prepare_region; Bool prepared; -#if GLAMOR_HAS_GBM +#ifdef GLAMOR_HAS_GBM EGLImageKHR image; + Bool used_modifiers; #endif /** block width of this large pixmap. */ int block_w; @@ -498,18 +496,11 @@ typedef struct { extern DevPrivateKeyRec glamor_gc_private_key; extern DevPrivateKeyRec glamor_screen_private_key; -static inline glamor_screen_private * -glamor_get_screen_private(ScreenPtr screen) -{ - return (glamor_screen_private *) - dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); -} +extern glamor_screen_private * +glamor_get_screen_private(ScreenPtr screen); -static inline void -glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) -{ - dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); -} +extern void +glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv); static inline glamor_gc_private * glamor_get_gc_private(GCPtr gc) @@ -910,18 +901,8 @@ int glamor_xv_put_image(glamor_port_private *port_priv, void glamor_xv_core_init(ScreenPtr screen); void glamor_xv_render(glamor_port_private *port_priv); -#include"glamor_utils.h" +#include "glamor_utils.h" -/* Dynamic pixmap upload to texture if needed. - * Sometimes, the target is a gl texture pixmap/picture, - * but the source or mask is in cpu memory. In that case, - * upload the source/mask to gl texture and then avoid - * fallback the whole process to cpu. Most of the time, - * this will increase performance obviously. */ - -#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD -#define GLAMOR_GRADIENT_SHADER -#define GLAMOR_TEXTURED_LARGE_PIXMAP 1 #if 0 #define MAX_FBO_SIZE 32 /* For test purpose only. */ #endif diff --git a/xserver/glamor/glamor_program.c b/xserver/glamor/glamor_program.c index 23c102bc3..830deb38b 100644 --- a/xserver/glamor/glamor_program.c +++ b/xserver/glamor/glamor_program.c @@ -508,12 +508,13 @@ glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst) static Bool use_source_solid(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog) { + PictSolidFill *solid = &src->pSourcePict->solidFill; + float color[4]; + glamor_get_rgba_from_color(&solid->fullcolor, color); glamor_set_blend(op, prog->alpha, dst); + glUniform4fv(prog->fg_uniform, 1, color); - glamor_set_color_depth(dst->pDrawable->pScreen, 32, - src->pSourcePict->solidFill.color, - prog->fg_uniform); return TRUE; } diff --git a/xserver/glamor/glamor_rects.c b/xserver/glamor/glamor_rects.c index cc029c8c0..6cbb040c1 100644 --- a/xserver/glamor/glamor_rects.c +++ b/xserver/glamor/glamor_rects.c @@ -53,6 +53,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, char *vbo_offset; int box_index; Bool ret = FALSE; + BoxRec bounds = glamor_no_rendering_bounds(); pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -60,6 +61,12 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, glamor_make_current(glamor_priv); + if (nrect < 100) { + bounds = glamor_start_rendering_bounds(); + for (int i = 0; i < nrect; i++) + glamor_bounds_union_rect(&bounds, &prect[i]); + } + if (glamor_priv->glsl_version >= 130) { prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_fill_rect_program, @@ -121,11 +128,22 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, goto bail; while (nbox--) { - glScissor(box->x1 + off_x, - box->y1 + off_y, - box->x2 - box->x1, - box->y2 - box->y1); + BoxRec scissor = { + .x1 = max(box->x1, bounds.x1 + drawable->x), + .y1 = max(box->y1, bounds.y1 + drawable->y), + .x2 = min(box->x2, bounds.x2 + drawable->x), + .y2 = min(box->y2, bounds.y2 + drawable->y), + }; + box++; + + if (scissor.x1 >= scissor.x2 || scissor.y1 >= scissor.y2) + continue; + + glScissor(scissor.x1 + off_x, + scissor.y1 + off_y, + scissor.x2 - scissor.x1, + scissor.y2 - scissor.y1); if (glamor_priv->glsl_version >= 130) glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nrect); else { diff --git a/xserver/glamor/glamor_render.c b/xserver/glamor/glamor_render.c index a8b208101..d5737018f 100644 --- a/xserver/glamor/glamor_render.c +++ b/xserver/glamor/glamor_render.c @@ -762,21 +762,31 @@ glamor_set_normalize_tcoords_generic(PixmapPtr pixmap, /** * Returns whether the general composite path supports this picture * format for a pixmap that is permanently stored in an FBO (as - * opposed to the GLAMOR_PIXMAP_DYNAMIC_UPLOAD path). + * opposed to the dynamic upload path). * * We could support many more formats by using GL_ARB_texture_view to * parse the same bits as different formats. For now, we only support - * tweaking whether we sample the alpha bits of an a8r8g8b8, or just - * force them to 1. + * tweaking whether we sample the alpha bits, or just force them to 1. */ static Bool -glamor_render_format_is_supported(PictFormatShort format) +glamor_render_format_is_supported(PicturePtr picture) { - switch (format) { + PictFormatShort storage_format; + + /* Source-only pictures should always work */ + if (!picture->pDrawable) + return TRUE; + + storage_format = format_for_depth(picture->pDrawable->depth); + + switch (picture->format) { + case PICT_x2r10g10b10: + return storage_format == PICT_x2r10g10b10; case PICT_a8r8g8b8: case PICT_x8r8g8b8: + return storage_format == PICT_a8r8g8b8 || storage_format == PICT_x8r8g8b8; case PICT_a8: - return TRUE; + return storage_format == PICT_a8; default: return FALSE; } @@ -814,7 +824,7 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } - if (!glamor_render_format_is_supported(dest->format)) { + if (!glamor_render_format_is_supported(dest)) { glamor_fallback("Unsupported dest picture format.\n"); goto fail; } @@ -828,13 +838,11 @@ glamor_composite_choose_shader(CARD8 op, source_solid_color[3] = 0.0; } else if (!source->pDrawable) { - if (source->pSourcePict->type == SourcePictTypeSolidFill) { + SourcePictPtr sp = source->pSourcePict; + if (sp->type == SourcePictTypeSolidFill) { key.source = SHADER_SOURCE_SOLID; - glamor_get_rgba_from_pixel(source->pSourcePict->solidFill.color, - &source_solid_color[0], - &source_solid_color[1], - &source_solid_color[2], - &source_solid_color[3], PICT_a8r8g8b8); + glamor_get_rgba_from_color(&sp->solidFill.fullcolor, + source_solid_color); } else goto fail; @@ -848,13 +856,11 @@ glamor_composite_choose_shader(CARD8 op, if (mask) { if (!mask->pDrawable) { - if (mask->pSourcePict->type == SourcePictTypeSolidFill) { + SourcePictPtr sp = mask->pSourcePict; + if (sp->type == SourcePictTypeSolidFill) { key.mask = SHADER_MASK_SOLID; - glamor_get_rgba_from_pixel - (mask->pSourcePict->solidFill.color, - &mask_solid_color[0], - &mask_solid_color[1], - &mask_solid_color[2], &mask_solid_color[3], PICT_a8r8g8b8); + glamor_get_rgba_from_color(&sp->solidFill.fullcolor, + mask_solid_color); } else goto fail; @@ -915,12 +921,7 @@ glamor_composite_choose_shader(CARD8 op, glamor_fallback("source == dest\n"); } if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { -#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD source_needs_upload = TRUE; -#else - glamor_fallback("no texture in source\n"); - goto fail; -#endif } } @@ -931,16 +932,10 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { -#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD mask_needs_upload = TRUE; -#else - glamor_fallback("no texture in mask\n"); - goto fail; -#endif } } -#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD if (source_needs_upload && mask_needs_upload && source_pixmap == mask_pixmap) { @@ -992,7 +987,7 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } } else { - if (source && !glamor_render_format_is_supported(source->format)) { + if (source && !glamor_render_format_is_supported(source)) { glamor_fallback("Unsupported source picture format.\n"); goto fail; } @@ -1004,13 +999,12 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } } else if (mask) { - if (!glamor_render_format_is_supported(mask->format)) { + if (!glamor_render_format_is_supported(mask)) { glamor_fallback("Unsupported mask picture format.\n"); goto fail; } } } -#endif /* If the source and mask are two differently-formatted views of * the same pixmap bits, and the pixmap was already uploaded (so @@ -1198,6 +1192,29 @@ glamor_composite_with_shader(CARD8 op, nrect_max = MIN(nrect, GLAMOR_COMPOSITE_VBO_VERT_CNT / 4); + if (nrect < 100) { + BoxRec bounds = glamor_start_rendering_bounds(); + + for (int i = 0; i < nrect; i++) { + BoxRec box = { + .x1 = rects[i].x_dst, + .y1 = rects[i].y_dst, + .x2 = rects[i].x_dst + rects[i].width, + .y2 = rects[i].y_dst + rects[i].height, + }; + glamor_bounds_union_box(&bounds, &box); + } + + if (bounds.x1 >= bounds.x2 || bounds.y1 >= bounds.y2) + goto disable_va; + + glEnable(GL_SCISSOR_TEST); + glScissor(bounds.x1 + dest_x_off, + bounds.y1 + dest_y_off, + bounds.x2 - bounds.x1, + bounds.y2 - bounds.y1); + } + while (nrect) { int mrect, rect_processed; int vb_stride; @@ -1279,6 +1296,8 @@ glamor_composite_with_shader(CARD8 op, } } + glDisable(GL_SCISSOR_TEST); +disable_va: glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glDisableVertexAttribArray(GLAMOR_VERTEX_MASK); @@ -1318,7 +1337,6 @@ glamor_convert_gradient_picture(ScreenPtr screen, pFormat = PictureMatchFormat(screen, 32, format); } -#ifdef GLAMOR_GRADIENT_SHADER if (!source->pDrawable) { if (source->pSourcePict->type == SourcePictTypeLinear) { dst = glamor_generate_linear_gradient_picture(screen, @@ -1337,7 +1355,7 @@ glamor_convert_gradient_picture(ScreenPtr screen, return dst; } } -#endif + pixmap = glamor_create_pixmap(screen, width, height, diff --git a/xserver/glamor/glamor_transfer.c b/xserver/glamor/glamor_transfer.c index d788d06f4..ebb5101d1 100644 --- a/xserver/glamor/glamor_transfer.c +++ b/xserver/glamor/glamor_transfer.c @@ -33,6 +33,10 @@ glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) *format = GL_BGRA; *type = GL_UNSIGNED_INT_8_8_8_8_REV; break; + case 30: + *format = GL_BGRA; + *type = GL_UNSIGNED_INT_2_10_10_10_REV; + break; case 16: *format = GL_RGB; *type = GL_UNSIGNED_SHORT_5_6_5; diff --git a/xserver/glamor/glamor_utils.h b/xserver/glamor/glamor_utils.h index a35917c37..0d5674d63 100644 --- a/xserver/glamor/glamor_utils.h +++ b/xserver/glamor/glamor_utils.h @@ -562,10 +562,6 @@ (c)[1] = (float)y; \ } while(0) -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) -#endif - #define ALIGN(i,m) (((i) + (m) - 1) & ~((m) - 1)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) @@ -605,10 +601,8 @@ format_for_depth(int depth) default: case 24: return PICT_x8r8g8b8; -#if XORG_VERSION_CURRENT >= 10699900 case 30: return PICT_x2r10g10b10; -#endif case 32: return PICT_a8r8g8b8; } @@ -623,6 +617,9 @@ gl_iformat_for_pixmap(PixmapPtr pixmap) if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && ((pixmap)->drawable.depth == 1 || (pixmap)->drawable.depth == 8)) { return glamor_priv->one_channel_format; + } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && + (pixmap)->drawable.depth == 30) { + return GL_RGB10_A2; } else { return GL_RGBA; } @@ -670,7 +667,6 @@ glamor_get_rgba_from_pixel(CARD32 pixel, gshift = rbits; bshift = gshift + gbits; ashift = bshift + bbits; -#if XORG_VERSION_CURRENT >= 10699900 } else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) { ashift = 0; @@ -679,7 +675,6 @@ glamor_get_rgba_from_pixel(CARD32 pixel, rshift = PICT_FORMAT_BPP(format) - (rbits + gbits + bbits); gshift = rshift + rbits; bshift = gshift + gbits; -#endif } else { return FALSE; @@ -711,6 +706,15 @@ glamor_get_rgba_from_pixel(CARD32 pixel, return TRUE; } +static inline void +glamor_get_rgba_from_color(const xRenderColor *color, float rgba[4]) +{ + rgba[0] = color->red / (float)UINT16_MAX; + rgba[1] = color->green / (float)UINT16_MAX; + rgba[2] = color->blue / (float)UINT16_MAX; + rgba[3] = color->alpha / (float)UINT16_MAX; +} + inline static Bool glamor_is_large_pixmap(PixmapPtr pixmap) { @@ -729,6 +733,50 @@ glamor_make_current(glamor_screen_private *glamor_priv) } } +static inline BoxRec +glamor_no_rendering_bounds(void) +{ + BoxRec bounds = { + .x1 = 0, + .y1 = 0, + .x2 = MAXSHORT, + .y2 = MAXSHORT, + }; + + return bounds; +} + +static inline BoxRec +glamor_start_rendering_bounds(void) +{ + BoxRec bounds = { + .x1 = MAXSHORT, + .y1 = MAXSHORT, + .x2 = 0, + .y2 = 0, + }; + + return bounds; +} + +static inline void +glamor_bounds_union_rect(BoxPtr bounds, xRectangle *rect) +{ + bounds->x1 = min(bounds->x1, rect->x); + bounds->y1 = min(bounds->y1, rect->y); + bounds->x2 = min(SHRT_MAX, max(bounds->x2, rect->x + rect->width)); + bounds->y2 = min(SHRT_MAX, max(bounds->y2, rect->y + rect->height)); +} + +static inline void +glamor_bounds_union_box(BoxPtr bounds, BoxPtr box) +{ + bounds->x1 = min(bounds->x1, box->x1); + bounds->y1 = min(bounds->y1, box->y1); + bounds->x2 = max(bounds->x2, box->x2); + bounds->y2 = max(bounds->y2, box->y2); +} + /** * Helper function for implementing draws with GL_QUADS on GLES2, * where we don't have them. diff --git a/xserver/glamor/glamor_vbo.c b/xserver/glamor/glamor_vbo.c index b8db0092b..734189fa2 100644 --- a/xserver/glamor/glamor_vbo.c +++ b/xserver/glamor/glamor_vbo.c @@ -128,7 +128,7 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset) if (glamor_priv->vbo_size < size) { glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size); free(glamor_priv->vb); - glamor_priv->vb = XNFalloc(glamor_priv->vbo_size); + glamor_priv->vb = xnfalloc(glamor_priv->vbo_size); } *vbo_offset = NULL; /* We point to the start of glamor_priv->vb every time, and @@ -174,11 +174,8 @@ glamor_init_vbo(ScreenPtr screen) glamor_make_current(glamor_priv); glGenBuffers(1, &glamor_priv->vbo); - if (glamor_priv->has_vertex_array_object) { - glGenVertexArrays(1, &glamor_priv->vao); - glBindVertexArray(glamor_priv->vao); - } else - glamor_priv->vao = 0; + glGenVertexArrays(1, &glamor_priv->vao); + glBindVertexArray(glamor_priv->vao); } void @@ -188,10 +185,8 @@ glamor_fini_vbo(ScreenPtr screen) glamor_make_current(glamor_priv); - if (glamor_priv->vao != 0) { - glDeleteVertexArrays(1, &glamor_priv->vao); - glamor_priv->vao = 0; - } + glDeleteVertexArrays(1, &glamor_priv->vao); + glamor_priv->vao = 0; if (!glamor_priv->has_map_buffer_range) free(glamor_priv->vb); } diff --git a/xserver/glamor/glamor_xv.c b/xserver/glamor/glamor_xv.c index e0375d7cd..62fc4fff5 100644 --- a/xserver/glamor/glamor_xv.c +++ b/xserver/glamor/glamor_xv.c @@ -210,6 +210,7 @@ glamor_xv_query_image_attributes(int id, switch (id) { case FOURCC_YV12: case FOURCC_I420: + *w = ALIGN(*w, 2); *h = ALIGN(*h, 2); size = ALIGN(*w, 4); if (pitches) diff --git a/xserver/glx/Makefile.am b/xserver/glx/Makefile.am index 699de63b8..0f652356d 100644 --- a/xserver/glx/Makefile.am +++ b/xserver/glx/Makefile.am @@ -2,7 +2,7 @@ if DRI2 GLXDRI_LIBRARY = libglxdri.la endif -noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) +noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) libglxvnd.la AM_CFLAGS = \ @DIX_CFLAGS@ \ @@ -12,8 +12,7 @@ AM_CFLAGS = \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ -# none yet -#sdk_HEADERS = +sdk_HEADERS = vndserver.h AM_CPPFLAGS = \ -I$(top_srcdir)/hw/xfree86/os-support \ @@ -83,3 +82,12 @@ libglx_la_SOURCES = \ xfont.c libglx_la_LIBADD = $(DLOPEN_LIBS) + +libglxvnd_la_SOURCES = \ + vndcmds.c \ + vndext.c \ + vndservermapping.c \ + vndservervendor.h \ + vndservervendor.c + +EXTRA_DIST = vnd_dispatch_stubs.c diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in index 5f4239d93..f055567fb 100644 --- a/xserver/glx/Makefile.in +++ b/xserver/glx/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -52,8 +53,8 @@ build_triplet = @build@ host_triplet = @host@ @DRI2_TRUE@am__append_1 = glxdri2.c subdir = glx -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/depcomp +DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -69,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -96,6 +97,10 @@ am__libglxdri_la_SOURCES_DIST = glxdri2.c am_libglxdri_la_OBJECTS = $(am__objects_2) libglxdri_la_OBJECTS = $(am_libglxdri_la_OBJECTS) @DRI2_TRUE@am_libglxdri_la_rpath = +libglxvnd_la_LIBADD = +am_libglxvnd_la_OBJECTS = vndcmds.lo vndext.lo vndservermapping.lo \ + vndservervendor.lo +libglxvnd_la_OBJECTS = $(am_libglxvnd_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -130,13 +135,44 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libglx_la_SOURCES) $(libglxdri_la_SOURCES) -DIST_SOURCES = $(libglx_la_SOURCES) $(am__libglxdri_la_SOURCES_DIST) +SOURCES = $(libglx_la_SOURCES) $(libglxdri_la_SOURCES) \ + $(libglxvnd_la_SOURCES) +DIST_SOURCES = $(libglx_la_SOURCES) $(am__libglxdri_la_SOURCES_DIST) \ + $(libglxvnd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(sdkdir)" +HEADERS = $(sdk_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -323,6 +359,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -341,15 +378,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -357,6 +397,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -428,8 +470,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -495,7 +535,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @DRI2_TRUE@GLXDRI_LIBRARY = libglxdri.la -noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) +noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) libglxvnd.la AM_CFLAGS = \ @DIX_CFLAGS@ \ @GL_CFLAGS@ \ @@ -504,9 +544,7 @@ AM_CFLAGS = \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ - -# none yet -#sdk_HEADERS = +sdk_HEADERS = vndserver.h AM_CPPFLAGS = \ -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ @@ -570,6 +608,14 @@ libglx_la_SOURCES = \ xfont.c libglx_la_LIBADD = $(DLOPEN_LIBS) +libglxvnd_la_SOURCES = \ + vndcmds.c \ + vndext.c \ + vndservermapping.c \ + vndservervendor.h \ + vndservervendor.c + +EXTRA_DIST = vnd_dispatch_stubs.c all: all-am .SUFFIXES: @@ -619,6 +665,8 @@ libglx.la: $(libglx_la_OBJECTS) $(libglx_la_DEPENDENCIES) $(EXTRA_libglx_la_DEPE $(AM_V_CCLD)$(LINK) $(libglx_la_OBJECTS) $(libglx_la_LIBADD) $(LIBS) libglxdri.la: $(libglxdri_la_OBJECTS) $(libglxdri_la_DEPENDENCIES) $(EXTRA_libglxdri_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libglxdri_la_rpath) $(libglxdri_la_OBJECTS) $(libglxdri_la_LIBADD) $(LIBS) +libglxvnd.la: $(libglxvnd_la_OBJECTS) $(libglxvnd_la_DEPENDENCIES) $(EXTRA_libglxvnd_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libglxvnd_la_OBJECTS) $(libglxvnd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -655,6 +703,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/singlepixswap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/singlesize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap_interval.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vndcmds.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vndext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vndservermapping.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vndservervendor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfont.Plo@am__quote@ .c.o: @@ -683,6 +735,27 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-sdkHEADERS: $(sdk_HEADERS) + @$(NORMAL_INSTALL) + @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sdkdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sdkdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \ + done + +uninstall-sdkHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(sdkdir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -782,8 +855,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: + for dir in "$(DESTDIR)$(sdkdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -837,7 +913,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-sdkHEADERS install-dvi: install-dvi-am @@ -883,7 +959,7 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-sdkHEADERS .MAKE: install-am install-strip @@ -895,11 +971,11 @@ uninstall-am: install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-ps install-ps-am install-sdkHEADERS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + tags uninstall uninstall-am uninstall-sdkHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/glx/createcontext.c b/xserver/glx/createcontext.c index c8b36ebb0..24b02ddfb 100644 --- a/xserver/glx/createcontext.c +++ b/xserver/glx/createcontext.c @@ -28,6 +28,7 @@ #include "glxserver.h" #include "glxext.h" #include "indirect_dispatch.h" +#include "opaque.h" #define ALL_VALID_FLAGS \ (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \ @@ -37,29 +38,29 @@ static Bool validate_GL_version(int major_version, int minor_version) { if (major_version <= 0 || minor_version < 0) - return False; + return FALSE; switch (major_version) { case 1: if (minor_version > 5) - return False; + return FALSE; break; case 2: if (minor_version > 1) - return False; + return FALSE; break; case 3: if (minor_version > 3) - return False; + return FALSE; break; default: break; } - return True; + return TRUE; } static Bool @@ -70,9 +71,9 @@ validate_render_type(uint32_t render_type) case GLX_COLOR_INDEX_TYPE: case GLX_RGBA_FLOAT_TYPE_ARB: case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT: - return True; + return TRUE; default: - return False; + return FALSE; } } @@ -93,7 +94,7 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) __GLXcontext *ctx = NULL; __GLXcontext *shareCtx = NULL; __GLXscreen *glxScreen; - __GLXconfig *config; + __GLXconfig *config = NULL; int err; /* The GLX_ARB_create_context_robustness spec says: @@ -123,8 +124,6 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) if (req->length != expected_size) return BadLength; - LEGAL_NEW_RESOURCE(req->context, client); - /* The GLX_ARB_create_context spec says: * * "* If is not a valid GLXFBConfig, GLXBadFBConfig is @@ -136,8 +135,10 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) if (!validGlxScreen(client, req->screen, &glxScreen, &err)) return __glXError(GLXBadFBConfig); - if (!validGlxFBConfig(client, glxScreen, req->fbconfig, &config, &err)) - return __glXError(GLXBadFBConfig); + if (req->fbconfig) { + if (!validGlxFBConfig(client, glxScreen, req->fbconfig, &config, &err)) + return __glXError(GLXBadFBConfig); + } /* Validate the context with which the new context should share resources. */ @@ -182,6 +183,9 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) break; case GLX_RENDER_TYPE: + /* Not valid for GLX_EXT_no_config_context */ + if (!req->fbconfig) + return BadValue; render_type = attribs[2 * i + 1]; break; @@ -206,8 +210,23 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) break; #endif + case GLX_SCREEN: + /* Only valid for GLX_EXT_no_config_context */ + if (req->fbconfig) + return BadValue; + /* Must match the value in the request header */ + if (attribs[2 * i + 1] != req->screen) + return BadValue; + break; + + case GLX_CONTEXT_OPENGL_NO_ERROR_ARB: + /* ignore */ + break; + default: - return BadValue; + if (!req->isDirect) + return BadValue; + break; } } @@ -302,6 +321,17 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) err = BadAlloc; } else { + /* Only allow creating indirect GLX contexts if allowed by + * server command line. Indirect GLX is of limited use (since + * it's only GL 1.4), it's slower than direct contexts, and + * it's a massive attack surface for buffer overflow type + * errors. + */ + if (!enableIndirectGLX) { + client->errorValue = req->isDirect; + return BadValue; + } + ctx = glxScreen->createContext(glxScreen, config, shareCtx, req->numAttribs, (uint32_t *) attribs, &err); @@ -314,7 +344,7 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) ctx->config = config; ctx->id = req->context; ctx->share_id = req->shareList; - ctx->idExists = True; + ctx->idExists = TRUE; ctx->isDirect = req->isDirect; ctx->renderMode = GL_RENDER; ctx->resetNotificationStrategy = reset; diff --git a/xserver/glx/extension_string.c b/xserver/glx/extension_string.c index d1da4815c..354ce06f7 100644 --- a/xserver/glx/extension_string.c +++ b/xserver/glx/extension_string.c @@ -74,6 +74,7 @@ static const struct extension_info known_glx_extensions[] = { /* *INDENT-OFF* */ { GLX(ARB_context_flush_control), VER(0,0), N, }, { GLX(ARB_create_context), VER(0,0), N, }, + { GLX(ARB_create_context_no_error), VER(0,0), N, }, { GLX(ARB_create_context_profile), VER(0,0), N, }, { GLX(ARB_create_context_robustness), VER(0,0), N, }, { GLX(ARB_fbconfig_float), VER(0,0), N, }, @@ -86,6 +87,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(EXT_framebuffer_sRGB), VER(0,0), N, }, { GLX(EXT_import_context), VER(0,0), Y, }, { GLX(EXT_libglvnd), VER(0,0), N, }, + { GLX(EXT_no_config_context), VER(0,0), N, }, { GLX(EXT_stereo_tree), VER(0,0), N, }, { GLX(EXT_texture_from_pixmap), VER(0,0), N, }, { GLX(EXT_visual_info), VER(0,0), Y, }, diff --git a/xserver/glx/extension_string.h b/xserver/glx/extension_string.h index a10d7108a..eab385a3c 100644 --- a/xserver/glx/extension_string.h +++ b/xserver/glx/extension_string.h @@ -38,6 +38,7 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ ARB_context_flush_control_bit = 0, ARB_create_context_bit, + ARB_create_context_no_error_bit, ARB_create_context_profile_bit, ARB_create_context_robustness_bit, ARB_fbconfig_float_bit, @@ -48,6 +49,7 @@ enum { EXT_fbconfig_packed_float_bit, EXT_import_context_bit, EXT_libglvnd_bit, + EXT_no_config_context_bit, EXT_stereo_tree_bit, EXT_texture_from_pixmap_bit, EXT_visual_info_bit, diff --git a/xserver/glx/glxbyteorder.h b/xserver/glx/glxbyteorder.h index aa88b44b9..8f0cd8a4b 100644 --- a/xserver/glx/glxbyteorder.h +++ b/xserver/glx/glxbyteorder.h @@ -35,27 +35,6 @@ #include #endif -#if HAVE_BYTESWAP_H -#include -#elif defined(USE_SYS_ENDIAN_H) -#include -#elif defined(__APPLE__) -#include -#define bswap_16 OSSwapInt16 -#define bswap_32 OSSwapInt32 -#define bswap_64 OSSwapInt64 -#else -#define bswap_16(value) \ - ((((value) & 0xff) << 8) | ((value) >> 8)) - -#define bswap_32(value) \ - (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ - (uint32_t)bswap_16((uint16_t)((value) >> 16))) - -#define bswap_64(value) \ - (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ - << 32) | \ - (uint64_t)bswap_32((uint32_t)((value) >> 32))) -#endif +#include "misc.h" #endif /* !defined(__GLXBYTEORDER_H__) */ diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c index 295857b26..54d452e58 100644 --- a/xserver/glx/glxcmds.c +++ b/xserver/glx/glxcmds.c @@ -37,6 +37,7 @@ #include "glxserver.h" #include +#include #include #include #include @@ -46,6 +47,7 @@ #include "indirect_table.h" #include "indirect_util.h" #include "protocol-versions.h" +#include "glxvndabi.h" static char GLXServerVendorName[] = "SGI"; @@ -134,6 +136,12 @@ _X_HIDDEN int validGlxContext(ClientPtr client, XID id, int access_mode, __GLXcontext ** context, int *err) { + /* no ghost contexts */ + if (id & SERVER_BIT) { + *err = __glXError(GLXBadContext); + return FALSE; + } + *err = dixLookupResourceByType((void **) context, id, __glXContextRes, client, access_mode); if (*err != Success || (*context)->idExists == GL_FALSE) { @@ -225,7 +233,7 @@ __glXdirectContextCreate(__GLXscreen * screen, /** * Create a GL context with the given properties. This routine is used * to implement \c glXCreateContext, \c glXCreateNewContext, and - * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way + * \c glXCreateContextWithConfigSGIX. This works because of the hack way * that GLXFBConfigs are implemented. Basically, the FBConfigID is the * same as the VisualID. */ @@ -239,8 +247,6 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, __GLXcontext *glxc, *shareglxc; int err; - LEGAL_NEW_RESOURCE(gcId, client); - /* ** Find the display list space that we want to share. ** @@ -355,14 +361,11 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, int __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; - REQUEST_SIZE_MATCH(xGLXCreateContextReq); - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) @@ -375,14 +378,11 @@ __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc) int __glXDisp_CreateNewContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; - REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) @@ -416,64 +416,47 @@ __glXDisp_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) int __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLXcontext *glxc; int err; - REQUEST_SIZE_MATCH(xGLXDestroyContextReq); - if (!validGlxContext(cl->client, req->context, DixDestroyAccess, &glxc, &err)) return err; glxc->idExists = GL_FALSE; - if (!glxc->currentClient) - FreeResourceByType(req->context, __glXContextRes, FALSE); + if (glxc->currentClient) { + XID ghost = FakeClientID(glxc->currentClient->index); + + if (!AddResource(ghost, __glXContextRes, glxc)) + return BadAlloc; + ChangeResourceValue(glxc->id, __glXContextRes, NULL); + glxc->id = ghost; + } + + FreeResourceByType(req->context, __glXContextRes, FALSE); return Success; } -/* - * This will return "deleted" contexts, ie, where idExists is GL_FALSE. - * Contrast validGlxContext, which will not. We're cheating here and - * using the XID as the context tag, which is fine as long as we defer - * actually destroying the context until it's no longer referenced, and - * block clients from trying to MakeCurrent on contexts that are on the - * way to destruction. Notice that DoMakeCurrent calls validGlxContext - * for new contexts but __glXLookupContextByTag for previous contexts. - */ __GLXcontext * __glXLookupContextByTag(__GLXclientState * cl, GLXContextTag tag) { - __GLXcontext *ret; + return glxServer.getContextTagPrivate(cl->client, tag); +} - if (dixLookupResourceByType((void **) &ret, tag, __glXContextRes, - cl->client, DixUseAccess) == Success) - return ret; +static __GLXconfig * +inferConfigForWindow(__GLXscreen *pGlxScreen, WindowPtr pWin) +{ + int i, vid = wVisual(pWin); + + for (i = 0; i < pGlxScreen->numVisuals; i++) + if (pGlxScreen->visuals[i]->visualID == vid) + return pGlxScreen->visuals[i]; return NULL; } -/*****************************************************************************/ - -static void -StopUsingContext(__GLXcontext * glxc) -{ - if (glxc) { - glxc->currentClient = NULL; - if (!glxc->idExists) { - FreeResourceByType(glxc->id, __glXContextRes, FALSE); - } - } -} - -static void -StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc) -{ - glxc->currentClient = cl->client; -} - /** * This is a helper function to handle the legacy (pre GLX 1.3) cases * where passing an X window to glXMakeCurrent is valid. Given a @@ -486,11 +469,15 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, { DrawablePtr pDraw; __GLXdrawable *pGlxDraw; + __GLXconfig *config; + __GLXscreen *pGlxScreen; int rc; if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, DixWriteAccess, &pGlxDraw, &rc)) { - if (glxc != NULL && pGlxDraw->config != glxc->config) { + if (glxc != NULL && + glxc->config != NULL && + glxc->config != pGlxDraw->config) { client->errorValue = drawId; *error = BadMatch; return NULL; @@ -518,19 +505,35 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, return NULL; } - if (pDraw->pScreen != glxc->pGlxScreen->pScreen) { + pGlxScreen = glxc->pGlxScreen; + if (pDraw->pScreen != pGlxScreen->pScreen) { client->errorValue = pDraw->pScreen->myNum; *error = BadMatch; return NULL; } - if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error)) + config = glxc->config; + if (!config) + config = inferConfigForWindow(pGlxScreen, (WindowPtr)pDraw); + if (!config) { + /* + * If we get here, we've tried to bind a no-config context to a + * window without a corresponding fbconfig, presumably because + * we don't support GL on it (PseudoColor perhaps). From GLX Section + * 3.3.7 "Rendering Contexts": + * + * "If draw or read are not compatible with ctx a BadMatch error + * is generated." + */ + *error = BadMatch; + return NULL; + } + + if (!validGlxFBConfigForWindow(client, config, pDraw, error)) return NULL; - pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen, - pDraw, drawId, - GLX_DRAWABLE_WINDOW, - drawId, glxc->config); + pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw, drawId, + GLX_DRAWABLE_WINDOW, drawId, config); if (!pGlxDraw) { *error = BadAlloc; return NULL; @@ -550,108 +553,77 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, ** Make an OpenGL context and drawable current. */ -static int -DoMakeCurrent(__GLXclientState * cl, - GLXDrawable drawId, GLXDrawable readId, - GLXContextID contextId, GLXContextTag tag) +int +xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, + XID contextId, GLXContextTag newContextTag) { - ClientPtr client = cl->client; - xGLXMakeCurrentReply reply; - __GLXcontext *glxc, *prevglxc; + __GLXclientState *cl = glxGetClient(client); + __GLXcontext *glxc = NULL, *prevglxc = NULL; __GLXdrawable *drawPriv = NULL; __GLXdrawable *readPriv = NULL; int error; - GLuint mask; - /* - ** If one is None and the other isn't, it's a bad match. - */ - - mask = (drawId == None) ? (1 << 0) : 0; - mask |= (readId == None) ? (1 << 1) : 0; - mask |= (contextId == None) ? (1 << 2) : 0; - - if ((mask != 0x00) && (mask != 0x07)) { + /* Drawables but no context makes no sense */ + if (!contextId && (drawId || readId)) return BadMatch; - } - /* - ** Lookup old context. If we have one, it must be in a usable state. - */ + /* If either drawable is null, the other must be too */ + if ((drawId == None) != (readId == None)) + return BadMatch; + + /* Look up old context. If we have one, it must be in a usable state. */ if (tag != 0) { - prevglxc = __glXLookupContextByTag(cl, tag); - if (!prevglxc) { - /* - ** Tag for previous context is invalid. - */ + prevglxc = glxServer.getContextTagPrivate(client, tag); + if (!prevglxc) return __glXError(GLXBadContextTag); - } + if (prevglxc->renderMode != GL_RENDER) { /* Oops. Not in render mode render. */ client->errorValue = prevglxc->id; return __glXError(GLXBadContextState); } } - else { - prevglxc = 0; - } - /* - ** Lookup new context. It must not be current for someone else. - */ + /* Look up new context. It must not be current for someone else. */ if (contextId != None) { int status; if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error)) return error; - if ((glxc != prevglxc) && glxc->currentClient) { - /* Context is current to somebody else */ + + if ((glxc != prevglxc) && glxc->currentClient) return BadAccess; + + if (drawId) { + drawPriv = __glXGetDrawable(glxc, drawId, client, &status); + if (drawPriv == NULL) + return status; } - assert(drawId != None); - assert(readId != None); - - drawPriv = __glXGetDrawable(glxc, drawId, client, &status); - if (drawPriv == NULL) - return status; - - readPriv = __glXGetDrawable(glxc, readId, client, &status); - if (readPriv == NULL) - return status; - - } - else { - /* Switching to no context. Ignore new drawable. */ - glxc = 0; - drawPriv = 0; - readPriv = 0; + if (readId) { + readPriv = __glXGetDrawable(glxc, readId, client, &status); + if (readPriv == NULL) + return status; + } } if (prevglxc) { - /* - ** Flush the previous context if needed. - */ + /* Flush the previous context if needed. */ Bool need_flush = !prevglxc->isDirect; #ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) need_flush = GL_FALSE; #endif if (need_flush) { - if (__glXForceCurrent(cl, tag, (int *) &error)) { - glFlush(); - } - else { + if (!__glXForceCurrent(cl, tag, (int *) &error)) return error; - } + glFlush(); } - /* - ** Make the previous context not current. - */ - if (!(*prevglxc->loseCurrent) (prevglxc)) { + /* Make the previous context not current. */ + if (!(*prevglxc->loseCurrent) (prevglxc)) return __glXError(GLXBadContext); - } + lastGLContext = NULL; if (!prevglxc->isDirect) { prevglxc->drawPriv = NULL; @@ -659,8 +631,7 @@ DoMakeCurrent(__GLXclientState * cl, } } - if ((glxc != 0) && !glxc->isDirect) { - + if (glxc && !glxc->isDirect) { glxc->drawPriv = drawPriv; glxc->readPriv = readPriv; @@ -674,65 +645,35 @@ DoMakeCurrent(__GLXclientState * cl, } glxc->currentClient = client; + glxServer.setContextTagPrivate(client, newContextTag, glxc); } - StopUsingContext(prevglxc); - - reply = (xGLXMakeCurrentReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .contextTag = 0 - }; - - if (glxc) { - StartUsingContext(cl, glxc); - reply.contextTag = glxc->id; + if (prevglxc) { + prevglxc->currentClient = NULL; + if (!prevglxc->idExists) { + FreeResourceByType(prevglxc->id, __glXContextRes, FALSE); + } } - if (client->swapped) { - __glXSwapMakeCurrentReply(client, &reply); - } - else { - WriteToClient(client, sz_xGLXMakeCurrentReply, &reply); - } return Success; } int __glXDisp_MakeCurrent(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); - - return DoMakeCurrent(cl, req->drawable, req->drawable, - req->context, req->oldContextTag); + return BadImplementation; } int __glXDisp_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); - - return DoMakeCurrent(cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag); + return BadImplementation; } int __glXDisp_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); - - return DoMakeCurrent(cl, req->drawable, req->readable, - req->context, req->oldContextTag); + return BadImplementation; } int @@ -744,8 +685,6 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc) __GLXcontext *glxc; int err; - REQUEST_SIZE_MATCH(xGLXIsDirectReq); - if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) return err; @@ -757,11 +696,11 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc) }; if (client->swapped) { - __glXSwapIsDirectReply(client, &reply); - } - else { - WriteToClient(client, sz_xGLXIsDirectReply, &reply); + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); } + WriteToClient(client, sz_xGLXIsDirectReply, &reply); return Success; } @@ -795,25 +734,25 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc) }; if (client->swapped) { - __glXSwapQueryVersionReply(client, &reply); - } - else { - WriteToClient(client, sz_xGLXQueryVersionReply, &reply); + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.majorVersion); + __GLX_SWAP_INT(&reply.minorVersion); } + + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); return Success; } int __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; GLXContextTag tag; __GLXcontext *glxc = NULL; int error; - REQUEST_SIZE_MATCH(xGLXWaitGLReq); - tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); @@ -835,14 +774,11 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc) int __glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *) pc; GLXContextTag tag; __GLXcontext *glxc = NULL; int error; - REQUEST_SIZE_MATCH(xGLXWaitXReq); - tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); @@ -871,8 +807,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc) __GLXcontext *src, *dst; int error; - REQUEST_SIZE_MATCH(xGLXCopyContextReq); - source = req->source; dest = req->dest; tag = req->contextTag; @@ -960,8 +894,6 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; @@ -1181,10 +1113,8 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen) int __glXDisp_GetFBConfigs(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; - REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); return DoGetFBConfigs(cl, req->screen); } @@ -1255,8 +1185,6 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen * pGlxScreen, DrawablePtr pDraw; int err; - LEGAL_NEW_RESOURCE(glxDrawableId, client); - err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess); if (err != Success) { client->errorValue = drawableId; @@ -1322,14 +1250,11 @@ determineTextureTarget(ClientPtr client, XID glxDrawableID, int __glXDisp_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) @@ -1410,11 +1335,8 @@ DoDestroyDrawable(__GLXclientState * cl, XID glxdrawable, int type) int __glXDisp_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; - REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); - return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); } @@ -1440,18 +1362,14 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, PixmapPtr pPixmap; int err; - LEGAL_NEW_RESOURCE(glxDrawableId, client); - if (!validGlxScreen(client, screenNum, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err)) return err; - __glXenterServer(GL_FALSE); pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, width, height, config->rgbBits, 0); - __glXleaveServer(GL_FALSE); if (!pPixmap) return BadAlloc; @@ -1628,8 +1546,6 @@ __glXDisp_CreateWindow(__GLXclientState * cl, GLbyte * pc) } REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); - LEGAL_NEW_RESOURCE(req->glxwindow, client); - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err)) @@ -1679,8 +1595,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc) __GLXdrawable *pGlxDraw; int error; - REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); - tag = req->contextTag; drawId = req->drawable; if (tag) { @@ -1741,16 +1655,25 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) sendBuf[0] = GLX_SHARE_CONTEXT_EXT; sendBuf[1] = (int) (ctx->share_id); sendBuf[2] = GLX_VISUAL_ID_EXT; - sendBuf[3] = (int) (ctx->config->visualID); + sendBuf[3] = (int) (ctx->config ? ctx->config->visualID : 0); sendBuf[4] = GLX_SCREEN_EXT; sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum); sendBuf[6] = GLX_FBCONFIG_ID; - sendBuf[7] = (int) (ctx->config->fbconfigID); + sendBuf[7] = (int) (ctx->config ? ctx->config->fbconfigID : 0); sendBuf[8] = GLX_RENDER_TYPE; - sendBuf[9] = (int) (ctx->config->renderType); + sendBuf[9] = (int) (ctx->config ? ctx->config->renderType : GLX_DONT_CARE); if (client->swapped) { - __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); + int length = reply.length; + + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.n); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); + __GLX_SWAP_INT_ARRAY((int *) sendBuf, length); + WriteToClient(client, length << 2, sendBuf); } else { WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); @@ -1774,11 +1697,8 @@ __glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) int __glXDisp_QueryContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; - REQUEST_SIZE_MATCH(xGLXQueryContextReq); - return DoQueryContext(cl, req->context); } @@ -1819,10 +1739,10 @@ __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc) DixReadAccess, &pGlxDraw, &error)) return error; - if (!context->textureFromPixmap) + if (!context->bindTexImage) return __glXError(GLXUnsupportedPrivateRequest); - return context->textureFromPixmap->bindTexImage(context, buffer, pGlxDraw); + return context->bindTexImage(context, buffer, pGlxDraw); } int @@ -1851,11 +1771,10 @@ __glXDisp_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc) DixReadAccess, &pGlxDraw, &error)) return error; - if (!context->textureFromPixmap) + if (!context->releaseTexImage) return __glXError(GLXUnsupportedPrivateRequest); - return context->textureFromPixmap->releaseTexImage(context, - buffer, pGlxDraw); + return context->releaseTexImage(context, buffer, pGlxDraw); } int @@ -1981,7 +1900,16 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) }; if (client->swapped) { - __glXSwapGetDrawableAttributesReply(client, &reply, attributes); + int length = reply.length; + + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.numAttribs); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply); + __GLX_SWAP_INT_ARRAY((int *) attributes, length); + WriteToClient(client, length << 2, attributes); } else { WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply); @@ -2022,6 +1950,18 @@ __glXDisp_GetDrawableAttributesSGIX(__GLXclientState * cl, GLbyte * pc) ** client library to send batches of GL rendering commands. */ +/* +** Reset state used to keep track of large (multi-request) commands. +*/ +static void +ResetLargeCommandStatus(__GLXcontext *cx) +{ + cx->largeCmdBytesSoFar = 0; + cx->largeCmdBytesTotal = 0; + cx->largeCmdRequestsSoFar = 0; + cx->largeCmdRequestsTotal = 0; +} + /* ** Execute all the drawing commands in a request. */ @@ -2153,8 +2093,6 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) glxc = __glXForceCurrent(cl, req->contextTag, &error); if (!glxc) { - /* Reset in case this isn't 1st request. */ - __glXResetLargeCommandStatus(cl); return error; } if (safe_pad(req->dataBytes) < 0) @@ -2167,12 +2105,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) { client->errorValue = req->length; /* Reset in case this isn't 1st request. */ - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return BadLength; } pc += sz_xGLXRenderLargeReq; - if (cl->largeCmdRequestsSoFar == 0) { + if (glxc->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData entry; int extra = 0; int left = (req->length << 2) - sz_xGLXRenderLargeReq; @@ -2231,21 +2169,21 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) /* ** Make enough space in the buffer, then copy the entire request. */ - if (cl->largeCmdBufSize < cmdlen) { - GLbyte *newbuf = cl->largeCmdBuf; + if (glxc->largeCmdBufSize < cmdlen) { + GLbyte *newbuf = glxc->largeCmdBuf; if (!(newbuf = realloc(newbuf, cmdlen))) return BadAlloc; - cl->largeCmdBuf = newbuf; - cl->largeCmdBufSize = cmdlen; + glxc->largeCmdBuf = newbuf; + glxc->largeCmdBufSize = cmdlen; } - memcpy(cl->largeCmdBuf, pc, dataBytes); + memcpy(glxc->largeCmdBuf, pc, dataBytes); - cl->largeCmdBytesSoFar = dataBytes; - cl->largeCmdBytesTotal = cmdlen; - cl->largeCmdRequestsSoFar = 1; - cl->largeCmdRequestsTotal = req->requestTotal; + glxc->largeCmdBytesSoFar = dataBytes; + glxc->largeCmdBytesTotal = cmdlen; + glxc->largeCmdRequestsSoFar = 1; + glxc->largeCmdRequestsTotal = req->requestTotal; return Success; } @@ -2259,37 +2197,37 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) /* ** Check the request number and the total request count. */ - if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) { + if (req->requestNumber != glxc->largeCmdRequestsSoFar + 1) { client->errorValue = req->requestNumber; - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return __glXError(GLXBadLargeRequest); } - if (req->requestTotal != cl->largeCmdRequestsTotal) { + if (req->requestTotal != glxc->largeCmdRequestsTotal) { client->errorValue = req->requestTotal; - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return __glXError(GLXBadLargeRequest); } /* ** Check that we didn't get too much data. */ - if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) { + if ((bytesSoFar = safe_add(glxc->largeCmdBytesSoFar, dataBytes)) < 0) { client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return __glXError(GLXBadLargeRequest); } - if (bytesSoFar > cl->largeCmdBytesTotal) { + if (bytesSoFar > glxc->largeCmdBytesTotal) { client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return __glXError(GLXBadLargeRequest); } - memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); - cl->largeCmdBytesSoFar += dataBytes; - cl->largeCmdRequestsSoFar++; + memcpy(glxc->largeCmdBuf + glxc->largeCmdBytesSoFar, pc, dataBytes); + glxc->largeCmdBytesSoFar += dataBytes; + glxc->largeCmdRequestsSoFar++; - if (req->requestNumber == cl->largeCmdRequestsTotal) { + if (req->requestNumber == glxc->largeCmdRequestsTotal) { __GLXdispatchRenderProcPtr proc; /* @@ -2305,12 +2243,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) ** fixes a bug that did not allow large commands of odd sizes to ** be accepted by the server. */ - if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) { + if (safe_pad(glxc->largeCmdBytesSoFar) != glxc->largeCmdBytesTotal) { client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); return __glXError(GLXBadLargeRequest); } - hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf; + hdr = (__GLXrenderLargeHeader *) glxc->largeCmdBuf; /* ** The opcode and length field in the header had already been ** swapped when the first request was received. @@ -2330,12 +2268,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) /* ** Skip over the header and execute the command. */ - (*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); + (*proc) (glxc->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); /* ** Reset for the next RenderLarge series. */ - __glXResetLargeCommandStatus(cl); + ResetLargeCommandStatus(glxc); } else { /* @@ -2367,8 +2305,7 @@ __glXDisp_VendorPrivate(__GLXclientState * cl, GLbyte * pc) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 0); if (proc != NULL) { - (*proc) (cl, (GLbyte *) req); - return Success; + return (*proc) (cl, (GLbyte *) req); } cl->client->errorValue = req->vendorCode; @@ -2407,8 +2344,6 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) char *buf; int err; - REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; @@ -2428,7 +2363,14 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) memcpy(buf, pGlxScreen->GLXextensions, n); if (client->swapped) { - glxSwapQueryExtensionsStringReply(client, &reply, buf); + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.n); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply); + __GLX_SWAP_INT_ARRAY((int *) buf, length); + WriteToClient(client, length << 2, buf); } else { WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply); @@ -2455,8 +2397,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) __GLXscreen *pGlxScreen; int err; - REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; @@ -2496,7 +2436,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) memcpy(buf, ptr, n); if (client->swapped) { - glxSwapQueryServerStringReply(client, &reply, buf); + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.n); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); + /** no swap is needed for an array of chars **/ + /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ + WriteToClient(client, length << 2, buf); } else { WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); diff --git a/xserver/glx/glxcmdsswap.c b/xserver/glx/glxcmdsswap.c index 9ec1222f8..7d6674470 100644 --- a/xserver/glx/glxcmdsswap.c +++ b/xserver/glx/glxcmdsswap.c @@ -56,13 +56,10 @@ int __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXCreateContextReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->visual); @@ -75,13 +72,10 @@ __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->fbconfig); @@ -115,13 +109,10 @@ __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXDestroyContextReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); @@ -131,69 +122,28 @@ __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_MakeCurrent(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeCurrent(cl, pc); + return BadImplementation; } int __glXDispSwap_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readdrawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeContextCurrent(cl, pc); + return BadImplementation; } int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeCurrentReadSGI(cl, pc); + return BadImplementation; } int __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXIsDirectReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); @@ -203,13 +153,10 @@ __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXQueryVersionReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->majorVersion); __GLX_SWAP_INT(&req->minorVersion); @@ -220,13 +167,10 @@ __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXWaitGLReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -236,13 +180,10 @@ __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXWaitXReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -252,13 +193,10 @@ __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXCopyContextReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->source); __GLX_SWAP_INT(&req->dest); @@ -270,13 +208,10 @@ __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); - __GLX_SWAP_INT(&req->screen); return __glXDisp_GetVisualConfigs(cl, pc); } @@ -284,13 +219,10 @@ __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); - __GLX_SWAP_INT(&req->screen); return __glXDisp_GetFBConfigs(cl, pc); } @@ -312,13 +244,10 @@ __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->visual); @@ -380,13 +309,10 @@ __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->glxpixmap); @@ -412,13 +338,10 @@ __glXDispSwap_DestroyPixmap(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_QueryContext(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXQueryContextReq); - __GLX_SWAP_INT(&req->context); return __glXDisp_QueryContext(cl, pc); @@ -474,13 +397,10 @@ __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); - __GLX_SWAP_INT(&req->pbuffer); return __glXDisp_DestroyPbuffer(cl, pc); @@ -604,13 +524,10 @@ __glXDispSwap_DestroyWindow(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->drawable); @@ -621,13 +538,10 @@ __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXUseXFontReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->font); @@ -641,13 +555,10 @@ __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); @@ -657,13 +568,10 @@ __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_QueryServerString(__GLXclientState * cl, GLbyte * pc) { - ClientPtr client = cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; - REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); - __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->name); @@ -825,109 +733,6 @@ __glXDispSwap_GetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) /************************************************************************/ -/* -** Swap replies. -*/ - -void -__glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->contextTag); - WriteToClient(client, sz_xGLXMakeCurrentReply, reply); -} - -void -__glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - WriteToClient(client, sz_xGLXIsDirectReply, reply); -} - -void -__glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->majorVersion); - __GLX_SWAP_INT(&reply->minorVersion); - WriteToClient(client, sz_xGLXQueryVersionReply, reply); -} - -void -glxSwapQueryExtensionsStringReply(ClientPtr client, - xGLXQueryExtensionsStringReply * reply, - char *buf) -{ - int length = reply->length; - - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply); - __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, buf); -} - -void -glxSwapQueryServerStringReply(ClientPtr client, - xGLXQueryServerStringReply * reply, char *buf) -{ - int length = reply->length; - - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryServerStringReply, reply); - /** no swap is needed for an array of chars **/ - /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ - WriteToClient(client, length << 2, buf); -} - -void -__glXSwapQueryContextInfoEXTReply(ClientPtr client, - xGLXQueryContextInfoEXTReply * reply, - int *buf) -{ - int length = reply->length; - - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply); - __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, buf); -} - -void -__glXSwapGetDrawableAttributesReply(ClientPtr client, - xGLXGetDrawableAttributesReply * reply, - CARD32 *buf) -{ - int length = reply->length; - - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->numAttribs); - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply); - __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, buf); -} - -/************************************************************************/ - /* ** Render and Renderlarge are not in the GLX API. They are used by the GLX ** client library to send batches of GL rendering commands. @@ -976,8 +781,7 @@ __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 1); if (proc != NULL) { - (*proc) (cl, (GLbyte *) req); - return Success; + return (*proc) (cl, (GLbyte *) req); } cl->client->errorValue = req->vendorCode; diff --git a/xserver/glx/glxcontext.h b/xserver/glx/glxcontext.h index edbd491ff..8f623b4b4 100644 --- a/xserver/glx/glxcontext.h +++ b/xserver/glx/glxcontext.h @@ -35,14 +35,6 @@ * Silicon Graphics, Inc. */ -typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap; -struct __GLXtextureFromPixmap { - int (*bindTexImage) (__GLXcontext * baseContext, - int buffer, __GLXdrawable * pixmap); - int (*releaseTexImage) (__GLXcontext * baseContext, - int buffer, __GLXdrawable * pixmap); -}; - struct __GLXcontext { void (*destroy) (__GLXcontext * context); int (*makeCurrent) (__GLXcontext * context); @@ -50,7 +42,11 @@ struct __GLXcontext { int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask); Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error); - __GLXtextureFromPixmap *textureFromPixmap; + /* EXT_texture_from_pixmap */ + int (*bindTexImage) (__GLXcontext * baseContext, + int buffer, __GLXdrawable * pixmap); + int (*releaseTexImage) (__GLXcontext * baseContext, + int buffer, __GLXdrawable * pixmap); /* ** list of context structs @@ -116,6 +112,16 @@ struct __GLXcontext { GLuint *selectBuf; GLint selectBufSize; /* number of elements allocated */ + /* + ** Keep track of large rendering commands, which span multiple requests. + */ + GLint largeCmdBytesSoFar; /* bytes received so far */ + GLint largeCmdBytesTotal; /* total bytes expected */ + GLint largeCmdRequestsSoFar; /* requests received so far */ + GLint largeCmdRequestsTotal; /* total requests expected */ + GLbyte *largeCmdBuf; + GLint largeCmdBufSize; + /* ** The drawable private this context is bound to */ diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c index 91de0476a..d402ca860 100644 --- a/xserver/glx/glxdri2.c +++ b/xserver/glx/glxdri2.c @@ -42,10 +42,10 @@ #include #include +#include #include "glxserver.h" #include "glxutil.h" #include "glxdricommon.h" -#include #include "extension_string.h" @@ -335,11 +335,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext, return Success; } -static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { - __glXDRIbindTexImage, - __glXDRIreleaseTexImage -}; - static Bool dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, const uint32_t *attribs, @@ -349,11 +344,11 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, unsigned i; if (num_attribs == 0) - return True; + return TRUE; if (attribs == NULL) { *error = BadImplementation; - return False; + return FALSE; } *major_ver = 1; @@ -386,13 +381,13 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, break; default: *error = __glXError(GLXBadProfileARB); - return False; + return FALSE; } break; case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB: if (screen->dri2->base.version >= 4) { *error = BadValue; - return False; + return FALSE; } switch (attribs[i * 2 + 1]) { @@ -404,14 +399,20 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, break; default: *error = BadValue; - return False; + return FALSE; } break; + case GLX_SCREEN: + /* already checked for us */ + break; + case GLX_CONTEXT_OPENGL_NO_ERROR_ARB: + /* ignore */ + break; default: /* If an unknown attribute is received, fail. */ *error = BadValue; - return False; + return FALSE; } } @@ -419,7 +420,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, */ if ((*flags & ~ALL_DRI_CTX_FLAGS) != 0) { *error = BadValue; - return False; + return FALSE; } /* If the core profile is requested for a GL version is less than 3.2, @@ -433,7 +434,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, } *error = Success; - return True; + return TRUE; } static void @@ -445,6 +446,7 @@ create_driver_context(__GLXDRIcontext * context, const uint32_t *attribs, int *error) { + const __DRIconfig *driConfig = config ? config->driConfig : NULL; context->driContext = NULL; if (screen->dri2->base.version >= 3) { @@ -488,10 +490,8 @@ create_driver_context(__GLXDRIcontext * context, } context->driContext = - (*screen->dri2->createContextAttribs)(screen->driScreen, - api, - config->driConfig, - driShare, + (*screen->dri2->createContextAttribs)(screen->driScreen, api, + driConfig, driShare, num_ctx_attribs / 2, ctx_attribs, &dri_err, @@ -527,8 +527,7 @@ create_driver_context(__GLXDRIcontext * context, } context->driContext = - (*screen->dri2->createNewContext) (screen->driScreen, - config->driConfig, + (*screen->dri2->createNewContext) (screen->driScreen, driConfig, driShare, context); } @@ -562,7 +561,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; - context->base.textureFromPixmap = &__glXDRItextureFromPixmap; + context->base.bindTexImage = __glXDRIbindTexImage; + context->base.releaseTexImage = __glXDRIreleaseTexImage; context->base.wait = __glXDRIcontextWait; create_driver_context(context, screen, config, driShare, num_attribs, @@ -772,7 +772,6 @@ static const __DRIuseInvalidateExtension dri2UseInvalidate = { }; static const __DRIextension *loader_extensions[] = { - &systemTimeExtension.base, &loaderExtension.base, &dri2UseInvalidate.base, NULL @@ -834,56 +833,40 @@ initializeExtensions(__GLXscreen * screen) extensions = dri->core->getExtensions(dri->driScreen); __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_no_config_context"); if (dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_no_error"); __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_create_context_es_profile"); __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_create_context_es2_profile"); - LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n"); - LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_EXT_create_context_es{,2}_profile\n"); } if (DRI2HasSwapControl(pScreen)) { __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control"); - LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control\n"); } /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */ - { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_EXT_framebuffer_sRGB"); - LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n"); - } + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); /* enable ARB_fbconfig_float extension (even if there are no float fbconfigs) */ - { - __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); - LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n"); - } + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); /* enable EXT_fbconfig_packed_float (even if there are no packed float fbconfigs) */ - { - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_fbconfig_packed_float"); - LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_fbconfig_packed_float\n"); - } + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_fbconfig_packed_float"); for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { dri->texBuffer = (const __DRItexBufferExtension *) extensions[i]; __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_texture_from_pixmap"); - LogMessage(X_INFO, - "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); } if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 && @@ -895,8 +878,6 @@ initializeExtensions(__GLXscreen * screen) dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_robustness"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_ARB_create_context_robustness\n"); } #ifdef __DRI2_FLUSH_CONTROL @@ -1026,8 +1007,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen) free(screen); - LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n"); - return NULL; } diff --git a/xserver/glx/glxdricommon.c b/xserver/glx/glxdricommon.c index dbf199c93..1baf082cf 100644 --- a/xserver/glx/glxdricommon.c +++ b/xserver/glx/glxdricommon.c @@ -35,35 +35,13 @@ #include #include #include +#include "extinit.h" #include "glxserver.h" #include "glxext.h" #include "glxcontext.h" #include "glxscreens.h" #include "glxdricommon.h" -static int -getUST(int64_t * ust) -{ - struct timeval tv; - - if (ust == NULL) - return -EFAULT; - - if (gettimeofday(&tv, NULL) == 0) { - ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; - return 0; - } - else { - return -errno; - } -} - -const __DRIsystemTimeExtension systemTimeExtension = { - {__DRI_SYSTEM_TIME, 1}, - getUST, - NULL, -}; - #define __ATTRIB(attrib, field) \ { attrib, offsetof(__GLXconfig, field) } @@ -206,28 +184,30 @@ createModeFromConfig(const __DRIcoreExtension * core, config->config.yInverted = GL_TRUE; #ifdef COMPOSITE - /* - * Here we decide what fbconfigs will be duplicated for compositing. - * fgbconfigs marked with duplicatedForConf will be reserved for - * compositing visuals. - * It might look strange to do this decision this late when translation - * from a __DRIConfig is already done, but using the __DRIConfig - * accessor function becomes worse both with respect to code complexity - * and CPU usage. - */ - if (duplicateForComp && - (render_type_is_pbuffer_only(renderType) || - config->config.rgbBits != 32 || - config->config.redBits != 8 || - config->config.greenBits != 8 || - config->config.blueBits != 8 || - config->config.visualRating != GLX_NONE || - config->config.sampleBuffers != 0)) { - free(config); - return NULL; - } + if (!noCompositeExtension) { + /* + * Here we decide what fbconfigs will be duplicated for compositing. + * fgbconfigs marked with duplicatedForConf will be reserved for + * compositing visuals. + * It might look strange to do this decision this late when translation + * from a __DRIConfig is already done, but using the __DRIConfig + * accessor function becomes worse both with respect to code complexity + * and CPU usage. + */ + if (duplicateForComp && + (render_type_is_pbuffer_only(renderType) || + config->config.rgbBits != 32 || + config->config.redBits != 8 || + config->config.greenBits != 8 || + config->config.blueBits != 8 || + config->config.visualRating != GLX_NONE || + config->config.sampleBuffers != 0)) { + free(config); + return NULL; + } - config->config.duplicatedForComp = duplicateForComp; + config->config.duplicatedForComp = duplicateForComp; + } #endif return &config->config; @@ -261,14 +241,16 @@ glxConvertConfigs(const __DRIcoreExtension * core, } #ifdef COMPOSITE - /* Duplicate fbconfigs for use with compositing visuals */ - for (i = 0; configs[i]; i++) { - tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, - GL_TRUE); - if (tail->next == NULL) - continue; + if (!noCompositeExtension) { + /* Duplicate fbconfigs for use with compositing visuals */ + for (i = 0; configs[i]; i++) { + tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, + GL_TRUE); + if (tail->next == NULL) + continue; - tail = tail->next; + tail = tail->next; + } } #endif @@ -295,14 +277,44 @@ glxProbeDriver(const char *driverName, char filename[PATH_MAX]; char *get_extensions_name; const __DRIextension **extensions = NULL; + const char *path = NULL; - snprintf(filename, sizeof filename, "%s/%s_dri.so", - dri_driver_path, driverName); + /* Search in LIBGL_DRIVERS_PATH if we're not setuid. */ + if (!PrivsElevated()) + path = getenv("LIBGL_DRIVERS_PATH"); + + if (!path) + path = dri_driver_path; + + do { + const char *next; + int path_len; + + next = strchr(path, ':'); + if (next) { + path_len = next - path; + next++; + } else { + path_len = strlen(path); + next = NULL; + } + + snprintf(filename, sizeof filename, "%.*s/%s_dri.so", path_len, path, + driverName); + + driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + if (driver != NULL) + break; - driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); - if (driver == NULL) { LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", filename, dlerror()); + + path = next; + } while (path); + + if (driver == NULL) { + LogMessage(X_ERROR, "AIGLX error: unable to load driver %s\n", + driverName); goto cleanup_failure; } diff --git a/xserver/glx/glxdricommon.h b/xserver/glx/glxdricommon.h index 2db46dc07..6851f244e 100644 --- a/xserver/glx/glxdricommon.h +++ b/xserver/glx/glxdricommon.h @@ -35,8 +35,6 @@ struct __GLXDRIconfig { __GLXconfig *glxConvertConfigs(const __DRIcoreExtension * core, const __DRIconfig ** configs); -extern const __DRIsystemTimeExtension systemTimeExtension; - void *glxProbeDriver(const char *name, void **coreExt, const char *coreName, int coreVersion, void **renderExt, const char *renderName, diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c index e310fda75..2858312de 100644 --- a/xserver/glx/glxdriswrast.c +++ b/xserver/glx/glxdriswrast.c @@ -71,8 +71,6 @@ struct __GLXDRIscreen { const __DRIcopySubBufferExtension *copySubBuffer; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; - - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -84,9 +82,6 @@ struct __GLXDRIdrawable { __GLXdrawable base; __DRIdrawable *driDrawable; __GLXDRIscreen *screen; - - GCPtr gc; /* scratch GC for span drawing */ - GCPtr swapgc; /* GC for swapping the color buffers */ }; /* white lie */ @@ -100,9 +95,6 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable) (*core->destroyDrawable) (private->driDrawable); - FreeGC(private->gc, (GContext) 0); - FreeGC(private->swapgc, (GContext) 0); - __glXDrawableRelease(drawable); free(private); @@ -208,11 +200,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext, return Success; } -static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { - __glXDRIbindTexImage, - __glXDRIreleaseTexImage -}; - static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, @@ -224,6 +211,7 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; + const __DRIconfig *driConfig = config ? config->driConfig : NULL; const __DRIcoreExtension *core = screen->core; __DRIcontext *driShare; @@ -249,11 +237,12 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; - context->base.textureFromPixmap = &__glXDRItextureFromPixmap; + context->base.bindTexImage = __glXDRIbindTexImage; + context->base.releaseTexImage = __glXDRIreleaseTexImage; context->driContext = - (*core->createNewContext) (screen->driScreen, - config->driConfig, driShare, context); + (*core->createNewContext) (screen->driScreen, driConfig, driShare, + context); return &context->base; } @@ -265,8 +254,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client, XID drawId, int type, XID glxDrawId, __GLXconfig * glxConfig) { - XID gcvals[2]; - int status; __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIdrawable *private; @@ -286,14 +273,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->base.swapBuffers = __glXDRIdrawableSwapBuffers; private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; - gcvals[0] = GXcopy; - private->gc = - CreateGC(pDraw, GCFunction, gcvals, &status, (XID) 0, serverClient); - gcvals[1] = FALSE; - private->swapgc = - CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status, - (XID) 0, serverClient); - private->driDrawable = (*driScreen->swrast->createNewDrawable) (driScreen->driScreen, config->driConfig, private); @@ -323,20 +302,13 @@ swrastPutImage(__DRIdrawable * draw, int op, GCPtr gc; __GLXcontext *cx = lastGLContext; - switch (op) { - case __DRI_SWRAST_IMAGE_OP_DRAW: - gc = drawable->gc; - break; - case __DRI_SWRAST_IMAGE_OP_SWAP: - gc = drawable->swapgc; - break; - default: - return; + if ((gc = GetScratchGC(pDraw->depth, pDraw->pScreen))) { + ValidateGC(pDraw, gc); + gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, + data); + FreeScratchGC(gc); } - ValidateGC(pDraw, gc); - - gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, data); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); @@ -367,7 +339,6 @@ static const __DRIswrastLoaderExtension swrastLoaderExtension = { }; static const __DRIextension *loader_extensions[] = { - &systemTimeExtension.base, &swrastLoaderExtension.base, NULL }; @@ -380,11 +351,13 @@ initializeExtensions(__GLXscreen * screen) int i; __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "IGLX: enabled GLX_MESA_copy_sub_buffer\n"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_no_config_context"); if (dri->swrast->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_no_error"); __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); __glXEnableExtension(screen->glx_enable_bits, @@ -507,7 +480,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) return NULL; } -_X_EXPORT __GLXprovider __glXDRISWRastProvider = { +__GLXprovider __glXDRISWRastProvider = { __glXDRIscreenProbe, "DRISWRAST", NULL diff --git a/xserver/glx/glxext.c b/xserver/glx/glxext.c index d595a05cb..99f866104 100644 --- a/xserver/glx/glxext.c +++ b/xserver/glx/glxext.c @@ -46,19 +46,17 @@ #include "glxext.h" #include "indirect_table.h" #include "indirect_util.h" +#include "glxvndabi.h" /* ** X resources. */ +static int glxGeneration; RESTYPE __glXContextRes; RESTYPE __glXDrawableRes; -/* -** Reply for most singles. -*/ -xGLXSingleReply __glXReply; - static DevPrivateKeyRec glxClientPrivateKeyRec; +static GlxServerVendor *glvnd_vendor = NULL; #define glxClientPrivateKey (&glxClientPrivateKeyRec) @@ -68,46 +66,26 @@ static DevPrivateKeyRec glxClientPrivateKeyRec; static int __glXDispatch(ClientPtr); static GLboolean __glXFreeContext(__GLXcontext * cx); -/* -** Called when the extension is reset. -*/ -static void -ResetExtension(ExtensionEntry * extEntry) -{ - lastGLContext = NULL; -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void -__glXResetLargeCommandStatus(__GLXclientState * cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - /* * This procedure is called when the client who created the context goes away - * OR when glXDestroyContext is called. In either case, all we do is flag that - * the ID is no longer valid, and (maybe) free the context. + * OR when glXDestroyContext is called. If the context is current for a client + * the dispatch layer will have moved the context struct to a fake resource ID + * and cx here will be NULL. Otherwise we really free the context. */ static int ContextGone(__GLXcontext * cx, XID id) { - cx->idExists = GL_FALSE; - if (!cx->currentClient) { - __glXFreeContext(cx); - } + if (!cx) + return TRUE; - return True; + if (!cx->currentClient) + __glXFreeContext(cx); + + return TRUE; } static __GLXcontext *glxPendingDestroyContexts; static __GLXcontext *glxAllContexts; -static int glxServerLeaveCount; static int glxBlockClients; /* @@ -152,7 +130,7 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) glxPriv->destroy(glxPriv); - return True; + return TRUE; } Bool @@ -161,12 +139,12 @@ __glXAddContext(__GLXcontext * cx) /* Register this context as a resource. */ if (!AddResource(cx->id, __glXContextRes, (void *)cx)) { - return False; + return FALSE; } cx->next = glxAllContexts; glxAllContexts = cx; - return True; + return TRUE; } static void @@ -199,6 +177,7 @@ __glXFreeContext(__GLXcontext * cx) free(cx->feedbackBuf); free(cx->selectBuf); + free(cx->largeCmdBuf); if (cx == lastGLContext) { lastGLContext = NULL; } @@ -208,9 +187,7 @@ __glXFreeContext(__GLXcontext * cx) * the latter case we need to lift the DRI lock manually. */ if (!glxBlockClients) { - __glXleaveServer(GL_FALSE); cx->destroy(cx); - __glXenterServer(GL_FALSE); } else { cx->next = glxPendingDestroyContexts; @@ -279,28 +256,13 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data) NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; __GLXclientState *cl = glxGetClient(pClient); - __GLXcontext *c, *next; switch (pClient->clientState) { - case ClientStateRunning: - cl->client = pClient; - break; - case ClientStateGone: - /* detach from all current contexts */ - for (c = glxAllContexts; c; c = next) { - next = c->next; - if (c->currentClient == pClient) { - c->loseCurrent(c); - lastGLContext = NULL; - c->currentClient = NULL; - FreeResourceByType(c->id, __glXContextRes, FALSE); - } - } - free(cl->returnBuf); - free(cl->largeCmdBuf); free(cl->GLClientextensions); + cl->returnBuf = NULL; + cl->GLClientextensions = NULL; break; default: @@ -310,7 +272,7 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data) /************************************************************************/ -static __GLXprovider *__glXProviderStack; +static __GLXprovider *__glXProviderStack = &__glXDRISWRastProvider; void GlxPushProvider(__GLXprovider * provider) @@ -327,13 +289,14 @@ checkScreenVisuals(void) for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr screen = screenInfo.screens[i]; for (j = 0; j < screen->numVisuals; j++) { - if (screen->visuals[j].class == TrueColor || - screen->visuals[j].class == DirectColor) - return True; + if ((screen->visuals[j].class == TrueColor || + screen->visuals[j].class == DirectColor) && + screen->visuals[j].nplanes > 12) + return TRUE; } } - return False; + return FALSE; } static void @@ -353,50 +316,238 @@ GetGLXDrawableBytes(void *value, XID id, ResourceSizePtr size) } } -/* -** Initialize the GLX extension. -*/ -void -GlxExtensionInit(void) +static void +xorgGlxCloseExtension(const ExtensionEntry *extEntry) { - ExtensionEntry *extEntry; - ScreenPtr pScreen; - int i; - __GLXprovider *p, **stack; - Bool glx_provided = False; + if (glvnd_vendor != NULL) { + glxServer.destroyVendor(glvnd_vendor); + glvnd_vendor = NULL; + } + lastGLContext = NULL; +} - if (serverGeneration == 1) { - for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next) - ; - *stack = &__glXDRISWRastProvider; +static int +xorgGlxHandleRequest(ClientPtr client) +{ + return __glXDispatch(client); +} + +static ScreenPtr +screenNumToScreen(int screen) +{ + if (screen < 0 || screen >= screenInfo.numScreens) + return NULL; + + return screenInfo.screens[screen]; +} + +static int +maybe_swap32(ClientPtr client, int x) +{ + return client->swapped ? bswap_32(x) : x; +} + +static GlxServerVendor * +vendorForScreen(ClientPtr client, int screen) +{ + screen = maybe_swap32(client, screen); + + return glxServer.getVendorForScreen(client, screenNumToScreen(screen)); +} + +/* this ought to be generated */ +static int +xorgGlxThunkRequest(ClientPtr client) +{ + REQUEST(xGLXVendorPrivateReq); + CARD32 vendorCode = maybe_swap32(client, stuff->vendorCode); + GlxServerVendor *vendor = NULL; + XID resource = 0; + int ret; + + switch (vendorCode) { + case X_GLXvop_QueryContextInfoEXT: { + xGLXQueryContextInfoEXTReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + if (!(vendor = glxServer.getXIDMap(maybe_swap32(client, req->context)))) + return __glXError(GLXBadContext); + break; + } + + case X_GLXvop_GetFBConfigsSGIX: { + xGLXGetFBConfigsSGIXReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + if (!(vendor = vendorForScreen(client, req->screen))) + return BadValue; + break; + } + + case X_GLXvop_CreateContextWithConfigSGIX: { + xGLXCreateContextWithConfigSGIXReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + resource = maybe_swap32(client, req->context); + if (!(vendor = vendorForScreen(client, req->screen))) + return BadValue; + break; + } + + case X_GLXvop_CreateGLXPixmapWithConfigSGIX: { + xGLXCreateGLXPixmapWithConfigSGIXReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + resource = maybe_swap32(client, req->glxpixmap); + if (!(vendor = vendorForScreen(client, req->screen))) + return BadValue; + break; + } + + case X_GLXvop_CreateGLXPbufferSGIX: { + xGLXCreateGLXPbufferSGIXReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + resource = maybe_swap32(client, req->pbuffer); + if (!(vendor = vendorForScreen(client, req->screen))) + return BadValue; + break; + } + + /* same offset for the drawable for these three */ + case X_GLXvop_DestroyGLXPbufferSGIX: + case X_GLXvop_ChangeDrawableAttributesSGIX: + case X_GLXvop_GetDrawableAttributesSGIX: { + xGLXGetDrawableAttributesSGIXReq *req = (void *)stuff; + REQUEST_AT_LEAST_SIZE(*req); + if (!(vendor = glxServer.getXIDMap(maybe_swap32(client, + req->drawable)))) + return __glXError(GLXBadDrawable); + break; + } + + /* most things just use the standard context tag */ + default: { + /* size checked by vnd layer already */ + GLXContextTag tag = maybe_swap32(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, tag); + if (!vendor) + return __glXError(GLXBadContextTag); + break; + } } - /* Mesa requires at least one True/DirectColor visual */ - if (!checkScreenVisuals()) - return; + /* If we're creating a resource, add the map now */ + if (resource) { + LEGAL_NEW_RESOURCE(resource, client); + if (!glxServer.addXIDMap(resource, vendor)) + return BadAlloc; + } - __glXContextRes = CreateNewResourceType((DeleteType) ContextGone, - "GLXContext"); - __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone, - "GLXDrawable"); - if (!__glXContextRes || !__glXDrawableRes) - return; + ret = glxServer.forwardRequest(vendor, client); - SetResourceTypeSizeFunc(__glXDrawableRes, GetGLXDrawableBytes); + if (ret == Success && vendorCode == X_GLXvop_DestroyGLXPbufferSGIX) { + xGLXDestroyGLXPbufferSGIXReq *req = (void *)stuff; + glxServer.removeXIDMap(maybe_swap32(client, req->pbuffer)); + } - if (!dixRegisterPrivateKey - (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) + if (ret != Success) + glxServer.removeXIDMap(resource); + + return ret; +} + +static GlxServerDispatchProc +xorgGlxGetDispatchAddress(CARD8 minorOpcode, CARD32 vendorCode) +{ + /* we don't support any other GLX opcodes */ + if (minorOpcode != X_GLXVendorPrivate && + minorOpcode != X_GLXVendorPrivateWithReply) + return NULL; + + /* we only support some vendor private requests */ + if (!__glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorCode, + FALSE)) + return NULL; + + return xorgGlxThunkRequest; +} + +static Bool +xorgGlxServerPreInit(const ExtensionEntry *extEntry) +{ + if (glxGeneration != serverGeneration) { + /* Mesa requires at least one True/DirectColor visual */ + if (!checkScreenVisuals()) + return FALSE; + + __glXContextRes = CreateNewResourceType((DeleteType) ContextGone, + "GLXContext"); + __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone, + "GLXDrawable"); + if (!__glXContextRes || !__glXDrawableRes) + return FALSE; + + if (!dixRegisterPrivateKey + (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) + return FALSE; + if (!AddCallback(&ClientStateCallback, glxClientCallback, 0)) + return FALSE; + + __glXErrorBase = extEntry->errorBase; + __glXEventBase = extEntry->eventBase; + + SetResourceTypeSizeFunc(__glXDrawableRes, GetGLXDrawableBytes); +#if PRESENT + __glXregisterPresentCompleteNotify(); +#endif + + glxGeneration = serverGeneration; + } + + return glxGeneration == serverGeneration; +} + +static void +xorgGlxInitGLVNDVendor(void) +{ + if (glvnd_vendor == NULL) { + GlxServerImports *imports = NULL; + imports = glxServer.allocateServerImports(); + + if (imports != NULL) { + imports->extensionCloseDown = xorgGlxCloseExtension; + imports->handleRequest = xorgGlxHandleRequest; + imports->getDispatchAddress = xorgGlxGetDispatchAddress; + imports->makeCurrent = xorgGlxMakeCurrent; + glvnd_vendor = glxServer.createVendor(imports); + glxServer.freeServerImports(imports); + } + } +} + +static void +xorgGlxServerInit(CallbackListPtr *pcbl, void *param, void *ext) +{ + const ExtensionEntry *extEntry = ext; + int i; + + if (!xorgGlxServerPreInit(extEntry)) { return; - if (!AddCallback(&ClientStateCallback, glxClientCallback, 0)) + } + + xorgGlxInitGLVNDVendor(); + if (!glvnd_vendor) { return; + } for (i = 0; i < screenInfo.numScreens; i++) { - pScreen = screenInfo.screens[i]; + ScreenPtr pScreen = screenInfo.screens[i]; + __GLXprovider *p; + + if (glxServer.getVendorForScreen(NULL, pScreen) != NULL) { + // There's already a vendor registered. + LogMessage(X_INFO, "GLX: Another vendor is already registered for screen %d\n", i); + continue; + } for (p = __glXProviderStack; p != NULL; p = p->next) { - __GLXscreen *glxScreen; - - glxScreen = p->screenProbe(pScreen); + __GLXscreen *glxScreen = p->screenProbe(pScreen); if (glxScreen != NULL) { LogMessage(X_INFO, "GLX: Initialized %s GL provider for screen %d\n", @@ -406,37 +557,19 @@ GlxExtensionInit(void) } - if (!p) + if (p) { + glxServer.setScreenVendor(pScreen, glvnd_vendor); + } else { LogMessage(X_INFO, "GLX: no usable GL providers found for screen %d\n", i); - else - glx_provided = True; + } } +} - /* don't register extension if GL is not provided on any screen */ - if (!glx_provided) - return; - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXDispatch, ResetExtension, StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXErrorBase = extEntry->errorBase; - __glXEventBase = extEntry->eventBase; -#if PRESENT - __glXregisterPresentCompleteNotify(); -#endif +Bool +xorgGlxCreateVendor(void) +{ + return AddCallback(glxServer.extensionInitCallback, xorgGlxServerInit, NULL); } /************************************************************************/ @@ -450,6 +583,9 @@ GlxExtensionInit(void) __GLXcontext * __glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error) { + ClientPtr client = cl->client; + REQUEST(xGLXSingleReq); + __GLXcontext *cx; /* @@ -463,6 +599,13 @@ __glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error) return 0; } + /* If we're expecting a glXRenderLarge request, this better be one. */ + if (cx->largeCmdRequestsSoFar != 0 && stuff->glxCode != X_GLXRenderLarge) { + client->errorValue = stuff->glxCode; + *error = __glXError(GLXBadLargeRequest); + return 0; + } + if (!cx->isDirect) { if (cx->drawPriv == NULL) { /* @@ -511,7 +654,7 @@ glxSuspendClients(void) int i; for (i = 1; i < currentMaxClients; i++) { - if (clients[i] && glxGetClient(clients[i])->inUse) + if (clients[i] && glxGetClient(clients[i])->client) IgnoreClient(clients[i]); } @@ -527,57 +670,16 @@ glxResumeClients(void) glxBlockClients = FALSE; for (i = 1; i < currentMaxClients; i++) { - if (clients[i] && glxGetClient(clients[i])->inUse) + if (clients[i] && glxGetClient(clients[i])->client) AttendClient(clients[i]); } - __glXleaveServer(GL_FALSE); for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) { next = cx->next; cx->destroy(cx); } glxPendingDestroyContexts = NULL; - __glXenterServer(GL_FALSE); -} - -static void -__glXnopEnterServer(GLboolean rendering) -{ -} - -static void -__glXnopLeaveServer(GLboolean rendering) -{ -} - -static void (*__glXenterServerFunc) (GLboolean) = __glXnopEnterServer; -static void (*__glXleaveServerFunc) (GLboolean) = __glXnopLeaveServer; - -void -__glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean), - void (*leave) (GLboolean)) -{ - __glXenterServerFunc = enter; - __glXleaveServerFunc = leave; -} - -void -__glXenterServer(GLboolean rendering) -{ - glxServerLeaveCount--; - - if (glxServerLeaveCount == 0) - (*__glXenterServerFunc) (rendering); -} - -void -__glXleaveServer(GLboolean rendering) -{ - if (glxServerLeaveCount == 0) - (*__glXleaveServerFunc) (rendering); - - glxServerLeaveCount++; } static glx_gpa_proc _get_proc_address; @@ -605,20 +707,14 @@ __glXDispatch(ClientPtr client) CARD8 opcode; __GLXdispatchSingleProcPtr proc; __GLXclientState *cl; - int retval; + int retval = BadRequest; opcode = stuff->glxCode; cl = glxGetClient(client); - /* Mark it in use so we suspend it on VT switch. */ - cl->inUse = TRUE; - /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ - if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXError(GLXBadLargeRequest); - } + + if (!cl->client) + cl->client = client; /* If we're currently blocking GLX clients, just put this guy to * sleep, reset the request and return. */ @@ -634,18 +730,8 @@ __glXDispatch(ClientPtr client) */ proc = __glXGetProtocolDecodeFunction(&Single_dispatch_info, opcode, client->swapped); - if (proc != NULL) { - GLboolean rendering = opcode <= X_GLXRenderLarge; - - __glXleaveServer(rendering); - + if (proc != NULL) retval = (*proc) (cl, (GLbyte *) stuff); - __glXenterServer(rendering); - } - else { - retval = BadRequest; - } - return retval; } diff --git a/xserver/glx/glxext.h b/xserver/glx/glxext.h index cde0e1519..5ad497e4a 100644 --- a/xserver/glx/glxext.h +++ b/xserver/glx/glxext.h @@ -57,9 +57,12 @@ extern Bool __glXAddContext(__GLXcontext * cx); extern void __glXErrorCallBack(GLenum code); extern void __glXClearErrorOccured(void); extern GLboolean __glXErrorOccured(void); -extern void __glXResetLargeCommandStatus(__GLXclientState *); extern const char GLServerVersion[]; extern int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap); +extern int +xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, + XID contextId, GLXContextTag newContextTag); + #endif /* _glxext_h_ */ diff --git a/xserver/glx/glxscreens.c b/xserver/glx/glxscreens.c index 62d66bc54..5cd9fcfd4 100644 --- a/xserver/glx/glxscreens.c +++ b/xserver/glx/glxscreens.c @@ -38,12 +38,16 @@ #include #include +#include "extinit.h" #include "privates.h" #include "glxserver.h" #include "glxutil.h" #include "glxext.h" #include "protocol-versions.h" + +#ifdef COMPOSITE #include "compositeext.h" +#endif static DevPrivateKeyRec glxScreenPrivateKeyRec; @@ -173,13 +177,6 @@ glxGetScreen(ScreenPtr pScreen) return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey); } -_X_EXPORT void -GlxSetVisualConfigs(int nconfigs, void *configs, void **privates) -{ - /* We keep this stub around for the DDX drivers that still - * call it. */ -} - GLint glxConvertToXVisualType(int visualType) { @@ -284,10 +281,12 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual) if (config->visualID != 0) continue; #ifdef COMPOSITE - /* Use only duplicated configs for compIsAlternateVisuals */ - if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) != - !!config->duplicatedForComp) - continue; + if (!noCompositeExtension) { + /* Use only duplicated configs for compIsAlternateVisuals */ + if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) != + !!config->duplicatedForComp) + continue; + } #endif /* * If possible, use the same swapmethod for all built-in visual @@ -357,8 +356,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; config->visualID = visual->vid; #ifdef COMPOSITE - if (compIsAlternateVisual(pScreen, visual->vid)) - config->visualSelectGroup++; + if (!noCompositeExtension) { + if (compIsAlternateVisual(pScreen, visual->vid)) + config->visualSelectGroup++; + } #endif } } @@ -380,10 +381,12 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) */ depth = config->redBits + config->greenBits + config->blueBits; #ifdef COMPOSITE - if (config->duplicatedForComp) { - depth += config->alphaBits; - config->visualSelectGroup++; - } + if (!noCompositeExtension) { + if (config->duplicatedForComp) { + depth += config->alphaBits; + config->visualSelectGroup++; + } + } #endif /* Make sure that our FBconfig's depth can actually be displayed * (corresponds to an existing visual). @@ -408,8 +411,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) continue; #ifdef COMPOSITE - if (config->duplicatedForComp) - (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1); + if (!noCompositeExtension) { + if (config->duplicatedForComp) + (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1); + } #endif pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; initGlxVisual(visual, config); @@ -432,8 +437,15 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) void __glXScreenDestroy(__GLXscreen * screen) { + __GLXconfig *config, *next; + free(screen->glvnd); free(screen->GLXextensions); free(screen->GLextensions); free(screen->visuals); + + for (config = screen->fbconfigs; config != NULL; config = next) { + next = config->next; + free(config); + } } diff --git a/xserver/glx/glxscreens.h b/xserver/glx/glxscreens.h index c6a0c5021..40649f88d 100644 --- a/xserver/glx/glxscreens.h +++ b/xserver/glx/glxscreens.h @@ -36,6 +36,7 @@ */ #include "extension_string.h" +#include "glxvndabi.h" typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { diff --git a/xserver/glx/glxserver.h b/xserver/glx/glxserver.h index 9088ec478..79f4944d0 100644 --- a/xserver/glx/glxserver.h +++ b/xserver/glx/glxserver.h @@ -50,11 +50,14 @@ #include #include +#ifndef GLX_CONTEXT_OPENGL_NO_ERROR_ARB +#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#endif + /* ** GLX resources. */ typedef XID GLXContextID; -typedef XID GLXPixmap; typedef XID GLXDrawable; typedef struct __GLXclientStateRec __GLXclientState; @@ -64,21 +67,13 @@ typedef struct __GLXcontext __GLXcontext; #include "glxscreens.h" #include "glxdrawable.h" #include "glxcontext.h" - -#ifndef True -#define True 1 -#endif -#ifndef False -#define False 0 -#endif +#include "glx_extinit.h" extern __GLXscreen *glxGetScreen(ScreenPtr pScreen); extern __GLXclientState *glxGetClient(ClientPtr pClient); /************************************************************************/ -void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates); - void __glXScreenInitVisuals(__GLXscreen * screen); /* @@ -91,27 +86,12 @@ int __glXError(int error); /************************************************************************/ -typedef struct __GLXprovider __GLXprovider; -struct __GLXprovider { - __GLXscreen *(*screenProbe) (ScreenPtr pScreen); - const char *name; - __GLXprovider *next; -}; -extern __GLXprovider __glXDRISWRastProvider; - -void GlxPushProvider(__GLXprovider * provider); - enum { GLX_MINIMAL_VISUALS, GLX_TYPICAL_VISUALS, GLX_ALL_VISUALS }; -void __glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean), - void (*leave) (GLboolean)); -void __glXenterServer(GLboolean rendering); -void __glXleaveServer(GLboolean rendering); - void glxSuspendClients(void); void glxResumeClients(void); @@ -133,27 +113,12 @@ __glXregisterPresentCompleteNotify(void); ** State kept per client. */ struct __GLXclientStateRec { - /* - ** Whether this structure is currently being used to support a client. - */ - Bool inUse; - /* ** Buffer for returned data. */ GLbyte *returnBuf; GLint returnBufSize; - /* - ** Keep track of large rendering commands, which span multiple requests. - */ - GLint largeCmdBytesSoFar; /* bytes received so far */ - GLint largeCmdBytesTotal; /* total bytes expected */ - GLint largeCmdRequestsSoFar; /* requests received so far */ - GLint largeCmdRequestsTotal; /* total requests expected */ - GLbyte *largeCmdBuf; - GLint largeCmdBufSize; - /* Back pointer to X client record */ ClientPtr client; @@ -169,11 +134,6 @@ typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *); typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *); typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *); -/* - * Dispatch for GLX commands. - */ -typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc); - /* * Tables for computing the size of each rendering command. */ @@ -191,39 +151,10 @@ typedef struct { */ extern RESTYPE __glXContextRes; extern RESTYPE __glXClientRes; -extern RESTYPE __glXPixmapRes; extern RESTYPE __glXDrawableRes; /************************************************************************/ -/* -** Prototypes. -*/ - -extern char *__glXcombine_strings(const char *, const char *); - -/* -** Routines for sending swapped replies. -*/ - -extern void __glXSwapMakeCurrentReply(ClientPtr client, - xGLXMakeCurrentReply * reply); -extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply); -extern void __glXSwapQueryVersionReply(ClientPtr client, - xGLXQueryVersionReply * reply); -extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client, - xGLXQueryContextInfoEXTReply * - reply, int *buf); -extern void __glXSwapGetDrawableAttributesReply(ClientPtr client, - xGLXGetDrawableAttributesReply * - reply, CARD32 *buf); -extern void glxSwapQueryExtensionsStringReply(ClientPtr client, - xGLXQueryExtensionsStringReply * - reply, char *buf); -extern void glxSwapQueryServerStringReply(ClientPtr client, - xGLXQueryServerStringReply * reply, - char *buf); - /* * Routines for computing the size of variably-sized rendering commands. */ diff --git a/xserver/glx/indirect_program.c b/xserver/glx/indirect_program.c index 5caee7b2a..c7bfa03ca 100644 --- a/xserver/glx/indirect_program.c +++ b/xserver/glx/indirect_program.c @@ -64,6 +64,7 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc, GLenum pname; GLint compsize = 0; char *answer = NULL, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; if (do_swap) { target = (GLenum) bswap_32(*(int *) (pc + 0)); @@ -92,7 +93,7 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc, } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &reply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -111,7 +112,7 @@ __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) PFNGLGETPROGRAMSTRINGARBPROC get_program_string = __glGetProcAddress("glGetProgramStringARB"); - return DoGetProgramString(cl, pc, get_program, get_program_string, False); + return DoGetProgramString(cl, pc, get_program, get_program_string, FALSE); } int @@ -122,5 +123,5 @@ __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) PFNGLGETPROGRAMSTRINGARBPROC get_program_string = __glGetProcAddress("glGetProgramStringARB"); - return DoGetProgramString(cl, pc, get_program, get_program_string, True); + return DoGetProgramString(cl, pc, get_program, get_program_string, TRUE); } diff --git a/xserver/glx/indirect_texture_compression.c b/xserver/glx/indirect_texture_compression.c index 1ebf7f3a2..6d25bcd04 100644 --- a/xserver/glx/indirect_texture_compression.c +++ b/xserver/glx/indirect_texture_compression.c @@ -51,6 +51,7 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) const GLint level = *(GLint *) (pc + 4); GLint compsize = 0; char *answer = NULL, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize); @@ -69,7 +70,7 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &reply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -97,6 +98,7 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) const GLint level = (GLint) bswap_32(*(int *) (pc + 4)); GLint compsize = 0; char *answer = NULL, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize); @@ -115,7 +117,7 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &reply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/indirect_util.c b/xserver/glx/indirect_util.c index 9ba28157c..dccffa393 100644 --- a/xserver/glx/indirect_util.c +++ b/xserver/glx/indirect_util.c @@ -45,8 +45,6 @@ #define __GLX_PAD(a) (((a)+3)&~3) -extern xGLXSingleReply __glXReply; - GLint __glGetBooleanv_variable_size(GLenum e) { @@ -117,6 +115,7 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval) { size_t reply_ints = 0; + xGLXSingleReply reply = { 0, }; if (__glXErrorOccured()) { elements = 0; @@ -125,11 +124,11 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements, reply_ints = bytes_to_int32(elements * element_size); } - __glXReply.length = reply_ints; - __glXReply.type = X_Reply; - __glXReply.sequenceNumber = client->sequence; - __glXReply.size = elements; - __glXReply.retval = retval; + reply.length = reply_ints; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.size = elements; + reply.retval = retval; /* It is faster on almost always every architecture to just copy the 8 * bytes, even when not necessary, than check to see of the value of @@ -137,8 +136,8 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements, * harm. */ - (void) memcpy(&__glXReply.pad3, data, 8); - WriteToClient(client, sz_xGLXSingleReply, &__glXReply); + (void) memcpy(&reply.pad3, data, 8); + WriteToClient(client, sz_xGLXSingleReply, &reply); if (reply_ints != 0) { WriteToClient(client, reply_ints * 4, data); @@ -163,6 +162,7 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval) { size_t reply_ints = 0; + xGLXSingleReply reply = { 0, }; if (__glXErrorOccured()) { elements = 0; @@ -171,11 +171,11 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, reply_ints = bytes_to_int32(elements * element_size); } - __glXReply.length = bswap_32(reply_ints); - __glXReply.type = X_Reply; - __glXReply.sequenceNumber = bswap_16(client->sequence); - __glXReply.size = bswap_32(elements); - __glXReply.retval = bswap_32(retval); + reply.length = bswap_32(reply_ints); + reply.type = X_Reply; + reply.sequenceNumber = bswap_16(client->sequence); + reply.size = bswap_32(elements); + reply.retval = bswap_32(retval); /* It is faster on almost always every architecture to just copy the 8 * bytes, even when not necessary, than check to see of the value of @@ -183,8 +183,8 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, * harm. */ - (void) memcpy(&__glXReply.pad3, data, 8); - WriteToClient(client, sz_xGLXSingleReply, &__glXReply); + (void) memcpy(&reply.pad3, data, 8); + WriteToClient(client, sz_xGLXSingleReply, &reply); if (reply_ints != 0) { WriteToClient(client, reply_ints * 4, data); diff --git a/xserver/glx/single2.c b/xserver/glx/single2.c index 62dcd79ef..36a01f0cb 100644 --- a/xserver/glx/single2.c +++ b/xserver/glx/single2.c @@ -232,6 +232,7 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; __GLXcontext *cx; int error; + xGLXSingleReply reply = { 0, }; REQUEST_SIZE_MATCH(xGLXSingleReq); @@ -252,7 +253,7 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc) #define SEPARATOR " " -char * +static char * __glXcombine_strings(const char *cext_string, const char *sext_string) { size_t clen, slen; @@ -328,6 +329,7 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap) __GLXcontext *cx; GLenum name; const char *string; + xGLXSingleReply reply = { 0, }; __GLX_DECLARE_SWAP_VARIABLES; int error; diff --git a/xserver/glx/single2swap.c b/xserver/glx/single2swap.c index c1df248e8..b140946ba 100644 --- a/xserver/glx/single2swap.c +++ b/xserver/glx/single2swap.c @@ -252,6 +252,7 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; __GLXcontext *cx; int error; + xGLXSingleReply reply = { 0, }; __GLX_DECLARE_SWAP_VARIABLES; diff --git a/xserver/glx/singlepix.c b/xserver/glx/singlepix.c index b253a59be..e1bed19aa 100644 --- a/xserver/glx/singlepix.c +++ b/xserver/glx/singlepix.c @@ -50,6 +50,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; REQUEST_FIXED_SIZE(xGLXSingleReq, 28); @@ -100,6 +101,7 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc) int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0, depth = 1; + xGLXSingleReply reply = { 0, }; REQUEST_FIXED_SIZE(xGLXSingleReq, 20); @@ -141,9 +143,9 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) &__glXReply)->width = width; - ((xGLXGetTexImageReply *) &__glXReply)->height = height; - ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; + ((xGLXGetTexImageReply *) &reply)->width = width; + ((xGLXGetTexImageReply *) &reply)->height = height; + ((xGLXGetTexImageReply *) &reply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -159,6 +161,7 @@ __glXDisp_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc) int error; GLubyte answerBuffer[200]; char *answer; + xGLXSingleReply reply = { 0, }; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); @@ -199,6 +202,7 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -239,8 +243,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize + compsize2); - ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; - ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; + ((xGLXGetSeparableFilterReply *) &reply)->width = width; + ((xGLXGetSeparableFilterReply *) &reply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize + compsize2); } @@ -277,6 +281,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -315,8 +320,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; - ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; + ((xGLXGetConvolutionFilterReply *) &reply)->width = width; + ((xGLXGetConvolutionFilterReply *) &reply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -353,6 +358,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) int error; char *answer, answerBuffer[200]; GLint width = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -385,7 +391,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetHistogramReply *) &__glXReply)->width = width; + ((xGLXGetHistogramReply *) &reply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -421,6 +427,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -484,6 +491,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) int error; char *answer, answerBuffer[200]; GLint width = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -516,7 +524,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetColorTableReply *) &__glXReply)->width = width; + ((xGLXGetColorTableReply *) &reply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/singlepixswap.c b/xserver/glx/singlepixswap.c index 684f4e834..8e4d9bddf 100644 --- a/xserver/glx/singlepixswap.c +++ b/xserver/glx/singlepixswap.c @@ -52,6 +52,7 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; REQUEST_FIXED_SIZE(xGLXSingleReq, 28); @@ -114,6 +115,7 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc) int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0, depth = 1; + xGLXSingleReply reply = { 0, }; REQUEST_FIXED_SIZE(xGLXSingleReq, 20); @@ -166,9 +168,9 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc) __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); __GLX_SWAP_INT(&depth); - ((xGLXGetTexImageReply *) &__glXReply)->width = width; - ((xGLXGetTexImageReply *) &__glXReply)->height = height; - ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; + ((xGLXGetTexImageReply *) &reply)->width = width; + ((xGLXGetTexImageReply *) &reply)->height = height; + ((xGLXGetTexImageReply *) &reply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -184,6 +186,7 @@ __glXDispSwap_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc) int error; GLubyte answerBuffer[200]; char *answer; + xGLXSingleReply reply = { 0, }; __GLX_DECLARE_SWAP_VARIABLES; @@ -229,6 +232,7 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0, height = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -276,8 +280,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); - ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; - ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; + ((xGLXGetSeparableFilterReply *) &reply)->width = width; + ((xGLXGetSeparableFilterReply *) &reply)->height = height; __GLX_SEND_VOID_ARRAY(compsize + compsize2); } @@ -317,6 +321,7 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0, height = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -362,8 +367,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); - ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; - ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; + ((xGLXGetConvolutionFilterReply *) &reply)->width = width; + ((xGLXGetConvolutionFilterReply *) &reply)->height = height; __GLX_SEND_VOID_ARRAY(compsize); } @@ -403,6 +408,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -441,7 +447,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); - ((xGLXGetHistogramReply *) &__glXReply)->width = width; + ((xGLXGetHistogramReply *) &reply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } @@ -480,6 +486,7 @@ GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -551,6 +558,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0; + xGLXSingleReply reply = { 0, }; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { @@ -589,7 +597,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); - ((xGLXGetColorTableReply *) &__glXReply)->width = width; + ((xGLXGetColorTableReply *) &reply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/unpack.h b/xserver/glx/unpack.h index 2b1ebcf02..9676e64c4 100644 --- a/xserver/glx/unpack.h +++ b/xserver/glx/unpack.h @@ -53,26 +53,19 @@ #define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src)) #endif -extern void __glXMemInit(void); - -extern xGLXSingleReply __glXReply; - #define __GLX_BEGIN_REPLY(size) \ - __glXReply.length = __GLX_PAD(size) >> 2; \ - __glXReply.type = X_Reply; \ - __glXReply.sequenceNumber = client->sequence; + reply.length = __GLX_PAD(size) >> 2; \ + reply.type = X_Reply; \ + reply.sequenceNumber = client->sequence; #define __GLX_SEND_HEADER() \ - WriteToClient (client, sz_xGLXSingleReply, &__glXReply); + WriteToClient (client, sz_xGLXSingleReply, &reply); #define __GLX_PUT_RETVAL(a) \ - __glXReply.retval = (a); + reply.retval = (a); #define __GLX_PUT_SIZE(a) \ - __glXReply.size = (a); - -#define __GLX_PUT_RENDERMODE(m) \ - __glXReply.pad3 = (m) + reply.size = (a); /* ** Get a buffer to hold returned data, with the given alignment. If we have @@ -101,21 +94,6 @@ extern xGLXSingleReply __glXReply; res = (char *)answerBuffer; \ } -#define __GLX_PUT_BYTE() \ - *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer - -#define __GLX_PUT_SHORT() \ - *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer - -#define __GLX_PUT_INT() \ - *(GLint *)&__glXReply.pad3 = *(GLint *)answer - -#define __GLX_PUT_FLOAT() \ - *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer - -#define __GLX_PUT_DOUBLE() \ - *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer - #define __GLX_SEND_BYTE_ARRAY(len) \ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer) @@ -216,13 +194,13 @@ extern xGLXSingleReply __glXReply; } #define __GLX_SWAP_REPLY_HEADER() \ - __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \ - __GLX_SWAP_INT(&__glXReply.length); + __GLX_SWAP_SHORT(&reply.sequenceNumber); \ + __GLX_SWAP_INT(&reply.length); #define __GLX_SWAP_REPLY_RETVAL() \ - __GLX_SWAP_INT(&__glXReply.retval) + __GLX_SWAP_INT(&reply.retval) #define __GLX_SWAP_REPLY_SIZE() \ - __GLX_SWAP_INT(&__glXReply.size) + __GLX_SWAP_INT(&reply.size) #endif /* !__GLX_unpack_h__ */ diff --git a/xserver/glx/vnd_dispatch_stubs.c b/xserver/glx/vnd_dispatch_stubs.c new file mode 100644 index 000000000..629160fe7 --- /dev/null +++ b/xserver/glx/vnd_dispatch_stubs.c @@ -0,0 +1,525 @@ + +#include +#include +#include "vndserver.h" + +// HACK: The opcode in old glxproto.h has a typo in it. +#if !defined(X_GLXCreateContextAttribsARB) +#define X_GLXCreateContextAttribsARB X_GLXCreateContextAtrribsARB +#endif + +static int dispatch_Render(ClientPtr client) +{ + REQUEST(xGLXRenderReq); + CARD32 contextTag; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + contextTag = GlxCheckSwap(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, contextTag); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = contextTag; + return GlxErrorBase + GLXBadContextTag; + } +} +static int dispatch_RenderLarge(ClientPtr client) +{ + REQUEST(xGLXRenderLargeReq); + CARD32 contextTag; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + contextTag = GlxCheckSwap(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, contextTag); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = contextTag; + return GlxErrorBase + GLXBadContextTag; + } +} +static int dispatch_CreateContext(ClientPtr client) +{ + REQUEST(xGLXCreateContextReq); + CARD32 screen, context; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + context = GlxCheckSwap(client, stuff->context); + LEGAL_NEW_RESOURCE(context, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(context, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(context); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_DestroyContext(ClientPtr client) +{ + REQUEST(xGLXDestroyContextReq); + CARD32 context; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + context = GlxCheckSwap(client, stuff->context); + vendor = glxServer.getXIDMap(context); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + if (ret == Success) { + glxServer.removeXIDMap(context); + } + return ret; + } else { + client->errorValue = context; + return GlxErrorBase + GLXBadContext; + } +} +static int dispatch_WaitGL(ClientPtr client) +{ + REQUEST(xGLXWaitGLReq); + CARD32 contextTag; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + contextTag = GlxCheckSwap(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, contextTag); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = contextTag; + return GlxErrorBase + GLXBadContextTag; + } +} +static int dispatch_WaitX(ClientPtr client) +{ + REQUEST(xGLXWaitXReq); + CARD32 contextTag; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + contextTag = GlxCheckSwap(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, contextTag); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = contextTag; + return GlxErrorBase + GLXBadContextTag; + } +} +static int dispatch_UseXFont(ClientPtr client) +{ + REQUEST(xGLXUseXFontReq); + CARD32 contextTag; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + contextTag = GlxCheckSwap(client, stuff->contextTag); + vendor = glxServer.getContextTag(client, contextTag); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = contextTag; + return GlxErrorBase + GLXBadContextTag; + } +} +static int dispatch_CreateGLXPixmap(ClientPtr client) +{ + REQUEST(xGLXCreateGLXPixmapReq); + CARD32 screen, glxpixmap; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + glxpixmap = GlxCheckSwap(client, stuff->glxpixmap); + LEGAL_NEW_RESOURCE(glxpixmap, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(glxpixmap, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(glxpixmap); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_GetVisualConfigs(ClientPtr client) +{ + REQUEST(xGLXGetVisualConfigsReq); + CARD32 screen; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_DestroyGLXPixmap(ClientPtr client) +{ + REQUEST(xGLXDestroyGLXPixmapReq); + CARD32 glxpixmap; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + glxpixmap = GlxCheckSwap(client, stuff->glxpixmap); + vendor = glxServer.getXIDMap(glxpixmap); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = glxpixmap; + return GlxErrorBase + GLXBadPixmap; + } +} +static int dispatch_QueryExtensionsString(ClientPtr client) +{ + REQUEST(xGLXQueryExtensionsStringReq); + CARD32 screen; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_QueryServerString(ClientPtr client) +{ + REQUEST(xGLXQueryServerStringReq); + CARD32 screen; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_ChangeDrawableAttributes(ClientPtr client) +{ + REQUEST(xGLXChangeDrawableAttributesReq); + CARD32 drawable; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + drawable = GlxCheckSwap(client, stuff->drawable); + vendor = glxServer.getXIDMap(drawable); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = drawable; + return BadDrawable; + } +} +static int dispatch_CreateNewContext(ClientPtr client) +{ + REQUEST(xGLXCreateNewContextReq); + CARD32 screen, context; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + context = GlxCheckSwap(client, stuff->context); + LEGAL_NEW_RESOURCE(context, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(context, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(context); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_CreatePbuffer(ClientPtr client) +{ + REQUEST(xGLXCreatePbufferReq); + CARD32 screen, pbuffer; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + pbuffer = GlxCheckSwap(client, stuff->pbuffer); + LEGAL_NEW_RESOURCE(pbuffer, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(pbuffer, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(pbuffer); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_CreatePixmap(ClientPtr client) +{ + REQUEST(xGLXCreatePixmapReq); + CARD32 screen, glxpixmap; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + glxpixmap = GlxCheckSwap(client, stuff->glxpixmap); + LEGAL_NEW_RESOURCE(glxpixmap, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(glxpixmap, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(glxpixmap); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_CreateWindow(ClientPtr client) +{ + REQUEST(xGLXCreateWindowReq); + CARD32 screen, glxwindow; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + glxwindow = GlxCheckSwap(client, stuff->glxwindow); + LEGAL_NEW_RESOURCE(glxwindow, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(glxwindow, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(glxwindow); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_CreateContextAttribsARB(ClientPtr client) +{ + REQUEST(xGLXCreateContextAttribsARBReq); + CARD32 screen, context; + GlxServerVendor *vendor = NULL; + REQUEST_AT_LEAST_SIZE(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + context = GlxCheckSwap(client, stuff->context); + LEGAL_NEW_RESOURCE(context, client); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + if (!glxServer.addXIDMap(context, vendor)) { + return BadAlloc; + } + ret = glxServer.forwardRequest(vendor, client); + if (ret != Success) { + glxServer.removeXIDMap(context); + } + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_DestroyPbuffer(ClientPtr client) +{ + REQUEST(xGLXDestroyPbufferReq); + CARD32 pbuffer; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + pbuffer = GlxCheckSwap(client, stuff->pbuffer); + vendor = glxServer.getXIDMap(pbuffer); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + if (ret == Success) { + glxServer.removeXIDMap(pbuffer); + } + return ret; + } else { + client->errorValue = pbuffer; + return GlxErrorBase + GLXBadPbuffer; + } +} +static int dispatch_DestroyPixmap(ClientPtr client) +{ + REQUEST(xGLXDestroyPixmapReq); + CARD32 glxpixmap; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + glxpixmap = GlxCheckSwap(client, stuff->glxpixmap); + vendor = glxServer.getXIDMap(glxpixmap); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + if (ret == Success) { + glxServer.removeXIDMap(glxpixmap); + } + return ret; + } else { + client->errorValue = glxpixmap; + return GlxErrorBase + GLXBadPixmap; + } +} +static int dispatch_DestroyWindow(ClientPtr client) +{ + REQUEST(xGLXDestroyWindowReq); + CARD32 glxwindow; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + glxwindow = GlxCheckSwap(client, stuff->glxwindow); + vendor = glxServer.getXIDMap(glxwindow); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + if (ret == Success) { + glxServer.removeXIDMap(glxwindow); + } + return ret; + } else { + client->errorValue = glxwindow; + return GlxErrorBase + GLXBadWindow; + } +} +static int dispatch_GetDrawableAttributes(ClientPtr client) +{ + REQUEST(xGLXGetDrawableAttributesReq); + CARD32 drawable; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + drawable = GlxCheckSwap(client, stuff->drawable); + vendor = glxServer.getXIDMap(drawable); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = drawable; + return BadDrawable; + } +} +static int dispatch_GetFBConfigs(ClientPtr client) +{ + REQUEST(xGLXGetFBConfigsReq); + CARD32 screen; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + screen = GlxCheckSwap(client, stuff->screen); + if (screen < screenInfo.numScreens) { + vendor = glxServer.getVendorForScreen(client, screenInfo.screens[screen]); + } + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = screen; + return BadMatch; + } +} +static int dispatch_QueryContext(ClientPtr client) +{ + REQUEST(xGLXQueryContextReq); + CARD32 context; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + context = GlxCheckSwap(client, stuff->context); + vendor = glxServer.getXIDMap(context); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = context; + return GlxErrorBase + GLXBadContext; + } +} +static int dispatch_IsDirect(ClientPtr client) +{ + REQUEST(xGLXIsDirectReq); + CARD32 context; + GlxServerVendor *vendor = NULL; + REQUEST_SIZE_MATCH(*stuff); + context = GlxCheckSwap(client, stuff->context); + vendor = glxServer.getXIDMap(context); + if (vendor != NULL) { + int ret; + ret = glxServer.forwardRequest(vendor, client); + return ret; + } else { + client->errorValue = context; + return GlxErrorBase + GLXBadContext; + } +} diff --git a/xserver/glx/vndcmds.c b/xserver/glx/vndcmds.c new file mode 100644 index 000000000..f0779d14a --- /dev/null +++ b/xserver/glx/vndcmds.c @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#include + +#include "hashtable.h" +#include "vndserver.h" +#include "vndservervendor.h" + +/** + * The length of the dispatchFuncs array. Every opcode above this is a + * X_GLsop_* code, which all can use the same handler. + */ +#define OPCODE_ARRAY_LEN 100 + +// This hashtable is used to keep track of the dispatch stubs for +// GLXVendorPrivate and GLXVendorPrivateWithReply. +typedef struct GlxVendorPrivDispatchRec { + CARD32 vendorCode; + GlxServerDispatchProc proc; + HashTable hh; +} GlxVendorPrivDispatch; + +static GlxServerDispatchProc dispatchFuncs[OPCODE_ARRAY_LEN] = {}; +static HashTable vendorPrivHash = NULL; +static HtGenericHashSetupRec vendorPrivSetup = { + .keySize = sizeof(CARD32) +}; + +static int DispatchBadRequest(ClientPtr client) +{ + return BadRequest; +} + +static GlxVendorPrivDispatch *LookupVendorPrivDispatch(CARD32 vendorCode, Bool create) +{ + GlxVendorPrivDispatch *disp = NULL; + + disp = ht_find(vendorPrivHash, &vendorCode); + if (disp == NULL && create) { + if ((disp = ht_add(vendorPrivHash, &vendorCode))) { + disp->vendorCode = vendorCode; + disp->proc = NULL; + } + } + + return disp; +} + +static GlxServerDispatchProc GetVendorDispatchFunc(CARD8 opcode, CARD32 vendorCode) +{ + GlxServerVendor *vendor; + + xorg_list_for_each_entry(vendor, &GlxVendorList, entry) { + GlxServerDispatchProc proc = vendor->glxvc.getDispatchAddress(opcode, vendorCode); + if (proc != NULL) { + return proc; + } + } + + return DispatchBadRequest; +} + +static void SetReplyHeader(ClientPtr client, void *replyPtr) +{ + xGenericReply *rep = (xGenericReply *) replyPtr; + rep->type = X_Reply; + rep->sequenceNumber = client->sequence; + rep->length = 0; +} + +/* Include the trivial dispatch handlers */ +#include "vnd_dispatch_stubs.c" + +static int dispatch_GLXQueryVersion(ClientPtr client) +{ + xGLXQueryVersionReply reply; + REQUEST_SIZE_MATCH(xGLXQueryVersionReq); + + SetReplyHeader(client, &reply); + reply.majorVersion = GlxCheckSwap(client, 1); + reply.minorVersion = GlxCheckSwap(client, 4); + + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); + return Success; +} + +/* broken header workaround */ +#ifndef X_GLXSetClientInfo2ARB +#define X_GLXSetClientInfo2ARB X_GLXSetConfigInfo2ARB +#endif + +/** + * This function is used for X_GLXClientInfo, X_GLXSetClientInfoARB, and + * X_GLXSetClientInfo2ARB. + */ +static int dispatch_GLXClientInfo(ClientPtr client) +{ + GlxServerVendor *vendor; + void *requestCopy = NULL; + size_t requestSize = client->req_len * 4; + + if (client->minorOp == X_GLXClientInfo) { + REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); + } else if (client->minorOp == X_GLXSetClientInfoARB) { + REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq); + } else if (client->minorOp == X_GLXSetClientInfo2ARB) { + REQUEST_AT_LEAST_SIZE(xGLXSetClientInfo2ARBReq); + } else { + return BadImplementation; + } + + // We'll forward this request to each vendor library. Since a vendor might + // modify the request data in place (e.g., for byte swapping), make a copy + // of the request first. + requestCopy = malloc(requestSize); + if (requestCopy == NULL) { + return BadAlloc; + } + memcpy(requestCopy, client->requestBuffer, requestSize); + + xorg_list_for_each_entry(vendor, &GlxVendorList, entry) { + vendor->glxvc.handleRequest(client); + // Revert the request buffer back to our copy. + memcpy(client->requestBuffer, requestCopy, requestSize); + } + free(requestCopy); + return Success; +} + +static int CommonLoseCurrent(ClientPtr client, GlxContextTagInfo *tagInfo) +{ + int ret; + + ret = tagInfo->vendor->glxvc.makeCurrent(client, + tagInfo->tag, // No old context tag, + None, None, None, 0); + + if (ret == Success) { + GlxFreeContextTag(tagInfo); + } + return ret; +} + +static int CommonMakeNewCurrent(ClientPtr client, + GlxServerVendor *vendor, + GLXDrawable drawable, + GLXDrawable readdrawable, + GLXContextID context, + GLXContextTag *newContextTag) +{ + int ret = BadAlloc; + GlxContextTagInfo *tagInfo; + + tagInfo = GlxAllocContextTag(client, vendor); + + if (tagInfo) { + ret = vendor->glxvc.makeCurrent(client, + 0, // No old context tag, + drawable, readdrawable, context, + tagInfo->tag); + + if (ret == Success) { + tagInfo->drawable = drawable; + tagInfo->readdrawable = readdrawable; + tagInfo->context = context; + *newContextTag = tagInfo->tag; + } else { + GlxFreeContextTag(tagInfo); + } + } + + return ret; +} + +static int CommonMakeCurrent(ClientPtr client, + GLXContextTag oldContextTag, + GLXDrawable drawable, + GLXDrawable readdrawable, + GLXContextID context) +{ + xGLXMakeCurrentReply reply = {}; + GlxContextTagInfo *oldTag = NULL; + GlxServerVendor *newVendor = NULL; + + oldContextTag = GlxCheckSwap(client, oldContextTag); + drawable = GlxCheckSwap(client, drawable); + readdrawable = GlxCheckSwap(client, readdrawable); + context = GlxCheckSwap(client, context); + + SetReplyHeader(client, &reply); + + if (oldContextTag != 0) { + oldTag = GlxLookupContextTag(client, oldContextTag); + if (oldTag == NULL) { + return GlxErrorBase + GLXBadContextTag; + } + } + if (context != 0) { + newVendor = GlxGetXIDMap(context); + if (newVendor == NULL) { + return GlxErrorBase + GLXBadContext; + } + } + + if (oldTag == NULL && newVendor == NULL) { + // Nothing to do here. Just send a successful reply. + reply.contextTag = 0; + } else if (oldTag != NULL && newVendor != NULL + && oldTag->context == context + && oldTag->drawable == drawable + && oldTag->readdrawable == readdrawable) + { + // The old and new values are all the same, so send a successful reply. + reply.contextTag = oldTag->tag; + } else { + // TODO: For switching contexts in a single vendor, just make one + // makeCurrent call? + + // TODO: When changing vendors, would it be better to do the + // MakeCurrent(new) first, then the LoseCurrent(old)? + // If the MakeCurrent(new) fails, then the old context will still be current. + // If the LoseCurrent(old) fails, then we can (probably) undo the MakeCurrent(new) with + // a LoseCurrent(old). + // But, if the recovery LoseCurrent(old) fails, then we're really in a bad state. + + // Clear the old context first. + if (oldTag != NULL) { + int ret = CommonLoseCurrent(client, oldTag); + if (ret != Success) { + return ret; + } + oldTag = NULL; + } + + if (newVendor != NULL) { + int ret = CommonMakeNewCurrent(client, newVendor, drawable, readdrawable, context, &reply.contextTag); + if (ret != Success) { + return ret; + } + } else { + reply.contextTag = 0; + } + } + + reply.contextTag = GlxCheckSwap(client, reply.contextTag); + WriteToClient(client, sz_xGLXMakeCurrentReply, &reply); + return Success; +} + +static int dispatch_GLXMakeCurrent(ClientPtr client) +{ + REQUEST(xGLXMakeCurrentReq); + REQUEST_SIZE_MATCH(*stuff); + + return CommonMakeCurrent(client, stuff->oldContextTag, + stuff->drawable, stuff->drawable, stuff->context); +} + +static int dispatch_GLXMakeContextCurrent(ClientPtr client) +{ + REQUEST(xGLXMakeContextCurrentReq); + REQUEST_SIZE_MATCH(*stuff); + + return CommonMakeCurrent(client, stuff->oldContextTag, + stuff->drawable, stuff->readdrawable, stuff->context); +} + +static int dispatch_GLXMakeCurrentReadSGI(ClientPtr client) +{ + REQUEST(xGLXMakeCurrentReadSGIReq); + REQUEST_SIZE_MATCH(*stuff); + + return CommonMakeCurrent(client, stuff->oldContextTag, + stuff->drawable, stuff->readable, stuff->context); +} + +static int dispatch_GLXCopyContext(ClientPtr client) +{ + REQUEST(xGLXCopyContextReq); + GlxServerVendor *vendor; + REQUEST_SIZE_MATCH(*stuff); + + // If we've got a context tag, then we'll use it to select a vendor. If we + // don't have a tag, then we'll look up one of the contexts. In either + // case, it's up to the vendor library to make sure that the context ID's + // are valid. + if (stuff->contextTag != 0) { + GlxContextTagInfo *tagInfo = GlxLookupContextTag(client, GlxCheckSwap(client, stuff->contextTag)); + if (tagInfo == NULL) { + return GlxErrorBase + GLXBadContextTag; + } + vendor = tagInfo->vendor; + } else { + vendor = GlxGetXIDMap(GlxCheckSwap(client, stuff->source)); + if (vendor == NULL) { + return GlxErrorBase + GLXBadContext; + } + } + return vendor->glxvc.handleRequest(client); +} + +static int dispatch_GLXSwapBuffers(ClientPtr client) +{ + GlxServerVendor *vendor = NULL; + REQUEST(xGLXSwapBuffersReq); + REQUEST_SIZE_MATCH(*stuff); + + if (stuff->contextTag != 0) { + // If the request has a context tag, then look up a vendor from that. + // The vendor library is then responsible for validating the drawable. + GlxContextTagInfo *tagInfo = GlxLookupContextTag(client, GlxCheckSwap(client, stuff->contextTag)); + if (tagInfo == NULL) { + return GlxErrorBase + GLXBadContextTag; + } + vendor = tagInfo->vendor; + } else { + // We don't have a context tag, so look up the vendor from the + // drawable. + vendor = GlxGetXIDMap(GlxCheckSwap(client, stuff->drawable)); + if (vendor == NULL) { + return GlxErrorBase + GLXBadDrawable; + } + } + + return vendor->glxvc.handleRequest(client); +} + +/** + * This is a generic handler for all of the X_GLXsop* requests. + */ +static int dispatch_GLXSingle(ClientPtr client) +{ + REQUEST(xGLXSingleReq); + GlxContextTagInfo *tagInfo; + REQUEST_AT_LEAST_SIZE(*stuff); + + tagInfo = GlxLookupContextTag(client, GlxCheckSwap(client, stuff->contextTag)); + if (tagInfo != NULL) { + return tagInfo->vendor->glxvc.handleRequest(client); + } else { + return GlxErrorBase + GLXBadContextTag; + } +} + +static int dispatch_GLXVendorPriv(ClientPtr client) +{ + GlxVendorPrivDispatch *disp; + REQUEST(xGLXVendorPrivateReq); + REQUEST_AT_LEAST_SIZE(*stuff); + + disp = LookupVendorPrivDispatch(GlxCheckSwap(client, stuff->vendorCode), TRUE); + if (disp == NULL) { + return BadAlloc; + } + + if (disp->proc == NULL) { + // We don't have a dispatch function for this request yet. Check with + // each vendor library to find one. + // Note that even if none of the vendors provides a dispatch stub, + // we'll still add an entry to the dispatch table, so that we don't + // have to look it up again later. + + disp->proc = GetVendorDispatchFunc(stuff->glxCode, + GlxCheckSwap(client, + stuff->vendorCode)); + } + return disp->proc(client); +} + +Bool GlxDispatchInit(void) +{ + GlxVendorPrivDispatch *disp; + + vendorPrivHash = ht_create(sizeof(CARD32), sizeof(GlxVendorPrivDispatch), + ht_generic_hash, ht_generic_compare, + (void *) &vendorPrivSetup); + if (!vendorPrivHash) { + return FALSE; + } + + // Assign a custom dispatch stub GLXMakeCurrentReadSGI. This is the only + // vendor private request that we need to deal with in libglvnd itself. + disp = LookupVendorPrivDispatch(X_GLXvop_MakeCurrentReadSGI, TRUE); + if (disp == NULL) { + return FALSE; + } + disp->proc = dispatch_GLXMakeCurrentReadSGI; + + // Assign the dispatch stubs for requests that need special handling. + dispatchFuncs[X_GLXQueryVersion] = dispatch_GLXQueryVersion; + dispatchFuncs[X_GLXMakeCurrent] = dispatch_GLXMakeCurrent; + dispatchFuncs[X_GLXMakeContextCurrent] = dispatch_GLXMakeContextCurrent; + dispatchFuncs[X_GLXCopyContext] = dispatch_GLXCopyContext; + dispatchFuncs[X_GLXSwapBuffers] = dispatch_GLXSwapBuffers; + + dispatchFuncs[X_GLXClientInfo] = dispatch_GLXClientInfo; + dispatchFuncs[X_GLXSetClientInfoARB] = dispatch_GLXClientInfo; + dispatchFuncs[X_GLXSetClientInfo2ARB] = dispatch_GLXClientInfo; + + dispatchFuncs[X_GLXVendorPrivate] = dispatch_GLXVendorPriv; + dispatchFuncs[X_GLXVendorPrivateWithReply] = dispatch_GLXVendorPriv; + + // Assign the trivial stubs + dispatchFuncs[X_GLXRender] = dispatch_Render; + dispatchFuncs[X_GLXRenderLarge] = dispatch_RenderLarge; + dispatchFuncs[X_GLXCreateContext] = dispatch_CreateContext; + dispatchFuncs[X_GLXDestroyContext] = dispatch_DestroyContext; + dispatchFuncs[X_GLXWaitGL] = dispatch_WaitGL; + dispatchFuncs[X_GLXWaitX] = dispatch_WaitX; + dispatchFuncs[X_GLXUseXFont] = dispatch_UseXFont; + dispatchFuncs[X_GLXCreateGLXPixmap] = dispatch_CreateGLXPixmap; + dispatchFuncs[X_GLXGetVisualConfigs] = dispatch_GetVisualConfigs; + dispatchFuncs[X_GLXDestroyGLXPixmap] = dispatch_DestroyGLXPixmap; + dispatchFuncs[X_GLXQueryExtensionsString] = dispatch_QueryExtensionsString; + dispatchFuncs[X_GLXQueryServerString] = dispatch_QueryServerString; + dispatchFuncs[X_GLXChangeDrawableAttributes] = dispatch_ChangeDrawableAttributes; + dispatchFuncs[X_GLXCreateNewContext] = dispatch_CreateNewContext; + dispatchFuncs[X_GLXCreatePbuffer] = dispatch_CreatePbuffer; + dispatchFuncs[X_GLXCreatePixmap] = dispatch_CreatePixmap; + dispatchFuncs[X_GLXCreateWindow] = dispatch_CreateWindow; + dispatchFuncs[X_GLXCreateContextAttribsARB] = dispatch_CreateContextAttribsARB; + dispatchFuncs[X_GLXDestroyPbuffer] = dispatch_DestroyPbuffer; + dispatchFuncs[X_GLXDestroyPixmap] = dispatch_DestroyPixmap; + dispatchFuncs[X_GLXDestroyWindow] = dispatch_DestroyWindow; + dispatchFuncs[X_GLXGetDrawableAttributes] = dispatch_GetDrawableAttributes; + dispatchFuncs[X_GLXGetFBConfigs] = dispatch_GetFBConfigs; + dispatchFuncs[X_GLXQueryContext] = dispatch_QueryContext; + dispatchFuncs[X_GLXIsDirect] = dispatch_IsDirect; + + return TRUE; +} + +void GlxDispatchReset(void) +{ + memset(dispatchFuncs, 0, sizeof(dispatchFuncs)); + + ht_destroy(vendorPrivHash); + vendorPrivHash = NULL; +} + +int GlxDispatchRequest(ClientPtr client) +{ + REQUEST(xReq); + if (GlxExtensionEntry->base == 0) + return BadRequest; + if (stuff->data < OPCODE_ARRAY_LEN) { + if (dispatchFuncs[stuff->data] == NULL) { + // Try to find a dispatch stub. + dispatchFuncs[stuff->data] = GetVendorDispatchFunc(stuff->data, 0); + } + return dispatchFuncs[stuff->data](client); + } else { + return dispatch_GLXSingle(client); + } +} diff --git a/xserver/glx/vndext.c b/xserver/glx/vndext.c new file mode 100644 index 000000000..d7936467b --- /dev/null +++ b/xserver/glx/vndext.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#include "vndserver.h" + +#include +#include +#include +#include +#include +#include + +#include +#include "vndservervendor.h" + +ExtensionEntry *GlxExtensionEntry; +int GlxErrorBase = 0; +static CallbackListRec vndInitCallbackList; +static CallbackListPtr vndInitCallbackListPtr = &vndInitCallbackList; +static DevPrivateKeyRec glvXGLVScreenPrivKey; +static DevPrivateKeyRec glvXGLVClientPrivKey; + +// The resource type used to keep track of the vendor library for XID's. +RESTYPE idResource; + +static int +idResourceDeleteCallback(void *value, XID id) +{ + return 0; +} + +static GlxScreenPriv * +xglvGetScreenPrivate(ScreenPtr pScreen) +{ + return dixLookupPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey); +} + +static void +xglvSetScreenPrivate(ScreenPtr pScreen, void *priv) +{ + dixSetPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey, priv); +} + +GlxScreenPriv * +GlxGetScreen(ScreenPtr pScreen) +{ + if (pScreen != NULL) { + GlxScreenPriv *priv = xglvGetScreenPrivate(pScreen); + if (priv == NULL) { + priv = calloc(1, sizeof(GlxScreenPriv)); + if (priv == NULL) { + return NULL; + } + + xglvSetScreenPrivate(pScreen, priv); + } + return priv; + } else { + return NULL; + } +} + +static void +GlxMappingReset(void) +{ + int i; + + for (i=0; idevPrivates, &glvXGLVClientPrivKey); +} + +static void +xglvSetClientPrivate(ClientPtr pClient, void *priv) +{ + dixSetPrivate(&pClient->devPrivates, &glvXGLVClientPrivKey, priv); +} + +GlxClientPriv * +GlxGetClientData(ClientPtr client) +{ + GlxClientPriv *cl = xglvGetClientPrivate(client); + if (cl == NULL) { + cl = calloc(1, sizeof(GlxClientPriv)); + if (cl != NULL) { + xglvSetClientPrivate(client, cl); + } + } + return cl; +} + +void +GlxFreeClientData(ClientPtr client) +{ + GlxClientPriv *cl = xglvGetClientPrivate(client); + if (cl != NULL) { + unsigned int i; + for (i = 0; i < cl->contextTagCount; i++) { + GlxContextTagInfo *tag = &cl->contextTags[i]; + if (tag->vendor != NULL) { + tag->vendor->glxvc.makeCurrent(client, tag->tag, + None, None, None, 0); + } + } + xglvSetClientPrivate(client, NULL); + free(cl->contextTags); + free(cl); + } +} + +static void +GLXClientCallback(CallbackListPtr *list, void *closure, void *data) +{ + NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; + ClientPtr client = clientinfo->client; + + switch (client->clientState) + { + case ClientStateRetained: + case ClientStateGone: + GlxFreeClientData(client); + break; + } +} + +static void +GLXReset(ExtensionEntry *extEntry) +{ + // xf86Msg(X_INFO, "GLX: GLXReset\n"); + + GlxVendorExtensionReset(extEntry); + GlxDispatchReset(); + GlxMappingReset(); + + if ((dispatchException & DE_TERMINATE) == DE_TERMINATE) { + while (vndInitCallbackList.list != NULL) { + CallbackPtr next = vndInitCallbackList.list->next; + free(vndInitCallbackList.list); + vndInitCallbackList.list = next; + } + } +} + +void +GlxExtensionInit(void) +{ + ExtensionEntry *extEntry; + GlxExtensionEntry = NULL; + + // Init private keys, per-screen data + if (!dixRegisterPrivateKey(&glvXGLVScreenPrivKey, PRIVATE_SCREEN, 0)) + return; + if (!dixRegisterPrivateKey(&glvXGLVClientPrivKey, PRIVATE_CLIENT, 0)) + return; + + if (!GlxMappingInit()) { + return; + } + + if (!GlxDispatchInit()) { + return; + } + + if (!AddCallback(&ClientStateCallback, GLXClientCallback, NULL)) { + return; + } + + extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, + __GLX_NUMBER_ERRORS, GlxDispatchRequest, + GlxDispatchRequest, GLXReset, StandardMinorOpcode); + if (!extEntry) { + return; + } + + GlxExtensionEntry = extEntry; + GlxErrorBase = extEntry->errorBase; + CallCallbacks(&vndInitCallbackListPtr, extEntry); + + /* We'd better have found at least one vendor */ + for (int i = 0; i < screenInfo.numScreens; i++) + if (GlxGetVendorForScreen(serverClient, screenInfo.screens[i])) + return; + extEntry->base = 0; +} + +static int +GlxForwardRequest(GlxServerVendor *vendor, ClientPtr client) +{ + return vendor->glxvc.handleRequest(client); +} + +static GlxServerVendor * +GlxGetContextTag(ClientPtr client, GLXContextTag tag) +{ + GlxContextTagInfo *tagInfo = GlxLookupContextTag(client, tag); + + if (tagInfo != NULL) { + return tagInfo->vendor; + } else { + return NULL; + } +} + +static Bool +GlxSetContextTagPrivate(ClientPtr client, GLXContextTag tag, void *data) +{ + GlxContextTagInfo *tagInfo = GlxLookupContextTag(client, tag); + if (tagInfo != NULL) { + tagInfo->data = data; + return TRUE; + } else { + return FALSE; + } +} + +static void * +GlxGetContextTagPrivate(ClientPtr client, GLXContextTag tag) +{ + GlxContextTagInfo *tagInfo = GlxLookupContextTag(client, tag); + if (tagInfo != NULL) { + return tagInfo->data; + } else { + return NULL; + } +} + +static GlxServerImports * +GlxAllocateServerImports(void) +{ + return calloc(1, sizeof(GlxServerImports)); +} + +static void +GlxFreeServerImports(GlxServerImports *imports) +{ + free(imports); +} + +_X_EXPORT const GlxServerExports glxServer = { + .majorVersion = 0, + .minorVersion = 0, + + .extensionInitCallback = &vndInitCallbackListPtr, + + .allocateServerImports = GlxAllocateServerImports, + .freeServerImports = GlxFreeServerImports, + + .createVendor = GlxCreateVendor, + .destroyVendor = GlxDestroyVendor, + .setScreenVendor = GlxSetScreenVendor, + + .addXIDMap = GlxAddXIDMap, + .getXIDMap = GlxGetXIDMap, + .removeXIDMap = GlxRemoveXIDMap, + .getContextTag = GlxGetContextTag, + .setContextTagPrivate = GlxSetContextTagPrivate, + .getContextTagPrivate = GlxGetContextTagPrivate, + .getVendorForScreen = GlxGetVendorForScreen, + .forwardRequest = GlxForwardRequest, +}; + +const GlxServerExports * +glvndGetExports(void) +{ + return &glxServer; +} diff --git a/xserver/glx/vndserver.h b/xserver/glx/vndserver.h new file mode 100644 index 000000000..a175656ae --- /dev/null +++ b/xserver/glx/vndserver.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#ifndef VNDSERVER_H +#define VNDSERVER_H + +#include +#include "glxvndabi.h" + +#define GLXContextID CARD32 +#define GLXDrawable CARD32 + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef struct GlxScreenPrivRec { + GlxServerVendor *vendor; +} GlxScreenPriv; + +typedef struct GlxContextTagInfoRec { + GLXContextTag tag; + ClientPtr client; + GlxServerVendor *vendor; + void *data; + GLXContextID context; + GLXDrawable drawable; + GLXDrawable readdrawable; +} GlxContextTagInfo; + +typedef struct GlxClientPrivRec { + GlxContextTagInfo *contextTags; + unsigned int contextTagCount; +} GlxClientPriv; + +extern int GlxErrorBase; +extern RESTYPE idResource; + +extern ExtensionEntry *GlxExtensionEntry; +Bool GlxDispatchInit(void); +void GlxDispatchReset(void); + +/** + * Handles a request from the client. + * + * This function will look up the correct handler function and forward the + * request to it. + */ +int GlxDispatchRequest(ClientPtr client); + +/** + * Looks up the GlxClientPriv struct for a client. If we don't have a + * GlxClientPriv struct yet, then allocate one. + */ +GlxClientPriv *GlxGetClientData(ClientPtr client); + +/** + * Frees any data that's specific to a client. This should be called when a + * client disconnects. + */ +void GlxFreeClientData(ClientPtr client); + +Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor); +GlxServerVendor * GlxGetXIDMap(XID id); +void GlxRemoveXIDMap(XID id); + +GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor); +GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag); +void GlxFreeContextTag(GlxContextTagInfo *tagInfo); + +Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor); +GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen); +GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen); + +static inline CARD32 GlxCheckSwap(ClientPtr client, CARD32 value) +{ + if (client->swapped) + { + value = ((value & 0XFF000000) >> 24) | ((value & 0X00FF0000) >> 8) + | ((value & 0X0000FF00) << 8) | ((value & 0X000000FF) << 24); + } + return value; +} + +#if defined(__cplusplus) +} +#endif + +_X_EXPORT const GlxServerExports *glvndGetExports(void); + +#endif // VNDSERVER_H diff --git a/xserver/glx/vndservermapping.c b/xserver/glx/vndservermapping.c new file mode 100644 index 000000000..fd3be92d9 --- /dev/null +++ b/xserver/glx/vndservermapping.c @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#include "vndserver.h" + +#include + +#include "vndservervendor.h" + +static GlxServerVendor *LookupXIDMapResource(XID id) +{ + void *ptr = NULL; + int rv; + + rv = dixLookupResourceByType(&ptr, id, idResource, NULL, DixReadAccess); + if (rv == Success) { + return (GlxServerVendor *) ptr; + } else { + return NULL; + } +} + +GlxServerVendor *GlxGetXIDMap(XID id) +{ + GlxServerVendor *vendor = LookupXIDMapResource(id); + + if (vendor == NULL) { + // If we haven't seen this XID before, then it may be a drawable that + // wasn't created through GLX, like a regular X window or pixmap. Try + // to look up a matching drawable to find a screen number for it. + void *ptr = NULL; + int rv = dixLookupResourceByClass(&ptr, id, RC_DRAWABLE, NULL, + DixGetAttrAccess); + if (rv == Success && ptr != NULL) { + DrawablePtr draw = (DrawablePtr) ptr; + GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen); + if (screenPriv != NULL) { + vendor = screenPriv->vendor; + } + } + } + return vendor; +} + +Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor) +{ + if (id == 0 || vendor == NULL) { + return FALSE; + } + if (LookupXIDMapResource(id) != NULL) { + return FALSE; + } + return AddResource(id, idResource, vendor); +} + +void GlxRemoveXIDMap(XID id) +{ + FreeResourceByType(id, idResource, FALSE); +} + +GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor) +{ + GlxClientPriv *cl; + unsigned int index; + + if (vendor == NULL) { + return NULL; + } + + cl = GlxGetClientData(client); + if (cl == NULL) { + return NULL; + } + + // Look for a free tag index. + for (index=0; indexcontextTagCount; index++) { + if (cl->contextTags[index].vendor == NULL) { + break; + } + } + if (index >= cl->contextTagCount) { + // We didn't find a free entry, so grow the array. + GlxContextTagInfo *newTags; + unsigned int newSize = cl->contextTagCount * 2; + if (newSize == 0) { + // TODO: What's a good starting size for this? + newSize = 16; + } + + newTags = (GlxContextTagInfo *) + realloc(cl->contextTags, newSize * sizeof(GlxContextTagInfo)); + if (newTags == NULL) { + return NULL; + } + + memset(&newTags[cl->contextTagCount], 0, + (newSize - cl->contextTagCount) * sizeof(GlxContextTagInfo)); + + index = cl->contextTagCount; + cl->contextTags = newTags; + cl->contextTagCount = newSize; + } + + assert(index >= 0); + assert(index < cl->contextTagCount); + memset(&cl->contextTags[index], 0, sizeof(GlxContextTagInfo)); + cl->contextTags[index].tag = (GLXContextTag) (index + 1); + cl->contextTags[index].client = client; + cl->contextTags[index].vendor = vendor; + return &cl->contextTags[index]; +} + +GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag) +{ + GlxClientPriv *cl = GlxGetClientData(client); + if (cl == NULL) { + return NULL; + } + + if (tag > 0 && (tag - 1) < cl->contextTagCount) { + if (cl->contextTags[tag - 1].vendor != NULL) { + assert(cl->contextTags[tag - 1].client == client); + return &cl->contextTags[tag - 1]; + } + } + return NULL; +} + +void GlxFreeContextTag(GlxContextTagInfo *tagInfo) +{ + if (tagInfo != NULL) { + tagInfo->vendor = NULL; + tagInfo->vendor = NULL; + tagInfo->data = NULL; + tagInfo->context = None; + tagInfo->drawable = None; + tagInfo->readdrawable = None; + } +} + +Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) +{ + GlxScreenPriv *priv; + + if (vendor == NULL) { + return FALSE; + } + + priv = GlxGetScreen(screen); + if (priv == NULL) { + return FALSE; + } + + if (priv->vendor != NULL) { + return FALSE; + } + + priv->vendor = vendor; + return TRUE; +} + +GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) +{ + GlxScreenPriv *priv = GlxGetScreen(screen); + if (priv != NULL) { + return priv->vendor; + } else { + return NULL; + } +} diff --git a/xserver/glx/vndservervendor.c b/xserver/glx/vndservervendor.c new file mode 100644 index 000000000..bd86c67f7 --- /dev/null +++ b/xserver/glx/vndservervendor.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#include "vndservervendor.h" + +struct xorg_list GlxVendorList = { &GlxVendorList, &GlxVendorList }; + +GlxServerVendor *GlxCreateVendor(const GlxServerImports *imports) +{ + GlxServerVendor *vendor = NULL; + + if (imports == NULL) { + ErrorF("GLX: Vendor library did not provide an imports table\n"); + return NULL; + } + + if (imports->extensionCloseDown == NULL + || imports->handleRequest == NULL + || imports->getDispatchAddress == NULL + || imports->makeCurrent == NULL) { + ErrorF("GLX: Vendor library is missing required callback functions.\n"); + return NULL; + } + + vendor = (GlxServerVendor *) calloc(1, sizeof(GlxServerVendor)); + if (vendor == NULL) { + ErrorF("GLX: Can't allocate vendor library.\n"); + return NULL; + } + memcpy(&vendor->glxvc, imports, sizeof(GlxServerImports)); + + xorg_list_append(&vendor->entry, &GlxVendorList); + return vendor; +} + +void GlxDestroyVendor(GlxServerVendor *vendor) +{ + if (vendor != NULL) { + xorg_list_del(&vendor->entry); + free(vendor); + } +} + +void GlxVendorExtensionReset(const ExtensionEntry *extEntry) +{ + GlxServerVendor *vendor, *tempVendor; + + // TODO: Do we allow the driver to destroy a vendor library handle from + // here? + xorg_list_for_each_entry_safe(vendor, tempVendor, &GlxVendorList, entry) { + if (vendor->glxvc.extensionCloseDown != NULL) { + vendor->glxvc.extensionCloseDown(extEntry); + } + } + + // If the server is exiting instead of starting a new generation, then + // free the remaining GlxServerVendor structs. + // + // XXX this used to be conditional on xf86ServerIsExiting, but it's + // cleaner to just always create the vendor struct on every generation, + // if nothing else so all ddxes get the same behavior. + xorg_list_for_each_entry_safe(vendor, tempVendor, &GlxVendorList, entry) { + GlxDestroyVendor(vendor); + } +} diff --git a/xserver/glx/vndservervendor.h b/xserver/glx/vndservervendor.h new file mode 100644 index 000000000..77cb983a6 --- /dev/null +++ b/xserver/glx/vndservervendor.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#ifndef VND_SERVER_VENDOR_H +#define VND_SERVER_VENDOR_H + +#include + +#include "glxvndabi.h" +#include "list.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * Info related to a single vendor library. + */ +struct GlxServerVendorRec { + GlxServerImports glxvc; + + struct xorg_list entry; +}; + +/** + * A linked list of vendor libraries. + * + * Note that this list only includes vendor libraries that were successfully + * initialized. + */ +extern struct xorg_list GlxVendorList; + +GlxServerVendor *GlxCreateVendor(const GlxServerImports *imports); +void GlxDestroyVendor(GlxServerVendor *vendor); + +void GlxVendorExtensionReset(const ExtensionEntry *extEntry); + +#if defined(__cplusplus) +} +#endif + +#endif // VND_SERVER_VENDOR_H diff --git a/xserver/glx/xfont.c b/xserver/glx/xfont.c index 83a455d73..bd2fdae52 100644 --- a/xserver/glx/xfont.c +++ b/xserver/glx/xfont.c @@ -152,8 +152,6 @@ __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc) __GLXcontext *cx; int error; - REQUEST_SIZE_MATCH(xGLXUseXFontReq); - req = (xGLXUseXFontReq *) pc; cx = __glXForceCurrent(cl, req->contextTag, &error); if (!cx) { diff --git a/xserver/hw/Makefile.in b/xserver/hw/Makefile.in index 08e7a32aa..046b18253 100644 --- a/xserver/hw/Makefile.in +++ b/xserver/hw/Makefile.in @@ -66,7 +66,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -312,6 +312,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -330,15 +331,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -346,6 +350,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -417,8 +423,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in index 0a487b13a..4ad111e93 100644 --- a/xserver/hw/dmx/Makefile.in +++ b/xserver/hw/dmx/Makefile.in @@ -70,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -372,6 +372,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -390,15 +391,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -406,6 +410,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -486,8 +492,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/config/Makefile.in b/xserver/hw/dmx/config/Makefile.in index 85b57a30a..edc32741e 100644 --- a/xserver/hw/dmx/config/Makefile.in +++ b/xserver/hw/dmx/config/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -389,6 +389,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -407,15 +408,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -423,6 +427,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -494,8 +500,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/config/dmxparse.c b/xserver/hw/dmx/config/dmxparse.c index cf510844d..f66143a6a 100644 --- a/xserver/hw/dmx/config/dmxparse.c +++ b/xserver/hw/dmx/config/dmxparse.c @@ -382,7 +382,7 @@ dmxConfigCreateOption(DMXConfigTokenPtr pStart, if (p->string) { int len = strlen(p->string); - strncpy(option->string + offset, p->string, len); + memcpy(option->string + offset, p->string, len); offset += len; if (p->next) option->string[offset++] = ' '; diff --git a/xserver/hw/dmx/config/man/Makefile.in b/xserver/hw/dmx/config/man/Makefile.in index ddffcc578..f6d84fe50 100644 --- a/xserver/hw/dmx/config/man/Makefile.in +++ b/xserver/hw/dmx/config/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/config/man/dmxtodmx.man b/xserver/hw/dmx/config/man/dmxtodmx.man index 68c7f5b40..e93948755 100644 --- a/xserver/hw/dmx/config/man/dmxtodmx.man +++ b/xserver/hw/dmx/config/man/dmxtodmx.man @@ -26,7 +26,7 @@ .\" Authors: .\" Rickard E. (Rik) Faith .\" -.TH dmxtodmx 1 __vendorversion__ +.TH dmxtodmx 1 @vendorversion@ .SH NAME dmxtodmx - dmx configuration file parser and printer .SH SYNOPSIS diff --git a/xserver/hw/dmx/config/man/vdltodmx.man b/xserver/hw/dmx/config/man/vdltodmx.man index b733db7ab..aa5b4244f 100644 --- a/xserver/hw/dmx/config/man/vdltodmx.man +++ b/xserver/hw/dmx/config/man/vdltodmx.man @@ -26,7 +26,7 @@ .\" Authors: .\" Rickard E. (Rik) Faith .\" -.TH vdltodmx 1 __vendorversion__ +.TH vdltodmx 1 @vendorversion@ .SH NAME vdltodmx - dmx configuration file parser and printer .SH SYNOPSIS diff --git a/xserver/hw/dmx/config/man/xdmxconfig.man b/xserver/hw/dmx/config/man/xdmxconfig.man index dcceea0e3..45b6b9bcc 100644 --- a/xserver/hw/dmx/config/man/xdmxconfig.man +++ b/xserver/hw/dmx/config/man/xdmxconfig.man @@ -26,7 +26,7 @@ .\" Authors: .\" Rickard E. (Rik) Faith .\" -.TH xdmxconfig 1 __vendorversion__ +.TH xdmxconfig 1 @vendorversion@ .SH NAME xdmxconfig - a graphical configuration tool for Xdmx configuration files .SH SYNOPSIS diff --git a/xserver/hw/dmx/dmx.c b/xserver/hw/dmx/dmx.c index 9729963da..4c7808de1 100644 --- a/xserver/hw/dmx/dmx.c +++ b/xserver/hw/dmx/dmx.c @@ -62,9 +62,7 @@ #include "protocol-versions.h" #ifdef PANORAMIX -#include "panoramiX.h" -extern unsigned long XRT_WINDOW; -extern int PanoramiXNumScreens; +#include "panoramiXsrv.h" #endif static unsigned char DMXCode; @@ -440,7 +438,7 @@ ProcDMXChangeScreensAttributes(ClientPtr client) value_list += count; } -#if PANORAMIX +#ifdef PANORAMIX status = dmxConfigureScreenWindows(stuff->screenCount, screen_list, attribs, &errorScreen); #endif @@ -750,7 +748,7 @@ ProcDMXChangeDesktopAttributes(ClientPtr client) dmxGetDesktopAttributes(&attr); dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list); -#if PANORAMIX +#ifdef PANORAMIX status = dmxConfigureDesktop(&attr); #endif if (status == BadValue) @@ -969,7 +967,7 @@ ProcDMXDispatch(ClientPtr client) } } -static int +static int _X_COLD SProcDMXQueryVersion(ClientPtr client) { REQUEST(xDMXQueryVersionReq); @@ -979,7 +977,7 @@ SProcDMXQueryVersion(ClientPtr client) return ProcDMXQueryVersion(client); } -static int +static int _X_COLD SProcDMXSync(ClientPtr client) { REQUEST(xDMXSyncReq); @@ -989,7 +987,7 @@ SProcDMXSync(ClientPtr client) return ProcDMXSync(client); } -static int +static int _X_COLD SProcDMXForceWindowCreation(ClientPtr client) { REQUEST(xDMXForceWindowCreationReq); @@ -1000,7 +998,7 @@ SProcDMXForceWindowCreation(ClientPtr client) return ProcDMXForceWindowCreation(client); } -static int +static int _X_COLD SProcDMXGetScreenCount(ClientPtr client) { REQUEST(xDMXGetScreenCountReq); @@ -1010,7 +1008,7 @@ SProcDMXGetScreenCount(ClientPtr client) return ProcDMXGetScreenCount(client); } -static int +static int _X_COLD SProcDMXGetScreenAttributes(ClientPtr client) { REQUEST(xDMXGetScreenAttributesReq); @@ -1021,7 +1019,7 @@ SProcDMXGetScreenAttributes(ClientPtr client) return ProcDMXGetScreenAttributes(client); } -static int +static int _X_COLD SProcDMXChangeScreensAttributes(ClientPtr client) { REQUEST(xDMXChangeScreensAttributesReq); @@ -1034,7 +1032,7 @@ SProcDMXChangeScreensAttributes(ClientPtr client) return ProcDMXGetScreenAttributes(client); } -static int +static int _X_COLD SProcDMXAddScreen(ClientPtr client) { int paddedLength; @@ -1050,7 +1048,7 @@ SProcDMXAddScreen(ClientPtr client) return ProcDMXAddScreen(client); } -static int +static int _X_COLD SProcDMXRemoveScreen(ClientPtr client) { REQUEST(xDMXRemoveScreenReq); @@ -1061,7 +1059,7 @@ SProcDMXRemoveScreen(ClientPtr client) return ProcDMXRemoveScreen(client); } -static int +static int _X_COLD SProcDMXGetWindowAttributes(ClientPtr client) { REQUEST(xDMXGetWindowAttributesReq); @@ -1072,7 +1070,7 @@ SProcDMXGetWindowAttributes(ClientPtr client) return ProcDMXGetWindowAttributes(client); } -static int +static int _X_COLD SProcDMXGetDesktopAttributes(ClientPtr client) { REQUEST(xDMXGetDesktopAttributesReq); @@ -1082,7 +1080,7 @@ SProcDMXGetDesktopAttributes(ClientPtr client) return ProcDMXGetDesktopAttributes(client); } -static int +static int _X_COLD SProcDMXChangeDesktopAttributes(ClientPtr client) { REQUEST(xDMXChangeDesktopAttributesReq); @@ -1094,7 +1092,7 @@ SProcDMXChangeDesktopAttributes(ClientPtr client) return ProcDMXChangeDesktopAttributes(client); } -static int +static int _X_COLD SProcDMXGetInputCount(ClientPtr client) { REQUEST(xDMXGetInputCountReq); @@ -1104,7 +1102,7 @@ SProcDMXGetInputCount(ClientPtr client) return ProcDMXGetInputCount(client); } -static int +static int _X_COLD SProcDMXGetInputAttributes(ClientPtr client) { REQUEST(xDMXGetInputAttributesReq); @@ -1115,7 +1113,7 @@ SProcDMXGetInputAttributes(ClientPtr client) return ProcDMXGetInputAttributes(client); } -static int +static int _X_COLD SProcDMXAddInput(ClientPtr client) { int paddedLength; @@ -1131,7 +1129,7 @@ SProcDMXAddInput(ClientPtr client) return ProcDMXAddInput(client); } -static int +static int _X_COLD SProcDMXRemoveInput(ClientPtr client) { REQUEST(xDMXRemoveInputReq); @@ -1142,7 +1140,7 @@ SProcDMXRemoveInput(ClientPtr client) return ProcDMXRemoveInput(client); } -static int +static int _X_COLD SProcDMXDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/hw/dmx/dmxdpms.c b/xserver/hw/dmx/dmxdpms.c index d53a3d998..15a2cbd8d 100644 --- a/xserver/hw/dmx/dmxdpms.c +++ b/xserver/hw/dmx/dmxdpms.c @@ -53,10 +53,7 @@ #include "windowstr.h" /* For screenIsSaved */ #include -static unsigned long dpmsGeneration = 0; -static Bool dpmsSupported = TRUE; - -static void +static int _dmxDPMSInit(DMXScreenInfo * dmxScreen) { int event_base, error_base; @@ -65,14 +62,9 @@ _dmxDPMSInit(DMXScreenInfo * dmxScreen) BOOL state; const char *monitor; - if (dpmsGeneration != serverGeneration) { - dpmsSupported = TRUE; /* On unless a backend doesn't support it */ - dpmsGeneration = serverGeneration; - } - #ifdef DPMSExtension if (DPMSDisabledSwitch) - dpmsSupported = FALSE; /* -dpms turns off */ + return FALSE; #endif dmxScreen->dpmsCapable = 0; @@ -80,25 +72,21 @@ _dmxDPMSInit(DMXScreenInfo * dmxScreen) if (!dmxScreen->beDisplay) { dmxLogOutput(dmxScreen, "Cannot determine if DPMS supported (detached screen)\n"); - dpmsSupported = FALSE; - return; + return FALSE; } if (!DPMSQueryExtension(dmxScreen->beDisplay, &event_base, &error_base)) { dmxLogOutput(dmxScreen, "DPMS not supported\n"); - dpmsSupported = FALSE; - return; + return FALSE; } if (!DPMSGetVersion(dmxScreen->beDisplay, &major, &minor)) { dmxLogOutput(dmxScreen, "DPMS not supported\n"); - dpmsSupported = FALSE; - return; + return FALSE; } if (!DPMSCapable(dmxScreen->beDisplay)) { dmxLogOutput(dmxScreen, "DPMS %d.%d (not DPMS capable)\n", major, minor); - dpmsSupported = FALSE; - return; + return FALSE; } DPMSInfo(dmxScreen->beDisplay, &level, &state); @@ -134,20 +122,22 @@ _dmxDPMSInit(DMXScreenInfo * dmxScreen) "DPMS %d.%d (%s, %s, %d %d %d)\n", major, minor, monitor, state ? "enabled" : "disabled", standby, suspend, off); + return TRUE; } /** Initialize DPMS support. We save the current settings and turn off * DPMS. The settings are restored in #dmxDPMSTerm. */ -void +int dmxDPMSInit(DMXScreenInfo * dmxScreen) { int interval, preferBlanking, allowExposures; /* Turn off DPMS */ - _dmxDPMSInit(dmxScreen); + if (!_dmxDPMSInit(dmxScreen)) + return FALSE; if (!dmxScreen->beDisplay) - return; + return FALSE; /* Turn off screen saver */ XGetScreenSaver(dmxScreen->beDisplay, &dmxScreen->savedTimeout, &interval, @@ -156,6 +146,7 @@ dmxDPMSInit(DMXScreenInfo * dmxScreen) preferBlanking, allowExposures); XResetScreenSaver(dmxScreen->beDisplay); dmxSync(dmxScreen, FALSE); + return TRUE; } /** Terminate DPMS support on \a dmxScreen. We restore the settings @@ -199,38 +190,12 @@ dmxDPMSWakeup(void) } #ifdef DPMSExtension -/** This is called on each server generation. It should determine if - * DPMS is supported on all of the backends and, if so, return TRUE. */ -Bool -DPMSSupported(void) +void +dmxDPMSBackend(DMXScreenInfo *dmxScreen, int level) { - return dpmsSupported; -} - -/** This is used by clients (e.g., xset) to set the DPMS level. */ -int -DPMSSet(ClientPtr client, int level) -{ - int i; - - if (!dpmsSupported) - return Success; - - if (level < 0) - level = DPMSModeOn; - if (level > 3) - level = DPMSModeOff; - - DPMSPowerLevel = level; - - for (i = 0; i < dmxNumScreens; i++) { - DMXScreenInfo *dmxScreen = &dmxScreens[i]; - - if (dmxScreen->beDisplay) { - DPMSForceLevel(dmxScreen->beDisplay, level); - dmxSync(dmxScreen, FALSE); - } + if (dmxScreen->beDisplay) { + DPMSForceLevel(dmxScreen->beDisplay, level); + dmxSync(dmxScreen, FALSE); } - return Success; } #endif diff --git a/xserver/hw/dmx/dmxdpms.h b/xserver/hw/dmx/dmxdpms.h index 772fa2f11..8c4fe9d4f 100644 --- a/xserver/hw/dmx/dmxdpms.h +++ b/xserver/hw/dmx/dmxdpms.h @@ -36,7 +36,8 @@ #ifndef _DMXDPMS_H_ #define _DMXDPMS_H_ -extern void dmxDPMSInit(DMXScreenInfo * dmxScreen); +extern int dmxDPMSInit(DMXScreenInfo * dmxScreen); extern void dmxDPMSTerm(DMXScreenInfo * dmxScreen); extern void dmxDPMSWakeup(void); /* Call when input is processed */ +extern void dmxDPMSBackend(DMXScreenInfo *dmxScreen, int level); #endif diff --git a/xserver/hw/dmx/dmxextension.c b/xserver/hw/dmx/dmxextension.c index 75d7166f3..4f5ca7252 100644 --- a/xserver/hw/dmx/dmxextension.c +++ b/xserver/hw/dmx/dmxextension.c @@ -922,7 +922,7 @@ dmxBECreateResources(void *value, XID id, RESTYPE type, void *n) dmxBECreatePixmap(pGC->tile.pixmap); dmxBERestorePixmap(pGC->tile.pixmap); } - if (pGC->stipple != pScreen->PixmapPerDepth[0]) { + if (pGC->stipple != pScreen->defaultStipple) { dmxBECreatePixmap(pGC->stipple); dmxBERestorePixmap(pGC->stipple); } @@ -1327,8 +1327,8 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) * updated to handle dynamic addition/removal of screens. */ /* Create default stipple */ - dmxBECreatePixmap(pScreen->PixmapPerDepth[0]); - dmxBERestorePixmap(pScreen->PixmapPerDepth[0]); + dmxBECreatePixmap(pScreen->defaultStipple); + dmxBERestorePixmap(pScreen->defaultStipple); /* Create the scratch GCs */ dmxBECreateScratchGCs(idx); @@ -1692,8 +1692,8 @@ dmxDetachScreen(int idx) dmxBEDestroyWindowTree(idx); /* Free default stipple */ - dmxBESavePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); - dmxBEFreePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); + dmxBESavePixmap(screenInfo.screens[idx]->defaultStipple); + dmxBEFreePixmap(screenInfo.screens[idx]->defaultStipple); /* Free the remaining screen resources and close the screen */ dmxBECloseScreen(screenInfo.screens[idx]); diff --git a/xserver/hw/dmx/dmxinit.c b/xserver/hw/dmx/dmxinit.c index 24bb875fb..07154d648 100644 --- a/xserver/hw/dmx/dmxinit.c +++ b/xserver/hw/dmx/dmxinit.c @@ -532,13 +532,10 @@ dmxDisplayInit(DMXScreenInfo * dmxScreen) dmxGetPixmapFormats(dmxScreen); } -static void dmxAddExtensions(Bool glxSupported) +static void dmxAddExtensions(void) { const ExtensionModule dmxExtensions[] = { { DMXExtensionInit, DMX_EXTENSION_NAME, NULL }, -#ifdef GLXEXT - { GlxExtensionInit, "GLX", &glxSupported }, -#endif }; LoadExtensionList(dmxExtensions, ARRAY_SIZE(dmxExtensions), TRUE); @@ -551,12 +548,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) int i; static unsigned long dmxGeneration = 0; -#ifdef GLXEXT - static Bool glxSupported = TRUE; -#else - const Bool glxSupported = FALSE; -#endif - if (dmxGeneration != serverGeneration) { int vendrel = VENDOR_RELEASE; int major, minor, year, month, day; @@ -646,7 +637,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) for (i = 0; i < dmxNumScreens; i++) dmxDisplayInit(&dmxScreens[i]); -#if PANORAMIX +#ifdef PANORAMIX /* Register a Xinerama callback which will run from within * PanoramiXCreateConnectionBlock. We can use the callback to * determine if Xinerama is loaded and to check the visuals @@ -676,17 +667,17 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) #ifdef GLXEXT /* Check if GLX extension exists on all back-end servers */ for (i = 0; i < dmxNumScreens; i++) - glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); + noGlxExtension |= (dmxScreens[i].glxMajorOpcode == 0); #endif if (serverGeneration == 1) - dmxAddExtensions(glxSupported); + dmxAddExtensions(); /* Tell dix layer about the backend displays */ for (i = 0; i < dmxNumScreens; i++) { #ifdef GLXEXT - if (glxSupported) { + if (!noGlxExtension) { /* * Builds GLX configurations from the list of visuals * supported by the back-end server, and give that diff --git a/xserver/hw/dmx/dmxpixmap.c b/xserver/hw/dmx/dmxpixmap.c index 17aca9224..7b317eaef 100644 --- a/xserver/hw/dmx/dmxpixmap.c +++ b/xserver/hw/dmx/dmxpixmap.c @@ -205,7 +205,7 @@ dmxBitmapToRegion(PixmapPtr pPixmap) RegionPtr pReg, pTmpReg; int x, y; unsigned long previousPixel, currentPixel; - BoxRec Box; + BoxRec Box = { 0, }; Bool overlap; if (!dmxScreen->beDisplay) { diff --git a/xserver/hw/dmx/dmxprop.c b/xserver/hw/dmx/dmxprop.c index 4c85268b7..7dfa04af5 100644 --- a/xserver/hw/dmx/dmxprop.c +++ b/xserver/hw/dmx/dmxprop.c @@ -84,7 +84,7 @@ dmxPropertyIdentifier(void) /* RATS: These buffers are only used in * length-limited calls. */ char hostname[256]; - static char buf[128]; + static char buf[512]; static int initialized = 0; if (initialized++) @@ -346,7 +346,7 @@ dmxPropertyWindow(DMXScreenInfo * dmxScreen) Display *dpy = dmxScreen->beDisplay; Window win = dmxScreen->scrnWin; DMXScreenInfo *other; - char buf[128]; /* RATS: only used with snprintf */ + char buf[1024]; /* RATS: only used with snprintf */ if (!dpy) return; /* FIXME: What should be done here if Xdmx is started diff --git a/xserver/hw/dmx/dmxscrinit.c b/xserver/hw/dmx/dmxscrinit.c index e441dceef..ae095e300 100644 --- a/xserver/hw/dmx/dmxscrinit.c +++ b/xserver/hw/dmx/dmxscrinit.c @@ -75,6 +75,17 @@ DevPrivateKeyRec dmxColormapPrivateKeyRec; DevPrivateKeyRec dmxPictPrivateKeyRec; DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; +#ifdef DPMSExtension +static void +dmxDPMS(ScreenPtr pScreen, int level) +{ + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; + dmxDPMSBackend(dmxScreen, level); +} +#else +#define dmxDPMS NULL +#endif + /** Initialize the parts of screen \a idx that require access to the * back-end server. */ void @@ -103,7 +114,8 @@ dmxBEScreenInit(ScreenPtr pScreen) pScreen->blackPixel = dmxScreen->beBlackPixel; /* Handle screen savers and DPMS on the backend */ - dmxDPMSInit(dmxScreen); + if (dmxDPMSInit(dmxScreen)) + pScreen->DPMS = dmxDPMS; /* Create root window for screen */ mask = CWBackPixel | CWEventMask | CWColormap | CWOverrideRedirect; diff --git a/xserver/hw/dmx/doc/Makefile.in b/xserver/hw/dmx/doc/Makefile.in index 4577d6b9e..ca047fe50 100644 --- a/xserver/hw/dmx/doc/Makefile.in +++ b/xserver/hw/dmx/doc/Makefile.in @@ -108,7 +108,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -317,6 +317,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -335,15 +336,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -351,6 +355,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -422,8 +428,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/doxygen/Makefile.in b/xserver/hw/dmx/doxygen/Makefile.in index e54da2405..d84238aaf 100644 --- a/xserver/hw/dmx/doxygen/Makefile.in +++ b/xserver/hw/dmx/doxygen/Makefile.in @@ -89,7 +89,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = doxygen.conf CONFIG_CLEAN_VPATH_FILES = @@ -298,6 +298,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -316,15 +317,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -332,6 +336,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -403,8 +409,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/examples/Makefile.in b/xserver/hw/dmx/examples/Makefile.in index 0ac5a75d5..3311b00fb 100644 --- a/xserver/hw/dmx/examples/Makefile.in +++ b/xserver/hw/dmx/examples/Makefile.in @@ -73,7 +73,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -412,6 +412,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -430,15 +431,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -446,6 +450,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -517,8 +523,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/examples/ev.c b/xserver/hw/dmx/examples/ev.c index b70016a45..09e703ce7 100644 --- a/xserver/hw/dmx/examples/ev.c +++ b/xserver/hw/dmx/examples/ev.c @@ -56,7 +56,7 @@ main(int argc, char **argv) int fd = 0; int rc; int i, j; - char *tmp; + const char *tmp; #define test_bit(bit) (mask[(bit)/8] & (1 << ((bit)%8))) diff --git a/xserver/hw/dmx/glxProxy/Makefile.in b/xserver/hw/dmx/glxProxy/Makefile.in index e73cda1a5..54cc24f03 100644 --- a/xserver/hw/dmx/glxProxy/Makefile.in +++ b/xserver/hw/dmx/glxProxy/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -318,6 +318,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -336,15 +337,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -352,6 +356,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -423,8 +429,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/glxProxy/glxcmds.c b/xserver/hw/dmx/glxProxy/glxcmds.c index a77d556db..330d5c4ad 100644 --- a/xserver/hw/dmx/glxProxy/glxcmds.c +++ b/xserver/hw/dmx/glxProxy/glxcmds.c @@ -39,7 +39,6 @@ #include "dmxsync.h" #include "glxserver.h" -#include #include "g_disptab.h" #include #include diff --git a/xserver/hw/dmx/glxProxy/glxcmdsswap.c b/xserver/hw/dmx/glxProxy/glxcmdsswap.c index 5b1722d57..92ca512a7 100644 --- a/xserver/hw/dmx/glxProxy/glxcmdsswap.c +++ b/xserver/hw/dmx/glxProxy/glxcmdsswap.c @@ -30,7 +30,6 @@ #include "glxserver.h" #include "glxutil.h" -#include #include #include #include diff --git a/xserver/hw/dmx/glxProxy/glxcontext.h b/xserver/hw/dmx/glxProxy/glxcontext.h index ac8c0573d..479186ca5 100644 --- a/xserver/hw/dmx/glxProxy/glxcontext.h +++ b/xserver/hw/dmx/glxProxy/glxcontext.h @@ -33,8 +33,6 @@ typedef struct __GLXcontextRec __GLXcontext; -#include "GL/internal/glcore.h" - struct __GLXcontextRec { /* ** list of context structs diff --git a/xserver/hw/dmx/glxProxy/glxext.c b/xserver/hw/dmx/glxProxy/glxext.c index c85827284..49848bbff 100644 --- a/xserver/hw/dmx/glxProxy/glxext.c +++ b/xserver/hw/dmx/glxProxy/glxext.c @@ -47,6 +47,8 @@ #include "extinit.h" #include "glx_extinit.h" +int noGlxExtension; + /* ** Forward declarations. */ @@ -323,12 +325,6 @@ GlxExtensionInit(void) FatalError("__glXExtensionInit: AddExtensions failed\n"); return; } - /* - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - */ __glXerrorBase = extEntry->errorBase; __glXBadContext = extEntry->errorBase + GLXBadContext; diff --git a/xserver/hw/dmx/glxProxy/glxscreens.h b/xserver/hw/dmx/glxProxy/glxscreens.h index bb7477bc7..5f36b8158 100644 --- a/xserver/hw/dmx/glxProxy/glxscreens.h +++ b/xserver/hw/dmx/glxProxy/glxscreens.h @@ -31,8 +31,6 @@ * Silicon Graphics, Inc. */ -#include "GL/internal/glcore.h" - typedef struct { __GLXvisualConfig *pGlxVisual; diff --git a/xserver/hw/dmx/input/Makefile.am b/xserver/hw/dmx/input/Makefile.am index b56ee8e29..27f49d366 100644 --- a/xserver/hw/dmx/input/Makefile.am +++ b/xserver/hw/dmx/input/Makefile.am @@ -1,14 +1,5 @@ noinst_LIBRARIES = libdmxinput.a -if DMX_BUILD_LNX -RAWSRCS = lnx-keyboard.c \ - lnx-keyboard.h \ - lnx-ms.c \ - lnx-ms.h \ - lnx-ps2.c \ - lnx-ps2.h -endif - if DMX_BUILD_USB USBSRCS = usb-keyboard.c \ usb-keyboard.h \ diff --git a/xserver/hw/dmx/input/Makefile.in b/xserver/hw/dmx/input/Makefile.in index a5e7dcb1f..a1b4449a9 100644 --- a/xserver/hw/dmx/input/Makefile.in +++ b/xserver/hw/dmx/input/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -81,26 +81,23 @@ am__v_AR_1 = libdmxinput_a_AR = $(AR) $(ARFLAGS) libdmxinput_a_LIBADD = am__libdmxinput_a_SOURCES_DIST = ChkNotMaskEv.c ChkNotMaskEv.h \ - atKeynames.h lnx-keyboard.c lnx-keyboard.h lnx-ms.c lnx-ms.h \ - lnx-ps2.c lnx-ps2.h usb-keyboard.c usb-keyboard.h usb-mouse.c \ + atKeynames.h usb-keyboard.c usb-keyboard.h usb-mouse.c \ usb-mouse.h usb-other.c usb-other.h usb-common.c usb-common.h \ usb-private.h dmxdummy.c dmxdummy.h dmxbackend.c dmxbackend.h \ dmxconsole.c dmxconsole.h dmxcommon.c dmxcommon.h \ dmxinputinit.c dmxinputinit.h dmxarg.c dmxarg.h dmxevents.c \ dmxevents.h dmxxinput.c dmxmotion.c dmxmotion.h dmxmap.c \ dmxmap.h -@DMX_BUILD_LNX_TRUE@am__objects_1 = lnx-keyboard.$(OBJEXT) \ -@DMX_BUILD_LNX_TRUE@ lnx-ms.$(OBJEXT) lnx-ps2.$(OBJEXT) -@DMX_BUILD_USB_TRUE@am__objects_2 = usb-keyboard.$(OBJEXT) \ +@DMX_BUILD_USB_TRUE@am__objects_1 = usb-keyboard.$(OBJEXT) \ @DMX_BUILD_USB_TRUE@ usb-mouse.$(OBJEXT) usb-other.$(OBJEXT) \ @DMX_BUILD_USB_TRUE@ usb-common.$(OBJEXT) -am__objects_3 = dmxdummy.$(OBJEXT) dmxbackend.$(OBJEXT) \ +am__objects_2 = dmxdummy.$(OBJEXT) dmxbackend.$(OBJEXT) \ dmxconsole.$(OBJEXT) dmxcommon.$(OBJEXT) -am__objects_4 = dmxinputinit.$(OBJEXT) dmxarg.$(OBJEXT) \ +am__objects_3 = dmxinputinit.$(OBJEXT) dmxarg.$(OBJEXT) \ dmxevents.$(OBJEXT) dmxxinput.$(OBJEXT) dmxmotion.$(OBJEXT) \ dmxmap.$(OBJEXT) am_libdmxinput_a_OBJECTS = ChkNotMaskEv.$(OBJEXT) $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) + $(am__objects_2) $(am__objects_3) libdmxinput_a_OBJECTS = $(am_libdmxinput_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -333,6 +330,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -351,15 +349,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -367,6 +368,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -438,8 +441,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -505,13 +506,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libdmxinput.a -@DMX_BUILD_LNX_TRUE@RAWSRCS = lnx-keyboard.c \ -@DMX_BUILD_LNX_TRUE@ lnx-keyboard.h \ -@DMX_BUILD_LNX_TRUE@ lnx-ms.c \ -@DMX_BUILD_LNX_TRUE@ lnx-ms.h \ -@DMX_BUILD_LNX_TRUE@ lnx-ps2.c \ -@DMX_BUILD_LNX_TRUE@ lnx-ps2.h - @DMX_BUILD_USB_TRUE@USBSRCS = usb-keyboard.c \ @DMX_BUILD_USB_TRUE@ usb-keyboard.h \ @DMX_BUILD_USB_TRUE@ usb-mouse.c \ @@ -619,9 +613,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxmotion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxxinput.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx-keyboard.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx-ms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx-ps2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb-keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb-mouse.Po@am__quote@ diff --git a/xserver/hw/dmx/input/dmxarg.c b/xserver/hw/dmx/input/dmxarg.c index 6c21ae959..582ed3faa 100644 --- a/xserver/hw/dmx/input/dmxarg.c +++ b/xserver/hw/dmx/input/dmxarg.c @@ -114,30 +114,17 @@ dmxArgC(dmxArg a) dmxArg dmxArgParse(const char *string) { - char *tmp; - char *start, *pt; + int i = 0; dmxArg a = dmxArgCreate(); - int done; - int len; if (!string) return a; - len = strlen(string) + 2; - tmp = malloc(len); - strncpy(tmp, string, len); + a->argv = (const char **)xstrtokenize(string, ","); + if (a->argv) + for (i = 0; a->argv[i] != NULL; i++); + a->argc = i; - for (start = pt = tmp, done = 0; !done && *pt; start = ++pt) { - for (; *pt && *pt != ','; pt++); - if (!*pt) - done = 1; - *pt = '\0'; - dmxArgAdd(a, start); - } - if (!done) - dmxArgAdd(a, ""); /* Final comma */ - - free(tmp); return a; } diff --git a/xserver/hw/dmx/input/dmxinputinit.c b/xserver/hw/dmx/input/dmxinputinit.c index 554d234e9..04e4f3d92 100644 --- a/xserver/hw/dmx/input/dmxinputinit.c +++ b/xserver/hw/dmx/input/dmxinputinit.c @@ -55,9 +55,6 @@ #include "config/dmxconfig.h" #include "dmxcursor.h" -#include "lnx-keyboard.h" -#include "lnx-ms.h" -#include "lnx-ps2.h" #include "usb-keyboard.h" #include "usb-mouse.h" #include "usb-other.h" @@ -133,31 +130,6 @@ static DMXLocalInputInfoRec DMXConsoleKbd = { static DMXLocalInputInfoRec DMXLocalDevices[] = { /* Dummy drivers that can compile on any OS */ -#ifdef __linux__ - /* Linux-specific drivers */ - { - "kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1, - kbdLinuxCreatePrivate, kbdLinuxDestroyPrivate, - kbdLinuxInit, NULL, NULL, kbdLinuxGetInfo, - kbdLinuxOn, kbdLinuxOff, NULL, - kbdLinuxVTPreSwitch, kbdLinuxVTPostSwitch, kbdLinuxVTSwitch, - kbdLinuxRead, NULL, NULL, NULL, - NULL, kbdLinuxCtrl, kbdLinuxBell}, - { - "ms", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1, - msLinuxCreatePrivate, msLinuxDestroyPrivate, - msLinuxInit, NULL, NULL, msLinuxGetInfo, - msLinuxOn, msLinuxOff, NULL, - msLinuxVTPreSwitch, msLinuxVTPostSwitch, NULL, - msLinuxRead}, - { - "ps2", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1, - ps2LinuxCreatePrivate, ps2LinuxDestroyPrivate, - ps2LinuxInit, NULL, NULL, ps2LinuxGetInfo, - ps2LinuxOn, ps2LinuxOff, NULL, - ps2LinuxVTPreSwitch, ps2LinuxVTPostSwitch, NULL, - ps2LinuxRead}, -#endif #ifdef __linux__ /* USB drivers, currently only for Linux, but relatively easy to port to @@ -998,41 +970,6 @@ dmxInputInit(DMXInputInfo * dmxInput) a = dmxArgParse(dmxInput->name); - for (i = 1; i < dmxArgC(a); i++) { - switch (hasXkb) { - case 1: - dmxInput->keycodes = xstrdup(dmxArgV(a, i)); - ++hasXkb; - break; - case 2: - dmxInput->symbols = xstrdup(dmxArgV(a, i)); - ++hasXkb; - break; - case 3: - dmxInput->geometry = xstrdup(dmxArgV(a, i)); - hasXkb = 0; - break; - case 0: - if (!strcmp(dmxArgV(a, i), "noxi")) - doXI = 0; - else if (!strcmp(dmxArgV(a, i), "xi")) - doXI = 1; - else if (!strcmp(dmxArgV(a, i), "console")) - forceConsole = 1; - else if (!strcmp(dmxArgV(a, i), "noconsole")) - forceConsole = 0; - else if (!strcmp(dmxArgV(a, i), "windows")) - doWindows = 1; - else if (!strcmp(dmxArgV(a, i), "nowindows")) - doWindows = 0; - else if (!strcmp(dmxArgV(a, i), "xkb")) - hasXkb = 1; - else { - dmxLog(dmxFatal, "Unknown input argument: %s\n", dmxArgV(a, i)); - } - } - } - name = dmxArgV(a, 0); if (!strcmp(name, "local")) { @@ -1046,6 +983,41 @@ dmxInputInit(DMXInputInfo * dmxInput) else { int found; + for (i = 1; i < dmxArgC(a); i++) { + switch (hasXkb) { + case 1: + dmxInput->keycodes = xstrdup(dmxArgV(a, i)); + ++hasXkb; + break; + case 2: + dmxInput->symbols = xstrdup(dmxArgV(a, i)); + ++hasXkb; + break; + case 3: + dmxInput->geometry = xstrdup(dmxArgV(a, i)); + hasXkb = 0; + break; + case 0: + if (!strcmp(dmxArgV(a, i), "noxi")) + doXI = 0; + else if (!strcmp(dmxArgV(a, i), "xi")) + doXI = 1; + else if (!strcmp(dmxArgV(a, i), "console")) + forceConsole = 1; + else if (!strcmp(dmxArgV(a, i), "noconsole")) + forceConsole = 0; + else if (!strcmp(dmxArgV(a, i), "windows")) + doWindows = 1; + else if (!strcmp(dmxArgV(a, i), "nowindows")) + doWindows = 0; + else if (!strcmp(dmxArgV(a, i), "xkb")) + hasXkb = 1; + else { + dmxLog(dmxFatal, "Unknown input argument: %s\n", dmxArgV(a, i)); + } + } + } + for (found = 0, i = 0; i < dmxNumScreens; i++) { if (dmxPropertySameDisplay(&dmxScreens[i], name)) { if (dmxScreens[i].shared) diff --git a/xserver/hw/dmx/input/lnx-keyboard.c b/xserver/hw/dmx/input/lnx-keyboard.c deleted file mode 100644 index a273f6b71..000000000 --- a/xserver/hw/dmx/input/lnx-keyboard.c +++ /dev/null @@ -1,1193 +0,0 @@ -/* Portions of this file were derived from the following files: - * - ********************************************************************** - * - * xfree86/common/{xf86Io.c,xf86Kbd.c,xf86Events.c} - * - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * - * 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, and that the name of Thomas Roell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Thomas Roell makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THOMAS ROELL 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. - * - ********************************************************************** - * - * xfree86/common/xf86KbdLnx.c - * - * Linux version of keymapping setup. The kernel (since 0.99.14) has support - * for fully remapping the keyboard, but there are some differences between - * the Linux map and the SVR4 map (esp. in the extended keycodes). We also - * remove the restriction on what keycodes can be remapped. - * Orest Zborowski. - * - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * - * 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, and that the name of Thomas Roell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Thomas Roell makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THOMAS ROELL 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. - * - ********************************************************************** - * - * xfree86/os-support/linux/lnx_io.c - * - * Copyright 1992 by Orest Zborowski - * Copyright 1993 by David Dawes - * - * 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, and that the names of Orest Zborowski and David Dawes - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. Orest Zborowski - * and David Dawes make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES 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. - * - */ - -/* - * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * This code implements a low-level device driver for the Linux - * keyboard. The code is derived from code by Thomas Roell, Orest - * Zborowski, and David Dawes (see the source code for complete - * references). */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -/*****************************************************************************/ -/* Define some macros to make it easier to move this file to another - * part of the Xserver tree. All calls to the dmx* layer are #defined - * here for the .c file. The .h file will also have to be edited. */ -#include "dmxinputinit.h" -#include "lnx-keyboard.h" - -#define GETPRIV myPrivate *priv \ - = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private - -#define LOG0(f) dmxLog(dmxDebug,f) -#define LOG1(f,a) dmxLog(dmxDebug,f,a) -#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b) -#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c) -#define FATAL0(f) dmxLog(dmxFatal,f) -#define FATAL1(f,a) dmxLog(dmxFatal,f,a) -#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b) -#define MOTIONPROC dmxMotionProcPtr -#define ENQUEUEPROC dmxEnqueueProcPtr -#define CHECKPROC dmxCheckSpecialProcPtr -#define SWITCHRETPROC dmxVTSwitchReturnProcPtr -#define BLOCK DMXBlockType -#define MESSAGE "\033c\n\n\nDMX taking input from this console..." -#define FINALMESSAGE "\033cDMX terminated." - -/* End of interface definitions. */ -/*****************************************************************************/ - -#include "inputstr.h" -#include -#include -#include -#include -#include -#include -#include "atKeynames.h" -#if 00 -#include "xf86Keymap.h" -#endif -#include -#include - -#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0])) -#define NUM_STATE_ENTRIES (256/32) - -/* Private area for Linux-style keyboards. */ -typedef struct _myPrivate { - int fd; - int vtno; - int vtcurrent; - int kbdtrans; - struct termios kbdtty; - int kbdType; - CARD32 kbdState[NUM_STATE_ENTRIES]; - DeviceIntPtr pKeyboard; - unsigned char prefix; - - int switched; - SWITCHRETPROC switch_return; - void *switch_return_data; - - /* For bell */ - int pitch; - unsigned long duration; -} myPrivate; - -static myPrivate *PRIV = NULL; - -#undef SYSCALL -#define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) - -static int -kbdLinuxKeyDown(myPrivate * priv, int keyCode) -{ - CARD8 byte = keyCode >> 5; - CARD32 bit = 1 << (keyCode & 0x1f); - - if (byte > NUM_STATE_ENTRIES) - return 0; - return priv->kbdState[byte] & bit; -} - -static void -kbdLinuxKeyState(myPrivate * priv, int type, int keyCode) -{ - CARD8 byte = keyCode >> 5; - CARD32 bit = 1 << (keyCode & 0x1f); - - if (byte > NUM_STATE_ENTRIES) - return; - if (type == KeyPress) - priv->kbdState[byte] |= bit; - else - priv->kbdState[byte] &= ~bit; -} - -static KeySym linux_to_x[256] = { - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, XK_Escape, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_space, XK_exclam, XK_quotedbl, XK_numbersign, - XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, - XK_parenleft, XK_parenright, XK_asterisk, XK_plus, - XK_comma, XK_minus, XK_period, XK_slash, - XK_0, XK_1, XK_2, XK_3, - XK_4, XK_5, XK_6, XK_7, - XK_8, XK_9, XK_colon, XK_semicolon, - XK_less, XK_equal, XK_greater, XK_question, - XK_at, XK_A, XK_B, XK_C, - XK_D, XK_E, XK_F, XK_G, - XK_H, XK_I, XK_J, XK_K, - XK_L, XK_M, XK_N, XK_O, - XK_P, XK_Q, XK_R, XK_S, - XK_T, XK_U, XK_V, XK_W, - XK_X, XK_Y, XK_Z, XK_bracketleft, - XK_backslash, XK_bracketright, XK_asciicircum, XK_underscore, - XK_grave, XK_a, XK_b, XK_c, - XK_d, XK_e, XK_f, XK_g, - XK_h, XK_i, XK_j, XK_k, - XK_l, XK_m, XK_n, XK_o, - XK_p, XK_q, XK_r, XK_s, - XK_t, XK_u, XK_v, XK_w, - XK_x, XK_y, XK_z, XK_braceleft, - XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_nobreakspace, XK_exclamdown, XK_cent, XK_sterling, - XK_currency, XK_yen, XK_brokenbar, XK_section, - XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft, - XK_notsign, XK_hyphen, XK_registered, XK_macron, - XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior, - XK_acute, XK_mu, XK_paragraph, XK_periodcentered, - XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright, - XK_onequarter, XK_onehalf, XK_threequarters, XK_questiondown, - XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde, - XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla, - XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, - XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, - XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, - XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply, - XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex, - XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp, - XK_agrave, XK_aacute, XK_acircumflex, XK_atilde, - XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla, - XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, - XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis, - XK_eth, XK_ntilde, XK_ograve, XK_oacute, - XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division, - XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex, - XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis -}; - -/* - * Maps the AT keycodes to Linux keycodes - */ -static unsigned char at2lnx[NUM_KEYCODES] = { - 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */ - 0x03, /* KEY_2 */ 0x04, /* KEY_3 */ - 0x05, /* KEY_4 */ 0x06, /* KEY_5 */ - 0x07, /* KEY_6 */ 0x08, /* KEY_7 */ - 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */ - 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */ - 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */ - 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */ - 0x11, /* KEY_W */ 0x12, /* KEY_E */ - 0x13, /* KEY_R */ 0x14, /* KEY_T */ - 0x15, /* KEY_Y */ 0x16, /* KEY_U */ - 0x17, /* KEY_I */ 0x18, /* KEY_O */ - 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */ - 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */ - 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */ - 0x1f, /* KEY_S */ 0x20, /* KEY_D */ - 0x21, /* KEY_F */ 0x22, /* KEY_G */ - 0x23, /* KEY_H */ 0x24, /* KEY_J */ - 0x25, /* KEY_K */ 0x26, /* KEY_L */ - 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */ - 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */ - 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */ - 0x2d, /* KEY_X */ 0x2e, /* KEY_C */ - 0x2f, /* KEY_V */ 0x30, /* KEY_B */ - 0x31, /* KEY_N */ 0x32, /* KEY_M */ - 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */ - 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */ - 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */ - 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */ - 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */ - 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */ - 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */ - 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */ - 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */ - 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */ - 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */ - 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */ - 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */ - 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */ - 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */ - 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */ - 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */ - 0x00, /* 0x55 */ 0x56, /* KEY_Less */ - 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */ - 0x66, /* KEY_Home */ 0x67, /* KEY_Up */ - 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */ - 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */ - 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */ - 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */ - 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */ - 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */ - 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */ - 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */ - 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */ - 0x7A, /* KEY_Menu/FOCUS_PF11 */ 0x00, /* 0x6e */ - 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */ - 0x00, /* 0x71 */ 0x00, /* 0x72 */ - 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */ - 0x00, /* 0x75 */ 0x00, /* 0x76 */ - 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */ - 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */ - 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */ - 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */ - 0x00, /* 0x7f */ -}; - -/** Create a private structure for use within this file. */ -void * -kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard) -{ - myPrivate *priv = calloc(1, sizeof(*priv)); - - priv->fd = -1; - priv->pKeyboard = pKeyboard; - return priv; -} - -/** Destroy a private structure. */ -void -kbdLinuxDestroyPrivate(void *priv) -{ - free(priv); -} - -/** Ring the bell. - * - * Note: we completely ignore the \a volume, since Linux's ioctl() - * interface does not provide a way to control it. If it did, the XBell - * manpage tells how the actual volume is a function of the percent and - * the (base) volume. - * - * Note that most of the other PC-based bell drivers compute the - * duration for KDMKTONE as a function of the volume and the duration. - * For some drivers, the duration is only measured in mS if the volume - * is 50, and is scaled by the volume for other values. This seems - * confusing and possibly incorrect (the xset man page says that the - * bell will be "as closely as it can to the user's specifications" -- - * if we ignore the volume and set the duration correctly, then we'll - * get one parameter "wrong" -- but if we use the volume to scale the - * duration, then we'll get both parameters "wrong"). */ -void -kbdLinuxBell(DevicePtr pDev, int percent, int volume, int pitch, int duration) -{ - GETPRIV; - - if (duration && pitch) { - ioctl(priv->fd, KDMKTONE, ((1193190 / pitch) & 0xffff) /* Low bits specify cycle time */ - |(duration << 16)); /* High bits are duration in msec */ - } -} - -/** Set the LEDs. */ -void -kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl * ctrl) -{ - GETPRIV; - - ioctl(priv->fd, KDSETLED, ctrl->leds & 0x07); -} - -static int -kbdLinuxGetFreeVTNumber(void) -{ - int fd = -1; - int vtno; - int i; - const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; - - for (i = 0; tty0[i]; i++) - if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) - break; - if (fd < 0) - FATAL1("kbdLinuxGetFreeVTNumber: Cannot open tty0 (%s)\n", - strerror(errno)); - if (ioctl(fd, VT_OPENQRY, &vtno) < 0 || vtno < 0) - FATAL0("kbdLinuxGetFreeVTNumber: Cannot find a free VT\n"); - return vtno; -} - -static int -kbdLinuxOpenVT(int vtno) -{ - int fd = -1; - int i; - const char *vcs[] = { "/dev/vc/", "/dev/tty", NULL }; - char name[64]; /* RATS: Only used in snprintf */ - - for (i = 0; vcs[i]; i++) { - snprintf(name, sizeof(name), "%s%d", vcs[i], vtno); - if ((fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) - break; - } - if (fd < 0) - FATAL2("kbdLinuxOpenVT: Cannot open VT %d (%s)\n", - vtno, strerror(errno)); - return fd; -} - -static int -kbdLinuxGetCurrentVTNumber(int fd) -{ - struct vt_stat vts; - - if (!ioctl(fd, VT_GETSTATE, &vts)) - return vts.v_active; - return -1; -} - -static int kbdLinuxActivate(int fd, int vtno, int setSig); - -/** Currently unused hook called prior to an VT switch. */ -void -kbdLinuxVTPreSwitch(void *p) -{ -} - -/** Currently unused hook called after returning from a VT switch. */ -void -kbdLinuxVTPostSwitch(void *p) -{ -} - -/** Tell the operating system to switch to \a vt. The \a switch_return - * function is called with the \a switch_return_data when the VT is - * switched back to the pre-switch VT (i.e., the user returns to the DMX - * session). */ -int -kbdLinuxVTSwitch(void *p, int vt, - void (*switch_return) (void *), void *switch_return_data) -{ - myPrivate *priv = p; - - if (priv->switched) - FATAL0("kbdLinuxVTSwitch: already switched...\n"); - if (priv->vtno == vt) - return 0; - - PRIV = priv; - priv->switched = 0; /* Will switch to 1 in handler */ - priv->switch_return = switch_return; - priv->switch_return_data = switch_return_data; - kbdLinuxActivate(priv->fd, vt, 0); - return 1; -} - -/* RATS: This function is only ever used to handle SIGUSR1. */ -static void -kbdLinuxVTSignalHandler(int sig) -{ - myPrivate *priv = PRIV; - - OsSignal(sig, kbdLinuxVTSignalHandler); - if (priv) { - ioctl(priv->fd, VT_RELDISP, VT_ACKACQ); - priv->switched = !priv->switched; - LOG2("kbdLinuxVTSignalHandler: got signal %d, switched = %d\n", - sig, priv->switched); - if (!priv->switched && priv->switch_return) - priv->switch_return(priv->switch_return_data); - } -} - -static int -kbdLinuxActivate(int fd, int vtno, int setSig) -{ - int result; - struct vt_mode VT; - - SYSCALL(result = ioctl(fd, VT_ACTIVATE, vtno)); - if (result) - FATAL0("kbdLinuxActivate: VT_ACTIVATE failed\n"); - SYSCALL(result = ioctl(fd, VT_WAITACTIVE, vtno)); - if (result) - FATAL0("kbdLinuxActivate: VT_WAITACTIVE failed\n"); - if (setSig) { - SYSCALL(result = ioctl(fd, VT_GETMODE, &VT)); - if (result < 0) - FATAL0("kbdLinuxActivate: VT_GETMODE failed\n"); - VT.mode = VT_PROCESS; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - if (ioctl(fd, VT_SETMODE, &VT)) - FATAL0("kbdLinuxActivate: VT_SETMODE VT_PROCESS failed\n"); - OsSignal(SIGUSR1, kbdLinuxVTSignalHandler); - } - return Success; -} - -static void -kbdLinuxOpenConsole(DevicePtr pDev) -{ - GETPRIV; - const char *msg = MESSAGE; - - if (priv->fd >= 0) - return; - priv->vtno = kbdLinuxGetFreeVTNumber(); - priv->fd = kbdLinuxOpenVT(priv->vtno); - priv->vtcurrent = kbdLinuxGetCurrentVTNumber(priv->fd); - LOG2("kbdLinuxOpenConsole: current VT %d; using free VT %d\n", - priv->vtcurrent, priv->vtno); - kbdLinuxActivate(priv->fd, priv->vtno, 1); - ioctl(priv->fd, KDSETMODE, KD_GRAPHICS); /* To turn off gpm */ - if (msg) - write(priv->fd, msg, strlen(msg)); -} - -static void -kbdLinuxCloseConsole(DevicePtr pDev) -{ - GETPRIV; - struct vt_mode VT; - const char *msg = FINALMESSAGE; - - if (priv->fd < 0) - return; - - ioctl(priv->fd, KDSETMODE, KD_TEXT); - if (msg) - write(priv->fd, msg, strlen(msg)); - if (ioctl(priv->fd, VT_GETMODE, &VT) != -1) { - VT.mode = VT_AUTO; - ioctl(priv->fd, VT_SETMODE, &VT); - } - - LOG1("kbdLinuxCloseConsole: switching to VT %d\n", priv->vtcurrent); - if (priv->vtcurrent >= 0) - kbdLinuxActivate(priv->fd, priv->vtcurrent, 0); - - close(priv->fd); - priv->fd = -1; -} - -/** Initialize the \a pDev as a Linux keyboard. */ -void -kbdLinuxInit(DevicePtr pDev) -{ - GETPRIV; - - if (priv->fd <= 0) - kbdLinuxOpenConsole(pDev); - - ioctl(priv->fd, KDGKBMODE, &priv->kbdtrans); - if (tcgetattr(priv->fd, &priv->kbdtty) < 0) - FATAL1("kbdLinuxInit: tcgetattr failed (%s)\n", strerror(errno)); -} - -static int -kbdLinuxPrefix0Mapping(unsigned char *scanCode) -{ - /* Table from xfree86/common/xf86Events.c */ - switch (*scanCode) { - case KEY_KP_7: - *scanCode = KEY_Home; - break; /* curs home */ - case KEY_KP_8: - *scanCode = KEY_Up; - break; /* curs up */ - case KEY_KP_9: - *scanCode = KEY_PgUp; - break; /* curs pgup */ - case KEY_KP_4: - *scanCode = KEY_Left; - break; /* curs left */ - case KEY_KP_5: - *scanCode = KEY_Begin; - break; /* curs begin */ - case KEY_KP_6: - *scanCode = KEY_Right; - break; /* curs right */ - case KEY_KP_1: - *scanCode = KEY_End; - break; /* curs end */ - case KEY_KP_2: - *scanCode = KEY_Down; - break; /* curs down */ - case KEY_KP_3: - *scanCode = KEY_PgDown; - break; /* curs pgdown */ - case KEY_KP_0: - *scanCode = KEY_Insert; - break; /* curs insert */ - case KEY_KP_Decimal: - *scanCode = KEY_Delete; - break; /* curs delete */ - case KEY_Enter: - *scanCode = KEY_KP_Enter; - break; /* keypad enter */ - case KEY_LCtrl: - *scanCode = KEY_RCtrl; - break; /* right ctrl */ - case KEY_KP_Multiply: - *scanCode = KEY_Print; - break; /* print */ - case KEY_Slash: - *scanCode = KEY_KP_Divide; - break; /* keyp divide */ - case KEY_Alt: - *scanCode = KEY_AltLang; - break; /* right alt */ - case KEY_ScrollLock: - *scanCode = KEY_Break; - break; /* curs break */ - case 0x5b: - *scanCode = KEY_LMeta; - break; - case 0x5c: - *scanCode = KEY_RMeta; - break; - case 0x5d: - *scanCode = KEY_Menu; - break; - case KEY_F3: - *scanCode = KEY_F13; - break; - case KEY_F4: - *scanCode = KEY_F14; - break; - case KEY_F5: - *scanCode = KEY_F15; - break; - case KEY_F6: - *scanCode = KEY_F16; - break; - case KEY_F7: - *scanCode = KEY_F17; - break; - case KEY_KP_Plus: - *scanCode = KEY_KP_DEC; - break; - /* - * Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) - */ - case 0x2A: - case 0x36: - return 1; - default: - /* - * "Internet" keyboards are generating lots of new codes. - * Let them pass. There is little consistency between them, - * so don't bother with symbolic names at this level. - */ - scanCode += 0x78; - } - return 0; -} - -static int -kbdLinuxPrefixMapping(myPrivate * priv, unsigned char *scanCode) -{ - int pressed = *scanCode & 0x80; - unsigned char code = *scanCode & 0x7f; - - /* If we don't have a prefix, check for one */ - if (!priv->prefix) { - switch (code) { - case KEY_Prefix0: - case KEY_Prefix1: - priv->prefix = code; - return 1; - } - return 0; /* No change */ - } - - /* We have a prefix from the last scanCode */ - switch (priv->prefix) { - case KEY_Prefix0: - priv->prefix = 0; - if (kbdLinuxPrefix0Mapping(&code)) - return 1; /* Skip sequence */ - break; - case KEY_Prefix1: - priv->prefix = (code = KEY_LCtrl) ? KEY_LCtrl : 0; - return 1; /* Use new prefix */ - case KEY_LCtrl: - priv->prefix = 0; - if (code != KEY_NumLock) - return 1; /* Skip sequence */ - code = KEY_Pause; - break; - } - - *scanCode = code | (pressed ? 0x80 : 0x00); - return 0; /* Use old scanCode */ -} - -static void -kbdLinuxConvert(DevicePtr pDev, - unsigned char scanCode, - ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) -{ - GETPRIV; - XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo; - int type; - KeySym keySym = NoSymbol; - int keyCode; - int switching; - - /* Do special PC/AT prefix mapping -- may change scanCode! */ - if (kbdLinuxPrefixMapping(priv, &scanCode)) - return; - - type = (scanCode & 0x80) ? KeyRelease : KeyPress; - keyCode = (scanCode & 0x7f) + MIN_KEYCODE; - - /* Handle repeats */ - - if (keyCode >= xkbi->desc->min_key_code && - keyCode <= xkbi->desc->max_key_code) { - - int effectiveGroup = XkbGetEffectiveGroup(xkbi, - &xkbi->state, - scanCode); - - keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup); -#if 0 - switch (keySym) { - case XK_Num_Lock: - case XK_Scroll_Lock: - case XK_Shift_Lock: - case XK_Caps_Lock: - /* Ignore releases and all but first press */ - if (kbdLinuxModIgnore(priv, &xE, keySym)) - return; - if (kbdLinuxKeyDown(priv, &xE)) - xE.u.u.type = KeyRelease; - else - xE.u.u.type = KeyPress; - break; - } -#endif - - /* If key is already down, ignore or autorepeat */ - if (type == KeyPress && kbdLinuxKeyDown(priv, keyCode)) { - KbdFeedbackClassRec *feed = priv->pKeyboard->kbdfeed; - - /* No auto-repeat? */ - if ((feed && !feed->ctrl.autoRepeat) - || priv->pKeyboard->key->xkbInfo->desc->map->modmap[keyCode] - || (feed && !(feed->ctrl.autoRepeats[keyCode >> 3] - & (1 << (keyCode & 7))))) - return; /* Ignore */ - - /* Do auto-repeat */ - enqueue(pDev, KeyRelease, keyCode, keySym, NULL, block); - type = KeyPress; - } - - /* If key is already up, ignore */ - if (type == KeyRelease && !kbdLinuxKeyDown(priv, keyCode)) - return; - } - - switching = 0; - if (checkspecial && type == KeyPress) - switching = checkspecial(pDev, keySym); - if (!switching) { - if (enqueue) - enqueue(pDev, type, keyCode, keySym, NULL, block); - kbdLinuxKeyState(priv, type, keyCode); /* Update our state bitmap */ - } -} - -/** Read an event from the \a pDev device. If the event is a motion - * event, enqueue it with the \a motion function. Otherwise, check for - * special keys with the \a checkspecial function and enqueue the event - * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block the input thread as appropriate to the - * caller of this function. */ -void -kbdLinuxRead(DevicePtr pDev, - MOTIONPROC motion, - ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) -{ - GETPRIV; - unsigned char buf[256]; /* RATS: Only used in length-limited call */ - unsigned char *pt; - int n; - - while ((n = read(priv->fd, buf, sizeof(buf))) > 0) - for (pt = buf; n; --n, ++pt) - kbdLinuxConvert(pDev, *pt, enqueue, checkspecial, block); -} - -/** Turn \a pDev on (i.e., take input from \a pDev). */ -int -kbdLinuxOn(DevicePtr pDev) -{ - GETPRIV; - struct termios nTty; - - ioctl(priv->fd, KDSKBMODE, K_RAW); - - nTty = priv->kbdtty; - nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); - nTty.c_oflag = 0; - nTty.c_cflag = CREAD | CS8; - nTty.c_lflag = 0; - nTty.c_cc[VTIME] = 0; - nTty.c_cc[VMIN] = 1; - cfsetispeed(&nTty, B9600); - cfsetospeed(&nTty, B9600); - if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0) - FATAL1("kbdLinuxOn: tcsetattr failed (%s)\n", strerror(errno)); - return priv->fd; -} - -/** Turn \a pDev off (i.e., stop taking input from \a pDev). */ -void -kbdLinuxOff(DevicePtr pDev) -{ - GETPRIV; - - ioctl(priv->fd, KDSKBMODE, priv->kbdtrans); - tcsetattr(priv->fd, TCSANOW, &priv->kbdtty); - kbdLinuxCloseConsole(pDev); -} - -static void -kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms) -{ - KeySym *k; - int i; - int maxkey; - - static unsigned char tbl[GLYPHS_PER_KEY] = { /* RATS: Use ok */ - 0, /* unshifted */ - 1, /* shifted */ - 0, /* modeswitch unshifted */ - 0 /* modeswitch shifted */ - }; - - /* - * Read the mapping from the kernel. - * Since we're still using the XFree86 scancode->AT keycode mapping - * routines, we need to convert the AT keycodes to Linux keycodes, - * then translate the Linux keysyms into X keysyms. - * - * First, figure out which tables to use for the modeswitch columns - * above, from the XF86Config fields. - */ - tbl[2] = 8; /* alt */ - tbl[3] = tbl[2] | 1; - -#if 00 /*BP*/ - k = map + GLYPHS_PER_KEY; -#else - ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n"); - return; -#endif - maxkey = NUM_AT2LNX; - - for (i = 0; i < maxkey; ++i) { - struct kbentry kbe; - int j; - - kbe.kb_index = at2lnx[i]; - - for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) { - unsigned short kval; - - *k = NoSymbol; - - kbe.kb_table = tbl[j]; - if (kbe.kb_index == 0 || ioctl(fd, KDGKBENT, &kbe)) - continue; - - kval = KVAL(kbe.kb_value); - switch (KTYP(kbe.kb_value)) { - case KT_LATIN: - case KT_LETTER: - *k = linux_to_x[kval]; - break; - case KT_FN: - if (kval <= 19) - *k = XK_F1 + kval; - else - switch (kbe.kb_value) { - case K_FIND: - *k = XK_Home; /* or XK_Find */ - break; - case K_INSERT: - *k = XK_Insert; - break; - case K_REMOVE: - *k = XK_Delete; - break; - case K_SELECT: - *k = XK_End; /* or XK_Select */ - break; - case K_PGUP: - *k = XK_Prior; - break; - case K_PGDN: - *k = XK_Next; - break; - case K_HELP: - *k = XK_Help; - break; - case K_DO: - *k = XK_Execute; - break; - case K_PAUSE: - *k = XK_Pause; - break; - case K_MACRO: - *k = XK_Menu; - break; - default: - break; - } - break; - case KT_SPEC: - switch (kbe.kb_value) { - case K_ENTER: - *k = XK_Return; - break; - case K_BREAK: - *k = XK_Break; - break; - case K_CAPS: - *k = XK_Caps_Lock; - break; - case K_NUM: - *k = XK_Num_Lock; - break; - case K_HOLD: - *k = XK_Scroll_Lock; - break; - case K_COMPOSE: - *k = XK_Multi_key; - break; - default: - break; - } - break; - case KT_PAD: - switch (kbe.kb_value) { - case K_PPLUS: - *k = XK_KP_Add; - break; - case K_PMINUS: - *k = XK_KP_Subtract; - break; - case K_PSTAR: - *k = XK_KP_Multiply; - break; - case K_PSLASH: - *k = XK_KP_Divide; - break; - case K_PENTER: - *k = XK_KP_Enter; - break; - case K_PCOMMA: - *k = XK_KP_Separator; - break; - case K_PDOT: - *k = XK_KP_Decimal; - break; - case K_PPLUSMINUS: - *k = XK_KP_Subtract; - break; - default: - if (kval <= 9) - *k = XK_KP_0 + kval; - break; - } - break; - case KT_DEAD: - /* KT_DEAD keys are for accelerated diacritical creation. */ - switch (kbe.kb_value) { - case K_DGRAVE: - *k = XK_dead_grave; - break; - case K_DACUTE: - *k = XK_dead_acute; - break; - case K_DCIRCM: - *k = XK_dead_circumflex; - break; - case K_DTILDE: - *k = XK_dead_tilde; - break; - case K_DDIERE: - *k = XK_dead_diaeresis; - break; - } - break; - case KT_CUR: - switch (kbe.kb_value) { - case K_DOWN: - *k = XK_Down; - break; - case K_LEFT: - *k = XK_Left; - break; - case K_RIGHT: - *k = XK_Right; - break; - case K_UP: - *k = XK_Up; - break; - } - break; - case KT_SHIFT: - switch (kbe.kb_value) { - case K_ALTGR: - *k = XK_Alt_R; - break; - case K_ALT: - *k = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L); - break; - case K_CTRL: - *k = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L); - break; - case K_CTRLL: - *k = XK_Control_L; - break; - case K_CTRLR: - *k = XK_Control_R; - break; - case K_SHIFT: - *k = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L); - break; - case K_SHIFTL: - *k = XK_Shift_L; - break; - case K_SHIFTR: - *k = XK_Shift_R; - break; - default: - break; - } - break; - case KT_ASCII: - /* KT_ASCII keys accumulate a 3 digit decimal number that - * gets emitted when the shift state changes. We can't - * emulate that. - */ - break; - case KT_LOCK: - if (kbe.kb_value == K_SHIFTLOCK) - *k = XK_Shift_Lock; - break; - default: - break; - } - } - - if (k[-1] == k[-2]) - k[-1] = NoSymbol; - if (k[-2] == k[-3]) - k[-2] = NoSymbol; - if (k[-3] == k[-4]) - k[-3] = NoSymbol; - if (k[-4] == k[-2] && k[-3] == k[-1]) - k[-2] = k[-1] = NoSymbol; - if (k[-1] == k[-4] && k[-2] == k[-3] - && k[-2] == NoSymbol) - k[-1] = NoSymbol; - } -} - -static void -kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) -{ - GETPRIV; - KeySym *k, *mapCopy; - char type; - int i; - -#if 00 /*BP*/ - mapCopy = malloc(sizeof(map)); - memcpy(mapCopy, map, sizeof(map)); -#else - ErrorF("kbdLinuxGetMap() is broken/no-op'd\n"); - return; -#endif - - kbdLinuxReadKernelMapping(priv->fd, pKeySyms); - - /* compute the modifier map */ - for (i = 0; i < MAP_LENGTH; i++) - pModMap[i] = NoSymbol; /* make sure it is restored */ - - for (k = mapCopy, i = MIN_KEYCODE; - i < NUM_KEYCODES + MIN_KEYCODE; i++, k += 4) { - switch (*k) { - case XK_Shift_L: - case XK_Shift_R: - pModMap[i] = ShiftMask; - break; - case XK_Control_L: - case XK_Control_R: - pModMap[i] = ControlMask; - break; - case XK_Caps_Lock: - pModMap[i] = LockMask; - break; - case XK_Alt_L: - case XK_Alt_R: - pModMap[i] = AltMask; - break; - case XK_Num_Lock: - pModMap[i] = NumLockMask; - break; - case XK_Scroll_Lock: - pModMap[i] = ScrollLockMask; - break; - case XK_Kana_Lock: - case XK_Kana_Shift: - pModMap[i] = KanaMask; - break; - case XK_Mode_switch: - pModMap[i] = AltLangMask; - break; - } - } - - priv->kbdType = (ioctl(priv->fd, KDGKBTYPE, &type) < 0) ? KB_101 : type; - - pKeySyms->map = mapCopy; /* Must be XFree'able */ - pKeySyms->mapWidth = GLYPHS_PER_KEY; - pKeySyms->minKeyCode = MIN_KEYCODE; - pKeySyms->maxKeyCode = MAX_KEYCODE; -} - -/** Fill the \a info structure with information needed to initialize \a - * pDev. */ -void -kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) -{ - info->keyboard = 1; - info->keyClass = 1; - kbdLinuxGetMap(pDev, &info->keySyms, info->modMap); - info->focusClass = 1; - info->kbdFeedbackClass = 1; -} diff --git a/xserver/hw/dmx/input/lnx-keyboard.h b/xserver/hw/dmx/input/lnx-keyboard.h deleted file mode 100644 index 857ea11b1..000000000 --- a/xserver/hw/dmx/input/lnx-keyboard.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to Linux keyboard driver. \see lnx-keyboard.c */ - -#ifndef _LNX_KEYBOARD_H_ -#define _LNX_KEYBOARD_H_ - -extern void *kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard); -extern void kbdLinuxDestroyPrivate(void *private); - -extern void kbdLinuxInit(DevicePtr pDev); -extern void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); -extern int kbdLinuxOn(DevicePtr pDev); -extern void kbdLinuxOff(DevicePtr pDev); - -extern void kbdLinuxVTPreSwitch(void *p); -extern void kbdLinuxVTPostSwitch(void *p); -extern int kbdLinuxVTSwitch(void *p, int vt, - dmxVTSwitchReturnProcPtr switch_return, - void *switch_return_data); - -extern void kbdLinuxRead(DevicePtr pDev, - dmxMotionProcPtr motion, - dmxEnqueueProcPtr enqueue, - dmxCheckSpecialProcPtr checkspecial, - DMXBlockType block); - -extern void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl * ctrl); -extern void kbdLinuxBell(DevicePtr pDev, int percent, - int volume, int pitch, int duration); -#endif diff --git a/xserver/hw/dmx/input/lnx-ms.c b/xserver/hw/dmx/input/lnx-ms.c deleted file mode 100644 index 1a5786c7e..000000000 --- a/xserver/hw/dmx/input/lnx-ms.c +++ /dev/null @@ -1,349 +0,0 @@ -/* Portions of this file were derived from the following files: - * - ********************************************************************** - * - * Xserver/hw/kdrive/linux/ms.c - * - * Copyright (c) 2001 by Juliusz Chroboczek - * Copyright (c) 1999 by Keith Packard - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * 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 AUTHORS OR COPYRIGHT HOLDERS - * 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. - * - */ - -/* - * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * This code implements a low-level device driver for a serial MS mouse. - * The code is derived from code by Juliusz Chroboczek and Keith Packard - * (see the source code for complete references). */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "inputstr.h" -#include -#include -#include -#include - -/*****************************************************************************/ -/* Define some macros to make it easier to move this file to another - * part of the Xserver tree. All calls to the dmx* layer are #defined - * here for the .c file. The .h file will also have to be edited. */ -#include "dmxinputinit.h" -#include "lnx-ms.h" - -#define GETPRIV myPrivate *priv \ - = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private - -#define LOG0(f) dmxLog(dmxDebug,f) -#define LOG1(f,a) dmxLog(dmxDebug,f,a) -#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b) -#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c) -#define FATAL0(f) dmxLog(dmxFatal,f) -#define FATAL1(f,a) dmxLog(dmxFatal,f,a) -#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b) -#define MOTIONPROC dmxMotionProcPtr -#define ENQUEUEPROC dmxEnqueueProcPtr -#define CHECKPROC dmxCheckSpecialProcPtr -#define BLOCK DMXBlockType - -/* End of interface definitions. */ -/*****************************************************************************/ - -/* Private area for MS mouse devices. */ -typedef struct _myPrivate { - DeviceIntPtr pMouse; - int fd; - struct termios tty; - enum { - button1 = 0x0001, - button2 = 0x0002, - button3 = 0x0004, - button4 = 0x0008, - button5 = 0x0010 - } buttons; -} myPrivate; - -static int -msLinuxReadBytes(int fd, unsigned char *buf, int len, int min) -{ - int n, tot; - struct pollfd poll_fd; - - tot = 0; - poll_fd.fd = fd; - poll_fd.events = POLLIN; - while (len) { - n = read(fd, buf, len); - if (n > 0) { - tot += n; - buf += n; - len -= n; - } - if (tot % min == 0) - break; - n = xserver_poll(&poll_fd, 1, 100); - if (n <= 0) - break; - } - return tot; -} - -static void -msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block) -{ - GETPRIV; - -#define PRESS(b) \ - do { \ - enqueue(pDev, ButtonPress, 0, 0, NULL, block); \ - } while (0) - -#define RELEASE(b) \ - do { \ - enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \ - } while (0) - - if ((buttons & button1) && !(priv->buttons & button1)) - PRESS(1); - if (!(buttons & button1) && (priv->buttons & button1)) - RELEASE(1); - - if ((buttons & button2) && !(priv->buttons & button2)) - PRESS(2); - if (!(buttons & button2) && (priv->buttons & button2)) - RELEASE(2); - - if ((buttons & button3) && !(priv->buttons & button3)) - PRESS(3); - if (!(buttons & button3) && (priv->buttons & button3)) - RELEASE(3); - - if ((buttons & button4) && !(priv->buttons & button4)) - PRESS(4); - if (!(buttons & button4) && (priv->buttons & button4)) - RELEASE(4); - - if ((buttons & button5) && !(priv->buttons & button5)) - PRESS(5); - if (!(buttons & button5) && (priv->buttons & button5)) - RELEASE(5); - - priv->buttons = buttons; -} - -/** Read an event from the \a pDev device. If the event is a motion - * event, enqueue it with the \a motion function. Otherwise, check for - * special keys with the \a checkspecial function and enqueue the event - * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block the input thread as appropriate to the - * caller of this function. */ -void -msLinuxRead(DevicePtr pDev, - MOTIONPROC motion, - ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) -{ - GETPRIV; - unsigned char buf[3 * 200]; /* RATS: Use ok */ - unsigned char *b; - int n; - int dx, dy, v[2]; - - while ((n = msLinuxReadBytes(priv->fd, buf, sizeof(buf), 3)) > 0) { - b = buf; - while (n >= 3) { - dx = (char) (((b[0] & 0x03) << 6) | (b[1] & 0x3f)); - dy = (char) (((b[0] & 0x0c) << 4) | (b[2] & 0x3f)); - v[0] = -dx; - v[1] = -dy; - - motion(pDev, v, 0, 2, 1, block); - msLinuxButton(pDev, enqueue, (((b[0] & 0x10) ? button3 : 0) - | ((b[0] & 0x20) ? button1 : 0)), - block); - n -= 3; - b += 3; - } - } -} - -/** Initialize \a pDev. */ -void -msLinuxInit(DevicePtr pDev) -{ - GETPRIV; - const char *names[] = { "/dev/serialmouse", "/dev/mouse", NULL }; - int i; - - if (priv->fd >= 0) - return; - - for (i = 0; names[i]; i++) { - if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0) - break; - } - if (priv->fd < 0) - FATAL1("msLinuxInit: Cannot open mouse port (%s)\n", strerror(errno)); - - if (!isatty(priv->fd)) - FATAL1("msLinuxInit: Mouse port %s is not a tty\n", names[i]); - - if (tcgetattr(priv->fd, &priv->tty) < 0) - FATAL1("msLinuxInit: tcgetattr failed (%s)\n", strerror(errno)); - - i = write(priv->fd, "*n", 2); /* 1200 baud */ - (void) i; - usleep(100000); -} - -/** Turn \a pDev on (i.e., take input from \a pDev). */ -int -msLinuxOn(DevicePtr pDev) -{ - GETPRIV; - struct termios nTty; - int i; - - if (priv->fd < 0) - msLinuxInit(pDev); - - nTty = priv->tty; - nTty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR - | IGNCR | ICRNL | IXON | IXOFF); - nTty.c_oflag &= ~OPOST; - nTty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - nTty.c_cflag &= ~(CSIZE | PARENB); - nTty.c_cflag |= CS8 | CLOCAL | CSTOPB; - nTty.c_cc[VTIME] = 0; - nTty.c_cc[VMIN] = 1; - cfsetispeed(&nTty, B1200); - cfsetospeed(&nTty, B1200); - if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0) - FATAL1("msLinuxInit: tcsetattr failed (%s)\n", strerror(errno)); - i = write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */ - (void) i; - return priv->fd; -} - -/** Turn \a pDev off (i.e., stop taking input from \a pDev). */ -void -msLinuxOff(DevicePtr pDev) -{ - GETPRIV; - - tcsetattr(priv->fd, TCSANOW, &priv->tty); - close(priv->fd); - priv->fd = -1; -} - -static void -msLinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons) -{ - int i; - - if (nButtons) - *nButtons = 3; - if (map) - for (i = 0; i <= *nButtons; i++) - map[i] = i; -} - -/** Currently unused hook called prior to an VT switch. */ -void -msLinuxVTPreSwitch(void *p) -{ -} - -/** Currently unused hook called after returning from a VT switch. */ -void -msLinuxVTPostSwitch(void *p) -{ -} - -/** Create a private structure for use within this file. */ -void * -msLinuxCreatePrivate(DeviceIntPtr pMouse) -{ - myPrivate *priv = calloc(1, sizeof(*priv)); - - priv->fd = -1; - priv->pMouse = pMouse; - return priv; -} - -/** Destroy a private structure. */ -void -msLinuxDestroyPrivate(void *priv) -{ - free(priv); -} - -/** Fill the \a info structure with information needed to initialize \a - * pDev. */ -void -msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) -{ - info->buttonClass = 1; - msLinuxGetMap(pDev, info->map, &info->numButtons); - info->valuatorClass = 1; - info->numRelAxes = 2; - info->minval[0] = 0; - info->maxval[0] = 0; - info->res[0] = 1; - info->minres[0] = 0; - info->maxres[0] = 1; - info->ptrFeedbackClass = 1; -} diff --git a/xserver/hw/dmx/input/lnx-ms.h b/xserver/hw/dmx/input/lnx-ms.h deleted file mode 100644 index 7f3ba4ead..000000000 --- a/xserver/hw/dmx/input/lnx-ms.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to Linux MS mouse driver. \see lnx-ms.c */ - -#ifndef _LNX_MS_H_ -#define _LNX_MS_H_ - -extern void *msLinuxCreatePrivate(DeviceIntPtr pMouse); -extern void msLinuxDestroyPrivate(void *priv); -extern void msLinuxRead(DevicePtr pDev, - dmxMotionProcPtr motion, - dmxEnqueueProcPtr enqueue, - dmxCheckSpecialProcPtr checkspecial, - DMXBlockType block); -extern void msLinuxInit(DevicePtr pDev); -extern void msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); -extern int msLinuxOn(DevicePtr pDev); -extern void msLinuxOff(DevicePtr pDev); -extern void msLinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl); -extern void msLinuxVTPreSwitch(void *p); -extern void msLinuxVTPostSwitch(void *p); - -#endif diff --git a/xserver/hw/dmx/input/lnx-ps2.c b/xserver/hw/dmx/input/lnx-ps2.c deleted file mode 100644 index 2b6e8d63b..000000000 --- a/xserver/hw/dmx/input/lnx-ps2.c +++ /dev/null @@ -1,316 +0,0 @@ -/* Portions of this file were derived from the following files: - * - ********************************************************************** - * - * Xserver/hw/kdrive/linux/ps2.c - * - * Copyright (c) 1999 by Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - * - */ - -/* - * Copyright 2001,2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * This code implements a low-level device driver for a serial MS mouse. - * The code is derived from code by Keith Packard (see the source code - * for complete references). */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "inputstr.h" -#include -#include -#include -#include - -/*****************************************************************************/ -/* Define some macros to make it easier to move this file to another - * part of the Xserver tree. All calls to the dmx* layer are #defined - * here for the .c file. The .h file will also have to be edited. */ -#include "dmxinputinit.h" -#include "lnx-ps2.h" - -#define GETPRIV myPrivate *priv \ - = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private - -#define LOG0(f) dmxLog(dmxDebug,f) -#define LOG1(f,a) dmxLog(dmxDebug,f,a) -#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b) -#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c) -#define FATAL0(f) dmxLog(dmxFatal,f) -#define FATAL1(f,a) dmxLog(dmxFatal,f,a) -#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b) -#define MOTIONPROC dmxMotionProcPtr -#define ENQUEUEPROC dmxEnqueueProcPtr -#define CHECKPROC dmxCheckSpecialProcPtr -#define BLOCK DMXBlockType - -/* End of interface definitions. */ -/*****************************************************************************/ - -/* Private area for PS/2 devices. */ -typedef struct _myPrivate { - DeviceIntPtr pMouse; - int fd; - enum { - button1 = 0x0001, - button2 = 0x0002, - button3 = 0x0004, - button4 = 0x0008, - button5 = 0x0010 - } buttons; -} myPrivate; - -static int -ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min) -{ - int n, tot; - struct pollfd poll_fd; - - poll_fd.fd = fd; - poll_fd.events = POLLIN; - tot = 0; - while (len) { - n = read(fd, buf, len); - if (n > 0) { - tot += n; - buf += n; - len -= n; - } - if (tot % min == 0) - break; - n = xserver_poll(&poll_fd, 1, 100); - if (n <= 0) - break; - } - return tot; -} - -static void -ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block) -{ - GETPRIV; - -#define PRESS(b) \ - do { \ - enqueue(pDev, ButtonPress, 0, 0, NULL, block); \ - } while (0) - -#define RELEASE(b) \ - do { \ - enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \ - } while (0) - - if ((buttons & button1) && !(priv->buttons & button1)) - PRESS(1); - if (!(buttons & button1) && (priv->buttons & button1)) - RELEASE(1); - - if ((buttons & button2) && !(priv->buttons & button2)) - PRESS(2); - if (!(buttons & button2) && (priv->buttons & button2)) - RELEASE(2); - - if ((buttons & button3) && !(priv->buttons & button3)) - PRESS(3); - if (!(buttons & button3) && (priv->buttons & button3)) - RELEASE(3); - - if ((buttons & button4) && !(priv->buttons & button4)) - PRESS(4); - if (!(buttons & button4) && (priv->buttons & button4)) - RELEASE(4); - - if ((buttons & button5) && !(priv->buttons & button5)) - PRESS(5); - if (!(buttons & button5) && (priv->buttons & button5)) - RELEASE(5); - - priv->buttons = buttons; -} - -/** Read an event from the \a pDev device. If the event is a motion - * event, enqueue it with the \a motion function. Otherwise, check for - * special keys with the \a checkspecial function and enqueue the event - * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block the input thread as appropriate to the - * caller of this function. */ -void -ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion, - ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) -{ - GETPRIV; - unsigned char buf[3 * 200]; /* RATS: Use ok */ - unsigned char *b; - int n; - int dx, dy, v[2]; - - while ((n = ps2LinuxReadBytes(priv->fd, buf, sizeof(buf), 3)) > 0) { - b = buf; - while (n >= 3) { - dx = b[1] - ((b[0] & 0x10) ? 256 : 0); - dy = -b[2] + ((b[0] & 0x20) ? 256 : 0); - v[0] = -dx; - v[1] = -dy; - - motion(pDev, v, 0, 2, 1, block); - ps2LinuxButton(pDev, enqueue, (((b[0] & 4) ? button2 : 0) - | ((b[0] & 2) ? button3 : 0) - | ((b[0] & 1) ? button1 : 0)), - block); - n -= 3; - b += 3; - } - } -} - -/** Initialize \a pDev. */ -void -ps2LinuxInit(DevicePtr pDev) -{ - GETPRIV; - const char *names[] = { "/dev/mouse", "/dev/psaux", NULL }; - int i; - - if (priv->fd >= 0) - return; - - for (i = 0; names[i]; i++) { - if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0) - break; - } - if (priv->fd < 0) - FATAL1("ps2LinuxInit: Cannot open mouse port (%s)\n", strerror(errno)); -} - -/** Turn \a pDev on (i.e., take input from \a pDev). */ -int -ps2LinuxOn(DevicePtr pDev) -{ - GETPRIV; - - if (priv->fd < 0) - ps2LinuxInit(pDev); - return priv->fd; -} - -/** Turn \a pDev off (i.e., stop taking input from \a pDev). */ -void -ps2LinuxOff(DevicePtr pDev) -{ - GETPRIV; - - close(priv->fd); - priv->fd = -1; -} - -static void -ps2LinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons) -{ - int i; - - if (nButtons) - *nButtons = 3; - if (map) - for (i = 0; i <= *nButtons; i++) - map[i] = i; -} - -/** Currently unused hook called prior to an VT switch. */ -void -ps2LinuxVTPreSwitch(void *p) -{ -} - -/** Currently unused hook called after returning from a VT switch. */ -void -ps2LinuxVTPostSwitch(void *p) -{ -} - -/** Create a private structure for use within this file. */ -void * -ps2LinuxCreatePrivate(DeviceIntPtr pMouse) -{ - myPrivate *priv = calloc(1, sizeof(*priv)); - - priv->fd = -1; - priv->pMouse = pMouse; - return priv; -} - -/** Destroy a private structure. */ -void -ps2LinuxDestroyPrivate(void *priv) -{ - free(priv); -} - -/** Fill the \a info structure with information needed to initialize \a - * pDev. */ -void -ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) -{ - info->buttonClass = 1; - ps2LinuxGetMap(pDev, info->map, &info->numButtons); - info->valuatorClass = 1; - info->numRelAxes = 2; - info->minval[0] = 0; - info->maxval[0] = 0; - info->res[0] = 1; - info->minres[0] = 0; - info->maxres[0] = 1; - info->ptrFeedbackClass = 1; -} diff --git a/xserver/hw/dmx/input/lnx-ps2.h b/xserver/hw/dmx/input/lnx-ps2.h deleted file mode 100644 index 339f3538c..000000000 --- a/xserver/hw/dmx/input/lnx-ps2.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to Linux PS/2 mouse driver. \see lnx-ps2.c */ - -#ifndef _LNX_PS2_H_ -#define _LNX_PS2_H_ - -extern void *ps2LinuxCreatePrivate(DeviceIntPtr pMouse); -extern void ps2LinuxDestroyPrivate(void *priv); -extern void ps2LinuxRead(DevicePtr pDev, - dmxMotionProcPtr motion, - dmxEnqueueProcPtr enqueue, - dmxCheckSpecialProcPtr checkspecial, - DMXBlockType block); -extern void ps2LinuxInit(DevicePtr pDev); -extern void ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); -extern int ps2LinuxOn(DevicePtr pDev); -extern void ps2LinuxOff(DevicePtr pDev); -extern void ps2LinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl); -extern void ps2LinuxVTPreSwitch(void *p); -extern void ps2LinuxVTPostSwitch(void *p); - -#endif diff --git a/xserver/hw/dmx/man/Makefile.in b/xserver/hw/dmx/man/Makefile.in index 8146dbb80..05ea05f19 100644 --- a/xserver/hw/dmx/man/Makefile.in +++ b/xserver/hw/dmx/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/dmx/man/Xdmx.man b/xserver/hw/dmx/man/Xdmx.man index 6b3feb13b..ef62a02f5 100644 --- a/xserver/hw/dmx/man/Xdmx.man +++ b/xserver/hw/dmx/man/Xdmx.man @@ -22,7 +22,7 @@ .\" 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. -.TH Xdmx 1 __vendorversion__ +.TH Xdmx 1 @vendorversion@ .SH NAME Xdmx - Distributed Multi-head X server .SH SYNOPSIS @@ -48,7 +48,7 @@ communicates to the back-end X servers using the standard X11 protocol, and standard and/or commonly available X server extensions. .SH OPTIONS In addition to the normal X server options described in the -.I Xserver(__appmansuffix__) +.I Xserver(@appmansuffix@) manual page, .I Xdmx accepts the following command line switches: @@ -83,11 +83,8 @@ input events. .TP 4 .B local The raw keyboard and pointer from the local computer are used. A -comma-separated list of driver names can be appended. For example, to -select the example Linux keyboard and PS/2 mouse driver use: -.BR "-input local,kbd,ps2" . -The following drivers have been implemented for Linux: kbd, ms (a -two-button Microsoft mouse driver), ps2 (a PS/2 mouse driver), usb-mou +comma-separated list of driver names can be appended. +The following drivers have been implemented for Linux: usb-mou (a USB mouse driver), usb-kbd (a USB keyboard driver), and usb-oth (a USB non-keyboard, non-mouse driver). Additional drivers may be implemented in the future. Appropriate defaults will be used if no @@ -139,7 +136,7 @@ the "xfree86" keycodes and the "pc104" symbols should be used to initialize the keyboard. For an SGI keyboard, ",xkb,sgi/indy(pc102)" might be useful. A list of keycodes, symbols, and geometries can be found in -.IR __xkbdir__ . +.IR @xkbdir@ . Use of keycodes, symbols and geometries for XKB configuration is deprecated in favor of the rules, layout, model, variant and options settings available via the -param command line switch. @@ -344,31 +341,31 @@ This option specifies parameters on the command line. Currently, only parameters dealing with XKEYBOARD configuration are supported. These parameters apply only to the core keyboard. Parameter values are installation-dependent. Please see -.I __xkbdir__ +.I @xkbdir@ or a similar directory for complete information. .RS .TP 8 .B XkbRules -Defaults to "__XKB_DFLT_RULES__". Other values may include "sgi" and "sun". +Defaults to "@XKB_DFLT_RULES@". Other values may include "sgi" and "sun". .sp .TP 8 .B XkbModel -Defaults to "__XKB_DFLT_MODEL__". When used with "base" rules, other values +Defaults to "@XKB_DFLT_MODEL@". When used with "base" rules, other values may include "pc102", "pc104", "microsoft", and many others. When used with "sun" rules, other values may include "type4" and "type5". .sp .TP 8 .B XkbLayout -Defaults to "__XKB_DFLT_LAYOUT__". Other country codes and "dvorak" are usually +Defaults to "@XKB_DFLT_LAYOUT@". Other country codes and "dvorak" are usually available. .sp .TP 8 .B XkbVariant -Defaults to "__XKB_DFLT_VARIANT__". +Defaults to "@XKB_DFLT_VARIANT@". .sp .TP 8 .B XkbOptions -Defaults to "__XKB_DFLT_OPTIONS__". +Defaults to "@XKB_DFLT_OPTIONS@". .RE .SH "CONFIGURATION FILE GRAMMAR" The following words and tokens are reserved: @@ -603,7 +600,7 @@ Xdmx :1 -display d0:0 -display d1:0 -input :0 +xinerama .PP As above, except with core input from the local keyboard and mouse: .RS -Xdmx :1 -display d0:0 -display d1:0 -input local,kbd,ps2 +xinerama +Xdmx :1 -display d0:0 -display d1:0 -input local,usb-kbd,usb-mou +xinerama .RE Note that local input can be used under Linux while another X session is running on :0 (assuming the user can access the Linux console tty and @@ -714,10 +711,10 @@ translated if it was the first core keyboard. .SH FILES .. .SH "SEE ALSO" -.BR DMX "(__libmansuffix__), " X "(__miscmansuffix__), " -.BR Xserver "(__appmansuffix__), " xdmxconfig "(__appmansuffix__), " -.BR vdltodmx "(__appmansuffix__), " xfs "(__appmansuffix__), " -.BR xkbcomp "(__appmansuffix__), " xkeyboard-config "(__miscmansuffix__)" +.BR DMX "(@libmansuffix@), " X "(@miscmansuffix@), " +.BR Xserver "(@appmansuffix@), " xdmxconfig "(@appmansuffix@), " +.BR vdltodmx "(@appmansuffix@), " xfs "(@appmansuffix@), " +.BR xkbcomp "(@appmansuffix@), " xkeyboard-config "(@miscmansuffix@)" .SH AUTHORS Kevin E. Martin .I , diff --git a/xserver/hw/kdrive/Makefile.am b/xserver/hw/kdrive/Makefile.am index 471ca89dd..dc71dbd81 100644 --- a/xserver/hw/kdrive/Makefile.am +++ b/xserver/hw/kdrive/Makefile.am @@ -1,30 +1,15 @@ -if BUILD_KDRIVEFBDEVLIB -FBDEV_SUBDIRS = fbdev -endif - -if XFAKESERVER -XFAKE_SUBDIRS = fake -endif - if XEPHYR XEPHYR_SUBDIRS = ephyr endif -if KDRIVELINUX -LINUX_SUBDIRS = linux -endif - SERVER_SUBDIRS = \ - $(FBDEV_SUBDIRS) \ - $(XEPHYR_SUBDIRS) \ - $(XFAKE_SUBDIRS) + $(XEPHYR_SUBDIRS) SUBDIRS = \ src \ - $(LINUX_SUBDIRS) \ $(SERVER_SUBDIRS) -DIST_SUBDIRS = fbdev ephyr src linux fake +DIST_SUBDIRS = ephyr src relink: $(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done diff --git a/xserver/hw/kdrive/Makefile.in b/xserver/hw/kdrive/Makefile.in index f7d479d09..215a61770 100644 --- a/xserver/hw/kdrive/Makefile.in +++ b/xserver/hw/kdrive/Makefile.in @@ -66,7 +66,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -312,6 +312,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -330,15 +331,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -346,6 +350,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -417,8 +423,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -483,21 +487,15 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@BUILD_KDRIVEFBDEVLIB_TRUE@FBDEV_SUBDIRS = fbdev -@XFAKESERVER_TRUE@XFAKE_SUBDIRS = fake @XEPHYR_TRUE@XEPHYR_SUBDIRS = ephyr -@KDRIVELINUX_TRUE@LINUX_SUBDIRS = linux SERVER_SUBDIRS = \ - $(FBDEV_SUBDIRS) \ - $(XEPHYR_SUBDIRS) \ - $(XFAKE_SUBDIRS) + $(XEPHYR_SUBDIRS) SUBDIRS = \ src \ - $(LINUX_SUBDIRS) \ $(SERVER_SUBDIRS) -DIST_SUBDIRS = fbdev ephyr src linux fake +DIST_SUBDIRS = ephyr src all: all-recursive .SUFFIXES: diff --git a/xserver/hw/kdrive/ephyr/Makefile.am b/xserver/hw/kdrive/ephyr/Makefile.am index 6ce0d6fa0..d12559b39 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.am +++ b/xserver/hw/kdrive/ephyr/Makefile.am @@ -26,6 +26,7 @@ AM_CPPFLAGS = \ @KDRIVE_CFLAGS@ \ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ \ + -DHAVE_DIX_CONFIG_H \ -I$(top_srcdir) \ -I$(top_srcdir)/glamor \ -I$(top_srcdir)/exa @@ -53,7 +54,6 @@ Xephyr_SOURCES = \ ephyr.h \ ephyrlog.h \ ephyr_draw.c \ - os.c \ ephyrinit.c \ ephyrcursor.c \ hostx.c \ diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in index 1049504c8..212b68d3b 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.in +++ b/xserver/hw/kdrive/ephyr/Makefile.in @@ -91,20 +91,20 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c os.c \ +am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c \ ephyrinit.c ephyrcursor.c hostx.c hostx.h ephyrvideo.c \ ephyr_glamor_glx.c ephyr_glamor_glx.h ephyr_glamor_xv.c @XV_TRUE@am__objects_1 = ephyrvideo.$(OBJEXT) @GLAMOR_TRUE@@XV_TRUE@am__objects_2 = ephyr_glamor_xv.$(OBJEXT) @GLAMOR_TRUE@am__objects_3 = ephyr_glamor_glx.$(OBJEXT) \ @GLAMOR_TRUE@ $(am__objects_2) -am_Xephyr_OBJECTS = ephyr.$(OBJEXT) ephyr_draw.$(OBJEXT) os.$(OBJEXT) \ +am_Xephyr_OBJECTS = ephyr.$(OBJEXT) ephyr_draw.$(OBJEXT) \ ephyrinit.$(OBJEXT) ephyrcursor.$(OBJEXT) hostx.$(OBJEXT) \ $(am__objects_1) $(am__objects_3) Xephyr_OBJECTS = $(am_Xephyr_OBJECTS) @@ -382,6 +382,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -400,15 +401,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -416,6 +420,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -487,8 +493,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -555,8 +559,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man AM_CPPFLAGS = @KDRIVE_INCS@ @KDRIVE_CFLAGS@ @XEPHYR_INCS@ \ - @XEPHYR_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/glamor \ - -I$(top_srcdir)/exa $(am__append_1) + @XEPHYR_CFLAGS@ -DHAVE_DIX_CONFIG_H -I$(top_srcdir) \ + -I$(top_srcdir)/glamor -I$(top_srcdir)/exa $(am__append_1) @XV_TRUE@XV_SRCS = ephyrvideo.c @GLAMOR_TRUE@@XV_TRUE@GLAMOR_XV_SRCS = ephyr_glamor_xv.c @GLAMOR_TRUE@GLAMOR_SRCS = \ @@ -570,7 +574,6 @@ Xephyr_SOURCES = \ ephyr.h \ ephyrlog.h \ ephyr_draw.c \ - os.c \ ephyrinit.c \ ephyrcursor.c \ hostx.c \ @@ -690,7 +693,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrvideo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c index ef5350e18..4f1f19860 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.c +++ b/xserver/hw/kdrive/ephyr/ephyr.c @@ -23,8 +23,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include @@ -40,7 +40,7 @@ #include "glamor.h" #endif #include "ephyr_glamor_glx.h" - +#include "glx_extinit.h" #include "xkbsrv.h" extern Bool ephyr_glamor; @@ -734,33 +734,6 @@ ephyrCreateResources(ScreenPtr pScreen) } } -void -ephyrPreserve(KdCardInfo * card) -{ -} - -Bool -ephyrEnable(ScreenPtr pScreen) -{ - return TRUE; -} - -Bool -ephyrDPMS(ScreenPtr pScreen, int mode) -{ - return TRUE; -} - -void -ephyrDisable(ScreenPtr pScreen) -{ -} - -void -ephyrRestore(KdCardInfo * card) -{ -} - void ephyrScreenFini(KdScreenInfo * screen) { @@ -1330,6 +1303,7 @@ MouseDisable(KdPointerInfo * pi) static void MouseFini(KdPointerInfo * pi) { + free(pi->driverPrivate); ephyrMouse = NULL; return; } @@ -1393,6 +1367,7 @@ EphyrKeyboardDisable(KdKeyboardInfo * ki) static void EphyrKeyboardFini(KdKeyboardInfo * ki) { + free(ki->driverPrivate); ephyrKbd = NULL; return; } diff --git a/xserver/hw/kdrive/ephyr/ephyr.h b/xserver/hw/kdrive/ephyr/ephyr.h index b48a21ce2..fe01661dc 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.h +++ b/xserver/hw/kdrive/ephyr/ephyr.h @@ -79,6 +79,7 @@ typedef struct _ephyrScrPriv { const char *output; /* Set via -output option */ unsigned char *fb_data; /* only used when host bpp != server bpp */ xcb_shm_segment_info_t shminfo; + size_t shmsize; KdScreenInfo *screen; int mynum; /* Screen number */ @@ -192,8 +193,6 @@ extern KdPointerDriver EphyrMouseDriver; extern KdKeyboardDriver EphyrKeyboardDriver; -extern KdOsFuncs EphyrOsFuncs; - extern Bool ephyrCursorInit(ScreenPtr pScreen); extern int ephyrBufferHeight(KdScreenInfo * screen); diff --git a/xserver/hw/kdrive/ephyr/ephyr_draw.c b/xserver/hw/kdrive/ephyr/ephyr_draw.c index 5b8a1d504..64e07a7d1 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_draw.c +++ b/xserver/hw/kdrive/ephyr/ephyr_draw.c @@ -25,8 +25,8 @@ * */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "ephyr.h" @@ -254,7 +254,8 @@ ephyrPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, EphyrFakexaPriv *fakexa = scrpriv->fakexa; ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); - ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); + if (pSrc != NULL) + ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); if (pMask != NULL) ephyrPreparePipelinedAccess(pMask, EXA_PREPARE_MASK); @@ -298,7 +299,8 @@ ephyrDoneComposite(PixmapPtr pDst) if (fakexa->pMask != NULL) ephyrFinishPipelinedAccess(fakexa->pMask, EXA_PREPARE_MASK); - ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC); + if (fakexa->pSrc != NULL) + ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC); ephyrFinishPipelinedAccess(fakexa->pDst, EXA_PREPARE_DEST); } diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c index 007123c31..3fdc6663c 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c +++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c @@ -208,13 +208,6 @@ ephyr_glamor_set_vertices(struct ephyr_glamor *glamor) glEnableVertexAttribArray(glamor->texture_shader_texcoord_loc); } -static void -ephyr_glamor_clear_vertices(struct ephyr_glamor *glamor) -{ - glDisableVertexAttribArray(glamor->texture_shader_position_loc); - glDisableVertexAttribArray(glamor->texture_shader_texcoord_loc); -} - void ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, struct pixman_region16 *damage) @@ -230,13 +223,8 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx); - if (glamor->vao) { - glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao); - glBindVertexArray(glamor->vao); - } else { - glBindBuffer(GL_ARRAY_BUFFER, glamor->vbo); - ephyr_glamor_set_vertices(glamor); - } + glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao); + glBindVertexArray(glamor->vao); glBindFramebuffer(GL_FRAMEBUFFER, 0); glUseProgram(glamor->texture_shader); @@ -248,10 +236,7 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, glBindTexture(GL_TEXTURE_2D, glamor->tex); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - if (glamor->vao) - glBindVertexArray(old_vao); - else - ephyr_glamor_clear_vertices(glamor); + glBindVertexArray(old_vao); glXSwapBuffers(dpy, glamor->glx_win); } @@ -374,23 +359,17 @@ ephyr_glamor_glx_screen_init(xcb_window_t win) glamor->glx_win = glx_win; ephyr_glamor_setup_texturing_shader(glamor); - if (epoxy_has_gl_extension("GL_ARB_vertex_array_object")) { - glGenVertexArrays(1, &glamor->vao); - glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao); - glBindVertexArray(glamor->vao); - } else - glamor->vao = 0; + glGenVertexArrays(1, &glamor->vao); + glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao); + glBindVertexArray(glamor->vao); glGenBuffers(1, &glamor->vbo); glBindBuffer(GL_ARRAY_BUFFER, glamor->vbo); glBufferData(GL_ARRAY_BUFFER, sizeof (position), position, GL_STATIC_DRAW); - if (glamor->vao) { - ephyr_glamor_set_vertices(glamor); - glBindVertexArray(old_vao); - } else - glBindBuffer(GL_ARRAY_BUFFER, 0); + ephyr_glamor_set_vertices(glamor); + glBindVertexArray(old_vao); return glamor; } diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c index b9c3464d8..4dd15cf41 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c +++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c @@ -21,8 +21,8 @@ * IN THE SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" diff --git a/xserver/hw/kdrive/ephyr/ephyrcursor.c b/xserver/hw/kdrive/ephyr/ephyrcursor.c index 808b3c72c..f991899c5 100644 --- a/xserver/hw/kdrive/ephyr/ephyrcursor.c +++ b/xserver/hw/kdrive/ephyr/ephyrcursor.c @@ -24,8 +24,8 @@ * Adam Jackson */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "ephyr.h" #include "ephyrlog.h" diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c index 7632c2643..abc35dfca 100644 --- a/xserver/hw/kdrive/ephyr/ephyrinit.c +++ b/xserver/hw/kdrive/ephyr/ephyrinit.c @@ -23,8 +23,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "ephyr.h" #include "ephyrlog.h" @@ -40,11 +40,6 @@ extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present; extern Bool ephyrNoXV; -#ifdef KDRIVE_EVDEV -extern KdPointerDriver LinuxEvdevMouseDriver; -extern KdKeyboardDriver LinuxEvdevKeyboardDriver; -#endif - void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id); void processOutputArg(const char *output, char *parent_id); void processScreenArg(const char *screen_size, char *parent_id); @@ -63,25 +58,9 @@ InitCard(char *name) KdCardInfoAdd(&ephyrFuncs, 0); } -static const ExtensionModule ephyrExtensions[] = { -#ifdef GLXEXT - { GlxExtensionInit, "GLX", &noGlxExtension }, -#endif -}; - -static -void ephyrExtensionInit(void) -{ - LoadExtensionList(ephyrExtensions, ARRAY_SIZE(ephyrExtensions), TRUE); -} - - void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { - if (serverGeneration == 1) - ephyrExtensionInit(); - KdInitOutput(pScreenInfo, argc, argv); } @@ -91,11 +70,6 @@ InitInput(int argc, char **argv) KdKeyboardInfo *ki; KdPointerInfo *pi; -#ifdef KDRIVE_EVDEV - KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); - KdAddPointerDriver(&LinuxEvdevMouseDriver); -#endif - if (!SeatId) { KdAddKeyboardDriver(&EphyrKeyboardDriver); KdAddPointerDriver(&EphyrMouseDriver); @@ -384,7 +358,12 @@ OsVendorInit(void) if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; - KdOsInit(&EphyrOsFuncs); + if (serverGeneration == 1) { + if (!KdCardInfoLast()) { + processScreenArg("640x480", NULL); + } + hostx_init(); + } } KdCardFuncs ephyrFuncs = { @@ -393,19 +372,10 @@ KdCardFuncs ephyrFuncs = { ephyrInitScreen, /* initScreen */ ephyrFinishInitScreen, /* finishInitScreen */ ephyrCreateResources, /* createRes */ - ephyrPreserve, /* preserve */ - ephyrEnable, /* enable */ - ephyrDPMS, /* dpms */ - ephyrDisable, /* disable */ - ephyrRestore, /* restore */ ephyrScreenFini, /* scrfini */ ephyrCardFini, /* cardfini */ 0, /* initCursor */ - 0, /* enableCursor */ - 0, /* disableCursor */ - 0, /* finiCursor */ - 0, /* recolorCursor */ 0, /* initAccel */ 0, /* enableAccel */ diff --git a/xserver/hw/kdrive/ephyr/ephyrvideo.c b/xserver/hw/kdrive/ephyr/ephyrvideo.c index 17336ab2b..671a0ddce 100644 --- a/xserver/hw/kdrive/ephyr/ephyrvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrvideo.c @@ -26,8 +26,8 @@ * Dodji Seketeli */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include #include diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c index d5578deaa..c2f94ed04 100644 --- a/xserver/hw/kdrive/ephyr/hostx.c +++ b/xserver/hw/kdrive/ephyr/hostx.c @@ -23,8 +23,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "hostx.h" @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,7 @@ struct EphyrHostXVars { Bool use_sw_cursor; Bool use_fullscreen; Bool have_shm; + Bool have_shm_fd_passing; int n_screens; KdScreenInfo **screens; @@ -417,6 +419,101 @@ hostx_set_title(char *title) #pragma does_not_return(exit) #endif +static void +hostx_init_shm(void) +{ + /* Try to get share memory ximages for a little bit more speed */ + if (!hostx_has_extension(&xcb_shm_id) || getenv("XEPHYR_NO_SHM")) { + HostX.have_shm = FALSE; + } else { + xcb_generic_error_t *error = NULL; + xcb_shm_query_version_cookie_t cookie; + xcb_shm_query_version_reply_t *reply; + + HostX.have_shm = TRUE; + HostX.have_shm_fd_passing = FALSE; + cookie = xcb_shm_query_version(HostX.conn); + reply = xcb_shm_query_version_reply(HostX.conn, cookie, &error); + if (reply) { + HostX.have_shm_fd_passing = + (reply->major_version == 1 && reply->minor_version >= 2) || + reply->major_version > 1; + free(reply); + } + free(error); + } +} + +static Bool +hostx_create_shm_segment(xcb_shm_segment_info_t *shminfo, size_t size) +{ + shminfo->shmaddr = NULL; + + if (HostX.have_shm_fd_passing) { + xcb_generic_error_t *error = NULL; + xcb_shm_create_segment_cookie_t cookie; + xcb_shm_create_segment_reply_t *reply; + + shminfo->shmseg = xcb_generate_id(HostX.conn); + cookie = xcb_shm_create_segment(HostX.conn, shminfo->shmseg, size, TRUE); + reply = xcb_shm_create_segment_reply(HostX.conn, cookie, &error); + if (reply) { + int *fds = reply->nfd == 1 ? + xcb_shm_create_segment_reply_fds(HostX.conn, reply) : NULL; + if (fds) { + shminfo->shmaddr = + (uint8_t *)mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fds[0], 0); + close(fds[0]); + if (shminfo->shmaddr == MAP_FAILED) + shminfo->shmaddr = NULL; + } + if (!shminfo->shmaddr) + xcb_shm_detach(HostX.conn, shminfo->shmseg); + + free(reply); + } + free(error); + } else { + shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0666); + if (shminfo->shmid != -1) { + shminfo->shmaddr = shmat(shminfo->shmid, 0, 0); + if (shminfo->shmaddr == (void *)-1) { + shminfo->shmaddr = NULL; + } else { + xcb_generic_error_t *error = NULL; + xcb_void_cookie_t cookie; + + shmctl(shminfo->shmid, IPC_RMID, 0); + + shminfo->shmseg = xcb_generate_id(HostX.conn); + cookie = xcb_shm_attach_checked(HostX.conn, shminfo->shmseg, shminfo->shmid, TRUE); + error = xcb_request_check(HostX.conn, cookie); + + if (error) { + free(error); + shmdt(shminfo->shmaddr); + shminfo->shmaddr = NULL; + } + } + } + } + + return shminfo->shmaddr != NULL; +} + +static void +hostx_destroy_shm_segment(xcb_shm_segment_info_t *shminfo, size_t size) +{ + xcb_shm_detach(HostX.conn, shminfo->shmseg); + + if (HostX.have_shm_fd_passing) + munmap(shminfo->shmaddr, size); + else + shmdt(shminfo->shmaddr); + + shminfo->shmaddr = NULL; +} + int hostx_init(void) { @@ -638,36 +735,18 @@ hostx_init(void) } } - /* Try to get share memory ximages for a little bit more speed */ - if (!hostx_has_extension(&xcb_shm_id) || getenv("XEPHYR_NO_SHM")) { - fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); - HostX.have_shm = FALSE; - } - else { + hostx_init_shm(); + if (HostX.have_shm) { /* Really really check we have shm - better way ?*/ xcb_shm_segment_info_t shminfo; - xcb_generic_error_t *e; - xcb_void_cookie_t cookie; - xcb_shm_seg_t shmseg; - - HostX.have_shm = TRUE; - - shminfo.shmid = shmget(IPC_PRIVATE, 1, IPC_CREAT|0777); - shminfo.shmaddr = shmat(shminfo.shmid,0,0); - - shmseg = xcb_generate_id(HostX.conn); - cookie = xcb_shm_attach_checked(HostX.conn, shmseg, shminfo.shmid, - TRUE); - e = xcb_request_check(HostX.conn, cookie); - - if (e) { + if (!hostx_create_shm_segment(&shminfo, 1)) { fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); HostX.have_shm = FALSE; - free(e); + } else { + hostx_destroy_shm_segment(&shminfo, 1); } - - shmdt(shminfo.shmaddr); - shmctl(shminfo.shmid, IPC_RMID, 0); + } else { + fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); } xcb_flush(HostX.conn); @@ -812,10 +891,8 @@ hostx_screen_init(KdScreenInfo *screen, */ if (HostX.have_shm) { - xcb_shm_detach(HostX.conn, scrpriv->shminfo.shmseg); xcb_image_destroy(scrpriv->ximg); - shmdt(scrpriv->shminfo.shmaddr); - shmctl(scrpriv->shminfo.shmid, IPC_RMID, 0); + hostx_destroy_shm_segment(&scrpriv->shminfo, scrpriv->shmsize); } else { free(scrpriv->ximg->data); @@ -835,27 +912,17 @@ hostx_screen_init(KdScreenInfo *screen, ~0, NULL); - scrpriv->shminfo.shmid = - shmget(IPC_PRIVATE, - scrpriv->ximg->stride * buffer_height, - IPC_CREAT | 0777); - scrpriv->ximg->data = shmat(scrpriv->shminfo.shmid, 0, 0); - scrpriv->shminfo.shmaddr = scrpriv->ximg->data; - - if (scrpriv->ximg->data == (uint8_t *) -1) { + scrpriv->shmsize = scrpriv->ximg->stride * buffer_height; + if (!hostx_create_shm_segment(&scrpriv->shminfo, + scrpriv->shmsize)) { EPHYR_DBG - ("Can't attach SHM Segment, falling back to plain XImages"); + ("Can't create SHM Segment, falling back to plain XImages"); HostX.have_shm = FALSE; - xcb_image_destroy (scrpriv->ximg); - shmctl(scrpriv->shminfo.shmid, IPC_RMID, 0); + xcb_image_destroy(scrpriv->ximg); } else { - EPHYR_DBG("SHM segment attached %p", scrpriv->shminfo.shmaddr); - scrpriv->shminfo.shmseg = xcb_generate_id(HostX.conn); - xcb_shm_attach(HostX.conn, - scrpriv->shminfo.shmseg, - scrpriv->shminfo.shmid, - FALSE); + EPHYR_DBG("SHM segment created %p", scrpriv->shminfo.shmaddr); + scrpriv->ximg->data = scrpriv->shminfo.shmaddr; shm_success = TRUE; } } diff --git a/xserver/hw/kdrive/ephyr/man/Makefile.in b/xserver/hw/kdrive/ephyr/man/Makefile.in index 67cd15e2a..783ae4dd5 100644 --- a/xserver/hw/kdrive/ephyr/man/Makefile.in +++ b/xserver/hw/kdrive/ephyr/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/kdrive/ephyr/man/Xephyr.man b/xserver/hw/kdrive/ephyr/man/Xephyr.man index c04379035..cc8a80f21 100644 --- a/xserver/hw/kdrive/ephyr/man/Xephyr.man +++ b/xserver/hw/kdrive/ephyr/man/Xephyr.man @@ -13,7 +13,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.TH Xephyr __appmansuffix__ __vendorversion__ +.TH Xephyr @appmansuffix@ @vendorversion@ .SH NAME Xephyr - X server outputting to a window on a pre-existing X display .SH SYNOPSIS @@ -39,7 +39,7 @@ uses the host X server window as "framebuffer" via fast SHM XImages. It also has support for "visually" debugging what the server is painting. .SH OPTIONS -The server accepts all the standard options of Xserver(__appmansuffix__) +The server accepts all the standard options of Xserver(@appmansuffix@) and the following additional options: .TP 8 .BI -screen " width" x height @@ -91,6 +91,6 @@ Keyboard handling is basic but works. .IP \(bu 2 Mouse button 5 probably won't work. .SH "SEE ALSO" -X(__miscmansuffix__), Xserver(__appmansuffix__) +X(@miscmansuffix@), Xserver(@appmansuffix@) .SH AUTHOR Matthew Allum 2004 diff --git a/xserver/hw/kdrive/ephyr/os.c b/xserver/hw/kdrive/ephyr/os.c deleted file mode 100644 index b481d0a11..000000000 --- a/xserver/hw/kdrive/ephyr/os.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2004 Nokia - * - * 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, and that the name of Nokia not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Nokia makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL NOKIA 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "ephyr.h" - -extern void processScreenArg(const char *screen_size, char *parent_id); - -static int -EphyrInit(void) -{ - /* - * make sure at least one screen - * has been added to the system. - */ - if (!KdCardInfoLast()) { - processScreenArg("640x480", NULL); - } - return hostx_init(); -} - -KdOsFuncs EphyrOsFuncs = { - .Init = EphyrInit, -}; diff --git a/xserver/hw/kdrive/fake/Makefile.am b/xserver/hw/kdrive/fake/Makefile.am deleted file mode 100644 index d28bd2752..000000000 --- a/xserver/hw/kdrive/fake/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -AM_CPPFLAGS = \ - @KDRIVE_INCS@ \ - @KDRIVE_CFLAGS@ - -noinst_LTLIBRARIES = libfake.la - -bin_PROGRAMS = Xfake - -libfake_la_SOURCES = \ - fake.c \ - kbd.c \ - os.c \ - mouse.c \ - fake.h - -Xfake_SOURCES = \ - fakeinit.c - -Xfake_LDADD = \ - libfake.la \ - @KDRIVE_MAIN_LIB@ \ - @KDRIVE_LIBS@ - -Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) - -Xfake_DEPENDENCIES = \ - libfake.la \ - @KDRIVE_LOCAL_LIBS@ - -relink: - $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) diff --git a/xserver/hw/kdrive/fake/fake.c b/xserver/hw/kdrive/fake/fake.c deleted file mode 100644 index 7205df401..000000000 --- a/xserver/hw/kdrive/fake/fake.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fake.h" - -Bool -fakeInitialize(KdCardInfo * card, FakePriv * priv) -{ - priv->base = 0; - priv->bytes_per_line = 0; - return TRUE; -} - -Bool -fakeCardInit(KdCardInfo * card) -{ - FakePriv *priv; - - priv = (FakePriv *) malloc(sizeof(FakePriv)); - if (!priv) - return FALSE; - - if (!fakeInitialize(card, priv)) { - free(priv); - return FALSE; - } - card->driver = priv; - - return TRUE; -} - -Bool -fakeScreenInitialize(KdScreenInfo * screen, FakeScrPriv * scrpriv) -{ - if (!screen->width || !screen->height) { - screen->width = 1024; - screen->height = 768; - screen->rate = 72; - } - - if (screen->width <= 0) - screen->width = 1; - if (screen->height <= 0) - screen->height = 1; - - if (!screen->fb.depth) - screen->fb.depth = 16; - - if (screen->fb.depth <= 8) { - screen->fb.visuals = ((1 << StaticGray) | - (1 << GrayScale) | - (1 << StaticColor) | - (1 << PseudoColor) | - (1 << TrueColor) | (1 << DirectColor)); - } - else { - screen->fb.visuals = (1 << TrueColor); -#define Mask(o,l) (((1 << l) - 1) << o) - if (screen->fb.depth <= 15) { - screen->fb.depth = 15; - screen->fb.bitsPerPixel = 16; - screen->fb.redMask = Mask (10, 5); - screen->fb.greenMask = Mask (5, 5); - screen->fb.blueMask = Mask (0, 5); - } - else if (screen->fb.depth <= 16) { - screen->fb.depth = 16; - screen->fb.bitsPerPixel = 16; - screen->fb.redMask = Mask (11, 5); - screen->fb.greenMask = Mask (5, 6); - screen->fb.blueMask = Mask (0, 5); - } - else { - screen->fb.depth = 24; - screen->fb.bitsPerPixel = 32; - screen->fb.redMask = Mask (16, 8); - screen->fb.greenMask = Mask (8, 8); - screen->fb.blueMask = Mask (0, 8); - } - } - - scrpriv->randr = screen->randr; - - return fakeMapFramebuffer(screen); -} - -Bool -fakeScreenInit(KdScreenInfo * screen) -{ - FakeScrPriv *scrpriv; - - scrpriv = calloc(1, sizeof(FakeScrPriv)); - if (!scrpriv) - return FALSE; - screen->driver = scrpriv; - if (!fakeScreenInitialize(screen, scrpriv)) { - screen->driver = 0; - free(scrpriv); - return FALSE; - } - return TRUE; -} - -void * -fakeWindowLinear(ScreenPtr pScreen, - CARD32 row, - CARD32 offset, int mode, CARD32 *size, void *closure) -{ - KdScreenPriv(pScreen); - FakePriv *priv = pScreenPriv->card->driver; - - if (!pScreenPriv->enabled) - return 0; - *size = priv->bytes_per_line; - return priv->base + row * priv->bytes_per_line; -} - -Bool -fakeMapFramebuffer(KdScreenInfo * screen) -{ - FakeScrPriv *scrpriv = screen->driver; - KdPointerMatrix m; - FakePriv *priv = screen->card->driver; - - if (scrpriv->randr != RR_Rotate_0) - scrpriv->shadow = TRUE; - else - scrpriv->shadow = FALSE; - - KdComputePointerMatrix(&m, scrpriv->randr, screen->width, screen->height); - - KdSetPointerMatrix(&m); - - priv->bytes_per_line = - ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2; - free(priv->base); - priv->base = xallocarray(priv->bytes_per_line, screen->height); - - if (scrpriv->shadow) { - if (!KdShadowFbAlloc - (screen, scrpriv->randr & (RR_Rotate_90 | RR_Rotate_270))) - return FALSE; - } - else { - screen->fb.byteStride = priv->bytes_per_line; - screen->fb.pixelStride = (priv->bytes_per_line * 8 / - screen->fb.bitsPerPixel); - screen->fb.frameBuffer = (CARD8 *) (priv->base); - } - - return TRUE; -} - -void -fakeSetScreenSizes(ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - - if (scrpriv->randr & (RR_Rotate_0 | RR_Rotate_180)) { - pScreen->width = screen->width; - pScreen->height = screen->height; - pScreen->mmWidth = screen->width_mm; - pScreen->mmHeight = screen->height_mm; - } - else { - pScreen->width = screen->width; - pScreen->height = screen->height; - pScreen->mmWidth = screen->height_mm; - pScreen->mmHeight = screen->width_mm; - } -} - -Bool -fakeUnmapFramebuffer(KdScreenInfo * screen) -{ - FakePriv *priv = screen->card->driver; - - KdShadowFbFree(screen); - free(priv->base); - priv->base = NULL; - return TRUE; -} - -Bool -fakeSetShadow(ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - ShadowUpdateProc update; - ShadowWindowProc window; - - window = fakeWindowLinear; - update = 0; - if (scrpriv->randr) - update = shadowUpdateRotatePacked; - else - update = shadowUpdatePacked; - return KdShadowSet(pScreen, scrpriv->randr, update, window); -} - -#ifdef RANDR -Bool -fakeRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - RRScreenSizePtr pSize; - Rotation randr; - int n; - - *rotations = RR_Rotate_All | RR_Reflect_All; - - for (n = 0; n < pScreen->numDepths; n++) - if (pScreen->allowedDepths[n].numVids) - break; - if (n == pScreen->numDepths) - return FALSE; - - pSize = RRRegisterSize(pScreen, - screen->width, - screen->height, screen->width_mm, screen->height_mm); - - randr = KdSubRotation(scrpriv->randr, screen->randr); - - RRSetCurrentConfig(pScreen, randr, 0, pSize); - - return TRUE; -} - -Bool -fakeRandRSetConfig(ScreenPtr pScreen, - Rotation randr, int rate, RRScreenSizePtr pSize) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - Bool wasEnabled = pScreenPriv->enabled; - FakeScrPriv oldscr; - int oldwidth; - int oldheight; - int oldmmwidth; - int oldmmheight; - int newwidth, newheight; - - if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) { - newwidth = pSize->width; - newheight = pSize->height; - } - else { - newwidth = pSize->height; - newheight = pSize->width; - } - - if (wasEnabled) - KdDisableScreen(pScreen); - - oldscr = *scrpriv; - - oldwidth = screen->width; - oldheight = screen->height; - oldmmwidth = pScreen->mmWidth; - oldmmheight = pScreen->mmHeight; - - /* - * Set new configuration - */ - - scrpriv->randr = KdAddRotation(screen->randr, randr); - - fakeUnmapFramebuffer(screen); - - if (!fakeMapFramebuffer(screen)) - goto bail4; - - KdShadowUnset(screen->pScreen); - - if (!fakeSetShadow(screen->pScreen)) - goto bail4; - - fakeSetScreenSizes(screen->pScreen); - - /* - * Set frame buffer mapping - */ - (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), - pScreen->width, - pScreen->height, - screen->fb.depth, - screen->fb.bitsPerPixel, - screen->fb.byteStride, - screen->fb.frameBuffer); - - /* set the subpixel order */ - - KdSetSubpixelOrder(pScreen, scrpriv->randr); - if (wasEnabled) - KdEnableScreen(pScreen); - - return TRUE; - - bail4: - fakeUnmapFramebuffer(screen); - *scrpriv = oldscr; - (void) fakeMapFramebuffer(screen); - pScreen->width = oldwidth; - pScreen->height = oldheight; - pScreen->mmWidth = oldmmwidth; - pScreen->mmHeight = oldmmheight; - - if (wasEnabled) - KdEnableScreen(pScreen); - return FALSE; -} - -Bool -fakeRandRInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (!RRScreenInit(pScreen)) - return FALSE; - - pScrPriv = rrGetScrPriv(pScreen); - pScrPriv->rrGetInfo = fakeRandRGetInfo; - pScrPriv->rrSetConfig = fakeRandRSetConfig; - return TRUE; -} -#endif - -Bool -fakeCreateColormap(ColormapPtr pmap) -{ - return fbInitializeColormap(pmap); -} - -Bool -fakeInitScreen(ScreenPtr pScreen) -{ - pScreen->CreateColormap = fakeCreateColormap; - return TRUE; -} - -Bool -fakeFinishInitScreen(ScreenPtr pScreen) -{ - if (!shadowSetup(pScreen)) - return FALSE; - -#ifdef RANDR - if (!fakeRandRInit(pScreen)) - return FALSE; -#endif - - return TRUE; -} - -Bool -fakeCreateResources(ScreenPtr pScreen) -{ - return fakeSetShadow(pScreen); -} - -void -fakePreserve(KdCardInfo * card) -{ -} - -Bool -fakeEnable(ScreenPtr pScreen) -{ - return TRUE; -} - -Bool -fakeDPMS(ScreenPtr pScreen, int mode) -{ - return TRUE; -} - -void -fakeDisable(ScreenPtr pScreen) -{ -} - -void -fakeRestore(KdCardInfo * card) -{ -} - -void -fakeScreenFini(KdScreenInfo * screen) -{ -} - -void -fakeCardFini(KdCardInfo * card) -{ - FakePriv *priv = card->driver; - - free(priv->base); - free(priv); -} - -void -fakeGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs) -{ - while (n--) { - pdefs->red = 0; - pdefs->green = 0; - pdefs->blue = 0; - pdefs++; - } -} - -void -fakePutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) -{ -} diff --git a/xserver/hw/kdrive/fake/fake.h b/xserver/hw/kdrive/fake/fake.h deleted file mode 100644 index ae33fc6d0..000000000 --- a/xserver/hw/kdrive/fake/fake.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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 _FBDEV_H_ -#define _FBDEV_H_ -#include -#include -#include "kdrive.h" - -#ifdef RANDR -#include "randrstr.h" -#endif - -typedef struct _fakePriv { - CARD8 *base; - int bytes_per_line; -} FakePriv; - -typedef struct _fakeScrPriv { - Rotation randr; - Bool shadow; -} FakeScrPriv; - -extern KdCardFuncs fakeFuncs; - -Bool - fakeInitialize(KdCardInfo * card, FakePriv * priv); - -Bool - fakeCardInit(KdCardInfo * card); - -Bool - fakeScreenInit(KdScreenInfo * screen); - -Bool - fakeScreenInitialize(KdScreenInfo * screen, FakeScrPriv * scrpriv); - -Bool - fakeInitScreen(ScreenPtr pScreen); - -Bool - fakeFinishInitScreen(ScreenPtr pScreen); - -Bool - fakeCreateResources(ScreenPtr pScreen); - -void - fakePreserve(KdCardInfo * card); - -Bool - fakeEnable(ScreenPtr pScreen); - -Bool - fakeDPMS(ScreenPtr pScreen, int mode); - -void - fakeDisable(ScreenPtr pScreen); - -void - fakeRestore(KdCardInfo * card); - -void - fakeScreenFini(KdScreenInfo * screen); - -void - fakeCardFini(KdCardInfo * card); - -void - fakeGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs); - -void - fakePutColors(ScreenPtr pScreen, int n, xColorItem * pdefs); - -Bool - fakeMapFramebuffer(KdScreenInfo * screen); - -void *fakeWindowLinear(ScreenPtr pScreen, - CARD32 row, - CARD32 offset, int mode, CARD32 *size, void *closure); - -void - fakeSetScreenSizes(ScreenPtr pScreen); - -Bool - fakeUnmapFramebuffer(KdScreenInfo * screen); - -Bool - fakeSetShadow(ScreenPtr pScreen); - -Bool - fakeCreateColormap(ColormapPtr pmap); - -#ifdef RANDR -Bool - fakeRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); - -Bool - -fakeRandRSetConfig(ScreenPtr pScreen, - Rotation randr, int rate, RRScreenSizePtr pSize); -Bool - fakeRandRInit(ScreenPtr pScreen); - -#endif - -extern KdPointerDriver FakePointerDriver; - -extern KdKeyboardDriver FakeKeyboardDriver; - -extern KdOsFuncs FakeOsFuncs; - -#endif /* _FBDEV_H_ */ diff --git a/xserver/hw/kdrive/fake/fakeinit.c b/xserver/hw/kdrive/fake/fakeinit.c deleted file mode 100644 index 0aae1ddc1..000000000 --- a/xserver/hw/kdrive/fake/fakeinit.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fake.h" - -void -InitCard(char *name) -{ - KdCardInfoAdd(&fakeFuncs, 0); -} - -void -InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) -{ - KdInitOutput(pScreenInfo, argc, argv); -} - -void -InitInput(int argc, char **argv) -{ - KdPointerInfo *pi; - KdKeyboardInfo *ki; - - pi = KdNewPointer(); - if (!pi) - return; - pi->driver = &FakePointerDriver; - KdAddPointer(pi); - - ki = KdNewKeyboard(); - if (!ki) - return; - ki->driver = &FakeKeyboardDriver; - KdAddKeyboard(ki); - - KdInitInput(); -} - -void -CloseInput(void) -{ - KdCloseInput(); -} - -#ifdef DDXBEFORERESET -void -ddxBeforeReset(void) -{ -} -#endif - -void -ddxUseMsg(void) -{ - KdUseMsg(); -} - -int -ddxProcessArgument(int argc, char **argv, int i) -{ - return KdProcessArgument(argc, argv, i); -} - -void -OsVendorInit(void) -{ - KdOsInit(&FakeOsFuncs); -} - -KdCardFuncs fakeFuncs = { - fakeCardInit, /* cardinit */ - fakeScreenInit, /* scrinit */ - fakeInitScreen, /* initScreen */ - fakeFinishInitScreen, /* finishInitScreen */ - fakeCreateResources, /* createRes */ - fakePreserve, /* preserve */ - fakeEnable, /* enable */ - fakeDPMS, /* dpms */ - fakeDisable, /* disable */ - fakeRestore, /* restore */ - fakeScreenFini, /* scrfini */ - fakeCardFini, /* cardfini */ - - 0, /* initCursor */ - 0, /* enableCursor */ - 0, /* disableCursor */ - 0, /* finiCursor */ - 0, /* recolorCursor */ - - 0, /* initAccel */ - 0, /* enableAccel */ - 0, /* disableAccel */ - 0, /* finiAccel */ - - fakeGetColors, /* getColors */ - fakePutColors, /* putColors */ -}; diff --git a/xserver/hw/kdrive/fake/kbd.c b/xserver/hw/kdrive/fake/kbd.c deleted file mode 100644 index 83a3c66cf..000000000 --- a/xserver/hw/kdrive/fake/kbd.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fake.h" -#include - -#define FAKE_WIDTH 2 - -static Status -FakeKeyboardInit(KdKeyboardInfo * ki) -{ - ki->minScanCode = 8; - ki->maxScanCode = 255; - return Success; -} - -static Status -FakeKeyboardEnable(KdKeyboardInfo * ki) -{ - return Success; -} - -static void -FakeKeyboardDisable(KdKeyboardInfo * ki) -{ - return; -} - -static void -FakeKeyboardFini(KdKeyboardInfo * ki) -{ -} - -static void -FakeKeyboardLeds(KdKeyboardInfo * ki, int leds) -{ -} - -static void -FakeKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) -{ -} - -KdKeyboardDriver FakeKeyboardDriver = { - "fake", - FakeKeyboardInit, - FakeKeyboardEnable, - FakeKeyboardLeds, - FakeKeyboardBell, - FakeKeyboardDisable, - FakeKeyboardFini, - NULL, -}; diff --git a/xserver/hw/kdrive/fake/mouse.c b/xserver/hw/kdrive/fake/mouse.c deleted file mode 100644 index 564dae445..000000000 --- a/xserver/hw/kdrive/fake/mouse.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -static Status -MouseInit(KdPointerInfo * pi) -{ - return Success; -} - -static Status -MouseEnable(KdPointerInfo * pi) -{ - return Success; -} - -static void -MouseDisable(KdPointerInfo * pi) -{ - return; -} - -static void -MouseFini(KdPointerInfo * pi) -{ - return; -} - -KdPointerDriver FakePointerDriver = { - "fake", - MouseInit, - MouseEnable, - MouseDisable, - MouseFini, -}; diff --git a/xserver/hw/kdrive/fake/os.c b/xserver/hw/kdrive/fake/os.c deleted file mode 100644 index 01bb37bd5..000000000 --- a/xserver/hw/kdrive/fake/os.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fake.h" - -static int -FakeInit(void) -{ - return 1; -} - -static void -FakeEnable(void) -{ -} - -static Bool -FakeSpecialKey(KeySym sym) -{ - return FALSE; -} - -static void -FakeDisable(void) -{ -} - -static void -FakeFini(void) -{ -} - -KdOsFuncs FakeOsFuncs = { - FakeInit, - FakeEnable, - FakeSpecialKey, - FakeDisable, - FakeFini, - 0 -}; diff --git a/xserver/hw/kdrive/fbdev/Makefile.am b/xserver/hw/kdrive/fbdev/Makefile.am deleted file mode 100644 index d550c1391..000000000 --- a/xserver/hw/kdrive/fbdev/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -AM_CPPFLAGS = \ - @KDRIVE_INCS@ \ - @KDRIVE_CFLAGS@ - -noinst_LTLIBRARIES = libfbdev.la - -libfbdev_la_SOURCES = \ - fbdev.c \ - fbdev.h - -if KDRIVEFBDEV -bin_PROGRAMS = Xfbdev - -Xfbdev_SOURCES = \ - fbinit.c - -Xfbdev_LDADD = \ - libfbdev.la \ - @KDRIVE_MAIN_LIB@ \ - @KDRIVE_LIBS@ - -Xfbdev_DEPENDENCIES = \ - libfbdev.la \ - $(KDRIVE_PURE_LIBS) - -Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) - -relink: - $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) -endif diff --git a/xserver/hw/kdrive/fbdev/fbdev.c b/xserver/hw/kdrive/fbdev/fbdev.c deleted file mode 100644 index 9b69edf95..000000000 --- a/xserver/hw/kdrive/fbdev/fbdev.c +++ /dev/null @@ -1,892 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fbdev.h" -#include - -#include - -const char *fbdevDevicePath = NULL; - -static Bool -fbdevInitialize(KdCardInfo * card, FbdevPriv * priv) -{ - unsigned long off; - - if (fbdevDevicePath == NULL) - fbdevDevicePath = "/dev/fb0"; - - if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0) { - ErrorF("Error opening framebuffer %s: %s\n", - fbdevDevicePath, strerror(errno)); - return FALSE; - } - - /* quiet valgrind */ - memset(&priv->fix, '\0', sizeof(priv->fix)); - if (ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix) < 0) { - perror("Error with /dev/fb ioctl FIOGET_FSCREENINFO"); - close(priv->fd); - return FALSE; - } - /* quiet valgrind */ - memset(&priv->var, '\0', sizeof(priv->var)); - if (ioctl(priv->fd, FBIOGET_VSCREENINFO, &priv->var) < 0) { - perror("Error with /dev/fb ioctl FIOGET_VSCREENINFO"); - close(priv->fd); - return FALSE; - } - - priv->fb_base = (char *) mmap((caddr_t) NULL, - priv->fix.smem_len, - PROT_READ | PROT_WRITE, - MAP_SHARED, priv->fd, 0); - - if (priv->fb_base == (char *) -1) { - perror("ERROR: mmap framebuffer fails!"); - close(priv->fd); - return FALSE; - } - off = (unsigned long) priv->fix.smem_start % (unsigned long) getpagesize(); - priv->fb = priv->fb_base + off; - return TRUE; -} - -Bool -fbdevCardInit(KdCardInfo * card) -{ - FbdevPriv *priv; - - priv = (FbdevPriv *) malloc(sizeof(FbdevPriv)); - if (!priv) - return FALSE; - - if (!fbdevInitialize(card, priv)) { - free(priv); - return FALSE; - } - card->driver = priv; - - return TRUE; -} - -static Pixel -fbdevMakeContig(Pixel orig, Pixel others) -{ - Pixel low; - - low = lowbit(orig) >> 1; - while (low && (others & low) == 0) { - orig |= low; - low >>= 1; - } - return orig; -} - -static Bool -fbdevModeSupported(KdScreenInfo * screen, const KdMonitorTiming * t) -{ - return TRUE; -} - -static void -fbdevConvertMonitorTiming(const KdMonitorTiming * t, - struct fb_var_screeninfo *var) -{ - memset(var, 0, sizeof(struct fb_var_screeninfo)); - - var->xres = t->horizontal; - var->yres = t->vertical; - var->xres_virtual = t->horizontal; - var->yres_virtual = t->vertical; - var->xoffset = 0; - var->yoffset = 0; - var->pixclock = t->clock ? 1000000000 / t->clock : 0; - var->left_margin = t->hbp; - var->right_margin = t->hfp; - var->upper_margin = t->vbp; - var->lower_margin = t->vfp; - var->hsync_len = t->hblank - t->hfp - t->hbp; - var->vsync_len = t->vblank - t->vfp - t->vbp; - - var->sync = 0; - var->vmode = 0; - - if (t->hpol == KdSyncPositive) - var->sync |= FB_SYNC_HOR_HIGH_ACT; - if (t->vpol == KdSyncPositive) - var->sync |= FB_SYNC_VERT_HIGH_ACT; -} - -static Bool -fbdevScreenInitialize(KdScreenInfo * screen, FbdevScrPriv * scrpriv) -{ - FbdevPriv *priv = screen->card->driver; - Pixel allbits; - int depth; - Bool gray; - struct fb_var_screeninfo var; - const KdMonitorTiming *t; - int k; - - k = ioctl(priv->fd, FBIOGET_VSCREENINFO, &var); - - if (!screen->width || !screen->height) { - if (k >= 0) { - screen->width = var.xres; - screen->height = var.yres; - } - else { - screen->width = 1024; - screen->height = 768; - } - screen->rate = 103; /* FIXME: should get proper value from fb driver */ - } - if (!screen->fb.depth) { - if (k >= 0) - screen->fb.depth = var.bits_per_pixel; - else - screen->fb.depth = 16; - } - - if ((screen->width != var.xres) || (screen->height != var.yres)) { - t = KdFindMode(screen, fbdevModeSupported); - screen->rate = t->rate; - screen->width = t->horizontal; - screen->height = t->vertical; - - /* Now try setting the mode */ - if (k < 0 || (t->horizontal != var.xres || t->vertical != var.yres)) - fbdevConvertMonitorTiming(t, &var); - } - - var.activate = FB_ACTIVATE_NOW; - var.bits_per_pixel = screen->fb.depth; - var.nonstd = 0; - var.grayscale = 0; - - k = ioctl(priv->fd, FBIOPUT_VSCREENINFO, &var); - - if (k < 0) { - fprintf(stderr, "error: %s\n", strerror(errno)); - return FALSE; - } - - /* Re-get the "fixed" parameters since they might have changed */ - k = ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix); - if (k < 0) - perror("FBIOGET_FSCREENINFO"); - - /* Now get the new screeninfo */ - ioctl(priv->fd, FBIOGET_VSCREENINFO, &priv->var); - depth = priv->var.bits_per_pixel; - gray = priv->var.grayscale; - - /* Calculate fix.line_length if it's zero */ - if (!priv->fix.line_length) - priv->fix.line_length = (priv->var.xres_virtual * depth + 7) / 8; - - switch (priv->fix.visual) { - case FB_VISUAL_MONO01: - case FB_VISUAL_MONO10: - screen->fb.visuals = (1 << StaticGray); - break; - case FB_VISUAL_PSEUDOCOLOR: - screen->fb.visuals = (1 << StaticGray); - if (priv->var.bits_per_pixel == 1) { - /* Override to monochrome, to have preallocated black/white */ - priv->fix.visual = FB_VISUAL_MONO01; - } else if (gray) { - /* could also support GrayScale, but what's the point? */ - } else { - screen->fb.visuals = ((1 << StaticGray) | - (1 << GrayScale) | - (1 << StaticColor) | - (1 << PseudoColor) | - (1 << TrueColor) | (1 << DirectColor)); - } - screen->fb.blueMask = 0x00; - screen->fb.greenMask = 0x00; - screen->fb.redMask = 0x00; - break; - case FB_VISUAL_STATIC_PSEUDOCOLOR: - if (gray) { - screen->fb.visuals = (1 << StaticGray); - } - else { - screen->fb.visuals = (1 << StaticColor); - } - screen->fb.blueMask = 0x00; - screen->fb.greenMask = 0x00; - screen->fb.redMask = 0x00; - break; - case FB_VISUAL_TRUECOLOR: - case FB_VISUAL_DIRECTCOLOR: - screen->fb.visuals = (1 << TrueColor); -#define Mask(o,l) (((1 << l) - 1) << o) - screen->fb.redMask = Mask (priv->var.red.offset, priv->var.red.length); - screen->fb.greenMask = - Mask (priv->var.green.offset, priv->var.green.length); - screen->fb.blueMask = - Mask (priv->var.blue.offset, priv->var.blue.length); - - /* - * This is a kludge so that Render will work -- fill in the gaps - * in the pixel - */ - screen->fb.redMask = fbdevMakeContig(screen->fb.redMask, - screen->fb.greenMask | - screen->fb.blueMask); - - screen->fb.greenMask = fbdevMakeContig(screen->fb.greenMask, - screen->fb.redMask | - screen->fb.blueMask); - - screen->fb.blueMask = fbdevMakeContig(screen->fb.blueMask, - screen->fb.redMask | - screen->fb.greenMask); - - allbits = - screen->fb.redMask | screen->fb.greenMask | screen->fb.blueMask; - depth = 32; - while (depth && !(allbits & (1 << (depth - 1)))) - depth--; - break; - default: - return FALSE; - break; - } - screen->fb.depth = depth; - screen->fb.bitsPerPixel = priv->var.bits_per_pixel; - - scrpriv->randr = screen->randr; - - return fbdevMapFramebuffer(screen); -} - -Bool -fbdevScreenInit(KdScreenInfo * screen) -{ - FbdevScrPriv *scrpriv; - - scrpriv = calloc(1, sizeof(FbdevScrPriv)); - if (!scrpriv) - return FALSE; - screen->driver = scrpriv; - if (!fbdevScreenInitialize(screen, scrpriv)) { - screen->driver = 0; - free(scrpriv); - return FALSE; - } - return TRUE; -} - -static void * -fbdevWindowLinear(ScreenPtr pScreen, - CARD32 row, - CARD32 offset, int mode, CARD32 *size, void *closure) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - - if (!pScreenPriv->enabled) - return 0; - *size = priv->fix.line_length; - return (CARD8 *) priv->fb + row * priv->fix.line_length + offset; -} - -static void * -fbdevWindowAfb(ScreenPtr pScreen, - CARD32 row, - CARD32 offset, int mode, CARD32 *size, void *closure) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - - if (!pScreenPriv->enabled) - return 0; - /* offset to next plane */ - *size = priv->var.yres_virtual * priv->fix.line_length; - return (CARD8 *) priv->fb + row * priv->fix.line_length + offset; -} - -Bool -fbdevMapFramebuffer(KdScreenInfo * screen) -{ - FbdevScrPriv *scrpriv = screen->driver; - KdPointerMatrix m; - FbdevPriv *priv = screen->card->driver; - - if (scrpriv->randr != RR_Rotate_0 || - priv->fix.type != FB_TYPE_PACKED_PIXELS) - scrpriv->shadow = TRUE; - else - scrpriv->shadow = FALSE; - - KdComputePointerMatrix(&m, scrpriv->randr, screen->width, screen->height); - - KdSetPointerMatrix(&m); - - screen->width = priv->var.xres; - screen->height = priv->var.yres; - - if (scrpriv->shadow) { - if (!KdShadowFbAlloc(screen, - scrpriv->randr & (RR_Rotate_90 | RR_Rotate_270))) - return FALSE; - } - else { - screen->fb.byteStride = priv->fix.line_length; - screen->fb.pixelStride = (priv->fix.line_length * 8 / - priv->var.bits_per_pixel); - screen->fb.frameBuffer = (CARD8 *) (priv->fb); - } - - return TRUE; -} - -static void -fbdevSetScreenSizes(ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FbdevScrPriv *scrpriv = screen->driver; - FbdevPriv *priv = screen->card->driver; - - if (scrpriv->randr & (RR_Rotate_0 | RR_Rotate_180)) { - pScreen->width = priv->var.xres; - pScreen->height = priv->var.yres; - pScreen->mmWidth = screen->width_mm; - pScreen->mmHeight = screen->height_mm; - } - else { - pScreen->width = priv->var.yres; - pScreen->height = priv->var.xres; - pScreen->mmWidth = screen->height_mm; - pScreen->mmHeight = screen->width_mm; - } -} - -static Bool -fbdevUnmapFramebuffer(KdScreenInfo * screen) -{ - KdShadowFbFree(screen); - return TRUE; -} - -static Bool -fbdevSetShadow(ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FbdevScrPriv *scrpriv = screen->driver; - FbdevPriv *priv = screen->card->driver; - ShadowUpdateProc update; - ShadowWindowProc window; - int useYX = 0; - -#ifdef __arm__ - /* Use variant copy routines that always read left to right in the - shadow framebuffer. Reading vertical strips is exceptionally - slow on XScale due to cache effects. */ - useYX = 1; -#endif - - window = fbdevWindowLinear; - update = 0; - switch (priv->fix.type) { - case FB_TYPE_PACKED_PIXELS: - if (scrpriv->randr) - if (priv->var.bits_per_pixel == 16) { - switch (scrpriv->randr) { - case RR_Rotate_90: - if (useYX) - update = shadowUpdateRotate16_90YX; - else - update = shadowUpdateRotate16_90; - break; - case RR_Rotate_180: - update = shadowUpdateRotate16_180; - break; - case RR_Rotate_270: - if (useYX) - update = shadowUpdateRotate16_270YX; - else - update = shadowUpdateRotate16_270; - break; - default: - update = shadowUpdateRotate16; - break; - } - } - else - update = shadowUpdateRotatePacked; - else - update = shadowUpdatePacked; - break; - - case FB_TYPE_PLANES: - window = fbdevWindowAfb; - switch (priv->var.bits_per_pixel) { - case 4: - update = shadowUpdateAfb4; - break; - - case 8: - update = shadowUpdateAfb8; - break; - - default: - FatalError("Bitplanes with bpp %u are not yet supported\n", - priv->var.bits_per_pixel); - } - break; - - case FB_TYPE_INTERLEAVED_PLANES: - if (priv->fix.type_aux == 2) { - switch (priv->var.bits_per_pixel) { - case 4: - update = shadowUpdateIplan2p4; - break; - - case 8: - update = shadowUpdateIplan2p8; - break; - - default: - FatalError("Atari interleaved bitplanes with bpp %u are not yet supported\n", - priv->var.bits_per_pixel); - } - } else { - FatalError("Interleaved bitplanes with interleave %u are not yet supported\n", - priv->fix.type_aux); - } - break; - - case FB_TYPE_TEXT: - FatalError("Text frame buffers are not yet supported\n"); - break; - - case FB_TYPE_VGA_PLANES: - FatalError("VGA planes are not yet supported\n"); - break; - - default: - FatalError("Unsupported frame buffer type %u\n", priv->fix.type); - break; - } - - return KdShadowSet(pScreen, scrpriv->randr, update, window); -} - -#ifdef RANDR -static Bool -fbdevRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FbdevScrPriv *scrpriv = screen->driver; - RRScreenSizePtr pSize; - Rotation randr; - int n; - - *rotations = RR_Rotate_All | RR_Reflect_All; - - for (n = 0; n < pScreen->numDepths; n++) - if (pScreen->allowedDepths[n].numVids) - break; - if (n == pScreen->numDepths) - return FALSE; - - pSize = RRRegisterSize(pScreen, - screen->width, - screen->height, screen->width_mm, screen->height_mm); - - randr = KdSubRotation(scrpriv->randr, screen->randr); - - RRSetCurrentConfig(pScreen, randr, 0, pSize); - - return TRUE; -} - -static Bool -fbdevRandRSetConfig(ScreenPtr pScreen, - Rotation randr, int rate, RRScreenSizePtr pSize) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FbdevScrPriv *scrpriv = screen->driver; - Bool wasEnabled = pScreenPriv->enabled; - FbdevScrPriv oldscr; - int oldwidth; - int oldheight; - int oldmmwidth; - int oldmmheight; - int newwidth, newheight, newmmwidth, newmmheight; - - if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) { - newwidth = pSize->width; - newheight = pSize->height; - newmmwidth = pSize->mmWidth; - newmmheight = pSize->mmHeight; - } - else { - newwidth = pSize->height; - newheight = pSize->width; - newmmwidth = pSize->mmHeight; - newmmheight = pSize->mmWidth; - } - - if (wasEnabled) - KdDisableScreen(pScreen); - - oldscr = *scrpriv; - - oldwidth = screen->width; - oldheight = screen->height; - oldmmwidth = pScreen->mmWidth; - oldmmheight = pScreen->mmHeight; - - /* - * Set new configuration - */ - - scrpriv->randr = KdAddRotation(screen->randr, randr); - pScreen->width = newwidth; - pScreen->height = newheight; - pScreen->mmWidth = newmmwidth; - pScreen->mmHeight = newmmheight; - - fbdevUnmapFramebuffer(screen); - - if (!fbdevMapFramebuffer(screen)) - goto bail4; - - KdShadowUnset(screen->pScreen); - - if (!fbdevSetShadow(screen->pScreen)) - goto bail4; - - fbdevSetScreenSizes(screen->pScreen); - - /* - * Set frame buffer mapping - */ - (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), - pScreen->width, - pScreen->height, - screen->fb.depth, - screen->fb.bitsPerPixel, - screen->fb.byteStride, - screen->fb.frameBuffer); - - /* set the subpixel order */ - - KdSetSubpixelOrder(pScreen, scrpriv->randr); - if (wasEnabled) - KdEnableScreen(pScreen); - - return TRUE; - - bail4: - fbdevUnmapFramebuffer(screen); - *scrpriv = oldscr; - (void) fbdevMapFramebuffer(screen); - pScreen->width = oldwidth; - pScreen->height = oldheight; - pScreen->mmWidth = oldmmwidth; - pScreen->mmHeight = oldmmheight; - - if (wasEnabled) - KdEnableScreen(pScreen); - return FALSE; -} - -static Bool -fbdevRandRInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (!RRScreenInit(pScreen)) - return FALSE; - - pScrPriv = rrGetScrPriv(pScreen); - pScrPriv->rrGetInfo = fbdevRandRGetInfo; - pScrPriv->rrSetConfig = fbdevRandRSetConfig; - return TRUE; -} -#endif - -static Bool -fbdevCreateColormap(ColormapPtr pmap) -{ - ScreenPtr pScreen = pmap->pScreen; - - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - VisualPtr pVisual; - int i; - int nent; - xColorItem *pdefs; - - switch (priv->fix.visual) { - case FB_VISUAL_MONO01: - pScreen->whitePixel = 0; - pScreen->blackPixel = 1; - pmap->red[0].co.local.red = 65535; - pmap->red[0].co.local.green = 65535; - pmap->red[0].co.local.blue = 65535; - pmap->red[1].co.local.red = 0; - pmap->red[1].co.local.green = 0; - pmap->red[1].co.local.blue = 0; - return TRUE; - case FB_VISUAL_MONO10: - pScreen->blackPixel = 0; - pScreen->whitePixel = 1; - pmap->red[0].co.local.red = 0; - pmap->red[0].co.local.green = 0; - pmap->red[0].co.local.blue = 0; - pmap->red[1].co.local.red = 65535; - pmap->red[1].co.local.green = 65535; - pmap->red[1].co.local.blue = 65535; - return TRUE; - case FB_VISUAL_STATIC_PSEUDOCOLOR: - pVisual = pmap->pVisual; - nent = pVisual->ColormapEntries; - pdefs = xallocarray(nent, sizeof(xColorItem)); - if (!pdefs) - return FALSE; - for (i = 0; i < nent; i++) - pdefs[i].pixel = i; - fbdevGetColors(pScreen, nent, pdefs); - for (i = 0; i < nent; i++) { - pmap->red[i].co.local.red = pdefs[i].red; - pmap->red[i].co.local.green = pdefs[i].green; - pmap->red[i].co.local.blue = pdefs[i].blue; - } - free(pdefs); - return TRUE; - default: - return fbInitializeColormap(pmap); - } -} - -Bool -fbdevInitScreen(ScreenPtr pScreen) -{ - pScreen->CreateColormap = fbdevCreateColormap; - return TRUE; -} - -Bool -fbdevFinishInitScreen(ScreenPtr pScreen) -{ - if (!shadowSetup(pScreen)) - return FALSE; - -#ifdef RANDR - if (!fbdevRandRInit(pScreen)) - return FALSE; -#endif - - return TRUE; -} - -Bool -fbdevCreateResources(ScreenPtr pScreen) -{ - return fbdevSetShadow(pScreen); -} - -void -fbdevPreserve(KdCardInfo * card) -{ -} - -static int -fbdevUpdateFbColormap(FbdevPriv * priv, int minidx, int maxidx) -{ - struct fb_cmap cmap; - - cmap.start = minidx; - cmap.len = maxidx - minidx + 1; - cmap.red = &priv->red[minidx]; - cmap.green = &priv->green[minidx]; - cmap.blue = &priv->blue[minidx]; - cmap.transp = 0; - - return ioctl(priv->fd, FBIOPUTCMAP, &cmap); -} - -Bool -fbdevEnable(ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - int k; - - priv->var.activate = FB_ACTIVATE_NOW | FB_CHANGE_CMAP_VBL; - - /* display it on the LCD */ - k = ioctl(priv->fd, FBIOPUT_VSCREENINFO, &priv->var); - if (k < 0) { - perror("FBIOPUT_VSCREENINFO"); - return FALSE; - } - - if (priv->fix.visual == FB_VISUAL_DIRECTCOLOR) { - int i; - - for (i = 0; - i < (1 << priv->var.red.length) || - i < (1 << priv->var.green.length) || - i < (1 << priv->var.blue.length); i++) { - priv->red[i] = i * 65535 / ((1 << priv->var.red.length) - 1); - priv->green[i] = i * 65535 / ((1 << priv->var.green.length) - 1); - priv->blue[i] = i * 65535 / ((1 << priv->var.blue.length) - 1); - } - - fbdevUpdateFbColormap(priv, 0, i); - } - return TRUE; -} - -Bool -fbdevDPMS(ScreenPtr pScreen, int mode) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - static int oldmode = -1; - - if (mode == oldmode) - return TRUE; -#ifdef FBIOPUT_POWERMODE - if (ioctl(priv->fd, FBIOPUT_POWERMODE, &mode) >= 0) { - oldmode = mode; - return TRUE; - } -#endif -#ifdef FBIOBLANK - if (ioctl(priv->fd, FBIOBLANK, mode ? mode + 1 : 0) >= 0) { - oldmode = mode; - return TRUE; - } -#endif - return FALSE; -} - -void -fbdevDisable(ScreenPtr pScreen) -{ -} - -void -fbdevRestore(KdCardInfo * card) -{ -} - -void -fbdevScreenFini(KdScreenInfo * screen) -{ -} - -void -fbdevCardFini(KdCardInfo * card) -{ - FbdevPriv *priv = card->driver; - - munmap(priv->fb_base, priv->fix.smem_len); - close(priv->fd); - free(priv); -} - -/* - * Retrieve actual colormap and return selected n entries in pdefs. - */ -void -fbdevGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - struct fb_cmap cmap; - int p; - int k; - int min, max; - - min = 256; - max = 0; - for (k = 0; k < n; k++) { - if (pdefs[k].pixel < min) - min = pdefs[k].pixel; - if (pdefs[k].pixel > max) - max = pdefs[k].pixel; - } - cmap.start = min; - cmap.len = max - min + 1; - cmap.red = &priv->red[min]; - cmap.green = &priv->green[min]; - cmap.blue = &priv->blue[min]; - cmap.transp = 0; - k = ioctl(priv->fd, FBIOGETCMAP, &cmap); - if (k < 0) { - perror("can't get colormap"); - return; - } - while (n--) { - p = pdefs->pixel; - pdefs->red = priv->red[p]; - pdefs->green = priv->green[p]; - pdefs->blue = priv->blue[p]; - pdefs++; - } -} - -/* - * Change colormap by updating n entries described in pdefs. - */ -void -fbdevPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) -{ - KdScreenPriv(pScreen); - FbdevPriv *priv = pScreenPriv->card->driver; - int p; - int min, max; - - min = 256; - max = 0; - while (n--) { - p = pdefs->pixel; - priv->red[p] = pdefs->red; - priv->green[p] = pdefs->green; - priv->blue[p] = pdefs->blue; - if (p < min) - min = p; - if (p > max) - max = p; - pdefs++; - } - - fbdevUpdateFbColormap(priv, min, max); -} diff --git a/xserver/hw/kdrive/fbdev/fbdev.h b/xserver/hw/kdrive/fbdev/fbdev.h deleted file mode 100644 index f3f7aeceb..000000000 --- a/xserver/hw/kdrive/fbdev/fbdev.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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 _FBDEV_H_ -#define _FBDEV_H_ -#include -#include -#include -#include -#include "kdrive.h" - -#ifdef RANDR -#include "randrstr.h" -#endif - -typedef struct _fbdevPriv { - struct fb_var_screeninfo var; - struct fb_fix_screeninfo fix; - __u16 red[256]; - __u16 green[256]; - __u16 blue[256]; - int fd; - char *fb; - char *fb_base; -} FbdevPriv; - -typedef struct _fbdevScrPriv { - Rotation randr; - Bool shadow; -} FbdevScrPriv; - -extern KdCardFuncs fbdevFuncs; -extern const char *fbdevDevicePath; - -Bool - fbdevCardInit(KdCardInfo * card); - -Bool - fbdevScreenInit(KdScreenInfo * screen); - -Bool - fbdevInitScreen(ScreenPtr pScreen); - -Bool - fbdevFinishInitScreen(ScreenPtr pScreen); - -Bool - fbdevCreateResources(ScreenPtr pScreen); - -void - fbdevPreserve(KdCardInfo * card); - -Bool - fbdevEnable(ScreenPtr pScreen); - -Bool - fbdevDPMS(ScreenPtr pScreen, int mode); - -void - fbdevDisable(ScreenPtr pScreen); - -void - fbdevRestore(KdCardInfo * card); - -void - fbdevScreenFini(KdScreenInfo * screen); - -void - fbdevCardFini(KdCardInfo * card); - -void - fbdevGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs); - -void - fbdevPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs); - -Bool - fbdevMapFramebuffer(KdScreenInfo * screen); - -#endif /* _FBDEV_H_ */ diff --git a/xserver/hw/kdrive/fbdev/fbinit.c b/xserver/hw/kdrive/fbdev/fbinit.c deleted file mode 100644 index d2a14019d..000000000 --- a/xserver/hw/kdrive/fbdev/fbinit.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -void -InitCard(char *name) -{ - KdCardInfoAdd(&fbdevFuncs, 0); -} - -void -InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) -{ - KdInitOutput(pScreenInfo, argc, argv); -} - -void -InitInput(int argc, char **argv) -{ - KdOsAddInputDrivers(); - KdInitInput(); -} - -void -CloseInput(void) -{ - KdCloseInput(); -} - -void -ddxUseMsg(void) -{ - KdUseMsg(); - ErrorF("\nXfbdev Device Usage:\n"); - ErrorF - ("-fb path Framebuffer device to use. Defaults to /dev/fb0\n"); - ErrorF("\n"); -} - -int -ddxProcessArgument(int argc, char **argv, int i) -{ - if (!strcmp(argv[i], "-fb")) { - if (i + 1 < argc) { - fbdevDevicePath = argv[i + 1]; - return 2; - } - UseMsg(); - exit(1); - } - - return KdProcessArgument(argc, argv, i); -} - -KdCardFuncs fbdevFuncs = { - fbdevCardInit, /* cardinit */ - fbdevScreenInit, /* scrinit */ - fbdevInitScreen, /* initScreen */ - fbdevFinishInitScreen, /* finishInitScreen */ - fbdevCreateResources, /* createRes */ - fbdevPreserve, /* preserve */ - fbdevEnable, /* enable */ - fbdevDPMS, /* dpms */ - fbdevDisable, /* disable */ - fbdevRestore, /* restore */ - fbdevScreenFini, /* scrfini */ - fbdevCardFini, /* cardfini */ - - 0, /* initCursor */ - 0, /* enableCursor */ - 0, /* disableCursor */ - 0, /* finiCursor */ - 0, /* recolorCursor */ - - 0, /* initAccel */ - 0, /* enableAccel */ - 0, /* disableAccel */ - 0, /* finiAccel */ - - fbdevGetColors, /* getColors */ - fbdevPutColors, /* putColors */ -}; diff --git a/xserver/hw/kdrive/linux/Makefile.am b/xserver/hw/kdrive/linux/Makefile.am deleted file mode 100644 index 1362cd9d8..000000000 --- a/xserver/hw/kdrive/linux/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -AM_CPPFLAGS = \ - @KDRIVE_INCS@ \ - @KDRIVE_CFLAGS@ - -AM_CFLAGS = -DHAVE_DIX_CONFIG_H - -noinst_LTLIBRARIES = liblinux.la - -liblinux_la_SOURCES = - -liblinux_la_SOURCES += linux.c - -if KDRIVE_KBD -liblinux_la_SOURCES += keyboard.c -endif - -if KDRIVE_EVDEV -liblinux_la_SOURCES += evdev.c -endif - -if KDRIVE_MOUSE -liblinux_la_SOURCES += mouse.c ms.c ps2.c -endif - -if TSLIB -liblinux_la_SOURCES += tslib.c -endif diff --git a/xserver/hw/kdrive/linux/evdev.c b/xserver/hw/kdrive/linux/evdev.c deleted file mode 100644 index 9590413be..000000000 --- a/xserver/hw/kdrive/linux/evdev.c +++ /dev/null @@ -1,530 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -#define NUM_EVENTS 128 -#define ABS_UNSET -65535 - -#define BITS_PER_LONG (sizeof(long) * 8) -#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) -#define ISBITSET(x,y) ((x)[LONG(y)] & BIT(y)) -#define OFF(x) ((x)%BITS_PER_LONG) -#define LONG(x) ((x)/BITS_PER_LONG) -#define BIT(x) (1 << OFF(x)) - -typedef struct _kevdev { - /* current device state */ - int rel[REL_MAX + 1]; - int abs[ABS_MAX + 1]; - int prevabs[ABS_MAX + 1]; - long key[NBITS(KEY_MAX + 1)]; - - /* supported device info */ - long relbits[NBITS(REL_MAX + 1)]; - long absbits[NBITS(ABS_MAX + 1)]; - long keybits[NBITS(KEY_MAX + 1)]; - struct input_absinfo absinfo[ABS_MAX + 1]; - int max_rel; - int max_abs; - - int fd; -} Kevdev; - -static void -EvdevPtrBtn(KdPointerInfo * pi, struct input_event *ev) -{ - int flags = KD_MOUSE_DELTA | pi->buttonState; - - if (ev->code >= BTN_MOUSE && ev->code < BTN_JOYSTICK) { - switch (ev->code) { - case BTN_LEFT: - if (ev->value == 1) - flags |= KD_BUTTON_1; - else - flags &= ~KD_BUTTON_1; - break; - case BTN_MIDDLE: - if (ev->value == 1) - flags |= KD_BUTTON_2; - else - flags &= ~KD_BUTTON_2; - break; - case BTN_RIGHT: - if (ev->value == 1) - flags |= KD_BUTTON_3; - else - flags &= ~KD_BUTTON_3; - break; - default: - /* Unknow button */ - break; - } - - KdEnqueuePointerEvent(pi, flags, 0, 0, 0); - } -} - -static void -EvdevPtrMotion(KdPointerInfo * pi, struct input_event *ev) -{ - Kevdev *ke = pi->driverPrivate; - int i; - int flags = KD_MOUSE_DELTA | pi->buttonState; - - for (i = 0; i <= ke->max_rel; i++) - if (ke->rel[i]) { - int a; - - for (a = 0; a <= ke->max_rel; a++) { - if (ISBITSET(ke->relbits, a)) { - if (a == 0) - KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0); - else if (a == 1) - KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0); - } - ke->rel[a] = 0; - } - break; - } - for (i = 0; i < ke->max_abs; i++) - if (ke->abs[i] != ke->prevabs[i]) { - int a; - - ErrorF("abs"); - for (a = 0; a <= ke->max_abs; a++) { - if (ISBITSET(ke->absbits, a)) - ErrorF(" %d=%d", a, ke->abs[a]); - ke->prevabs[a] = ke->abs[a]; - } - ErrorF("\n"); - break; - } - - if (ev->code == REL_WHEEL) { - for (i = 0; i < abs(ev->value); i++) { - if (ev->value > 0) - flags |= KD_BUTTON_4; - else - flags |= KD_BUTTON_5; - - KdEnqueuePointerEvent(pi, flags, 0, 0, 0); - - if (ev->value > 0) - flags &= ~KD_BUTTON_4; - else - flags &= ~KD_BUTTON_5; - - KdEnqueuePointerEvent(pi, flags, 0, 0, 0); - } - } - -} - -static void -EvdevPtrRead(int evdevPort, void *closure) -{ - KdPointerInfo *pi = closure; - Kevdev *ke = pi->driverPrivate; - int i; - struct input_event events[NUM_EVENTS]; - int n; - - n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event)); - if (n <= 0) { - if (errno == ENODEV) - DeleteInputDeviceRequest(pi->dixdev); - return; - } - - n /= sizeof(struct input_event); - for (i = 0; i < n; i++) { - switch (events[i].type) { - case EV_SYN: - break; - case EV_KEY: - EvdevPtrBtn(pi, &events[i]); - break; - case EV_REL: - ke->rel[events[i].code] += events[i].value; - EvdevPtrMotion(pi, &events[i]); - break; - case EV_ABS: - ke->abs[events[i].code] = events[i].value; - EvdevPtrMotion(pi, &events[i]); - break; - } - } -} - -const char *kdefaultEvdev[] = { - "/dev/input/event0", - "/dev/input/event1", - "/dev/input/event2", - "/dev/input/event3", -}; - -#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0])) - -static Status -EvdevPtrInit(KdPointerInfo * pi) -{ - int i; - int fd; - - if (!pi->path) { - for (i = 0; i < NUM_DEFAULT_EVDEV; i++) { - fd = open(kdefaultEvdev[i], 2); - if (fd >= 0) { - pi->path = strdup(kdefaultEvdev[i]); - break; - } - } - } - else { - fd = open(pi->path, O_RDWR); - if (fd < 0) { - ErrorF("Failed to open evdev device %s\n", pi->path); - return BadMatch; - } - } - - close(fd); - - if (!pi->name) - pi->name = strdup("Evdev mouse"); - - return Success; -} - -static Status -EvdevPtrEnable(KdPointerInfo * pi) -{ - int fd; - unsigned long ev[NBITS(EV_MAX)]; - Kevdev *ke; - - if (!pi || !pi->path) - return BadImplementation; - - fd = open(pi->path, 2); - if (fd < 0) - return BadMatch; - - if (ioctl(fd, EVIOCGRAB, 1) < 0) - perror("Grabbing evdev mouse device failed"); - - if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { - perror("EVIOCGBIT 0"); - close(fd); - return BadMatch; - } - ke = calloc(1, sizeof(Kevdev)); - if (!ke) { - close(fd); - return BadAlloc; - } - if (ISBITSET(ev, EV_KEY)) { - if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(ke->keybits)), ke->keybits) < 0) { - perror("EVIOCGBIT EV_KEY"); - free(ke); - close(fd); - return BadMatch; - } - } - if (ISBITSET(ev, EV_REL)) { - if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(ke->relbits)), ke->relbits) < 0) { - perror("EVIOCGBIT EV_REL"); - free(ke); - close(fd); - return BadMatch; - } - for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--) - if (ISBITSET(ke->relbits, ke->max_rel)) - break; - } - if (ISBITSET(ev, EV_ABS)) { - int i; - - if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(ke->absbits)), ke->absbits) < 0) { - perror("EVIOCGBIT EV_ABS"); - free(ke); - close(fd); - return BadMatch; - } - for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--) - if (ISBITSET(ke->absbits, ke->max_abs)) - break; - for (i = 0; i <= ke->max_abs; i++) { - if (ISBITSET(ke->absbits, i)) - if (ioctl(fd, EVIOCGABS(i), &ke->absinfo[i]) < 0) { - perror("EVIOCGABS"); - break; - } - ke->prevabs[i] = ABS_UNSET; - } - if (i <= ke->max_abs) { - free(ke); - close(fd); - return BadValue; - } - } - if (!KdRegisterFd(fd, EvdevPtrRead, pi)) { - free(ke); - close(fd); - return BadAlloc; - } - pi->driverPrivate = ke; - ke->fd = fd; - - return Success; -} - -static void -EvdevPtrDisable(KdPointerInfo * pi) -{ - Kevdev *ke; - - ke = pi->driverPrivate; - - if (!pi || !pi->driverPrivate) - return; - - KdUnregisterFd(pi, ke->fd, TRUE); - - if (ioctl(ke->fd, EVIOCGRAB, 0) < 0) - perror("Ungrabbing evdev mouse device failed"); - - free(ke); - pi->driverPrivate = 0; -} - -static void -EvdevPtrFini(KdPointerInfo * pi) -{ -} - -/* - * Evdev keyboard functions - */ - -static void -readMapping(KdKeyboardInfo * ki) -{ - if (!ki) - return; - - ki->minScanCode = 0; - ki->maxScanCode = 247; -} - -static void -EvdevKbdRead(int evdevPort, void *closure) -{ - KdKeyboardInfo *ki = closure; - struct input_event events[NUM_EVENTS]; - int i, n; - - n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event)); - if (n <= 0) { - if (errno == ENODEV) - DeleteInputDeviceRequest(ki->dixdev); - return; - } - - n /= sizeof(struct input_event); - for (i = 0; i < n; i++) { - if (events[i].type == EV_KEY) - KdEnqueueKeyboardEvent(ki, events[i].code, !events[i].value); -/* FIXME: must implement other types of events - else - ErrorF("Event type (%d) not delivered\n", events[i].type); -*/ - } -} - -static Status -EvdevKbdInit(KdKeyboardInfo * ki) -{ - int fd; - - if (!ki->path) { - ErrorF("Couldn't find evdev device path\n"); - return BadValue; - } - else { - fd = open(ki->path, O_RDWR); - if (fd < 0) { - ErrorF("Failed to open evdev device %s\n", ki->path); - return BadMatch; - } - } - - close(fd); - - if (!ki->name) - ki->name = strdup("Evdev keyboard"); - - readMapping(ki); - - return Success; -} - -static Status -EvdevKbdEnable(KdKeyboardInfo * ki) -{ - unsigned long ev[NBITS(EV_MAX)]; - Kevdev *ke; - int fd; - - if (!ki || !ki->path) - return BadImplementation; - - fd = open(ki->path, O_RDWR); - if (fd < 0) - return BadMatch; - - if (ioctl(fd, EVIOCGRAB, 1) < 0) - perror("Grabbing evdev keyboard device failed"); - - if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { - perror("EVIOCGBIT 0"); - close(fd); - return BadMatch; - } - - ke = calloc(1, sizeof(Kevdev)); - if (!ke) { - close(fd); - return BadAlloc; - } - - if (!KdRegisterFd(fd, EvdevKbdRead, ki)) { - free(ke); - close(fd); - return BadAlloc; - } - ki->driverPrivate = ke; - ke->fd = fd; - - return Success; -} - -static void -EvdevKbdLeds(KdKeyboardInfo * ki, int leds) -{ - struct input_event event; - Kevdev *ke; - int i; - - if (!ki) - return; - - ke = ki->driverPrivate; - - if (!ke) - return; - - memset(&event, 0, sizeof(event)); - - event.type = EV_LED; - event.code = LED_CAPSL; - event.value = leds & (1 << 0) ? 1 : 0; - i = write(ke->fd, (char *) &event, sizeof(event)); - (void) i; - - event.type = EV_LED; - event.code = LED_NUML; - event.value = leds & (1 << 1) ? 1 : 0; - i = write(ke->fd, (char *) &event, sizeof(event)); - (void) i; - - event.type = EV_LED; - event.code = LED_SCROLLL; - event.value = leds & (1 << 2) ? 1 : 0; - i = write(ke->fd, (char *) &event, sizeof(event)); - (void) i; - - event.type = EV_LED; - event.code = LED_COMPOSE; - event.value = leds & (1 << 3) ? 1 : 0; - i = write(ke->fd, (char *) &event, sizeof(event)); - (void) i; -} - -static void -EvdevKbdBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) -{ -} - -static void -EvdevKbdDisable(KdKeyboardInfo * ki) -{ - Kevdev *ke; - - ke = ki->driverPrivate; - - if (!ki || !ki->driverPrivate) - return; - - KdUnregisterFd(ki, ke->fd, TRUE); - - if (ioctl(ke->fd, EVIOCGRAB, 0) < 0) - perror("Ungrabbing evdev keyboard device failed"); - - free(ke); - ki->driverPrivate = 0; -} - -static void -EvdevKbdFini(KdKeyboardInfo * ki) -{ -} - -KdPointerDriver LinuxEvdevMouseDriver = { - "evdev", - EvdevPtrInit, - EvdevPtrEnable, - EvdevPtrDisable, - EvdevPtrFini, - NULL, -}; - -KdKeyboardDriver LinuxEvdevKeyboardDriver = { - "evdev", - EvdevKbdInit, - EvdevKbdEnable, - EvdevKbdLeds, - EvdevKbdBell, - EvdevKbdDisable, - EvdevKbdFini, - NULL, -}; diff --git a/xserver/hw/kdrive/linux/keyboard.c b/xserver/hw/kdrive/linux/keyboard.c deleted file mode 100644 index 5d31b7da3..000000000 --- a/xserver/hw/kdrive/linux/keyboard.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * XKB integration © 2006 Nokia Corporation, author: Tomas Frydrych - * - * LinuxKeyboardRead() XKB code based on xf86KbdLnx.c: - * Copyright © 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * Copyright © 1994-2001 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s) - * and author(s) 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 copyright holder(s) and author(s). - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" -#include -#include -#define XK_PUBLISHING -#include -#include -#include - -extern int LinuxConsoleFd; - -/* - * We need these to handle extended scancodes correctly (I could just use the - * numbers below, but this makes the code more readable - */ - -/* The prefix codes */ -#define KEY_Prefix0 /* special 0x60 */ 96 -#define KEY_Prefix1 /* special 0x61 */ 97 - -/* The raw scancodes */ -#define KEY_Enter /* Enter 0x1c */ 28 -#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29 -#define KEY_Slash /* / (Slash) ? 0x35 */ 53 -#define KEY_KP_Multiply /* * 0x37 */ 55 -#define KEY_Alt /* Alt(left) 0x38 */ 56 -#define KEY_F3 /* F3 0x3d */ 61 -#define KEY_F4 /* F4 0x3e */ 62 -#define KEY_F5 /* F5 0x3f */ 63 -#define KEY_F6 /* F6 0x40 */ 64 -#define KEY_F7 /* F7 0x41 */ 65 -#define KEY_ScrollLock /* ScrollLock 0x46 */ 70 -#define KEY_KP_7 /* 7 Home 0x47 */ 71 -#define KEY_KP_8 /* 8 Up 0x48 */ 72 -#define KEY_KP_9 /* 9 PgUp 0x49 */ 73 -#define KEY_KP_Minus /* - (Minus) 0x4a */ 74 -#define KEY_KP_4 /* 4 Left 0x4b */ 75 -#define KEY_KP_5 /* 5 0x4c */ 76 -#define KEY_KP_6 /* 6 Right 0x4d */ 77 -#define KEY_KP_Plus /* + (Plus) 0x4e */ 78 -#define KEY_KP_1 /* 1 End 0x4f */ 79 -#define KEY_KP_2 /* 2 Down 0x50 */ 80 -#define KEY_KP_3 /* 3 PgDown 0x51 */ 81 -#define KEY_KP_0 /* 0 Insert 0x52 */ 82 -#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83 -#define KEY_Home /* Home 0x59 */ 89 -#define KEY_Up /* Up 0x5a */ 90 -#define KEY_PgUp /* PgUp 0x5b */ 91 -#define KEY_Left /* Left 0x5c */ 92 -#define KEY_Begin /* Begin 0x5d */ 93 -#define KEY_Right /* Right 0x5e */ 94 -#define KEY_End /* End 0x5f */ 95 -#define KEY_Down /* Down 0x60 */ 96 -#define KEY_PgDown /* PgDown 0x61 */ 97 -#define KEY_Insert /* Insert 0x62 */ 98 -#define KEY_Delete /* Delete 0x63 */ 99 -#define KEY_KP_Enter /* Enter 0x64 */ 100 -#define KEY_RCtrl /* Ctrl(right) 0x65 */ 101 -#define KEY_Pause /* Pause 0x66 */ 102 -#define KEY_Print /* Print 0x67 */ 103 -#define KEY_KP_Divide /* Divide 0x68 */ 104 -#define KEY_AltLang /* AtlLang(right) 0x69 */ 105 -#define KEY_Break /* Break 0x6a */ 106 -#define KEY_LMeta /* Left Meta 0x6b */ 107 -#define KEY_RMeta /* Right Meta 0x6c */ 108 -#define KEY_Menu /* Menu 0x6d */ 109 -#define KEY_F13 /* F13 0x6e */ 110 -#define KEY_F14 /* F14 0x6f */ 111 -#define KEY_F15 /* F15 0x70 */ 112 -#define KEY_F16 /* F16 0x71 */ 113 -#define KEY_F17 /* F17 0x72 */ 114 -#define KEY_KP_DEC /* KP_DEC 0x73 */ 115 - -static void -LinuxKeyboardRead(int fd, void *closure) -{ - unsigned char buf[256], *b; - int n; - unsigned char prefix = 0, scancode = 0; - - while ((n = read(fd, buf, sizeof(buf))) > 0) { - b = buf; - while (n--) { - /* - * With xkb we use RAW mode for reading the console, which allows us - * process extended scancodes. - * - * See if this is a prefix extending the following keycode - */ - if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0)) { - prefix = KEY_Prefix0; - /* swallow this up */ - b++; - continue; - } - else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1)) { - prefix = KEY_Prefix1; - /* swallow this up */ - b++; - continue; - } - scancode = b[0] & 0x7f; - - switch (prefix) { - /* from xf86Events.c */ - case KEY_Prefix0: - { - switch (scancode) { - case KEY_KP_7: - scancode = KEY_Home; - break; /* curs home */ - case KEY_KP_8: - scancode = KEY_Up; - break; /* curs up */ - case KEY_KP_9: - scancode = KEY_PgUp; - break; /* curs pgup */ - case KEY_KP_4: - scancode = KEY_Left; - break; /* curs left */ - case KEY_KP_5: - scancode = KEY_Begin; - break; /* curs begin */ - case KEY_KP_6: - scancode = KEY_Right; - break; /* curs right */ - case KEY_KP_1: - scancode = KEY_End; - break; /* curs end */ - case KEY_KP_2: - scancode = KEY_Down; - break; /* curs down */ - case KEY_KP_3: - scancode = KEY_PgDown; - break; /* curs pgdown */ - case KEY_KP_0: - scancode = KEY_Insert; - break; /* curs insert */ - case KEY_KP_Decimal: - scancode = KEY_Delete; - break; /* curs delete */ - case KEY_Enter: - scancode = KEY_KP_Enter; - break; /* keypad enter */ - case KEY_LCtrl: - scancode = KEY_RCtrl; - break; /* right ctrl */ - case KEY_KP_Multiply: - scancode = KEY_Print; - break; /* print */ - case KEY_Slash: - scancode = KEY_KP_Divide; - break; /* keyp divide */ - case KEY_Alt: - scancode = KEY_AltLang; - break; /* right alt */ - case KEY_ScrollLock: - scancode = KEY_Break; - break; /* curs break */ - case 0x5b: - scancode = KEY_LMeta; - break; - case 0x5c: - scancode = KEY_RMeta; - break; - case 0x5d: - scancode = KEY_Menu; - break; - case KEY_F3: - scancode = KEY_F13; - break; - case KEY_F4: - scancode = KEY_F14; - break; - case KEY_F5: - scancode = KEY_F15; - break; - case KEY_F6: - scancode = KEY_F16; - break; - case KEY_F7: - scancode = KEY_F17; - break; - case KEY_KP_Plus: - scancode = KEY_KP_DEC; - break; - /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */ - case 0x2A: - case 0x36: - b++; - prefix = 0; - continue; - default: - /* - * "Internet" keyboards are generating lots of new - * codes. Let them pass. There is little consistency - * between them, so don't bother with symbolic names at - * this level. - */ - scancode += 0x78; - } - break; - } - - case KEY_Prefix1: - { - /* we do no handle these */ - b++; - prefix = 0; - continue; - } - - default: /* should not happen */ - case 0: /* do nothing */ - ; - } - - prefix = 0; - KdEnqueueKeyboardEvent(closure, scancode, b[0] & 0x80); - b++; - } - } -} - -static int LinuxKbdTrans; -static struct termios LinuxTermios; - -static Status -LinuxKeyboardEnable(KdKeyboardInfo * ki) -{ - struct termios nTty; - unsigned char buf[256]; - int n; - int fd; - - if (!ki) - return !Success; - - fd = LinuxConsoleFd; - ki->driverPrivate = (void *) (intptr_t) fd; - - ioctl(fd, KDGKBMODE, &LinuxKbdTrans); - tcgetattr(fd, &LinuxTermios); - ioctl(fd, KDSKBMODE, K_RAW); - nTty = LinuxTermios; - nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); - nTty.c_oflag = 0; - nTty.c_cflag = CREAD | CS8; - nTty.c_lflag = 0; - nTty.c_cc[VTIME] = 0; - nTty.c_cc[VMIN] = 1; - cfsetispeed(&nTty, 9600); - cfsetospeed(&nTty, 9600); - tcsetattr(fd, TCSANOW, &nTty); - /* - * Flush any pending keystrokes - */ - while ((n = read(fd, buf, sizeof(buf))) > 0); - KdRegisterFd(fd, LinuxKeyboardRead, ki); - return Success; -} - -static void -LinuxKeyboardDisable(KdKeyboardInfo * ki) -{ - int fd; - - if (!ki) - return; - - fd = (int) (intptr_t) ki->driverPrivate; - - KdUnregisterFd(ki, fd, FALSE); - ioctl(fd, KDSKBMODE, LinuxKbdTrans); - tcsetattr(fd, TCSANOW, &LinuxTermios); -} - -static Status -LinuxKeyboardInit(KdKeyboardInfo * ki) -{ - if (!ki) - return !Success; - - free(ki->path); - ki->path = strdup("console"); - free(ki->name); - ki->name = strdup("Linux console keyboard"); - - return Success; -} - -static void -LinuxKeyboardLeds(KdKeyboardInfo * ki, int leds) -{ - if (!ki) - return; - - ioctl((int) (intptr_t) ki->driverPrivate, KDSETLED, leds & 7); -} - -KdKeyboardDriver LinuxKeyboardDriver = { - "keyboard", - .Init = LinuxKeyboardInit, - .Enable = LinuxKeyboardEnable, - .Leds = LinuxKeyboardLeds, - .Disable = LinuxKeyboardDisable, -}; diff --git a/xserver/hw/kdrive/linux/linux.c b/xserver/hw/kdrive/linux/linux.c deleted file mode 100644 index 56c2cb79c..000000000 --- a/xserver/hw/kdrive/linux/linux.c +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" -#include -#include -#include -#include -#include -#include -#include - -#ifdef KDRIVE_MOUSE -extern KdPointerDriver LinuxMouseDriver; -extern KdPointerDriver Ps2MouseDriver; -extern KdPointerDriver MsMouseDriver; -#endif -#ifdef TSLIB -extern KdPointerDriver TsDriver; -#endif -#ifdef KDRIVE_EVDEV -extern KdPointerDriver LinuxEvdevMouseDriver; -extern KdKeyboardDriver LinuxEvdevKeyboardDriver; -#endif -#ifdef KDRIVE_KBD -extern KdKeyboardDriver LinuxKeyboardDriver; -#endif - -static int vtno; -int LinuxConsoleFd; -int LinuxApmFd = -1; -static int activeVT; -static Bool enabled; - -static void -LinuxVTRequest(int sig) -{ - kdSwitchPending = TRUE; -} - -/* Check before chowning -- this avoids touching the file system */ -static void -LinuxCheckChown(const char *file) -{ - struct stat st; - __uid_t u; - __gid_t g; - int r; - - if (stat(file, &st) < 0) - return; - u = getuid(); - g = getgid(); - if (st.st_uid != u || st.st_gid != g) { - r = chown(file, u, g); - (void) r; - } -} - -static int -LinuxInit(void) -{ - int fd = -1; - char vtname[11]; - struct vt_stat vts; - - LinuxConsoleFd = -1; - /* check if we're run with euid==0 */ - if (geteuid() != 0) { - FatalError("LinuxInit: Server must be suid root\n"); - } - - if (kdVirtualTerminal >= 0) - vtno = kdVirtualTerminal; - else { - if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { - FatalError("LinuxInit: Cannot open /dev/tty0 (%s)\n", - strerror(errno)); - } - if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) { - FatalError("xf86OpenConsole: Cannot find a free VT\n"); - } - close(fd); - } - - snprintf(vtname, sizeof(vtname), "/dev/tty%d", vtno); /* /dev/tty1-64 */ - - if ((LinuxConsoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) < 0) { - FatalError("LinuxInit: Cannot open %s (%s)\n", vtname, strerror(errno)); - } - - /* change ownership of the vt */ - LinuxCheckChown(vtname); - - /* - * the current VT device we're running on is not "console", we want - * to grab all consoles too - * - * Why is this needed? - */ - LinuxCheckChown("/dev/tty0"); - /* - * Linux doesn't switch to an active vt after the last close of a vt, - * so we do this ourselves by remembering which is active now. - */ - memset(&vts, '\0', sizeof(vts)); /* valgrind */ - if (ioctl(LinuxConsoleFd, VT_GETSTATE, &vts) == 0) { - activeVT = vts.v_active; - } - - return 1; -} - -static void -LinuxSetSwitchMode(int mode) -{ - struct sigaction act; - struct vt_mode VT; - - if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0) { - FatalError("LinuxInit: VT_GETMODE failed\n"); - } - - if (mode == VT_PROCESS) { - act.sa_handler = LinuxVTRequest; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - sigaction(SIGUSR1, &act, 0); - - VT.mode = mode; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - } - else { - act.sa_handler = SIG_IGN; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - sigaction(SIGUSR1, &act, 0); - - VT.mode = mode; - VT.relsig = 0; - VT.acqsig = 0; - } - if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) { - FatalError("LinuxInit: VT_SETMODE failed\n"); - } -} - -static Bool LinuxApmRunning; - -static void -LinuxApmNotify(int fd, int mask, void *blockData) -{ - apm_event_t event; - Bool running = LinuxApmRunning; - int cmd = APM_IOC_SUSPEND; - - while (read(fd, &event, sizeof(event)) == sizeof(event)) { - switch (event) { - case APM_SYS_STANDBY: - case APM_USER_STANDBY: - running = FALSE; - cmd = APM_IOC_STANDBY; - break; - case APM_SYS_SUSPEND: - case APM_USER_SUSPEND: - case APM_CRITICAL_SUSPEND: - running = FALSE; - cmd = APM_IOC_SUSPEND; - break; - case APM_NORMAL_RESUME: - case APM_CRITICAL_RESUME: - case APM_STANDBY_RESUME: - running = TRUE; - break; - } - } - if (running && !LinuxApmRunning) { - KdResume(); - LinuxApmRunning = TRUE; - } - else if (!running && LinuxApmRunning) { - KdSuspend(); - LinuxApmRunning = FALSE; - ioctl(fd, cmd, 0); - } -} - -#ifdef FNONBLOCK -#define NOBLOCK FNONBLOCK -#else -#define NOBLOCK FNDELAY -#endif - -static void -LinuxEnable(void) -{ - if (enabled) - return; - if (kdSwitchPending) { - kdSwitchPending = FALSE; - ioctl(LinuxConsoleFd, VT_RELDISP, VT_ACKACQ); - } - /* - * Open the APM driver - */ - LinuxApmFd = open("/dev/apm_bios", 2); - if (LinuxApmFd < 0 && errno == ENOENT) - LinuxApmFd = open("/dev/misc/apm_bios", 2); - if (LinuxApmFd >= 0) { - LinuxApmRunning = TRUE; - fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); - SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL); - } - - /* - * now get the VT - */ - LinuxSetSwitchMode(VT_AUTO); - if (ioctl(LinuxConsoleFd, VT_ACTIVATE, vtno) != 0) { - FatalError("LinuxInit: VT_ACTIVATE failed\n"); - } - if (ioctl(LinuxConsoleFd, VT_WAITACTIVE, vtno) != 0) { - FatalError("LinuxInit: VT_WAITACTIVE failed\n"); - } - LinuxSetSwitchMode(VT_PROCESS); - if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) { - FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n"); - } - enabled = TRUE; -} - -static void -LinuxDisable(void) -{ - ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ - if (kdSwitchPending) { - kdSwitchPending = FALSE; - ioctl(LinuxConsoleFd, VT_RELDISP, 1); - } - enabled = FALSE; - if (LinuxApmFd >= 0) { - RemoveNotifyFd(LinuxApmFd); - close(LinuxApmFd); - LinuxApmFd = -1; - } -} - -static void -LinuxFini(void) -{ - struct vt_mode VT; - struct vt_stat vts; - int fd; - - if (LinuxConsoleFd < 0) - return; - - if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) != -1) { - VT.mode = VT_AUTO; - ioctl(LinuxConsoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ - } - memset(&vts, '\0', sizeof(vts)); /* valgrind */ - ioctl(LinuxConsoleFd, VT_GETSTATE, &vts); - if (vtno == vts.v_active) { - /* - * Find a legal VT to switch to, either the one we started from - * or the lowest active one that isn't ours - */ - if (activeVT < 0 || - activeVT == vts.v_active || !(vts.v_state & (1 << activeVT))) { - for (activeVT = 1; activeVT < 16; activeVT++) - if (activeVT != vtno && (vts.v_state & (1 << activeVT))) - break; - if (activeVT == 16) - activeVT = -1; - } - /* - * Perform a switch back to the active VT when we were started - */ - if (activeVT >= -1) { - ioctl(LinuxConsoleFd, VT_ACTIVATE, activeVT); - ioctl(LinuxConsoleFd, VT_WAITACTIVE, activeVT); - activeVT = -1; - } - } - close(LinuxConsoleFd); /* make the vt-manager happy */ - LinuxConsoleFd = -1; - fd = open("/dev/tty0", O_RDWR | O_NDELAY, 0); - if (fd >= 0) { - memset(&vts, '\0', sizeof(vts)); /* valgrind */ - ioctl(fd, VT_GETSTATE, &vts); - if (ioctl(fd, VT_DISALLOCATE, vtno) < 0) - fprintf(stderr, "Can't deallocate console %d %s\n", vtno, - strerror(errno)); - close(fd); - } - return; -} - -void -KdOsAddInputDrivers(void) -{ -#ifdef KDRIVE_MOUSE - KdAddPointerDriver(&LinuxMouseDriver); - KdAddPointerDriver(&MsMouseDriver); - KdAddPointerDriver(&Ps2MouseDriver); -#endif -#ifdef TSLIB - KdAddPointerDriver(&TsDriver); -#endif -#ifdef KDRIVE_EVDEV - KdAddPointerDriver(&LinuxEvdevMouseDriver); - KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); -#endif -#ifdef KDRIVE_KBD - KdAddKeyboardDriver(&LinuxKeyboardDriver); -#endif -} - -static void -LinuxBell(int volume, int pitch, int duration) -{ - if (volume && pitch) - ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | - (((unsigned long) duration * volume / 50) << 16)); -} - -KdOsFuncs LinuxFuncs = { - .Init = LinuxInit, - .Enable = LinuxEnable, - .Disable = LinuxDisable, - .Fini = LinuxFini, - .Bell = LinuxBell, -}; - -void -OsVendorInit(void) -{ - KdOsInit(&LinuxFuncs); -} diff --git a/xserver/hw/kdrive/linux/mouse.c b/xserver/hw/kdrive/linux/mouse.c deleted file mode 100644 index 6bdd28651..000000000 --- a/xserver/hw/kdrive/linux/mouse.c +++ /dev/null @@ -1,982 +0,0 @@ -/* - * Copyright © 2001 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -#undef DEBUG -#undef DEBUG_BYTES -#define KBUFIO_SIZE 256 -#define MOUSE_TIMEOUT 100 - -typedef struct _kbufio { - int fd; - unsigned char buf[KBUFIO_SIZE]; - int avail; - int used; -} Kbufio; - -static Bool -MouseWaitForReadable(int fd, int timeout) -{ - struct pollfd poll_fd; - int n; - CARD32 done; - - done = GetTimeInMillis() + timeout; - poll_fd.fd = fd; - poll_fd.events = POLLIN; - for (;;) { - n = xserver_poll(&poll_fd, 1, timeout); - if (n > 0) - return TRUE; - if (n < 0 && (errno == EAGAIN || errno == EINTR)) { - timeout = (int) (done - GetTimeInMillis()); - if (timeout > 0) - continue; - } - break; - } - return FALSE; -} - -static int -MouseReadByte(Kbufio * b, int timeout) -{ - int n; - - if (b->avail <= b->used) { - if (timeout && !MouseWaitForReadable(b->fd, timeout)) { -#ifdef DEBUG_BYTES - ErrorF("\tTimeout %d\n", timeout); -#endif - return -1; - } - n = read(b->fd, b->buf, KBUFIO_SIZE); - if (n <= 0) - return -1; - b->avail = n; - b->used = 0; - } -#ifdef DEBUG_BYTES - ErrorF("\tget %02x\n", b->buf[b->used]); -#endif - return b->buf[b->used++]; -} - -#if NOTUSED -static int -MouseFlush(Kbufio * b, char *buf, int size) -{ - CARD32 now = GetTimeInMillis(); - CARD32 done = now + 100; - int c; - int n = 0; - - while ((c = MouseReadByte(b, done - now)) != -1) { - if (buf) { - if (n == size) { - memmove(buf, buf + 1, size - 1); - n--; - } - buf[n++] = c; - } - now = GetTimeInMillis(); - if ((INT32) (now - done) >= 0) - break; - } - return n; -} - -static int -MousePeekByte(Kbufio * b, int timeout) -{ - int c; - - c = MouseReadByte(b, timeout); - if (c != -1) - --b->used; - return c; -} -#endif /* NOTUSED */ - -static Bool -MouseWaitForWritable(int fd, int timeout) -{ - struct pollfd poll_fd; - int n; - - poll_fd.fd = fd; - poll_fd.events = POLLOUT; - n = xserver_poll(&poll_fd, 1, timeout); - if (n > 0) - return TRUE; - return FALSE; -} - -static Bool -MouseWriteByte(int fd, unsigned char c, int timeout) -{ - int ret; - -#ifdef DEBUG_BYTES - ErrorF("\tput %02x\n", c); -#endif - for (;;) { - ret = write(fd, &c, 1); - if (ret == 1) - return TRUE; - if (ret == 0) - return FALSE; - if (errno != EWOULDBLOCK) - return FALSE; - if (!MouseWaitForWritable(fd, timeout)) - return FALSE; - } -} - -static Bool -MouseWriteBytes(int fd, unsigned char *c, int n, int timeout) -{ - while (n--) - if (!MouseWriteByte(fd, *c++, timeout)) - return FALSE; - return TRUE; -} - -#define MAX_MOUSE 10 /* maximum length of mouse protocol */ -#define MAX_SKIP 16 /* number of error bytes before switching */ -#define MAX_VALID 4 /* number of valid packets before accepting */ - -typedef struct _kmouseProt { - const char *name; - Bool (*Complete) (KdPointerInfo * pi, unsigned char *ev, int ne); - int (*Valid) (KdPointerInfo * pi, unsigned char *ev, int ne); - Bool (*Parse) (KdPointerInfo * pi, unsigned char *ev, int ne); - Bool (*Init) (KdPointerInfo * pi); - unsigned char headerMask, headerValid; - unsigned char dataMask, dataValid; - Bool tty; - unsigned int c_iflag; - unsigned int c_oflag; - unsigned int c_lflag; - unsigned int c_cflag; - unsigned int speed; - unsigned char *init; - unsigned long state; -} KmouseProt; - -typedef enum _kmouseStage { - MouseBroken, MouseTesting, MouseWorking -} KmouseStage; - -typedef struct _kmouse { - Kbufio iob; - const KmouseProt *prot; - int i_prot; - KmouseStage stage; /* protocol verification stage */ - Bool tty; /* mouse device is a tty */ - int valid; /* sequential valid events */ - int tested; /* bytes scanned during Testing phase */ - int invalid; /* total invalid bytes for this protocol */ - unsigned long state; /* private per protocol, init to prot->state */ -} Kmouse; - -static int -mouseValid(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - const KmouseProt *prot = km->prot; - int i; - - for (i = 0; i < ne; i++) - if ((ev[i] & prot->headerMask) == prot->headerValid) - break; - if (i != 0) - return i; - for (i = 1; i < ne; i++) - if ((ev[i] & prot->dataMask) != prot->dataValid) - return -1; - return 0; -} - -static Bool -threeComplete(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - return ne == 3; -} - -static Bool -fourComplete(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - return ne == 4; -} - -static Bool -fiveComplete(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - return ne == 5; -} - -static Bool -MouseReasonable(KdPointerInfo * pi, unsigned long flags, int dx, int dy) -{ - Kmouse *km = pi->driverPrivate; - - if (km->stage == MouseWorking) - return TRUE; - if (dx < -50 || dx > 50) { -#ifdef DEBUG - ErrorF("Large X %d\n", dx); -#endif - return FALSE; - } - if (dy < -50 || dy > 50) { -#ifdef DEBUG - ErrorF("Large Y %d\n", dy); -#endif - return FALSE; - } - return TRUE; -} - -/* - * Standard PS/2 mouse protocol - */ -static Bool -ps2Parse(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - int dx, dy, dz; - unsigned long flags; - unsigned long flagsrelease = 0; - - flags = KD_MOUSE_DELTA; - if (ev[0] & 4) - flags |= KD_BUTTON_2; - if (ev[0] & 2) - flags |= KD_BUTTON_3; - if (ev[0] & 1) - flags |= KD_BUTTON_1; - - if (ne > 3) { - dz = (int) (signed char) ev[3]; - if (dz < 0) { - flags |= KD_BUTTON_4; - flagsrelease = KD_BUTTON_4; - } - else if (dz > 0) { - flags |= KD_BUTTON_5; - flagsrelease = KD_BUTTON_5; - } - } - - dx = ev[1]; - if (ev[0] & 0x10) - dx -= 256; - dy = ev[2]; - if (ev[0] & 0x20) - dy -= 256; - dy = -dy; - if (!MouseReasonable(pi, flags, dx, dy)) - return FALSE; - if (km->stage == MouseWorking) { - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - if (flagsrelease) { - flags &= ~flagsrelease; - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - } - } - return TRUE; -} - -static Bool ps2Init(KdPointerInfo * pi); - -static const KmouseProt ps2Prot = { - "ps/2", - threeComplete, mouseValid, ps2Parse, ps2Init, - 0x08, 0x08, 0x00, 0x00, - FALSE -}; - -static const KmouseProt imps2Prot = { - "imps/2", - fourComplete, mouseValid, ps2Parse, ps2Init, - 0x08, 0x08, 0x00, 0x00, - FALSE -}; - -static const KmouseProt exps2Prot = { - "exps/2", - fourComplete, mouseValid, ps2Parse, ps2Init, - 0x08, 0x08, 0x00, 0x00, - FALSE -}; - -/* - * Once the mouse is known to speak ps/2 protocol, go and find out - * what advanced capabilities it has and turn them on - */ - -/* these extracted from FreeBSD 4.3 sys/dev/kbd/atkbdcreg.h */ - -/* aux device commands (sent to KBD_DATA_PORT) */ -#define PSMC_SET_SCALING11 0x00e6 -#define PSMC_SET_SCALING21 0x00e7 -#define PSMC_SET_RESOLUTION 0x00e8 -#define PSMC_SEND_DEV_STATUS 0x00e9 -#define PSMC_SET_STREAM_MODE 0x00ea -#define PSMC_SEND_DEV_DATA 0x00eb -#define PSMC_SET_REMOTE_MODE 0x00f0 -#define PSMC_SEND_DEV_ID 0x00f2 -#define PSMC_SET_SAMPLING_RATE 0x00f3 -#define PSMC_ENABLE_DEV 0x00f4 -#define PSMC_DISABLE_DEV 0x00f5 -#define PSMC_SET_DEFAULTS 0x00f6 -#define PSMC_RESET_DEV 0x00ff - -/* PSMC_SET_RESOLUTION argument */ -#define PSMD_RES_LOW 0 /* typically 25ppi */ -#define PSMD_RES_MEDIUM_LOW 1 /* typically 50ppi */ -#define PSMD_RES_MEDIUM_HIGH 2 /* typically 100ppi (default) */ -#define PSMD_RES_HIGH 3 /* typically 200ppi */ -#define PSMD_MAX_RESOLUTION PSMD_RES_HIGH - -/* PSMC_SET_SAMPLING_RATE */ -#define PSMD_MAX_RATE 255 /* FIXME: not sure if it's possible */ - -/* aux device ID */ -#define PSM_MOUSE_ID 0 -#define PSM_BALLPOINT_ID 2 -#define PSM_INTELLI_ID 3 -#define PSM_EXPLORER_ID 4 -#define PSM_4DMOUSE_ID 6 -#define PSM_4DPLUS_ID 8 - -static unsigned char ps2_init[] = { - PSMC_ENABLE_DEV, - 0, -}; - -#define NINIT_PS2 1 - -static unsigned char wheel_3button_init[] = { - PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 100, - PSMC_SET_SAMPLING_RATE, 80, - PSMC_SEND_DEV_ID, - 0, -}; - -#define NINIT_IMPS2 4 - -static unsigned char wheel_5button_init[] = { - PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 100, - PSMC_SET_SAMPLING_RATE, 80, - PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 80, - PSMC_SEND_DEV_ID, - 0 -}; - -#define NINIT_EXPS2 7 - -static unsigned char intelli_init[] = { - PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 100, - PSMC_SET_SAMPLING_RATE, 80, - 0 -}; - -#define NINIT_INTELLI 3 - -static int -ps2SkipInit(KdPointerInfo * pi, int ninit, Bool ret_next) -{ - Kmouse *km = pi->driverPrivate; - int c = -1; - Bool waiting; - - waiting = FALSE; - while (ninit || ret_next) { - c = MouseReadByte(&km->iob, MOUSE_TIMEOUT); - if (c == -1) - break; - /* look for ACK */ - if (c == 0xfa) { - ninit--; - if (ret_next) - waiting = TRUE; - } - /* look for packet start -- not the response */ - else if ((c & 0x08) == 0x08) - waiting = FALSE; - else if (waiting) - break; - } - return c; -} - -static Bool -ps2Init(KdPointerInfo * pi) -{ - Kmouse *km = pi->driverPrivate; - int id; - unsigned char *init; - int ninit; - - /* Send Intellimouse initialization sequence */ - MouseWriteBytes(km->iob.fd, intelli_init, strlen((char *) intelli_init), - 100); - /* - * Send ID command - */ - if (!MouseWriteByte(km->iob.fd, PSMC_SEND_DEV_ID, 100)) - return FALSE; - id = ps2SkipInit(pi, 0, TRUE); - switch (id) { - case 3: - init = wheel_3button_init; - ninit = NINIT_IMPS2; - km->prot = &imps2Prot; - break; - case 4: - init = wheel_5button_init; - ninit = NINIT_EXPS2; - km->prot = &exps2Prot; - break; - default: - init = ps2_init; - ninit = NINIT_PS2; - km->prot = &ps2Prot; - break; - } - if (init) - MouseWriteBytes(km->iob.fd, init, strlen((char *) init), 100); - /* - * Flush out the available data to eliminate responses to the - * initialization string. Make sure any partial event is - * skipped - */ - (void) ps2SkipInit(pi, ninit, FALSE); - return TRUE; -} - -static Bool -busParse(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - int dx, dy; - unsigned long flags; - - flags = KD_MOUSE_DELTA; - dx = (signed char) ev[1]; - dy = -(signed char) ev[2]; - if ((ev[0] & 4) == 0) - flags |= KD_BUTTON_1; - if ((ev[0] & 2) == 0) - flags |= KD_BUTTON_2; - if ((ev[0] & 1) == 0) - flags |= KD_BUTTON_3; - if (!MouseReasonable(pi, flags, dx, dy)) - return FALSE; - if (km->stage == MouseWorking) - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - return TRUE; -} - -static const KmouseProt busProt = { - "bus", - threeComplete, mouseValid, busParse, 0, - 0xf8, 0x00, 0x00, 0x00, - FALSE -}; - -/* - * Standard MS serial protocol, three bytes - */ - -static Bool -msParse(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - int dx, dy; - unsigned long flags; - - flags = KD_MOUSE_DELTA; - - if (ev[0] & 0x20) - flags |= KD_BUTTON_1; - if (ev[0] & 0x10) - flags |= KD_BUTTON_3; - - dx = (signed char) (((ev[0] & 0x03) << 6) | (ev[1] & 0x3F)); - dy = (signed char) (((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F)); - if (!MouseReasonable(pi, flags, dx, dy)) - return FALSE; - if (km->stage == MouseWorking) - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - return TRUE; -} - -static const KmouseProt msProt = { - "ms", - threeComplete, mouseValid, msParse, 0, - 0xc0, 0x40, 0xc0, 0x00, - TRUE, - IGNPAR, - 0, - 0, - CS7 | CSTOPB | CREAD | CLOCAL, - B1200, -}; - -/* - * Logitech mice send 3 or 4 bytes, the only way to tell is to look at the - * first byte of a synchronized protocol stream and see if it's got - * any bits turned on that can't occur in that fourth byte - */ -static Bool -logiComplete(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - - if ((ev[0] & 0x40) == 0x40) - return ne == 3; - if (km->stage != MouseBroken && (ev[0] & ~0x23) == 0) - return ne == 1; - return FALSE; -} - -static int -logiValid(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - const KmouseProt *prot = km->prot; - int i; - - for (i = 0; i < ne; i++) { - if ((ev[i] & 0x40) == 0x40) - break; - if (km->stage != MouseBroken && (ev[i] & ~0x23) == 0) - break; - } - if (i != 0) - return i; - for (i = 1; i < ne; i++) - if ((ev[i] & prot->dataMask) != prot->dataValid) - return -1; - return 0; -} - -static Bool -logiParse(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - int dx, dy; - unsigned long flags; - - flags = KD_MOUSE_DELTA; - - if (ne == 3) { - if (ev[0] & 0x20) - flags |= KD_BUTTON_1; - if (ev[0] & 0x10) - flags |= KD_BUTTON_3; - - dx = (signed char) (((ev[0] & 0x03) << 6) | (ev[1] & 0x3F)); - dy = (signed char) (((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F)); - flags |= km->state & KD_BUTTON_2; - } - else { - if (ev[0] & 0x20) - flags |= KD_BUTTON_2; - dx = 0; - dy = 0; - flags |= km->state & (KD_BUTTON_1 | KD_BUTTON_3); - } - - if (!MouseReasonable(pi, flags, dx, dy)) - return FALSE; - if (km->stage == MouseWorking) - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - return TRUE; -} - -static const KmouseProt logiProt = { - "logitech", - logiComplete, logiValid, logiParse, 0, - 0xc0, 0x40, 0xc0, 0x00, - TRUE, - IGNPAR, - 0, - 0, - CS7 | CSTOPB | CREAD | CLOCAL, - B1200, -}; - -/* - * Mouse systems protocol, 5 bytes - */ -static Bool -mscParse(KdPointerInfo * pi, unsigned char *ev, int ne) -{ - Kmouse *km = pi->driverPrivate; - int dx, dy; - unsigned long flags; - - flags = KD_MOUSE_DELTA; - - if (!(ev[0] & 0x4)) - flags |= KD_BUTTON_1; - if (!(ev[0] & 0x2)) - flags |= KD_BUTTON_2; - if (!(ev[0] & 0x1)) - flags |= KD_BUTTON_3; - dx = (signed char) (ev[1]) + (signed char) (ev[3]); - dy = -((signed char) (ev[2]) + (signed char) (ev[4])); - - if (!MouseReasonable(pi, flags, dx, dy)) - return FALSE; - if (km->stage == MouseWorking) - KdEnqueuePointerEvent(pi, flags, dx, dy, 0); - return TRUE; -} - -static const KmouseProt mscProt = { - "msc", - fiveComplete, mouseValid, mscParse, 0, - 0xf8, 0x80, 0x00, 0x00, - TRUE, - IGNPAR, - 0, - 0, - CS8 | CSTOPB | CREAD | CLOCAL, - B1200, -}; - -/* - * Use logitech before ms -- they're the same except that - * logitech sometimes has a fourth byte - */ -static const KmouseProt *kmouseProts[] = { - &ps2Prot, &imps2Prot, &exps2Prot, &busProt, &logiProt, &msProt, &mscProt, -}; - -#define NUM_PROT (sizeof (kmouseProts) / sizeof (kmouseProts[0])) - -static void -MouseInitProtocol(Kmouse * km) -{ - int ret; - struct termios t; - - if (km->prot->tty) { - ret = tcgetattr(km->iob.fd, &t); - - if (ret >= 0) { - t.c_iflag = km->prot->c_iflag; - t.c_oflag = km->prot->c_oflag; - t.c_lflag = km->prot->c_lflag; - t.c_cflag = km->prot->c_cflag; - cfsetispeed(&t, km->prot->speed); - cfsetospeed(&t, km->prot->speed); - ret = tcsetattr(km->iob.fd, TCSANOW, &t); - } - } - km->stage = MouseBroken; - km->valid = 0; - km->tested = 0; - km->invalid = 0; - km->state = km->prot->state; -} - -static void -MouseFirstProtocol(Kmouse * km, const char *prot) -{ - if (prot) { - for (km->i_prot = 0; km->i_prot < NUM_PROT; km->i_prot++) - if (!strcmp(prot, kmouseProts[km->i_prot]->name)) - break; - if (km->i_prot == NUM_PROT) { - int i; - - ErrorF("Unknown mouse protocol \"%s\". Pick one of:", prot); - for (i = 0; i < NUM_PROT; i++) - ErrorF(" %s", kmouseProts[i]->name); - ErrorF("\n"); - } - else { - km->prot = kmouseProts[km->i_prot]; - if (km->tty && !km->prot->tty) - ErrorF - ("Mouse device is serial port, protocol %s is not serial protocol\n", - prot); - else if (!km->tty && km->prot->tty) - ErrorF - ("Mouse device is not serial port, protocol %s is serial protocol\n", - prot); - } - } - if (!km->prot) { - for (km->i_prot = 0; kmouseProts[km->i_prot]->tty != km->tty; - km->i_prot++); - km->prot = kmouseProts[km->i_prot]; - } - MouseInitProtocol(km); -} - -static void -MouseNextProtocol(Kmouse * km) -{ - do { - if (!km->prot) - km->i_prot = 0; - else if (++km->i_prot == NUM_PROT) - km->i_prot = 0; - km->prot = kmouseProts[km->i_prot]; - } while (km->prot->tty != km->tty); - MouseInitProtocol(km); - ErrorF("Switching to mouse protocol \"%s\"\n", km->prot->name); -} - -static void -MouseRead(int mousePort, void *closure) -{ - KdPointerInfo *pi = closure; - Kmouse *km = pi->driverPrivate; - unsigned char event[MAX_MOUSE]; - int ne; - int c; - int i; - int timeout; - - timeout = 0; - ne = 0; - for (;;) { - c = MouseReadByte(&km->iob, timeout); - if (c == -1) { - if (ne) { - km->invalid += ne + km->tested; - km->valid = 0; - km->tested = 0; - km->stage = MouseBroken; - } - break; - } - event[ne++] = c; - i = (*km->prot->Valid) (pi, event, ne); - if (i != 0) { -#ifdef DEBUG - ErrorF("Mouse protocol %s broken %d of %d bytes bad\n", - km->prot->name, i > 0 ? i : ne, ne); -#endif - if (i > 0 && i < ne) { - ne -= i; - memmove(event, event + i, ne); - } - else { - i = ne; - ne = 0; - } - km->invalid += i + km->tested; - km->valid = 0; - km->tested = 0; - if (km->stage == MouseWorking) - km->i_prot--; - km->stage = MouseBroken; - if (km->invalid > MAX_SKIP) { - MouseNextProtocol(km); - ne = 0; - } - timeout = 0; - } - else { - if ((*km->prot->Complete) (pi, event, ne)) { - if ((*km->prot->Parse) (pi, event, ne)) { - switch (km->stage) { - case MouseBroken: -#ifdef DEBUG - ErrorF("Mouse protocol %s seems OK\n", km->prot->name); -#endif - /* do not zero invalid to accumulate invalid bytes */ - km->valid = 0; - km->tested = 0; - km->stage = MouseTesting; - /* fall through ... */ - case MouseTesting: - km->valid++; - km->tested += ne; - if (km->valid > MAX_VALID) { -#ifdef DEBUG - ErrorF("Mouse protocol %s working\n", - km->prot->name); -#endif - km->stage = MouseWorking; - km->invalid = 0; - km->tested = 0; - km->valid = 0; - if (km->prot->Init && !(*km->prot->Init) (pi)) - km->stage = MouseBroken; - } - break; - case MouseWorking: - break; - } - } - else { - km->invalid += ne + km->tested; - km->valid = 0; - km->tested = 0; - km->stage = MouseBroken; - } - ne = 0; - timeout = 0; - } - else - timeout = MOUSE_TIMEOUT; - } - } -} - -int MouseInputType; - -const char *kdefaultMouse[] = { - "/dev/input/mice", - "/dev/mouse", - "/dev/psaux", - "/dev/adbmouse", - "/dev/ttyS0", - "/dev/ttyS1", -}; - -#define NUM_DEFAULT_MOUSE (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0])) - -static Status -MouseInit(KdPointerInfo * pi) -{ - int i; - int fd; - Kmouse *km; - - if (!pi) - return BadImplementation; - - if (!pi->path || strcmp(pi->path, "auto") == 0) { - for (i = 0; i < NUM_DEFAULT_MOUSE; i++) { - fd = open(kdefaultMouse[i], 2); - if (fd >= 0) { - pi->path = strdup(kdefaultMouse[i]); - break; - } - } - } - else { - fd = open(pi->path, 2); - } - - if (fd < 0) - return BadMatch; - - close(fd); - - km = (Kmouse *) malloc(sizeof(Kmouse)); - if (km) { - km->iob.avail = km->iob.used = 0; - MouseFirstProtocol(km, pi->protocol ? pi->protocol : "exps/2"); - /* MouseFirstProtocol sets state to MouseBroken for later protocol - * checks. Skip these checks if a protocol was supplied */ - if (pi->protocol) - km->state = MouseWorking; - km->i_prot = 0; - km->tty = isatty(fd); - km->iob.fd = -1; - pi->driverPrivate = km; - } - else { - close(fd); - return BadAlloc; - } - - return Success; -} - -static Status -MouseEnable(KdPointerInfo * pi) -{ - Kmouse *km; - - if (!pi || !pi->driverPrivate || !pi->path) - return BadImplementation; - - km = pi->driverPrivate; - - km->iob.fd = open(pi->path, 2); - if (km->iob.fd < 0) - return BadMatch; - - if (!KdRegisterFd(km->iob.fd, MouseRead, pi)) { - close(km->iob.fd); - return BadAlloc; - } - - return Success; -} - -static void -MouseDisable(KdPointerInfo * pi) -{ - Kmouse *km; - - if (!pi || !pi->driverPrivate) - return; - - km = pi->driverPrivate; - KdUnregisterFd(pi, km->iob.fd, TRUE); -} - -static void -MouseFini(KdPointerInfo * pi) -{ - free(pi->driverPrivate); - pi->driverPrivate = NULL; -} - -KdPointerDriver LinuxMouseDriver = { - "mouse", - MouseInit, - MouseEnable, - MouseDisable, - MouseFini, - NULL, -}; diff --git a/xserver/hw/kdrive/linux/ms.c b/xserver/hw/kdrive/linux/ms.c deleted file mode 100644 index 3934682ad..000000000 --- a/xserver/hw/kdrive/linux/ms.c +++ /dev/null @@ -1,175 +0,0 @@ -/* -Copyright (c) 2001 by Juliusz Chroboczek -Copyright (c) 1999 by Keith Packard - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -static int -MsReadBytes(int fd, char *buf, int len, int min) -{ - int n, tot; - struct pollfd poll_fd; - - poll_fd.fd = fd; - poll_fd.events = POLLIN; - tot = 0; - while (len) { - n = read(fd, buf, len); - if (n > 0) { - tot += n; - buf += n; - len -= n; - } - if (tot % min == 0) - break; - n = xserver_poll(&poll_fd, 1, 100); - if (n <= 0) - break; - } - return tot; -} - -static void -MsRead(int port, void *closure) -{ - unsigned char buf[3 * 200]; - unsigned char *b; - int n; - int dx, dy; - unsigned long flags; - - while ((n = MsReadBytes(port, (char *) buf, sizeof(buf), 3)) > 0) { - b = buf; - while (n >= 3) { - flags = KD_MOUSE_DELTA; - - if (b[0] & 0x20) - flags |= KD_BUTTON_1; - if (b[0] & 0x10) - flags |= KD_BUTTON_3; - - dx = (char) (((b[0] & 0x03) << 6) | (b[1] & 0x3F)); - dy = (char) (((b[0] & 0x0C) << 4) | (b[2] & 0x3F)); - n -= 3; - b += 3; - KdEnqueuePointerEvent(closure, flags, dx, dy, 0); - } - } -} - -static Status -MsInit(KdPointerInfo * pi) -{ - if (!pi) - return BadImplementation; - - if (!pi->path || strcmp(pi->path, "auto")) - pi->path = strdup("/dev/mouse"); - if (!pi->name) - pi->name = strdup("Microsoft protocol mouse"); - - return Success; -} - -static Status -MsEnable(KdPointerInfo * pi) -{ - int port; - struct termios t; - int ret; - - port = open(pi->path, O_RDWR | O_NONBLOCK); - if (port < 0) { - ErrorF("Couldn't open %s (%d)\n", pi->path, (int) errno); - return 0; - } - else if (port == 0) { - ErrorF("Opening %s returned 0! Please complain to Keith.\n", pi->path); - goto bail; - } - - if (!isatty(port)) { - ErrorF("%s is not a tty\n", pi->path); - goto bail; - } - - ret = tcgetattr(port, &t); - if (ret < 0) { - ErrorF("Couldn't tcgetattr(%s): %d\n", pi->path, errno); - goto bail; - } - t.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | - IGNCR | ICRNL | IXON | IXOFF); - t.c_oflag &= ~OPOST; - t.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - t.c_cflag &= ~(CSIZE | PARENB); - t.c_cflag |= CS8 | CLOCAL | CSTOPB; - - cfsetispeed(&t, B1200); - cfsetospeed(&t, B1200); - t.c_cc[VMIN] = 1; - t.c_cc[VTIME] = 0; - ret = tcsetattr(port, TCSANOW, &t); - if (ret < 0) { - ErrorF("Couldn't tcsetattr(%s): %d\n", pi->path, errno); - goto bail; - } - if (KdRegisterFd(port, MsRead, pi)) - return TRUE; - pi->driverPrivate = (void *) (intptr_t) port; - - return Success; - - bail: - close(port); - return BadMatch; -} - -static void -MsDisable(KdPointerInfo * pi) -{ - KdUnregisterFd(pi, (int) (intptr_t) pi->driverPrivate, TRUE); -} - -static void -MsFini(KdPointerInfo * pi) -{ -} - -KdPointerDriver MsMouseDriver = { - "ms", - MsInit, - MsEnable, - MsDisable, - MsFini, - NULL, -}; diff --git a/xserver/hw/kdrive/linux/ps2.c b/xserver/hw/kdrive/linux/ps2.c deleted file mode 100644 index 4fec02408..000000000 --- a/xserver/hw/kdrive/linux/ps2.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -static int -Ps2ReadBytes(int fd, char *buf, int len, int min) -{ - int n, tot; - struct pollfd poll_fd; - - tot = 0; - poll_fd.fd = fd; - poll_fd.events = POLLIN; - while (len) { - n = read(fd, buf, len); - if (n > 0) { - tot += n; - buf += n; - len -= n; - } - if (tot % min == 0) - break; - n = xserver_poll(&poll_fd, 1, 100); - if (n <= 0) - break; - } - return tot; -} - -const char *Ps2Names[] = { - "/dev/psaux", -/* "/dev/mouse", */ - "/dev/input/mice", -}; - -#define NUM_PS2_NAMES (sizeof (Ps2Names) / sizeof (Ps2Names[0])) - -static void -Ps2Read(int ps2Port, void *closure) -{ - unsigned char buf[3 * 200]; - unsigned char *b; - int n; - int dx, dy; - unsigned long flags; - unsigned long left_button = KD_BUTTON_1; - unsigned long right_button = KD_BUTTON_3; - -#undef SWAP_USB -#ifdef SWAP_USB - if (id == 2) { - left_button = KD_BUTTON_3; - right_button = KD_BUTTON_1; - } -#endif - while ((n = Ps2ReadBytes(ps2Port, (char *) buf, sizeof(buf), 3)) > 0) { - b = buf; - while (n >= 3) { - flags = KD_MOUSE_DELTA; - if (b[0] & 4) - flags |= KD_BUTTON_2; - if (b[0] & 2) - flags |= right_button; - if (b[0] & 1) - flags |= left_button; - - dx = b[1]; - if (b[0] & 0x10) - dx -= 256; - dy = b[2]; - if (b[0] & 0x20) - dy -= 256; - dy = -dy; - n -= 3; - b += 3; - KdEnqueuePointerEvent(closure, flags, dx, dy, 0); - } - } -} - -static Status -Ps2Init(KdPointerInfo * pi) -{ - int ps2Port, i; - - if (!pi->path) { - for (i = 0; i < NUM_PS2_NAMES; i++) { - ps2Port = open(Ps2Names[i], 0); - if (ps2Port >= 0) { - pi->path = strdup(Ps2Names[i]); - break; - } - } - } - else { - ps2Port = open(pi->path, 0); - } - - if (ps2Port < 0) - return BadMatch; - - close(ps2Port); - if (!pi->name) - pi->name = strdup("PS/2 Mouse"); - - return Success; -} - -static Status -Ps2Enable(KdPointerInfo * pi) -{ - int fd; - - if (!pi) - return BadImplementation; - - fd = open(pi->path, 0); - if (fd < 0) - return BadMatch; - - if (!KdRegisterFd(fd, Ps2Read, pi)) { - close(fd); - return BadAlloc; - } - - pi->driverPrivate = (void *) (intptr_t) fd; - - return Success; -} - -static void -Ps2Disable(KdPointerInfo * pi) -{ - KdUnregisterFd(pi, (int) (intptr_t) pi->driverPrivate, TRUE); -} - -static void -Ps2Fini(KdPointerInfo * pi) -{ -} - -KdPointerDriver Ps2MouseDriver = { - "ps2", - Ps2Init, - Ps2Enable, - Ps2Disable, - Ps2Fini, - NULL, -}; diff --git a/xserver/hw/kdrive/linux/tslib.c b/xserver/hw/kdrive/linux/tslib.c deleted file mode 100644 index 0cdb4ea7d..000000000 --- a/xserver/hw/kdrive/linux/tslib.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * TSLIB based touchscreen driver for KDrive - * Porting to new input API and event queueing by Daniel Stone. - * Derived from ts.c by Keith Packard - * Derived from ps2.c by Jim Gettys - * - * Copyright © 1999 Keith Packard - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 MontaVista Software Inc. - * Copyright © 2005 OpenedHand Ltd. - * Copyright © 2006 Nokia Corporation - * - * 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, and that the name of the authors and/or copyright holders - * not be used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. The authors and/or - * copyright holders make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * THE AUTHORS AND/OR COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE AUTHORS AND/OR COPYRIGHT HOLDERS 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. - */ - -#ifdef HAVE_KDRIVE_CONFIG_H -#include -#endif - -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" -#include -#include -#include -#include - -struct TslibPrivate { - int fd; - int lastx, lasty; - struct tsdev *tsDev; - void (*raw_event_hook) (int x, int y, int pressure, void *closure); - void *raw_event_closure; - int phys_screen; -}; - -static void -TsRead(int fd, void *closure) -{ - KdPointerInfo *pi = closure; - struct TslibPrivate *private = pi->driverPrivate; - struct ts_sample event; - long x = 0, y = 0; - unsigned long flags; - - if (private->raw_event_hook) { - while (ts_read_raw(private->tsDev, &event, 1) == 1) - private->raw_event_hook(event.x, event.y, event.pressure, - private->raw_event_closure); - return; - } - - while (ts_read(private->tsDev, &event, 1) == 1) { - if (event.pressure) { - flags = KD_BUTTON_1; - - /* - * Here we test for the touch screen driver actually being on the - * touch screen, if it is we send absolute coordinates. If not, - * then we send delta's so that we can track the entire vga screen. - */ - if (KdCurScreen == private->phys_screen) { - x = event.x; - y = event.y; - } - else { - flags |= KD_MOUSE_DELTA; - if ((private->lastx == 0) || (private->lasty == 0)) { - x = event.x; - y = event.y; - } - else { - x = event.x - private->lastx; - y = event.y - private->lasty; - } - } - private->lastx = event.x; - private->lasty = event.y; - } - else { - flags = 0; - x = private->lastx; - y = private->lasty; - } - - KdEnqueuePointerEvent(pi, flags, x, y, event.pressure); - } -} - -static Status -TslibEnable(KdPointerInfo * pi) -{ - struct TslibPrivate *private = pi->driverPrivate; - - private->raw_event_hook = NULL; - private->raw_event_closure = NULL; - if (!pi->path) { - pi->path = strdup("/dev/input/touchscreen0"); - ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", - pi->path); - } - - private->tsDev = ts_open(pi->path, 0); - if (!private->tsDev) { - ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path); - return BadAlloc; - } - - if (ts_config(private->tsDev)) { - ErrorF("[tslib/TslibEnable] failed to load configuration\n"); - ts_close(private->tsDev); - private->tsDev = NULL; - return BadValue; - } - - private->fd = ts_fd(private->tsDev); - - KdRegisterFd(private->fd, TsRead, pi); - - return Success; -} - -static void -TslibDisable(KdPointerInfo * pi) -{ - struct TslibPrivate *private = pi->driverPrivate; - - if (private->fd) - KdUnregisterFd(pi, private->fd, TRUE); - - if (private->tsDev) - ts_close(private->tsDev); - - private->fd = 0; - private->tsDev = NULL; -} - -static Status -TslibInit(KdPointerInfo * pi) -{ - struct TslibPrivate *private = NULL; - - if (!pi || !pi->dixdev) - return !Success; - - pi->driverPrivate = (struct TslibPrivate *) - calloc(sizeof(struct TslibPrivate), 1); - if (!pi->driverPrivate) - return !Success; - - private = pi->driverPrivate; - /* hacktastic */ - private->phys_screen = 0; - pi->nAxes = 3; - pi->name = strdup("Touchscreen"); - pi->inputClass = KD_TOUCHSCREEN; - - return Success; -} - -static void -TslibFini(KdPointerInfo * pi) -{ - free(pi->driverPrivate); - pi->driverPrivate = NULL; -} - -KdPointerDriver TsDriver = { - "tslib", - TslibInit, - TslibEnable, - TslibDisable, - TslibFini, - NULL, -}; diff --git a/xserver/hw/kdrive/src/Makefile.am b/xserver/hw/kdrive/src/Makefile.am index b7f94b058..08331502f 100644 --- a/xserver/hw/kdrive/src/Makefile.am +++ b/xserver/hw/kdrive/src/Makefile.am @@ -19,7 +19,6 @@ libkdrive_la_SOURCES = \ kdrive.h \ kinfo.c \ kinput.c \ - kmode.c \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c diff --git a/xserver/hw/kdrive/src/Makefile.in b/xserver/hw/kdrive/src/Makefile.in index d679b82a8..1698d96fc 100644 --- a/xserver/hw/kdrive/src/Makefile.in +++ b/xserver/hw/kdrive/src/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -77,11 +77,11 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) @CONFIG_UDEV_TRUE@libkdrive_la_DEPENDENCIES = \ @CONFIG_UDEV_TRUE@ $(top_builddir)/config/libconfig.la am__libkdrive_la_SOURCES_DIST = fourcc.h kcmap.c kdrive.c kdrive.h \ - kinfo.c kinput.c kmode.c kshadow.c kxv.c kxv.h \ + kinfo.c kinput.c kshadow.c kxv.c kxv.h \ $(top_srcdir)/mi/miinitext.c @XV_TRUE@am__objects_1 = kxv.lo am_libkdrive_la_OBJECTS = kcmap.lo kdrive.lo kinfo.lo kinput.lo \ - kmode.lo kshadow.lo $(am__objects_1) miinitext.lo + kshadow.lo $(am__objects_1) miinitext.lo libkdrive_la_OBJECTS = $(am_libkdrive_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -314,6 +314,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -332,15 +333,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -348,6 +352,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -419,8 +425,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -502,7 +506,6 @@ libkdrive_la_SOURCES = \ kdrive.h \ kinfo.c \ kinput.c \ - kmode.c \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c @@ -567,7 +570,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kdrive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kinput.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kshadow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kxv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@ diff --git a/xserver/hw/kdrive/src/kcmap.c b/xserver/hw/kdrive/src/kcmap.c index 0970064f6..b8697ca63 100644 --- a/xserver/hw/kdrive/src/kcmap.c +++ b/xserver/hw/kdrive/src/kcmap.c @@ -20,8 +20,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" @@ -29,7 +29,7 @@ * Put the entire colormap into the DAC */ -void +static void KdSetColormap(ScreenPtr pScreen) { KdScreenPriv(pScreen); @@ -72,10 +72,6 @@ KdSetColormap(ScreenPtr pScreen) (*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, (1 << pScreenPriv->screen->fb. depth), defs); - - /* recolor hardware cursor */ - if (pScreenPriv->card->cfuncs->recolorCursor) - (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, 0, 0); } /* @@ -235,9 +231,4 @@ KdStoreColors(ColormapPtr pCmap, int ndef, xColorItem * pdefs) } (*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, ndef, pdefs); - - /* recolor hardware cursor */ - if (pScreenPriv->card->cfuncs->recolorCursor) - (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, ndef, - pdefs); } diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c index f02d8262b..6e8168323 100644 --- a/xserver/hw/kdrive/src/kdrive.c +++ b/xserver/hw/kdrive/src/kdrive.c @@ -20,8 +20,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" #include @@ -30,6 +30,7 @@ #ifdef RANDR #include #endif +#include "glx_extinit.h" #ifdef XV #include "kxv.h" @@ -66,25 +67,18 @@ KdDepths kdDepths[] = { {32, 32} }; -#define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0])) - #define KD_DEFAULT_BUTTONS 5 DevPrivateKeyRec kdScreenPrivateKeyRec; -unsigned long kdGeneration; +static unsigned long kdGeneration; -Bool kdVideoTest; -unsigned long kdVideoTestTime; Bool kdEmulateMiddleButton; Bool kdRawPointerCoordinates; Bool kdDisableZaphod; -Bool kdAllowZap; -Bool kdEnabled; -int kdSubpixelOrder; -int kdVirtualTerminal = -1; -Bool kdSwitchPending; -char *kdSwitchCmd; -DDXPointRec kdOrigin; +static Bool kdEnabled; +static int kdSubpixelOrder; +static char *kdSwitchCmd; +static DDXPointRec kdOrigin; Bool kdHasPointer = FALSE; Bool kdHasKbd = FALSE; const char *kdGlobalXkbRules = NULL; @@ -93,15 +87,6 @@ const char *kdGlobalXkbLayout = NULL; const char *kdGlobalXkbVariant = NULL; const char *kdGlobalXkbOptions = NULL; -static Bool kdCaughtSignal = FALSE; - -/* - * Carry arguments from InitOutput through driver initialization - * to KdScreenInit - */ - -KdOsFuncs *kdOsFuncs; - void KdDisableScreen(ScreenPtr pScreen) { @@ -114,14 +99,7 @@ KdDisableScreen(ScreenPtr pScreen) KdDisableColormap(pScreen); if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel) (*pScreenPriv->card->cfuncs->disableAccel) (pScreen); - if (!pScreenPriv->screen->softCursor && - pScreenPriv->card->cfuncs->disableCursor) - (*pScreenPriv->card->cfuncs->disableCursor) (pScreen); - if (pScreenPriv->card->cfuncs->dpms) - (*pScreenPriv->card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL); pScreenPriv->enabled = FALSE; - if (pScreenPriv->card->cfuncs->disable) - (*pScreenPriv->card->cfuncs->disable) (pScreen); } static void @@ -144,7 +122,7 @@ KdDoSwitchCmd(const char *reason) } } -void +static void KdSuspend(void) { KdCardInfo *card; @@ -155,23 +133,17 @@ KdSuspend(void) for (screen = card->screenList; screen; screen = screen->next) if (screen->mynum == card->selected && screen->pScreen) KdDisableScreen(screen->pScreen); - if (card->driver && card->cfuncs->restore) - (*card->cfuncs->restore) (card); } KdDisableInput(); KdDoSwitchCmd("suspend"); } } -void +static void KdDisableScreens(void) { KdSuspend(); - if (kdEnabled) { - if (kdOsFuncs->Disable) - (*kdOsFuncs->Disable) (); - kdEnabled = FALSE; - } + kdEnabled = FALSE; } Bool @@ -181,78 +153,20 @@ KdEnableScreen(ScreenPtr pScreen) if (pScreenPriv->enabled) return TRUE; - if (pScreenPriv->card->cfuncs->enable) - if (!(*pScreenPriv->card->cfuncs->enable) (pScreen)) - return FALSE; pScreenPriv->enabled = TRUE; pScreenPriv->dpmsState = KD_DPMS_NORMAL; pScreenPriv->card->selected = pScreenPriv->screen->mynum; - if (!pScreenPriv->screen->softCursor && - pScreenPriv->card->cfuncs->enableCursor) - (*pScreenPriv->card->cfuncs->enableCursor) (pScreen); if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel) (*pScreenPriv->card->cfuncs->enableAccel) (pScreen); KdEnableColormap(pScreen); SetRootClip(pScreen, ROOT_CLIP_FULL); - if (pScreenPriv->card->cfuncs->dpms) - (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState); return TRUE; } -void -KdResume(void) -{ - KdCardInfo *card; - KdScreenInfo *screen; - - if (kdEnabled) { - KdDoSwitchCmd("resume"); - for (card = kdCardInfo; card; card = card->next) { - if (card->cfuncs->preserve) - (*card->cfuncs->preserve) (card); - for (screen = card->screenList; screen; screen = screen->next) - if (screen->mynum == card->selected && screen->pScreen) - KdEnableScreen(screen->pScreen); - } - KdEnableInput(); - KdReleaseAllKeys(); - } -} - -void -KdEnableScreens(void) -{ - if (!kdEnabled) { - kdEnabled = TRUE; - if (kdOsFuncs->Enable) - (*kdOsFuncs->Enable) (); - } - KdResume(); -} - -void -KdProcessSwitch(void) -{ - if (kdEnabled) - KdDisableScreens(); - else - KdEnableScreens(); -} - void AbortDDX(enum ExitCode error) { KdDisableScreens(); - if (kdOsFuncs) { - if (kdEnabled && kdOsFuncs->Disable) - (*kdOsFuncs->Disable) (); - if (kdOsFuncs->Fini) - (*kdOsFuncs->Fini) (); - KdDoSwitchCmd("stop"); - } - - if (kdCaughtSignal) - OsAbort(); } void @@ -261,8 +175,8 @@ ddxGiveUp(enum ExitCode error) AbortDDX(error); } -Bool kdDumbDriver; -Bool kdSoftCursor; +static Bool kdDumbDriver; +static Bool kdSoftCursor; const char * KdParseFindNext(const char *cur, const char *delim, char *save, char *last) @@ -418,18 +332,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) } } -/* - * Mouse argument syntax: - * - * device,protocol,options... - * - * Options are any of: - * 1-5 n button mouse - * 2button emulate middle button - * {NMO} Reorder buttons - */ - -void +static void KdParseRgba(char *rgba) { if (!strcmp(rgba, "rgb")) @@ -474,7 +377,6 @@ KdUseMsg(void) ErrorF ("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n"); ErrorF("-switchCmd Command to execute on vt switch\n"); - ErrorF("-zap Terminate server on Ctrl+Alt+Backspace\n"); ErrorF ("vtxx Use virtual terminal xx instead of the next available\n"); } @@ -507,10 +409,6 @@ KdProcessArgument(int argc, char **argv, int i) kdDisableZaphod = TRUE; return 1; } - if (!strcmp(argv[i], "-zap")) { - kdAllowZap = TRUE; - return 1; - } if (!strcmp(argv[i], "-3button")) { kdEmulateMiddleButton = FALSE; return 1; @@ -531,10 +429,6 @@ KdProcessArgument(int argc, char **argv, int i) kdSoftCursor = TRUE; return 1; } - if (!strcmp(argv[i], "-videoTest")) { - kdVideoTest = TRUE; - return 1; - } if (!strcmp(argv[i], "-origin")) { if ((i + 1) < argc) { char *x = argv[i + 1]; @@ -567,10 +461,6 @@ KdProcessArgument(int argc, char **argv, int i) UseMsg(); return 2; } - if (!strncmp(argv[i], "vt", 2) && - sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) { - return 1; - } if (!strcmp(argv[i], "-xkb-rules")) { if (i + 1 >= argc) { UseMsg(); @@ -629,25 +519,7 @@ KdProcessArgument(int argc, char **argv, int i) return 0; } -/* - * These are getting tossed in here until I can think of where - * they really belong - */ - -void -KdOsInit(KdOsFuncs * pOsFuncs) -{ - kdOsFuncs = pOsFuncs; - if (pOsFuncs) { - if (serverGeneration == 1) { - KdDoSwitchCmd("start"); - if (pOsFuncs->Init) - (*pOsFuncs->Init) (); - } - } -} - -Bool +static Bool KdAllocatePrivates(ScreenPtr pScreen) { KdPrivScreenPtr pScreenPriv; @@ -665,7 +537,7 @@ KdAllocatePrivates(ScreenPtr pScreen) return TRUE; } -Bool +static Bool KdCreateScreenResources(ScreenPtr pScreen) { KdScreenPriv(pScreen); @@ -684,7 +556,7 @@ KdCreateScreenResources(ScreenPtr pScreen) return ret; } -Bool +static Bool KdCloseScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); @@ -703,26 +575,12 @@ KdCloseScreen(ScreenPtr pScreen) else ret = TRUE; - if (pScreenPriv->dpmsState != KD_DPMS_NORMAL) - (*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL); - if (screen->mynum == card->selected) KdDisableScreen(pScreen); - /* - * Restore video hardware when last screen is closed - */ - if (screen == card->screenList) { - if (kdEnabled && card->cfuncs->restore) - (*card->cfuncs->restore) (card); - } - if (!pScreenPriv->screen->dumb && card->cfuncs->finiAccel) (*card->cfuncs->finiAccel) (pScreen); - if (!pScreenPriv->screen->softCursor && card->cfuncs->finiCursor) - (*card->cfuncs->finiCursor) (pScreen); - if (card->cfuncs->scrfini) (*card->cfuncs->scrfini) (screen); @@ -737,11 +595,7 @@ KdCloseScreen(ScreenPtr pScreen) * Clean up OS when last card is closed */ if (card == kdCardInfo) { - if (kdEnabled) { - kdEnabled = FALSE; - if (kdOsFuncs->Disable) - (*kdOsFuncs->Disable) (); - } + kdEnabled = FALSE; } } @@ -751,37 +605,10 @@ KdCloseScreen(ScreenPtr pScreen) return ret; } -Bool +static Bool KdSaveScreen(ScreenPtr pScreen, int on) { - KdScreenPriv(pScreen); - int dpmsState; - - if (!pScreenPriv->card->cfuncs->dpms) - return FALSE; - - dpmsState = pScreenPriv->dpmsState; - switch (on) { - case SCREEN_SAVER_OFF: - dpmsState = KD_DPMS_NORMAL; - break; - case SCREEN_SAVER_ON: - if (dpmsState == KD_DPMS_NORMAL) - dpmsState = KD_DPMS_NORMAL + 1; - break; - case SCREEN_SAVER_CYCLE: - if (dpmsState < KD_DPMS_MAX) - dpmsState++; - break; - case SCREEN_SAVER_FORCER: - break; - } - if (dpmsState != pScreenPriv->dpmsState) { - if (pScreenPriv->enabled) - (*pScreenPriv->card->cfuncs->dpms) (pScreen, dpmsState); - pScreenPriv->dpmsState = dpmsState; - } - return TRUE; + return FALSE; } static Bool @@ -858,7 +685,7 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) /* Pass through AddScreen, which doesn't take any closure */ static KdScreenInfo *kdCurrentScreen; -Bool +static Bool KdScreenInit(ScreenPtr pScreen, int argc, char **argv) { KdScreenInfo *screen = kdCurrentScreen; @@ -968,7 +795,6 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv) /* * Wrap CloseScreen, the order now is: * KdCloseScreen - * miBSCloseScreen * fbCloseScreen */ pScreenPriv->CloseScreen = pScreen->CloseScreen; @@ -993,21 +819,10 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv) /* * Enable the hardware */ - if (!kdEnabled) { - kdEnabled = TRUE; - if (kdOsFuncs->Enable) - (*kdOsFuncs->Enable) (); - } + kdEnabled = TRUE; if (screen->mynum == card->selected) { - if (card->cfuncs->preserve) - (*card->cfuncs->preserve) (card); - if (card->cfuncs->enable) - if (!(*card->cfuncs->enable) (pScreen)) - return FALSE; pScreenPriv->enabled = TRUE; - if (!screen->softCursor && card->cfuncs->enableCursor) - (*card->cfuncs->enableCursor) (pScreen); KdEnableColormap(pScreen); if (!screen->dumb && card->cfuncs->enableAccel) (*card->cfuncs->enableAccel) (pScreen); @@ -1016,7 +831,7 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv) return TRUE; } -void +static void KdInitScreen(ScreenInfo * pScreenInfo, KdScreenInfo * screen, int argc, char **argv) { @@ -1065,7 +880,7 @@ KdSetPixmapFormats(ScreenInfo * pScreenInfo) /* * Fill in additional formats */ - for (i = 0; i < NUM_KD_DEPTHS; i++) + for (i = 0; i < ARRAY_SIZE(kdDepths); i++) if (!depthToBpp[kdDepths[i].depth]) depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp; @@ -1118,27 +933,6 @@ KdAddScreen(ScreenInfo * pScreenInfo, AddScreen(KdScreenInit, argc, argv); } -#if 0 /* This function is not used currently */ - -int -KdDepthToFb(ScreenPtr pScreen, int depth) -{ - KdScreenPriv(pScreen); - - for (fb = 0; fb <= KD_MAX_FB && pScreenPriv->screen->fb.frameBuffer; fb++) - if (pScreenPriv->screen->fb.depth == depth) - return fb; -} - -#endif - -static int -KdSignalWrapper(int signum) -{ - kdCaughtSignal = TRUE; - return 1; /* use generic OS layer cleanup & abort */ -} - void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { @@ -1180,7 +974,7 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) for (screen = card->screenList; screen; screen = screen->next) KdAddScreen(pScreenInfo, screen, argc, argv); - OsRegisterSigWrapper(KdSignalWrapper); + xorgGlxCreateVendor(); #if defined(CONFIG_UDEV) || defined(CONFIG_HAL) if (SeatId) /* Enable input hot-plugging */ @@ -1193,18 +987,6 @@ OsVendorFatalError(const char *f, va_list args) { } -int -DPMSSet(ClientPtr client, int level) -{ - return Success; -} - -Bool -DPMSSupported(void) -{ - return FALSE; -} - /* These stubs can be safely removed once we can * split input and GPU parts in hotplug.h et al. */ #ifdef CONFIG_UDEV_KMS diff --git a/xserver/hw/kdrive/src/kdrive.h b/xserver/hw/kdrive/src/kdrive.h index 3c7f2cdf2..432f89140 100644 --- a/xserver/hw/kdrive/src/kdrive.h +++ b/xserver/hw/kdrive/src/kdrive.h @@ -110,19 +110,10 @@ typedef struct _KdCardFuncs { Bool (*initScreen) (ScreenPtr); /* initialize ScreenRec */ Bool (*finishInitScreen) (ScreenPtr pScreen); Bool (*createRes) (ScreenPtr); /* create screen resources */ - void (*preserve) (KdCardInfo *); /* save graphics card state */ - Bool (*enable) (ScreenPtr); /* set up for rendering */ - Bool (*dpms) (ScreenPtr, int); /* set DPMS screen saver */ - void (*disable) (ScreenPtr); /* turn off rendering */ - void (*restore) (KdCardInfo *); /* restore graphics card state */ void (*scrfini) (KdScreenInfo *); /* close down screen */ void (*cardfini) (KdCardInfo *); /* close down */ Bool (*initCursor) (ScreenPtr); /* detect and map cursor */ - void (*enableCursor) (ScreenPtr); /* enable cursor */ - void (*disableCursor) (ScreenPtr); /* disable cursor */ - void (*finiCursor) (ScreenPtr); /* close down */ - void (*recolorCursor) (ScreenPtr, int, xColorItem *); Bool (*initAccel) (ScreenPtr); void (*enableAccel) (ScreenPtr); @@ -222,8 +213,6 @@ struct _KdPointerInfo { struct _KdPointerInfo *next; }; -extern int KdCurScreen; - void KdAddPointerDriver(KdPointerDriver * driver); void KdRemovePointerDriver(KdPointerDriver * driver); KdPointerInfo *KdNewPointer(void); @@ -290,42 +279,6 @@ int KdAddConfigKeyboard(char *pointer); int KdAddKeyboard(KdKeyboardInfo * ki); void KdRemoveKeyboard(KdKeyboardInfo * ki); -typedef struct _KdOsFuncs { - int (*Init) (void); - void (*Enable) (void); - Bool (*SpecialKey) (KeySym); - void (*Disable) (void); - void (*Fini) (void); - void (*pollEvents) (void); - void (*Bell) (int, int, int); -} KdOsFuncs; - -typedef enum _KdSyncPolarity { - KdSyncNegative, KdSyncPositive -} KdSyncPolarity; - -typedef struct _KdMonitorTiming { - /* label */ - int horizontal; - int vertical; - int rate; - /* pixel clock */ - int clock; /* in KHz */ - /* horizontal timing */ - int hfp; /* front porch */ - int hbp; /* back porch */ - int hblank; /* blanking */ - KdSyncPolarity hpol; /* polarity */ - /* vertical timing */ - int vfp; /* front porch */ - int vbp; /* back porch */ - int vblank; /* blanking */ - KdSyncPolarity vpol; /* polarity */ -} KdMonitorTiming; - -extern const KdMonitorTiming kdMonitorTimings[]; -extern const int kdNumMonitorTimings; - typedef struct _KdPointerMatrix { int matrix[2][3]; } KdPointerMatrix; @@ -334,15 +287,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec; #define kdScreenPrivateKey (&kdScreenPrivateKeyRec) -extern unsigned long kdGeneration; -extern Bool kdEnabled; -extern Bool kdSwitchPending; extern Bool kdEmulateMiddleButton; extern Bool kdDisableZaphod; -extern Bool kdAllowZap; -extern int kdVirtualTerminal; -extern char *kdSwitchCmd; -extern KdOsFuncs *kdOsFuncs; #define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey)) @@ -351,9 +297,6 @@ extern KdOsFuncs *kdOsFuncs; #define KdScreenPriv(pScreen) KdPrivScreenPtr pScreenPriv = KdGetScreenPriv(pScreen) /* kcmap.c */ -void - KdSetColormap(ScreenPtr pScreen); - void KdEnableColormap(ScreenPtr pScreen); @@ -378,21 +321,12 @@ extern miPointerScreenFuncRec kdPointerScreenFuncs; void KdDisableScreen(ScreenPtr pScreen); -void - KdDisableScreens(void); - Bool KdEnableScreen(ScreenPtr pScreen); void KdEnableScreens(void); -void - KdSuspend(void); - -void - KdResume(void); - void KdProcessSwitch(void); @@ -403,48 +337,18 @@ Rotation KdSubRotation(Rotation a, Rotation b); void KdParseScreen(KdScreenInfo * screen, const char *arg); -KdPointerInfo *KdParsePointer(const char *arg); - -KdKeyboardInfo *KdParseKeyboard(const char *arg); - const char * KdParseFindNext(const char *cur, const char *delim, char *save, char *last); -void - KdParseRgba(char *rgba); - void KdUseMsg(void); int KdProcessArgument(int argc, char **argv, int i); -void - KdOsInit(KdOsFuncs * pOsFuncs); - void KdOsAddInputDrivers(void); -Bool - KdAllocatePrivates(ScreenPtr pScreen); - -Bool - KdCreateScreenResources(ScreenPtr pScreen); - -Bool - KdCloseScreen(ScreenPtr pScreen); - -Bool - KdSaveScreen(ScreenPtr pScreen, int on); - -Bool - KdScreenInit(ScreenPtr pScreen, int argc, char **argv); - -void - -KdInitScreen(ScreenInfo * pScreenInfo, - KdScreenInfo * screen, int argc, char **argv); - void KdInitCard(ScreenInfo * pScreenInfo, KdCardInfo * card, int argc, char **argv); @@ -476,17 +380,7 @@ void void KdCloseInput(void); -Bool - KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure); - void - KdUnregisterFds(void *closure, Bool do_close); - -void - KdUnregisterFd(void *closure, int fd, Bool do_close); - -void - KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code, unsigned char is_up); @@ -500,32 +394,16 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code, #define KD_MOUSE_DELTA 0x80000000 void - KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry, int rz); -void - -_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, - int b, int absrel, Bool force); - -void - KdReleaseAllKeys(void); - -void - KdSetLed(KdKeyboardInfo * ki, int led, Bool on); - void KdSetPointerMatrix(KdPointerMatrix *pointer); void - KdComputePointerMatrix(KdPointerMatrix *pointer, Rotation randr, int width, int height); -void - KdScreenToPointerCoords(int *x, int *y); - void KdBlockHandler(ScreenPtr pScreen, void *timeout); @@ -538,34 +416,6 @@ void void KdEnableInput(void); -void - KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration); - -/* kmode.c */ -const KdMonitorTiming *KdFindMode(KdScreenInfo * screen, - Bool (*supported) (KdScreenInfo *, - const KdMonitorTiming *)); - -Bool - -KdTuneMode(KdScreenInfo * screen, - Bool (*usable) (KdScreenInfo *), - Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)); - -#ifdef RANDR -Bool - -KdRandRGetInfo(ScreenPtr pScreen, - int randr, - Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *)); - -const KdMonitorTiming *KdRandRGetTiming(ScreenPtr pScreen, - Bool (*supported) (ScreenPtr pScreen, - const KdMonitorTiming - *), int rate, - RRScreenSizePtr pSize); -#endif - /* kshadow.c */ Bool KdShadowFbAlloc(KdScreenInfo * screen, Bool rotate); diff --git a/xserver/hw/kdrive/src/kinfo.c b/xserver/hw/kdrive/src/kinfo.c index f91d57504..4abb082b0 100644 --- a/xserver/hw/kdrive/src/kinfo.c +++ b/xserver/hw/kdrive/src/kinfo.c @@ -20,8 +20,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" diff --git a/xserver/hw/kdrive/src/kinput.c b/xserver/hw/kdrive/src/kinput.c index 8b08747a6..8ab8c24c8 100644 --- a/xserver/hw/kdrive/src/kinput.c +++ b/xserver/hw/kdrive/src/kinput.c @@ -21,8 +21,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include +#include #endif #include "kdrive.h" #include "inputstr.h" @@ -54,11 +55,6 @@ #include #endif -#ifdef KDRIVE_EVDEV -#define DEV_INPUT_EVENT_PREFIX "/dev/input/event" -#define DEV_INPUT_EVENT_PREFIX_LEN (sizeof(DEV_INPUT_EVENT_PREFIX) - 1) -#endif - #define AtomFromName(x) MakeAtom(x, strlen(x), 1) struct KdConfigDevice { @@ -84,21 +80,6 @@ static KdPointerMatrix kdPointerMatrix = { {0, 1, 0}} }; -void KdResetInputMachine(void); - -#define KD_MAX_INPUT_FDS 8 - -typedef struct _kdInputFd { - int fd; - void (*read) (int fd, void *closure); - int (*enable) (int fd, void *closure); - void (*disable) (int fd, void *closure); - void *closure; -} KdInputFd; - -static KdInputFd kdInputFds[KD_MAX_INPUT_FDS]; -static int kdNumInputFds; - extern Bool kdRawPointerCoordinates; extern const char *kdGlobalXkbRules; @@ -113,7 +94,7 @@ extern const char *kdGlobalXkbOptions; #define NOBLOCK FNDELAY #endif -void +static void KdResetInputMachine(void) { KdPointerInfo *pi; @@ -124,89 +105,11 @@ KdResetInputMachine(void) } } -static void -KdNonBlockFd(int fd) -{ - int flags; - - flags = fcntl(fd, F_GETFL); - flags |= FASYNC | NOBLOCK; - fcntl(fd, F_SETFL, flags); -} - -static void -KdNotifyFd(int fd, int ready, void *data) -{ - int i = (int) (intptr_t) data; - (*kdInputFds[i].read)(fd, kdInputFds[i].closure); -} - -static void -KdAddFd(int fd, int i) -{ - KdNonBlockFd(fd); - InputThreadRegisterDev(fd, KdNotifyFd, (void *) (intptr_t) i); -} - -static void -KdRemoveFd(int fd) -{ - int flags; - - InputThreadUnregisterDev(fd); - flags = fcntl(fd, F_GETFL); - flags &= ~(FASYNC | NOBLOCK); - fcntl(fd, F_SETFL, flags); -} - -Bool -KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure) -{ - if (kdNumInputFds == KD_MAX_INPUT_FDS) - return FALSE; - kdInputFds[kdNumInputFds].fd = fd; - kdInputFds[kdNumInputFds].read = read; - kdInputFds[kdNumInputFds].enable = 0; - kdInputFds[kdNumInputFds].disable = 0; - kdInputFds[kdNumInputFds].closure = closure; - if (kdInputEnabled) - KdAddFd(fd, kdNumInputFds); - kdNumInputFds++; - return TRUE; -} - -void -KdUnregisterFd(void *closure, int fd, Bool do_close) -{ - int i, j; - - for (i = 0; i < kdNumInputFds; i++) { - if (kdInputFds[i].closure == closure && - (fd == -1 || kdInputFds[i].fd == fd)) { - if (kdInputEnabled) - KdRemoveFd(kdInputFds[i].fd); - if (do_close) - close(kdInputFds[i].fd); - for (j = i; j < (kdNumInputFds - 1); j++) - kdInputFds[j] = kdInputFds[j + 1]; - kdNumInputFds--; - break; - } - } -} - -void -KdUnregisterFds(void *closure, Bool do_close) -{ - KdUnregisterFd(closure, -1, do_close); -} - void KdDisableInput(void) { KdKeyboardInfo *ki; KdPointerInfo *pi; - int found = 0, i = 0; input_lock(); @@ -220,49 +123,6 @@ KdDisableInput(void) (*pi->driver->Disable) (pi); } - if (kdNumInputFds) { - ErrorF("[KdDisableInput] Buggy drivers: still %d input fds left!", - kdNumInputFds); - i = 0; - while (i < kdNumInputFds) { - found = 0; - for (ki = kdKeyboards; ki; ki = ki->next) { - if (ki == kdInputFds[i].closure) { - ErrorF(" fd %d belongs to keybd driver %s\n", - kdInputFds[i].fd, - ki->driver && ki->driver->name ? - ki->driver->name : "(unnamed!)"); - found = 1; - break; - } - } - - if (found) { - i++; - continue; - } - - for (pi = kdPointers; pi; pi = pi->next) { - if (pi == kdInputFds[i].closure) { - ErrorF(" fd %d belongs to pointer driver %s\n", - kdInputFds[i].fd, - pi->driver && pi->driver->name ? - pi->driver->name : "(unnamed!)"); - break; - } - } - - if (found) { - i++; - continue; - } - - ErrorF(" fd %d not claimed by any active device!\n", - kdInputFds[i].fd); - KdUnregisterFd(kdInputFds[i].closure, kdInputFds[i].fd, TRUE); - } - } - kdInputEnabled = FALSE; } @@ -500,6 +360,16 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) return TRUE; } +static void +KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration) +{ + if (!ki || !ki->driver || !ki->driver->Bell) + return; + + if (kdInputEnabled) + (*ki->driver->Bell) (ki, volume, pitch, duration); +} + static void KdBell(int volume, DeviceIntPtr pDev, void *arg, int something) { @@ -522,25 +392,10 @@ DDXRingBell(int volume, int pitch, int duration) { KdKeyboardInfo *ki = NULL; - if (kdOsFuncs->Bell) { - (*kdOsFuncs->Bell) (volume, pitch, duration); + for (ki = kdKeyboards; ki; ki = ki->next) { + if (ki->dixdev->coreEvents) + KdRingBell(ki, volume, pitch, duration); } - else { - for (ki = kdKeyboards; ki; ki = ki->next) { - if (ki->dixdev->coreEvents) - KdRingBell(ki, volume, pitch, duration); - } - } -} - -void -KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration) -{ - if (!ki || !ki->driver || !ki->driver->Bell) - return; - - if (kdInputEnabled) - (*ki->driver->Bell) (ki, volume, pitch, duration); } static void @@ -555,7 +410,7 @@ KdSetLeds(KdKeyboardInfo * ki, int leds) } } -void +static void KdSetLed(KdKeyboardInfo * ki, int led, Bool on) { if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed) @@ -619,20 +474,6 @@ KdComputePointerMatrix(KdPointerMatrix * m, Rotation randr, int width, } } -void -KdScreenToPointerCoords(int *x, int *y) -{ - int (*m)[3] = kdPointerMatrix.matrix; - int div = m[0][1] * m[1][0] - m[1][1] * m[0][0]; - int sx = *x; - int sy = *y; - - *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - - m[1][1] * sx) / div; - *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - - m[0][0] * sy) / div; -} - static void KdKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl) { @@ -1091,19 +932,9 @@ KdParseKbdOptions(KdKeyboardInfo * ki) ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", key, value); } - -#ifdef KDRIVE_EVDEV - if (!ki->driver && ki->path != NULL && - strncasecmp(ki->path, - DEV_INPUT_EVENT_PREFIX, - DEV_INPUT_EVENT_PREFIX_LEN) == 0) { - ki->driver = KdFindKeyboardDriver("evdev"); - ki->options = input_option_new(ki->options, "driver", "evdev"); - } -#endif } -KdKeyboardInfo * +static KdKeyboardInfo * KdParseKeyboard(const char *arg) { char save[1024]; @@ -1209,19 +1040,9 @@ KdParsePointerOptions(KdPointerInfo * pi) ErrorF("Pointer option key (%s) of value (%s) not assigned!\n", key, value); } - -#ifdef KDRIVE_EVDEV - if (!pi->driver && pi->path != NULL && - strncasecmp(pi->path, - DEV_INPUT_EVENT_PREFIX, - DEV_INPUT_EVENT_PREFIX_LEN) == 0) { - pi->driver = KdFindPointerDriver("evdev"); - pi->options = input_option_new(pi->options, "driver", "evdev"); - } -#endif } -KdPointerInfo * +static KdPointerInfo * KdParsePointer(const char *arg) { char save[1024]; @@ -1697,6 +1518,9 @@ KdClassifyInput(KdPointerInfo * pi, int type, int x, int y, int z, int b) return keyboard; } +static void +_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, + int b, int absrel, Bool force); /* We return true if we're stealing the event. */ static Bool KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y, @@ -1770,47 +1594,30 @@ KdHandlePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b, return FALSE; } +static void +_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, + int b, int absrel, Bool force) +{ + int valuators[3] = { x, y, z }; + ValuatorMask mask; + + /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */ + if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel)) + return; + + valuator_mask_set_range(&mask, 0, 3, valuators); + + QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); +} + static void KdReceiveTimeout(KdPointerInfo * pi) { KdRunMouseMachine(pi, timeout, 0, 0, 0, 0, 0, 0); } -/* - * kdCheckTermination - * - * This function checks for the key sequence that terminates the server. When - * detected, it sets the dispatchException flag and returns. The key sequence - * is: - * Control-Alt - * It's assumed that the server will be waken up by the caller when this - * function returns. - */ - extern int nClients; -void -KdReleaseAllKeys(void) -{ -#if 0 - int key; - KdKeyboardInfo *ki; - - input_lock(); - - for (ki = kdKeyboards; ki; ki = ki->next) { - for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) { - if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { - KdHandleKeyboardEvent(ki, KeyRelease, key); - QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL); - } - } - } - - input_unlock(); -#endif -} - static void KdCheckLock(void) { @@ -1944,22 +1751,6 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry, pi->buttonState = buttons; } -void -_KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, - int b, int absrel, Bool force) -{ - int valuators[3] = { x, y, z }; - ValuatorMask mask; - - /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */ - if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel)) - return; - - valuator_mask_set_range(&mask, 0, 3, valuators); - - QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); -} - void KdBlockHandler(ScreenPtr pScreen, void *timeo) { @@ -1977,11 +1768,6 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo) myTimeout = ms; } } - /* if we need to poll for events, do that */ - if (kdOsFuncs->pollEvents) { - (*kdOsFuncs->pollEvents) (); - myTimeout = 20; - } if (myTimeout > 0) AdjustWaitForDelay(timeo, myTimeout); } @@ -2001,8 +1787,6 @@ KdWakeupHandler(ScreenPtr pScreen, int result) } } } - if (kdSwitchPending) - KdProcessSwitch(); } #define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin)) @@ -2089,13 +1873,10 @@ KdCrossScreen(ScreenPtr pScreen, Bool entering) { } -int KdCurScreen; /* current event screen */ - static void KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { input_lock(); - KdCurScreen = pScreen->myNum; miPointerWarpCursor(pDev, pScreen, x, y); input_unlock(); } @@ -2110,8 +1891,6 @@ void ProcessInputEvents(void) { mieqProcessInputEvents(); - if (kdSwitchPending) - KdProcessSwitch(); KdCheckLock(); } diff --git a/xserver/hw/kdrive/src/kmode.c b/xserver/hw/kdrive/src/kmode.c deleted file mode 100644 index ef1b6b4fa..000000000 --- a/xserver/hw/kdrive/src/kmode.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 1999 SuSE, Inc. - * - * 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, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * 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. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" - -const KdMonitorTiming kdMonitorTimings[] = { - /* H V Hz KHz */ - /* FP BP BLANK POLARITY */ - - /* IPAQ modeline: - * - * Modeline "320x240" 5.7222 320 337 340 352 240 241 244 254" - */ - {320, 240, 64, 16256, - 17, 12, 32, KdSyncNegative, - 1, 11, 14, KdSyncNegative, - }, - - /* Other VESA modes */ - {640, 350, 85, 31500, /* VESA */ - 32, 96, 192, KdSyncPositive, /* 26.413 */ - 32, 60, 95, KdSyncNegative, /* 59.354 */ - }, - {640, 400, 60, 31500, /* VESA */ - 32, 96, 192, KdSyncNegative, /* 26.413 */ - 1, 41, 45, KdSyncPositive, /* 59.354 */ - }, - {720, 400, 85, 35500, /* VESA */ - 36, 108, 216, KdSyncNegative, /* 37.927 */ - 1, 42, 46, KdSyncPositive, /* 85.039 */ - }, - - /* Modeline "720x576" 29.000 720 736 800 880 576 577 580 625 */ - { - 720, 576, 52, 32954, /* PAL Video */ - 16, 80, 160, KdSyncPositive, /* 32.954 */ - 1, 45, 49, KdSyncPositive, /* 52.727 */ - }, - - /* 640x480 modes */ - {640, 480, 85, 36000, /* VESA */ - 56, 80, 192, KdSyncNegative, /* 43.269 */ - 1, 25, 29, KdSyncNegative, /* 85.008 */ - }, - {640, 480, 75, 31500, /* VESA */ - 16, 120, 200, KdSyncNegative, /* 37.500 */ - 1, 16, 20, KdSyncNegative, /* 75.000 */ - }, - {640, 480, 72, 31500, /* VESA */ - 16, 120, 176, KdSyncNegative, /* 37.861 */ - 1, 20, 24, KdSyncNegative, /* 72.809 */ - }, - {640, 480, 60, 25175, /* VESA */ - 16, 48, 160, KdSyncNegative, /* 31.469 */ - 10, 33, 45, KdSyncNegative, /* 59.940 */ - }, - - /* 800x600 modes */ - {800, 600, 85, 56250, /* VESA */ - 32, 152, 248, KdSyncPositive, /* 53.674 */ - 1, 27, 31, KdSyncPositive, /* 85.061 */ - }, - {800, 600, 75, 49500, /* VESA */ - 16, 160, 256, KdSyncPositive, /* 46.875 */ - 1, 21, 25, KdSyncPositive, /* 75.000 */ - }, - /* DEFAULT */ -#define MONITOR_TIMING_DEFAULT 9 - {800, 600, 72, 50000, /* VESA */ - 56, 64, 240, KdSyncPositive, /* 48.077 */ - 37, 23, 66, KdSyncPositive, /* 72.188 */ - }, - {800, 600, 60, 40000, /* VESA */ - 40, 88, 256, KdSyncPositive, /* 37.879 */ - 1, 23, 28, KdSyncPositive, /* 60.317 */ - }, - {800, 600, 56, 36000, /* VESA */ - 24, 128, 224, KdSyncPositive, /* 35.156 */ - 1, 22, 25, KdSyncPositive, /* 56.250 */ - }, - - /* 1024x768 modes */ - {1024, 768, 85, 94500, /* VESA */ - 48, 208, 352, KdSyncPositive, /* 68.677 */ - 1, 36, 40, KdSyncPositive, /* 84.997 */ - }, - {1024, 768, 75, 78750, /* VESA */ - 16, 176, 288, KdSyncPositive, /* 60.023 */ - 1, 28, 32, KdSyncPositive, /* 75.029 */ - }, - {1024, 768, 70, 75000, /* VESA */ - 24, 144, 304, KdSyncNegative, /* 56.476 */ - 3, 29, 38, KdSyncNegative, /* 70.069 */ - }, - {1024, 768, 60, 65000, /* VESA */ - 24, 160, 320, KdSyncNegative, /* 48.363 */ - 3, 29, 38, KdSyncNegative, /* 60.004 */ - }, - - /* 1152x864 mode */ - {1152, 864, 75, 108000, /* VESA */ - 64, 256, 448, KdSyncPositive, /* 67.500 */ - 1, 32, 36, KdSyncPositive, /* 75.000 */ - }, - - /* 1152x900 modes */ - {1152, 900, 85, 122500, /* ADDED */ - 48, 208, 384, KdSyncPositive, /* 79.753 */ - 1, 32, 38, KdSyncPositive, /* 85.024 */ - }, - {1152, 900, 75, 108250, /* ADDED */ - 32, 208, 384, KdSyncPositive, /* 70.475 */ - 1, 32, 38, KdSyncPositive, /* 75.133 */ - }, - {1152, 900, 70, 100250, /* ADDED */ - 32, 208, 384, KdSyncPositive, /* 65.267 */ - 2, 32, 38, KdSyncPositive, /* 69.581 */ - }, - {1152, 900, 66, 95000, /* ADDED */ - 32, 208, 384, KdSyncPositive, /* 61.849 */ - 1, 32, 38, KdSyncPositive, /* 65.937 */ - }, - - /* 1280x854 modes */ - {1280, 854, 103, 12500, /* ADDED */ - 56, 16, 128, KdSyncPositive, /* 102.554 */ - 1, 216, 12, KdSyncPositive, - }, - - /* 1280x960 modes */ - {1280, 960, 85, 148500, /* VESA */ - 64, 224, 448, KdSyncPositive, /* 85.938 */ - 1, 47, 51, KdSyncPositive, /* 85.002 */ - }, - {1280, 960, 60, 108000, /* VESA */ - 96, 312, 520, KdSyncPositive, /* 60.000 */ - 1, 36, 40, KdSyncPositive, /* 60.000 */ - }, - - /* 1280x1024 modes */ - {1280, 1024, 85, 157500, /* VESA */ - 64, 224, 448, KdSyncPositive, /* 91.146 */ - 1, 44, 48, KdSyncPositive, /* 85.024 */ - }, - {1280, 1024, 75, 135000, /* VESA */ - 16, 248, 408, KdSyncPositive, /* 79.976 */ - 1, 38, 42, KdSyncPositive, /* 75.025 */ - }, - {1280, 1024, 60, 108000, /* VESA */ - 48, 248, 408, KdSyncPositive, /* 63.981 */ - 1, 38, 42, KdSyncPositive, /* 60.020 */ - }, - - /* 1600x1200 modes */ - {1600, 1200, 85, 229500, /* VESA */ - 64, 304, 560, KdSyncPositive, /* 106.250 */ - 1, 46, 50, KdSyncPositive, /* 85.000 */ - }, - {1600, 1200, 75, 202500, /* VESA */ - 64, 304, 560, KdSyncPositive, /* 93.750 */ - 1, 46, 50, KdSyncPositive, /* 75.000 */ - }, - {1600, 1200, 70, 189000, /* VESA */ - 64, 304, 560, KdSyncPositive, /* 87.500 */ - 1, 46, 50, KdSyncPositive, /* 70.000 */ - }, - {1600, 1200, 65, 175500, /* VESA */ - 64, 304, 560, KdSyncPositive, /* 81.250 */ - 1, 46, 50, KdSyncPositive, /* 65.000 */ - }, - {1600, 1200, 60, 162000, /* VESA */ - 64, 304, 560, KdSyncPositive, /* 75.000 */ - 1, 46, 50, KdSyncPositive, /* 60.000 */ - }, - - /* 1792x1344 modes */ - {1792, 1344, 85, 301500, /* ADDED */ - 96, 352, 672, KdSyncNegative, /* 122.362 */ - 1, 92, 96, KdSyncPositive, /* 84.974 */ - }, - {1792, 1344, 75, 261000, /* VESA */ - 96, 352, 664, KdSyncNegative, /* 106.270 */ - 1, 69, 73, KdSyncPositive, /* 74.997 */ - }, - {1792, 1344, 60, 204750, /* VESA */ - 128, 328, 656, KdSyncNegative, /* 83.640 */ - 1, 46, 50, KdSyncPositive, /* 60.000 */ - }, - -#if 0 - {1800, 1012, 75}, - {1906, 1072, 68}, -#endif - - /* 1856x1392 modes */ - {1856, 1392, 85, 330500, /* ADDED */ - 160, 352, 736, KdSyncNegative, /* 127.508 */ - 1, 104, 108, KdSyncPositive, /* 85.001 */ - }, - {1856, 1392, 75, 288000, /* VESA */ - 128, 352, 704, KdSyncNegative, /* 112.500 */ - 1, 104, 108, KdSyncPositive, /* 75.000 */ - }, - {1856, 1392, 60, 218250, /* VESA */ - 96, 352, 672, KdSyncNegative, /* 86.333 */ - 1, 43, 47, KdSyncPositive, /* 59.995 */ - }, - - /* 1920x1440 modes */ - {1920, 1440, 85, 341750, /* ADDED */ - 160, 352, 760, KdSyncNegative, /* 127.512 */ - 1, 56, 60, KdSyncPositive, /* 85.012 */ - }, - {1920, 1440, 75, 297000, /* VESA */ - 144, 352, 720, KdSyncNegative, /* 112.500 */ - 1, 56, 60, KdSyncPositive, /* 75.000 */ - }, - {1920, 1440, 60, 234000, /* VESA */ - 128, 244, 680, KdSyncNegative, /* 90.000 */ - 1, 56, 60, KdSyncPositive, /* 60.000 */ - }, -}; - -#define NUM_MONITOR_TIMINGS (sizeof kdMonitorTimings/sizeof kdMonitorTimings[0]) - -const int kdNumMonitorTimings = NUM_MONITOR_TIMINGS; - -const KdMonitorTiming * -KdFindMode(KdScreenInfo * screen, - Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)) -{ - int i; - const KdMonitorTiming *t; - - for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { - if ((*supported) (screen, t) && - t->horizontal == screen->width && - t->vertical == screen->height && - (!screen->rate || t->rate <= screen->rate)) { - return t; - } - } - ErrorF("Warning: mode not found, using default\n"); - return &kdMonitorTimings[MONITOR_TIMING_DEFAULT]; -} - -static const KdMonitorTiming * -kdFindPrevSize(const KdMonitorTiming * old) -{ - const KdMonitorTiming *new, *prev; - - if (old == kdMonitorTimings) - return 0; - new = old; - /* - * Search for the previous size - */ - while (new != kdMonitorTimings) { - new--; - if (new->horizontal != old->horizontal && - new->vertical != old->vertical) { - break; - } - } - /* - * Match the refresh rate (<=) - */ - while (new != kdMonitorTimings) { - prev = new - 1; - if (prev->horizontal == new->horizontal && - prev->vertical == new->vertical && prev->rate > old->rate) { - break; - } - new--; - } - return new; -} - -Bool -KdTuneMode(KdScreenInfo * screen, - Bool (*usable) (KdScreenInfo *), - Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)) -{ - const KdMonitorTiming *t; - - while (!(*usable) (screen)) { - /* - * Fix requested depth and geometry until it works - */ - if (screen->fb.depth > 16) - screen->fb.depth = 16; - else if (screen->fb.depth > 8) - screen->fb.depth = 8; - else { - t = kdFindPrevSize(KdFindMode(screen, supported)); - if (!t) - return FALSE; - screen->width = t->horizontal; - screen->height = t->vertical; - screen->rate = t->rate; - } - } - return TRUE; -} - -#ifdef RANDR -Bool -KdRandRGetInfo(ScreenPtr pScreen, - int randr, - Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *)) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - int i; - const KdMonitorTiming *t; - - for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { - if ((*supported) (pScreen, t)) { - RRScreenSizePtr pSize; - - pSize = RRRegisterSize(pScreen, - t->horizontal, - t->vertical, - screen->width_mm, screen->height_mm); - if (!pSize) - return FALSE; - if (!RRRegisterRate(pScreen, pSize, t->rate)) - return FALSE; - if (t->horizontal == screen->width && - t->vertical == screen->height && t->rate == screen->rate) - RRSetCurrentConfig(pScreen, randr, t->rate, pSize); - } - } - - return TRUE; -} - -const KdMonitorTiming * -KdRandRGetTiming(ScreenPtr pScreen, - Bool (*supported) (ScreenPtr pScreen, - const KdMonitorTiming *), - int rate, RRScreenSizePtr pSize) -{ - int i; - const KdMonitorTiming *t; - - for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { - if (t->horizontal == pSize->width && - t->vertical == pSize->height && - t->rate == rate && (*supported) (pScreen, t)) - return t; - } - return 0; -} -#endif diff --git a/xserver/hw/kdrive/src/kshadow.c b/xserver/hw/kdrive/src/kshadow.c index 7f1e2ee19..0cc8a1309 100644 --- a/xserver/hw/kdrive/src/kshadow.c +++ b/xserver/hw/kdrive/src/kshadow.c @@ -20,8 +20,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" diff --git a/xserver/hw/kdrive/src/kxv.c b/xserver/hw/kdrive/src/kxv.c index 844deca0d..711f4d80d 100644 --- a/xserver/hw/kdrive/src/kxv.c +++ b/xserver/hw/kdrive/src/kxv.c @@ -35,8 +35,8 @@ of the copyright holder. */ -#ifdef HAVE_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include "kdrive.h" @@ -110,18 +110,6 @@ static unsigned long PortResource = 0; #define GET_KDXV_WINDOW(pWin) ((KdXVWindowPtr) \ dixLookupPrivate(&(pWin)->devPrivates, KdXVWindowKey)) -KdVideoAdaptorPtr -KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen) -{ - return calloc(1, sizeof(KdVideoAdaptorRec)); -} - -void -KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr) -{ - free(ptr); -} - Bool KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) { @@ -719,27 +707,6 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) return ret; } -static int -KdXVReputAllVideo(WindowPtr pWin, void *data) -{ - KdXVWindowPtr WinPriv; - - if (pWin->drawable.type != DRAWABLE_WINDOW) - return WT_DONTWALKCHILDREN; - - WinPriv = GET_KDXV_WINDOW(pWin); - - while (WinPriv) { - if (WinPriv->PortRec->type == XvInputMask) - KdXVReputVideo(WinPriv->PortRec); - else - KdXVRegetVideo(WinPriv->PortRec); - WinPriv = WinPriv->next; - } - - return WT_WALKCHILDREN; -} - static int KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { @@ -970,61 +937,6 @@ KdXVCloseScreen(ScreenPtr pScreen) return pScreen->CloseScreen(pScreen); } -static Bool -KdXVRunning(ScreenPtr pScreen) -{ - return (KdXVGeneration == serverGeneration && GET_XV_SCREEN(pScreen) != 0); -} - -Bool -KdXVEnable(ScreenPtr pScreen) -{ - if (!KdXVRunning(pScreen)) - return TRUE; - - WalkTree(pScreen, KdXVReputAllVideo, 0); - - return TRUE; -} - -void -KdXVDisable(ScreenPtr pScreen) -{ - XvScreenPtr pxvs; - XvAdaptorPtr pAdaptor; - XvPortPtr pPort; - XvPortRecPrivatePtr pPriv; - int i, j; - - if (!KdXVRunning(pScreen)) - return; - - pxvs = GET_XV_SCREEN(pScreen); - - for (i = 0; i < pxvs->nAdaptors; i++) { - pAdaptor = &pxvs->pAdaptors[i]; - for (j = 0; j < pAdaptor->nPorts; j++) { - pPort = &pAdaptor->pPorts[j]; - pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; - if (pPriv->isOn > XV_OFF) { - - (*pPriv->AdaptorRec->StopVideo) (pPriv->screen, - pPriv->DevPriv.ptr, TRUE); - pPriv->isOn = XV_OFF; - - if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) - RegionDestroy(pPriv->pCompositeClip); - - pPriv->pCompositeClip = NULL; - - if (!pPriv->type && pPriv->pDraw) { /* still */ - KdXVRemovePortFromWindow((WindowPtr) pPriv->pDraw, pPriv); - } - } - } - } -} - /**** XvAdaptorRec fields ****/ static int @@ -1459,147 +1371,3 @@ KdXVQueryImageAttributes(XvPortPtr pPort, height, pitches, offsets); } - -/**************** Common video manipulation functions *******************/ - -void -KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, - int srcPitch, int dstPitch, int srcW, int srcH, int top, - int left, int h, int w) -{ - int srcDown = srcPitch, srcRight = 2, srcNext; - int p; - - switch (randr & RR_Rotate_All) { - case RR_Rotate_0: - srcDown = srcPitch; - srcRight = 2; - break; - case RR_Rotate_90: - src += (srcH - 1) * 2; - srcDown = -2; - srcRight = srcPitch; - break; - case RR_Rotate_180: - src += srcPitch * (srcH - 1) + (srcW - 1) * 2; - srcDown = -srcPitch; - srcRight = -2; - break; - case RR_Rotate_270: - src += srcPitch * (srcW - 1); - srcDown = 2; - srcRight = -srcPitch; - break; - } - - src = src + top * srcDown + left * srcRight; - - w >>= 1; - /* srcRight >>= 1; */ - srcNext = srcRight >> 1; - while (h--) { - CARD16 *s = (CARD16 *) src; - CARD32 *d = (CARD32 *) dst; - - p = w; - while (p--) { - *d++ = s[0] | (s[srcNext] << 16); - s += srcRight; - } - src += srcPitch; - dst += dstPitch; - } -} - -void -KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, - int srcPitch, int srcPitch2, int dstPitch, int srcW, - int srcH, int height, int top, int left, int h, int w, - int id) -{ - int i, j; - CARD8 *src1, *src2, *src3, *dst1; - int srcDown = srcPitch, srcDown2 = srcPitch2; - int srcRight = 2, srcRight2 = 1, srcNext = 1; - - /* compute source data pointers */ - src1 = src; - src2 = src1 + height * srcPitch; - src3 = src2 + (height >> 1) * srcPitch2; - switch (randr & RR_Rotate_All) { - case RR_Rotate_0: - srcDown = srcPitch; - srcDown2 = srcPitch2; - srcRight = 2; - srcRight2 = 1; - srcNext = 1; - break; - case RR_Rotate_90: - src1 = src1 + srcH - 1; - src2 = src2 + (srcH >> 1) - 1; - src3 = src3 + (srcH >> 1) - 1; - srcDown = -1; - srcDown2 = -1; - srcRight = srcPitch * 2; - srcRight2 = srcPitch2; - srcNext = srcPitch; - break; - case RR_Rotate_180: - src1 = src1 + srcPitch * (srcH - 1) + (srcW - 1); - src2 = src2 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1); - src3 = src3 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1); - srcDown = -srcPitch; - srcDown2 = -srcPitch2; - srcRight = -2; - srcRight2 = -1; - srcNext = -1; - break; - case RR_Rotate_270: - src1 = src1 + srcPitch * (srcW - 1); - src2 = src2 + srcPitch2 * ((srcW >> 1) - 1); - src3 = src3 + srcPitch2 * ((srcW >> 1) - 1); - srcDown = 1; - srcDown2 = 1; - srcRight = -srcPitch * 2; - srcRight2 = -srcPitch2; - srcNext = -srcPitch; - break; - } - - /* adjust for origin */ - src1 += top * srcDown + left * srcNext; - src2 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2; - src3 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2; - - if (id == FOURCC_I420) { - CARD8 *srct = src2; - - src2 = src3; - src3 = srct; - } - - dst1 = dst; - - w >>= 1; - for (j = 0; j < h; j++) { - CARD32 *dst32 = (CARD32 *) dst1; - CARD8 *s1l = src1; - CARD8 *s1r = src1 + srcNext; - CARD8 *s2 = src2; - CARD8 *s3 = src3; - - for (i = 0; i < w; i++) { - *dst32++ = *s1l | (*s1r << 16) | (*s3 << 8) | (*s2 << 24); - s1l += srcRight; - s1r += srcRight; - s2 += srcRight2; - s3 += srcRight2; - } - src1 += srcDown; - dst1 += dstPitch; - if (j & 1) { - src2 += srcDown2; - src3 += srcDown2; - } - } -} diff --git a/xserver/hw/kdrive/src/kxv.h b/xserver/hw/kdrive/src/kxv.h index b99729922..a264dcab2 100644 --- a/xserver/hw/kdrive/src/kxv.h +++ b/xserver/hw/kdrive/src/kxv.h @@ -148,27 +148,6 @@ typedef struct { Bool KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num); -void - -KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, - int srcPitch, int dstPitch, int srcW, int srcH, int top, - int left, int h, int w); - -void - -KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, - int srcPitch, int srcPitch2, int dstPitch, int srcW, - int srcH, int height, int top, int left, int h, int w, - int id); - -KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen); - -void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr); - -/* Must be called from KdCardInfo functions, can be called without Xv enabled */ -Bool KdXVEnable(ScreenPtr); -void KdXVDisable(ScreenPtr); - /*** These are DDX layer privates ***/ typedef struct { diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c index d7bfd70e9..407f2afcd 100644 --- a/xserver/hw/vfb/InitOutput.c +++ b/xserver/hw/vfb/InitOutput.c @@ -70,7 +70,7 @@ from The Open Group. #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 -#define VFB_DEFAULT_DEPTH 8 +#define VFB_DEFAULT_DEPTH 24 #define VFB_DEFAULT_WHITEPIXEL 1 #define VFB_DEFAULT_BLACKPIXEL 0 #define VFB_DEFAULT_LINEBIAS 0 @@ -957,27 +957,12 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) } /* end vfbScreenInit */ -static const ExtensionModule vfbExtensions[] = { -#ifdef GLXEXT - { GlxExtensionInit, "GLX", &noGlxExtension }, -#endif -}; - -static -void vfbExtensionInit(void) -{ - LoadExtensionList(vfbExtensions, ARRAY_SIZE(vfbExtensions), TRUE); -} - void InitOutput(ScreenInfo * screen_info, int argc, char **argv) { int i; int NumFormats = 0; - if (serverGeneration == 1) - vfbExtensionInit(); - /* initialize pixmap formats */ /* must have a pixmap depth to match every screen depth */ @@ -1002,6 +987,8 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) vfbPixmapDepths[32] = TRUE; } + xorgGlxCreateVendor(); + for (i = 1; i <= 32; i++) { if (vfbPixmapDepths[i]) { if (NumFormats >= MAXFORMATS) diff --git a/xserver/hw/vfb/Makefile.am b/xserver/hw/vfb/Makefile.am index f0f9fee47..70333976c 100644 --- a/xserver/hw/vfb/Makefile.am +++ b/xserver/hw/vfb/Makefile.am @@ -16,7 +16,6 @@ XVFB_LIBS = \ @XVFB_LIBS@ \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) diff --git a/xserver/hw/vfb/Makefile.in b/xserver/hw/vfb/Makefile.in index b73e97463..1197f32cb 100644 --- a/xserver/hw/vfb/Makefile.in +++ b/xserver/hw/vfb/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -81,7 +81,6 @@ am_Xvfb_OBJECTS = $(am__objects_1) Xvfb_OBJECTS = $(am_Xvfb_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -355,6 +354,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -373,15 +373,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -389,6 +392,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -451,7 +456,6 @@ XVFB_LIBS = \ @XVFB_LIBS@ \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ @@ -466,8 +470,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/vfb/man/Makefile.in b/xserver/hw/vfb/man/Makefile.in index 77d26f3c0..c91d250a4 100644 --- a/xserver/hw/vfb/man/Makefile.in +++ b/xserver/hw/vfb/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/vfb/man/Xvfb.man b/xserver/hw/vfb/man/Xvfb.man index 95b4dd4c1..d7959b879 100644 --- a/xserver/hw/vfb/man/Xvfb.man +++ b/xserver/hw/vfb/man/Xvfb.man @@ -26,7 +26,7 @@ .\" .\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.9 2001/12/14 19:59:45 dawes Exp $ .\" -.TH XVFB 1 __xorgversion__ +.TH XVFB 1 @xorgversion@ .SH NAME Xvfb \- virtual framebuffer X server for X Version 11 .SH SYNOPSIS @@ -55,7 +55,7 @@ manual page, \fIXvfb\fP accepts the following command line switches: .B "\-screen \fIscreennum\fP \fIWxHxD\fP" This option creates screen \fIscreennum\fP and sets its width, height, and depth to W, H, and D respectively. By default, only screen 0 exists -and has the dimensions 1280x1024x8. +and has the dimensions 1280x1024x24. .TP 4 .B "\-pixdepths \fIlist-of-depths\fP" This option specifies a list of pixmap depths that the server should @@ -100,18 +100,17 @@ snapshot can be done with a file copy command, and the resulting snapshot will even contain the cursor image. .SH EXAMPLES .TP 8 -Xvfb :1 -screen 0 1600x1200x32 +Xvfb :1 -screen 0 1600x1200x24 The server will listen for connections as server number 1, and screen 0 -will be depth 32 1600x1200. +will be depth 24 1600x1200. .TP 8 Xvfb :1 -screen 1 1600x1200x16 -The server will listen for connections as server number 1, will have the -default screen configuration (one screen, 1280x1024x8), and screen 1 -will be depth 16 1600x1200. +The server will listen for connections as server number 1, screen 0 will have the +default screen configuration (1280x1024x24), and screen 1 will be depth 16 1600x1200. .TP 8 Xvfb -pixdepths 3 27 -fbdir /var/tmp The server will listen for connections as server number 0, will have the -default screen configuration (one screen, 1280x1024x8), +default screen configuration (one screen, 1280x1024x24), will also support pixmap depths of 3 and 27, and will use memory mapped files in /var/tmp for the framebuffer. @@ -120,6 +119,6 @@ xwud -in /var/tmp/Xvfb_screen0 Displays screen 0 of the server started by the preceding example. .SH "SEE ALSO" .PP -X(__miscmansuffix__), Xserver(1), xwd(1), xwud(1), XWDFile.h +X(@miscmansuffix@), Xserver(1), xwd(1), xwud(1), XWDFile.h .SH AUTHORS David P. Wiggins, The Open Group, Inc. diff --git a/xserver/hw/xfree86/Makefile.am b/xserver/hw/xfree86/Makefile.am index 458720052..9aeaea1a6 100644 --- a/xserver/hw/xfree86/Makefile.am +++ b/xserver/hw/xfree86/Makefile.am @@ -14,6 +14,10 @@ DRI3_BUILDDIR = $(top_builddir)/dri3 DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la endif +if GLX +GLXVND_LIB = $(top_builddir)/glx/libglxvnd.la +endif + if GLAMOR_EGL GLAMOR_EGL_SUBDIR = glamor_egl endif @@ -70,6 +74,7 @@ LOCAL_LIBS = \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ + $(GLXVND_LIB) \ $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la \ @@ -103,14 +108,14 @@ endif install-exec-hook: (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg$(EXEEXT) X) if INSTALL_SETUID - chown root $(DESTDIR)$(bindir)/Xorg + chown 0 $(DESTDIR)$(bindir)/Xorg chmod u+s $(DESTDIR)$(bindir)/Xorg endif if SUID_WRAPPER $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg - -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap + -chown 0 $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap endif uninstall-local: diff --git a/xserver/hw/xfree86/Makefile.in b/xserver/hw/xfree86/Makefile.in index c57648f15..2f9e20d7b 100644 --- a/xserver/hw/xfree86/Makefile.in +++ b/xserver/hw/xfree86/Makefile.in @@ -70,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = Xorg.sh CONFIG_CLEAN_VPATH_FILES = @@ -85,7 +85,8 @@ am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ dixmods/libdixmods.la modes/libxf86modes.la \ ramdac/libramdac.la ddc/libddc.la i2c/libi2c.la \ $(am__DEPENDENCIES_1) xkb/libxorgxkb.la $(DRI_LIB) $(DRI2_LIB) \ - $(DRI3_LIB) $(top_builddir)/miext/sync/libsync.la \ + $(DRI3_LIB) $(GLXVND_LIB) \ + $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la \ $(top_builddir)/Xext/libXvidmode.la AM_V_lt = $(am__v_lt_@AM_V@) @@ -363,6 +364,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -381,15 +383,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -397,6 +402,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -468,8 +475,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -540,6 +545,7 @@ top_srcdir = @top_srcdir@ @DRI2_TRUE@DRI2_LIB = dri2/libdri2.la @DRI3_TRUE@DRI3_BUILDDIR = $(top_builddir)/dri3 @DRI3_TRUE@DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la +@GLX_TRUE@GLXVND_LIB = $(top_builddir)/glx/libglxvnd.la @GLAMOR_EGL_TRUE@GLAMOR_EGL_SUBDIR = glamor_egl @XF86UTILS_TRUE@XF86UTILS_SUBDIR = utils @VGAHW_TRUE@VGAHW_SUBDIR = vgahw @@ -579,6 +585,7 @@ LOCAL_LIBS = \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ + $(GLXVND_LIB) \ $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la \ @@ -1106,12 +1113,12 @@ install-data-local: install-exec-hook: (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg$(EXEEXT) X) -@INSTALL_SETUID_TRUE@ chown root $(DESTDIR)$(bindir)/Xorg +@INSTALL_SETUID_TRUE@ chown 0 $(DESTDIR)$(bindir)/Xorg @INSTALL_SETUID_TRUE@ chmod u+s $(DESTDIR)$(bindir)/Xorg @SUID_WRAPPER_TRUE@ $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) @SUID_WRAPPER_TRUE@ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg @SUID_WRAPPER_TRUE@ ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg -@SUID_WRAPPER_TRUE@ -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap +@SUID_WRAPPER_TRUE@ -chown 0 $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap uninstall-local: @CYGWIN_TRUE@ $(AM_V_at)rm -f $(DESTDIR)$(libdir)/libXorg.exe.a diff --git a/xserver/hw/xfree86/common/Makefile.am b/xserver/hw/xfree86/common/Makefile.am index caae7fd97..41758fd2e 100644 --- a/xserver/hw/xfree86/common/Makefile.am +++ b/xserver/hw/xfree86/common/Makefile.am @@ -58,7 +58,8 @@ sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h \ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ $(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ + xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h \ + xf86platformBus.h xf86MatchDrivers.h \ xaarop.h DISTCLEANFILES = xf86Build.h diff --git a/xserver/hw/xfree86/common/Makefile.in b/xserver/hw/xfree86/common/Makefile.in index 767488a9f..08aeea9d0 100644 --- a/xserver/hw/xfree86/common/Makefile.in +++ b/xserver/hw/xfree86/common/Makefile.in @@ -72,7 +72,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = xf86Build.h CONFIG_CLEAN_VPATH_FILES = @@ -154,7 +154,8 @@ am__sdk_HEADERS_DIST = compiler.h fourcc.h xf86.h xf86Module.h \ xf86Opt.h xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86cmap.h \ xf86fbman.h xf86str.h xf86Xinput.h xisb.h xf86xv.h xf86xvmc.h \ xf86xvpriv.h dgaproc.h xorgVersion.h xf86sbusBus.h \ - xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h xaarop.h + xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ + xf86MatchDrivers.h xaarop.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -370,6 +371,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -388,15 +390,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -404,6 +409,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -475,8 +482,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -578,7 +583,8 @@ sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h \ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ $(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ + xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h \ + xf86platformBus.h xf86MatchDrivers.h \ xaarop.h DISTCLEANFILES = xf86Build.h diff --git a/xserver/hw/xfree86/common/compiler.h b/xserver/hw/xfree86/common/compiler.h index 4e50a935d..fc1c8b54a 100644 --- a/xserver/hw/xfree86/common/compiler.h +++ b/xserver/hw/xfree86/common/compiler.h @@ -98,9 +98,9 @@ #if defined(DO_PROTOTYPES) #if !defined(__arm__) #if !defined(__sparc__) && !defined(__arm32__) && !defined(__nds32__) \ - && !(defined(__alpha__) && defined(linux)) \ - && !(defined(__ia64__) && defined(linux)) \ - && !(defined(__mips64) && defined(linux)) \ + && !(defined(__alpha__) && defined(__linux__)) \ + && !(defined(__ia64__) && defined(__linux__)) \ + && !(defined(__mips64) && defined(__linux__)) \ extern _X_EXPORT void outb(unsigned short, unsigned char); extern _X_EXPORT void outw(unsigned short, unsigned short); @@ -215,7 +215,7 @@ extern _X_EXPORT void xf86WriteMmio32Le (void *, unsigned long, unsigned int); #ifdef __GNUC__ #if defined(__alpha__) -#ifdef linux +#ifdef __linux__ /* for Linux on Alpha, we use the LIBC _inx/_outx routines */ /* note that the appropriate setup via "ioperm" needs to be done */ /* *before* any inx/outx is done. */ @@ -263,7 +263,7 @@ inl(unsigned long port) return _inl(port); } -#endif /* linux */ +#endif /* __linux__ */ #if (defined(__FreeBSD__) || defined(__OpenBSD__)) \ && !defined(DO_PROTOTYPES) @@ -570,7 +570,7 @@ inl(unsigned PORT_SIZE port) } #if defined(__mips__) -#ifdef linux /* don't mess with other OSs */ +#ifdef __linux__ /* don't mess with other OSs */ #if X_BYTE_ORDER == X_BIG_ENDIAN static __inline__ unsigned int xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) @@ -594,7 +594,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, :"r"(val), "r"(addr)); } #endif -#endif /* !linux */ +#endif /* !__linux__ */ #endif /* __mips__ */ #elif defined(__powerpc__) @@ -986,33 +986,64 @@ inl(unsigned PORT_SIZE port) #endif #ifdef __alpha__ -/* entry points for Mmio memory access routines */ -extern _X_EXPORT int (*xf86ReadMmio8) (void *, unsigned long); -extern _X_EXPORT int (*xf86ReadMmio16) (void *, unsigned long); -extern _X_EXPORT int (*xf86ReadMmio32) (void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmio8) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmio16) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmio32) (int, void *, unsigned long); +static inline int +xf86ReadMmio8(void *Base, unsigned long Offset) +{ + mem_barrier(); + return *(CARD8 *) ((unsigned long) Base + (Offset)); +} + +static inline int +xf86ReadMmio16(void *Base, unsigned long Offset) +{ + mem_barrier(); + return *(CARD16 *) ((unsigned long) Base + (Offset)); +} + +static inline int +xf86ReadMmio32(void *Base, unsigned long Offset) +{ + mem_barrier(); + return *(CARD32 *) ((unsigned long) Base + (Offset)); +} + +static inline void +xf86WriteMmio8(int Value, void *Base, unsigned long Offset) +{ + write_mem_barrier(); + *(CARD8 *) ((unsigned long) Base + (Offset)) = Value; +} + +static inline void +xf86WriteMmio16(int Value, void *Base, unsigned long Offset) +{ + write_mem_barrier(); + *(CARD16 *) ((unsigned long) Base + (Offset)) = Value; +} + +static inline void +xf86WriteMmio32(int Value, void *Base, unsigned long Offset) +{ + write_mem_barrier(); + *(CARD32 *) ((unsigned long) Base + (Offset)) = Value; +} + extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); /* Some macros to hide the system dependencies for MMIO accesses */ /* Changed to kill noise generated by gcc's -Wcast-align */ -#define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) -#define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) -#define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) - -#define MMIO_OUT32(base, offset, val) \ - do { \ - write_mem_barrier(); \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ - } while (0) +#define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) +#define MMIO_IN16(base, offset) xf86ReadMmio16(base, offset) +#define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) #define MMIO_OUT8(base, offset, val) \ - (*xf86WriteMmio8)((CARD8)(val), base, offset) + xf86WriteMmio8((CARD8)(val), base, offset) #define MMIO_OUT16(base, offset, val) \ - (*xf86WriteMmio16)((CARD16)(val), base, offset) + xf86WriteMmio16((CARD16)(val), base, offset) +#define MMIO_OUT32(base, offset, val) \ + xf86WriteMmio32((CARD32)(val), base, offset) #elif defined(__powerpc__) || defined(__sparc__) /* diff --git a/xserver/hw/xfree86/common/modeline2c.awk b/xserver/hw/xfree86/common/modeline2c.awk index 038e7e935..3c9f602d1 100644 --- a/xserver/hw/xfree86/common/modeline2c.awk +++ b/xserver/hw/xfree86/common/modeline2c.awk @@ -89,5 +89,5 @@ BEGIN { END { print "};" - printf "const int xf86NumDefaultModes = sizeof(xf86DefaultModes) / sizeof(DisplayModeRec);" + printf "const int xf86NumDefaultModes = ARRAY_SIZE(xf86DefaultModes);" } diff --git a/xserver/hw/xfree86/common/xf86.h b/xserver/hw/xfree86/common/xf86.h index e54c81170..5743f0cd4 100644 --- a/xserver/hw/xfree86/common/xf86.h +++ b/xserver/hw/xfree86/common/xf86.h @@ -35,7 +35,7 @@ #ifndef _XF86_H #define _XF86_H -#if HAVE_XORG_CONFIG_H +#ifdef HAVE_XORG_CONFIG_H #include #elif HAVE_DIX_CONFIG_H #include @@ -55,6 +55,7 @@ extern _X_EXPORT int xf86DoConfigure; extern _X_EXPORT int xf86DoShowOptions; extern _X_EXPORT Bool xf86DoConfigurePass1; +extern _X_EXPORT Bool xf86ProbeIgnorePrimary; extern _X_EXPORT Bool xorgHWAccess; extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; @@ -76,8 +77,6 @@ extern _X_EXPORT int platformSlotClaimed; extern _X_EXPORT confDRIRec xf86ConfigDRI; extern _X_EXPORT Bool xf86DRI2Enabled(void); -extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ - #define XF86SCRNINFO(p) xf86ScreenToScrn(p) #define XF86FLIP_PIXELS() \ @@ -90,9 +89,6 @@ extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ #define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE") -#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \ - (((p) == Pix24Use32) ? 32 : 0)) - /* Compatibility functions for pre-input-thread drivers */ static inline _X_DEPRECATED int xf86BlockSIGIO(void) { input_lock(); return 0; } static inline _X_DEPRECATED void xf86UnblockSIGIO(int wasset) { input_unlock(); } @@ -156,9 +152,6 @@ extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance); extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex); -extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, - EntityProc enter, EntityProc leave, - void *); extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex); extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); @@ -222,9 +215,6 @@ extern _X_EXPORT void xf86DisableGeneralHandler(void *handler); extern _X_EXPORT void xf86EnableGeneralHandler(void *handler); extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, void *data); -extern _X_EXPORT void xf86InterceptSignals(int *signo); -extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void)); -extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new); extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg); extern _X_EXPORT void xf86PrintBacktrace(void); extern _X_EXPORT Bool xf86VTOwner(void); @@ -289,8 +279,6 @@ extern _X_EXPORT const char * xf86GetVisualName(int visual); extern _X_EXPORT int xf86GetVerbosity(void); -extern _X_EXPORT Pix24Flags -xf86GetPix24(void); extern _X_EXPORT int xf86GetDepth(void); extern _X_EXPORT rgb @@ -308,8 +296,6 @@ xf86ServerIsResetting(void); extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void); extern _X_EXPORT Bool -xf86CaughtSignal(void); -extern _X_EXPORT Bool xf86GetVidModeAllowNonLocal(void); extern _X_EXPORT Bool xf86GetVidModeEnabled(void); @@ -319,8 +305,6 @@ extern _X_EXPORT Bool xf86GetModInDevEnabled(void); extern _X_EXPORT Bool xf86GetAllowMouseOpenFail(void); -extern _X_EXPORT void -xf86DisableRandR(void); extern _X_EXPORT CARD32 xorgGetVersion(void); extern _X_EXPORT CARD32 @@ -342,8 +326,6 @@ xf86SetSilkenMouse(ScreenPtr pScreen); extern _X_EXPORT void * xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name, const char **adaptor_name, void **adaptor_options); -extern _X_EXPORT void -xf86GetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c index dfde795d7..3b6bd05a2 100644 --- a/xserver/hw/xfree86/common/xf86AutoConfig.c +++ b/xserver/hw/xfree86/common/xf86AutoConfig.c @@ -37,6 +37,7 @@ #include "xf86Parser.h" #include "xf86tokens.h" #include "xf86Config.h" +#include "xf86MatchDrivers.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86platformBus.h" @@ -89,7 +90,7 @@ static const char **builtinConfig = NULL; static int builtinLines = 0; -static void listPossibleVideoDrivers(char *matches[], int nmatches); +static void listPossibleVideoDrivers(XF86MatchedDrivers *md); /* * A built-in config file is stored as an array of strings, with each string @@ -140,11 +141,33 @@ AppendToConfig(const char *s) AppendToList(s, &builtinConfig, &builtinLines); } +void +xf86AddMatchedDriver(XF86MatchedDrivers *md, const char *driver) +{ + int j; + int nmatches = md->nmatches; + + for (j = 0; j < nmatches; ++j) { + if (xf86NameCmp(md->matches[j], driver) == 0) { + // Driver already in matched drivers + return; + } + } + + if (nmatches < MATCH_DRIVERS_LIMIT) { + md->matches[nmatches] = xnfstrdup(driver); + md->nmatches++; + } + else { + xf86Msg(X_WARNING, "Too many drivers registered, can't add %s\n", driver); + } +} + Bool xf86AutoConfig(void) { - char *deviceList[20]; - char **p; + XF86MatchedDrivers md; + int i; const char **cp; char buf[1024]; ConfigStatus ret; @@ -158,24 +181,27 @@ xf86AutoConfig(void) return FALSE; } - listPossibleVideoDrivers(deviceList, 20); + listPossibleVideoDrivers(&md); - for (p = deviceList; *p; p++) { - snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p); + for (i = 0; i < md.nmatches; i++) { + snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, + md.matches[i], 0, md.matches[i]); AppendToConfig(buf); - snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0); + snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, + md.matches[i], 0, md.matches[i], 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE); - for (p = deviceList; *p; p++) { - snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0); + for (i = 0; i < md.nmatches; i++) { + snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, + md.matches[i], 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_POST); - for (p = deviceList; *p; p++) { - free(*p); + for (i = 0; i < md.nmatches; i++) { + free(md.matches[i]); } xf86MsgVerb(X_DEFAULT, 0, @@ -201,16 +227,12 @@ xf86AutoConfig(void) #ifdef __OpenBSD__ static void -listPossibleVideoDrivers(char *matches[], int nmatches) +listPossibleVideoDrivers(XF86MatchedDrivers *md) { int fd = xf86Info.consoleFd; u_int gtype; - int i; - for (i = 0; i < nmatches; i++) { - matches[i] = NULL; - } - i = 0; + md->nmatches = 0; if (ioctl(fd, WSDISPLAYIO_GTYPE, >ype) == -1) return; @@ -221,45 +243,40 @@ listPossibleVideoDrivers(char *matches[], int nmatches) case WSDISPLAY_TYPE_MACHFB: case WSDISPLAY_TYPE_INTELDRM: case WSDISPLAY_TYPE_RADEONDRM: - i = xf86PciMatchDriver(matches, nmatches); + xf86PciMatchDriver(md); break; #endif case WSDISPLAY_TYPE_IFB: - matches[i++] = xnfstrdup("wildcatfb"); + xf86AddMatchedDriver(md, "wildcatfb"); break; case WSDISPLAY_TYPE_SUNFFB: - matches[i++] = xnfstrdup("sunffb"); + xf86AddMatchedDriver(md, "sunffb"); break; default: - matches[i++] = xnfstrdup("wsfb"); + xf86AddMatchedDriver(md, "wsfb"); break; } #if defined(__i386__) || defined(__amd64__) - if (gtype == WSDISPLAY_TYPE_PCIVGA && i < (nmatches - 1)) - matches[i++] = xnfstrdup("vesa"); + if (gtype == WSDISPLAY_TYPE_PCIVGA) + xf86AddMatchedDriver(md, "vesa"); #endif } #else static void -listPossibleVideoDrivers(char *matches[], int nmatches) +listPossibleVideoDrivers(XF86MatchedDrivers *md) { - int i; - - for (i = 0; i < nmatches; i++) { - matches[i] = NULL; - } - i = 0; + md->nmatches = 0; #ifdef XSERVER_PLATFORM_BUS - i = xf86PlatformMatchDriver(matches, nmatches); + xf86PlatformMatchDriver(md); #endif #ifdef __sun /* Check for driver type based on /dev/fb type and if valid, use it instead of PCI bus probe results */ - if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { + if (xf86Info.consoleFd >= 0) { struct vis_identifier visid; const char *cp; int iret; @@ -285,7 +302,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) /* Special case from before the general case was set */ if (strcmp(visid.name, "NVDAnvda") == 0) { - matches[i++] = xnfstrdup("nvidia"); + xf86AddMatchedDriver(md, "nvidia"); } /* General case - split into vendor name (initial all-caps @@ -295,61 +312,52 @@ listPossibleVideoDrivers(char *matches[], int nmatches) /* find end of all uppercase vendor section */ } if ((cp != visid.name) && (*cp != '\0')) { - char *driverName = xnfstrdup(cp); char *vendorName = xnfstrdup(visid.name); vendorName[cp - visid.name] = '\0'; - matches[i++] = vendorName; - matches[i++] = driverName; + xf86AddMatchedDriver(md, vendorName); + xf86AddMatchedDriver(md, cp); + + free(vendorName); } } } } #endif #ifdef __sparc__ - if (i < (nmatches - 1)) - { - char *sbusDriver = sparcDriverName(); + char *sbusDriver = sparcDriverName(); - if (sbusDriver) - matches[i++] = xnfstrdup(sbusDriver); - } + if (sbusDriver) + xf86AddMatchedDriver(md, sbusDriver); #endif #ifdef XSERVER_LIBPCIACCESS - if (i < (nmatches - 1)) - i += xf86PciMatchDriver(&matches[i], nmatches - i); + xf86PciMatchDriver(md); #endif #if defined(__linux__) - matches[i++] = xnfstrdup("modesetting"); + xf86AddMatchedDriver(md, "modesetting"); #endif #if !defined(__sun) /* Fallback to platform default frame buffer driver */ - if (i < (nmatches - 1)) { #if defined(__OpenBSD__) #if !defined(__i386__) && !defined(__amd64__) - if (i == 0) { - matches[i++] = xnfstrdup("wsfb"); - } + xf86AddMatchedDriver(md, "wsfb"); #endif #elif !defined(__linux__) && defined(__sparc__) - matches[i++] = xnfstrdup("wsfb"); + xf86AddMatchedDriver(md, "wsfb"); #else - matches[i++] = xnfstrdup("fbdev"); + xf86AddMatchedDriver(md, "fbdev"); #endif - } #endif /* !__sun */ /* Fallback to platform default hardware */ - if (i < (nmatches - 1)) { #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) - matches[i++] = xnfstrdup("vesa"); + xf86AddMatchedDriver(md, "vesa"); #elif defined(__sparc__) && defined(__linux__) - matches[i++] = xnfstrdup("sunffb"); + xf86AddMatchedDriver(md, "sunffb"); #endif - } } #endif @@ -397,8 +405,8 @@ GDevPtr autoConfigDevice(GDevPtr preconf_device) { GDevPtr ptr = NULL; - char *matches[20]; /* If we have more than 20 drivers we're in trouble */ - int num_matches = 0, num_screens = 0, i; + XF86MatchedDrivers md; + int num_screens = 0, i; screenLayoutPtr slp; if (!xf86configptr) { @@ -425,10 +433,10 @@ autoConfigDevice(GDevPtr preconf_device) } if (!ptr->driver) { /* get all possible video drivers and count them */ - listPossibleVideoDrivers(matches, 20); - for (; matches[num_matches]; num_matches++) { + listPossibleVideoDrivers(&md); + for (i = 0; i < md.nmatches; i++) { xf86Msg(X_DEFAULT, "Matched %s as autoconfigured driver %d\n", - matches[num_matches], num_matches); + md.matches[i], i); } slp = xf86ConfigLayout.screens; @@ -438,12 +446,12 @@ autoConfigDevice(GDevPtr preconf_device) * minus one for the already existing first one * plus one for the terminating NULL */ for (; slp[num_screens].screen; num_screens++); - xf86ConfigLayout.screens = xnfcalloc(num_screens + num_matches, + xf86ConfigLayout.screens = xnfcalloc(num_screens + md.nmatches, sizeof(screenLayoutRec)); xf86ConfigLayout.screens[0] = slp[0]; /* do the first match and set that for the original first screen */ - ptr->driver = matches[0]; + ptr->driver = md.matches[0]; if (!xf86ConfigLayout.screens[0].screen->device) { xf86ConfigLayout.screens[0].screen->device = ptr; ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; @@ -451,8 +459,8 @@ autoConfigDevice(GDevPtr preconf_device) /* for each other driver found, copy the first screen, insert it * into the list of screens and set the driver */ - for (i = 1; i < num_matches; i++) { - if (!copyScreen(slp[0].screen, ptr, i, matches[i])) + for (i = 1; i < md.nmatches; i++) { + if (!copyScreen(slp[0].screen, ptr, i, md.matches[i])) return NULL; } @@ -461,19 +469,17 @@ autoConfigDevice(GDevPtr preconf_device) * * TODO Handle rest of multiple screen sections */ for (i = 1; i < num_screens; i++) { - xf86ConfigLayout.screens[i + num_matches] = slp[i]; + xf86ConfigLayout.screens[i + md.nmatches] = slp[i]; } - xf86ConfigLayout.screens[num_screens + num_matches - 1].screen = + xf86ConfigLayout.screens[num_screens + md.nmatches - 1].screen = NULL; free(slp); } else { /* layout does not have any screens, not much to do */ - ptr->driver = matches[0]; - for (i = 1; matches[i]; i++) { - if (matches[i] != matches[0]) { - free(matches[i]); - } + ptr->driver = md.matches[0]; + for (i = 1; i < md.nmatches; i++) { + free(md.matches[i]); } } } diff --git a/xserver/hw/xfree86/common/xf86Build.sh b/xserver/hw/xfree86/common/xf86Build.sh new file mode 100644 index 000000000..5f859a5d8 --- /dev/null +++ b/xserver/hw/xfree86/common/xf86Build.sh @@ -0,0 +1,13 @@ +DATE_FMT="%Y%m%d" +TIME_FMT="1%H%M%S" + +BUILD_DATE="`date "+$DATE_FMT"`" +BUILD_TIME="`date "+$TIME_FMT"`" +if test "x$SOURCE_DATE_EPOCH" != "x"; then + BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`" + BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`" +fi + +output=$1 +echo "#define BUILD_DATE $BUILD_DATE" > $output +echo "#define BUILD_TIME $BUILD_TIME" >> $output diff --git a/xserver/hw/xfree86/common/xf86Bus.c b/xserver/hw/xfree86/common/xf86Bus.c index 377a4211e..3f9305266 100644 --- a/xserver/hw/xfree86/common/xf86Bus.c +++ b/xserver/hw/xfree86/common/xf86Bus.c @@ -82,8 +82,6 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) if (!xf86DoConfigure && drv->platformProbe != NULL) { foundScreen = xf86platformProbeDev(drv); } - if (ServerIsNotSeat0() && foundScreen) - return foundScreen; #endif #ifdef XSERVER_LIBPCIACCESS @@ -119,14 +117,38 @@ xf86BusConfig(void) int i, j; /* - * Now call each of the Probe functions. Each successful probe will - * result in an extra entry added to the xf86Screens[] list for each - * instance of the hardware found. + * 3 step probe to (hopefully) ensure that we always find at least 1 + * (non GPU) screen: + * + * 1. Call each drivers probe function normally, + * Each successful probe will result in an extra entry added to the + * xf86Screens[] list for each instance of the hardware found. */ for (i = 0; i < xf86NumDrivers; i++) { xf86CallDriverProbe(xf86DriverList[i], FALSE); } + /* + * 2. If no Screens were found, call each drivers probe function with + * ignorePrimary = TRUE, to ensure that we do actually get a + * Screen if there is atleast one supported video card. + */ + if (xf86NumScreens == 0) { + xf86ProbeIgnorePrimary = TRUE; + for (i = 0; i < xf86NumDrivers && xf86NumScreens == 0; i++) { + xf86CallDriverProbe(xf86DriverList[i], FALSE); + } + xf86ProbeIgnorePrimary = FALSE; + } + + /* + * 3. Call xf86platformAddGPUDevices() to add any additional video cards as + * GPUScreens (GPUScreens are only supported by platformBus drivers). + */ + for (i = 0; i < xf86NumDrivers; i++) { + xf86platformAddGPUDevices(xf86DriverList[i]); + } + /* If nothing was detected, return now */ if (xf86NumScreens == 0) { xf86Msg(X_ERROR, "No devices detected.\n"); @@ -290,19 +312,6 @@ xf86IsEntityPrimary(int entityIndex) } } -Bool -xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, - EntityProc leave, void *private) -{ - if (entityIndex >= xf86NumEntities) - return FALSE; - xf86Entities[entityIndex]->entityInit = init; - xf86Entities[entityIndex]->entityEnter = enter; - xf86Entities[entityIndex]->entityLeave = leave; - xf86Entities[entityIndex]->private = private; - return TRUE; -} - Bool xf86DriverHasEntities(DriverPtr drvp) { @@ -520,30 +529,6 @@ xf86GetDevFromEntity(int entityIndex, int instance) return xf86Entities[entityIndex]->devices[i]; } -/* - * xf86AccessEnter() -- gets called to save the text mode VGA IO - * resources when reentering the server after a VT switch. - */ -void -xf86AccessEnter(void) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityEnter) - xf86Entities[i]->entityEnter(i, xf86Entities[i]->private); -} - -void -xf86AccessLeave(void) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityLeave) - xf86Entities[i]->entityLeave(i, xf86Entities[i]->private); -} - /* * xf86PostProbe() -- Allocate all non conflicting resources * This function gets called by xf86Init(). @@ -551,8 +536,6 @@ xf86AccessLeave(void) void xf86PostProbe(void) { - int i; - if (fbSlotClaimed && ( #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) sbusSlotClaimed || @@ -568,10 +551,6 @@ xf86PostProbe(void) )) FatalError("Cannot run in framebuffer mode. Please specify busIDs " " for all framebuffer devices\n"); - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityInit) - xf86Entities[i]->entityInit(i, xf86Entities[i]->private); } int diff --git a/xserver/hw/xfree86/common/xf86Bus.h b/xserver/hw/xfree86/common/xf86Bus.h index c59625db6..52b497af6 100644 --- a/xserver/hw/xfree86/common/xf86Bus.h +++ b/xserver/hw/xfree86/common/xf86Bus.h @@ -48,10 +48,6 @@ typedef struct { DriverPtr driver; int chipset; int entityProp; - EntityProc entityInit; - EntityProc entityEnter; - EntityProc entityLeave; - void *private; Bool active; Bool inUse; BusRec bus; diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c index 21f0110c1..77b3a6286 100644 --- a/xserver/hw/xfree86/common/xf86Config.c +++ b/xserver/hw/xfree86/common/xf86Config.c @@ -60,12 +60,14 @@ #include "globals.h" #include "extension.h" #include "xf86pciBus.h" - #include "xf86Xinput.h" +#include "loaderProcs.h" #include "xkbsrv.h" - #include "picture.h" +#ifdef DPMSExtension +#include "dpmsproc.h" +#endif /* * These paths define the way the config file search is done. The escape @@ -518,82 +520,6 @@ xf86InputDriverlistFromConfig(void) return modulearray; } -static int -is_fallback(const char *s) -{ - /* later entries are less preferred */ - const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; - int i; - - for (i = 0; fallback[i]; i++) - if (strstr(s, fallback[i])) - return i; - - return -1; -} - -static int -driver_sort(const void *_l, const void *_r) -{ - const char *l = *(const char **)_l; - const char *r = *(const char **)_r; - int left = is_fallback(l); - int right = is_fallback(r); - - /* neither is a fallback, asciibetize */ - if (left == -1 && right == -1) - return strcmp(l, r); - - /* left is a fallback */ - if (left >= 0) - return 1; - - /* right is a fallback */ - if (right >= 0) - return -1; - - /* both are fallbacks, which is worse */ - return left - right; -} - -static void -fixup_video_driver_list(const char **drivers) -{ - const char **end; - - /* walk to the end of the list */ - for (end = drivers; *end && **end; end++); - end--; - - qsort(drivers, end - drivers, sizeof(const char *), driver_sort); -} - -static const char ** -GenerateDriverlist(const char *dirname) -{ - const char **ret; - const char *subdirs[] = { dirname, NULL }; - static const char *patlist[] = { "(.*)_drv\\.so", NULL }; - ret = LoaderListDirs(subdirs, patlist); - - /* fix up the probe order for video drivers */ - if (strstr(dirname, "drivers") && ret != NULL) - fixup_video_driver_list(ret); - - return ret; -} - -const char ** -xf86DriverlistFromCompile(void) -{ - static const char **driverlist = NULL; - - if (!driverlist) - driverlist = GenerateDriverlist("drivers"); - - return driverlist; -} - static void configFiles(XF86ConfFilesPtr fileconf) { @@ -704,12 +630,10 @@ typedef enum { FLAG_DPMS_STANDBYTIME, FLAG_DPMS_SUSPENDTIME, FLAG_DPMS_OFFTIME, - FLAG_PIXMAP, FLAG_NOPM, FLAG_XINERAMA, FLAG_LOG, FLAG_RENDER_COLORMAP_MODE, - FLAG_RANDR, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, FLAG_USE_DEFAULT_FONT_PATH, @@ -721,6 +645,7 @@ typedef enum { FLAG_AUTO_ADD_GPU, FLAG_MAX_CLIENTS, FLAG_IGLX, + FLAG_DEBUG, } FlagValues; /** @@ -750,8 +675,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, {FLAG_DPMS_OFFTIME, "OffTime", OPTV_INTEGER, {0}, FALSE}, - {FLAG_PIXMAP, "Pixmap", OPTV_INTEGER, - {0}, FALSE}, {FLAG_NOPM, "NoPM", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN, @@ -760,8 +683,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, {FLAG_RENDER_COLORMAP_MODE, "RenderColormapMode", OPTV_STRING, {0}, FALSE}, - {FLAG_RANDR, "RandR", OPTV_BOOLEAN, - {0}, FALSE}, {FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -782,6 +703,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, {0}, FALSE}, + {FLAG_DEBUG, "Debug", OPTV_STRING, + {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; @@ -791,7 +714,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) { XF86OptionPtr optp, tmp; int i; - Pix24Flags pix24 = Pix24DontCare; Bool value; MessageType from; const char *s; @@ -905,15 +827,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } } -#ifdef RANDR - xf86Info.disableRandR = FALSE; - xf86Info.randRFrom = X_DEFAULT; - if (xf86GetOptValBool(FlagOptions, FLAG_RANDR, &value)) { - xf86Info.disableRandR = !value; - xf86Info.randRFrom = X_CONFIG; - } -#endif - #ifdef GLXEXT xf86Info.glxVisuals = XF86_GlxVisualsTypical; xf86Info.glxVisualsFrom = X_DEFAULT; @@ -940,13 +853,15 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif + xf86Info.debug = xf86GetOptValString(FlagOptions, FLAG_DEBUG); + /* if we're not hotplugging, force some input devices to exist */ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices); /* when forcing input devices, we use kbd. otherwise evdev, so use the * evdev rules set. */ -#if defined(linux) +#if defined(__linux__) if (!xf86Info.forceInputDevices) rules = "evdev"; else @@ -998,34 +913,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) i, MAX_TIME_IN_MIN); #endif - i = -1; - xf86GetOptValInteger(FlagOptions, FLAG_PIXMAP, &i); - switch (i) { - case 24: - pix24 = Pix24Use24; - break; - case 32: - pix24 = Pix24Use32; - break; - case -1: - break; - default: - ErrorF("Pixmap option's value (%d) must be 24 or 32\n", i); - break; - } - if (xf86Pix24 != Pix24DontCare) { - xf86Info.pixmap24 = xf86Pix24; - xf86Info.pix24From = X_CMDLINE; - } - else if (pix24 != Pix24DontCare) { - xf86Info.pixmap24 = pix24; - xf86Info.pix24From = X_CONFIG; - } - else { - xf86Info.pixmap24 = Pix24DontCare; - xf86Info.pix24From = X_DEFAULT; - } - #ifdef PANORAMIX from = X_DEFAULT; if (!noPanoramiXExtension) @@ -1052,10 +939,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) from = X_CMDLINE; i = -1; if (xf86GetOptValInteger(FlagOptions, FLAG_MAX_CLIENTS, &i)) { - if (i != 64 && i != 128 && i != 256 && i != 512) - ErrorF("MaxClients must be one of 64, 128, 256 or 512\n"); - from = X_CONFIG; - LimitClients = i; + if (Ones(i) != 1 || i < 64 || i > 2048) { + ErrorF("MaxClients must be one of 64, 128, 256, 512, 1024, or 2048\n"); + } else { + from = X_CONFIG; + LimitClients = i; + } } xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n", LimitClients, RESOURCE_ID_MASK); @@ -2181,7 +2070,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active, Bool g devicep->driver = conf_device->dev_driver; devicep->active = active; devicep->videoRam = conf_device->dev_videoram; - devicep->BiosBase = conf_device->dev_bios_base; devicep->MemBase = conf_device->dev_mem_base; devicep->IOBase = conf_device->dev_io_base; devicep->clockchip = conf_device->dev_clockchip; @@ -2381,8 +2269,10 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) ConfigStatus xf86HandleConfigFile(Bool autoconfig) { +#ifdef XSERVER_LIBPCIACCESS const char *scanptr; Bool singlecard = 0; +#endif Bool implicit_layout = FALSE; XF86ConfLayoutPtr layout; @@ -2392,7 +2282,7 @@ xf86HandleConfigFile(Bool autoconfig) MessageType filefrom = X_DEFAULT; MessageType dirfrom = X_DEFAULT; - if (!xf86PrivsElevated()) { + if (!PrivsElevated()) { filesearch = ALL_CONFIGPATH; dirsearch = ALL_CONFIGDIRPATH; } diff --git a/xserver/hw/xfree86/common/xf86Config.h b/xserver/hw/xfree86/common/xf86Config.h index 23fb383c3..bbcb252ed 100644 --- a/xserver/hw/xfree86/common/xf86Config.h +++ b/xserver/hw/xfree86/common/xf86Config.h @@ -61,7 +61,6 @@ typedef struct _ModuleDefault { */ const char **xf86ModulelistFromConfig(void ***); const char **xf86DriverlistFromConfig(void); -const char **xf86DriverlistFromCompile(void); const char **xf86InputDriverlistFromConfig(void); Bool xf86BuiltinInputDriver(const char *); ConfigStatus xf86HandleConfigFile(Bool); diff --git a/xserver/hw/xfree86/common/xf86Configure.c b/xserver/hw/xfree86/common/xf86Configure.c index 1ebcd4296..b88d1a2b1 100644 --- a/xserver/hw/xfree86/common/xf86Configure.c +++ b/xserver/hw/xfree86/common/xf86Configure.c @@ -40,6 +40,7 @@ #include "xf86Sbus.h" #endif #include "misc.h" +#include "loaderProcs.h" typedef struct _DevToConfig { GDevRec GDev; @@ -60,7 +61,7 @@ static Bool foundMouse = FALSE; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) static const char *DFLT_MOUSE_DEV = "/dev/sysmouse"; static const char *DFLT_MOUSE_PROTO = "auto"; -#elif defined(linux) +#elif defined(__linux__) static const char *DFLT_MOUSE_DEV = "/dev/input/mice"; static const char *DFLT_MOUSE_PROTO = "auto"; #elif defined(WSCONS_SUPPORT) @@ -157,7 +158,7 @@ configureInputSection(void) { XF86ConfInputPtr mouse = NULL; - parsePrologue(XF86ConfInputPtr, XF86ConfInputRec) + parsePrologue(XF86ConfInputPtr, XF86ConfInputRec); ptr->inp_identifier = xnfstrdup("Keyboard0"); ptr->inp_driver = xnfstrdup("kbd"); @@ -196,7 +197,7 @@ configureScreenSection(int screennum) int i; int depths[] = { 1, 4, 8, 15, 16, 24 /*, 32 */ }; char *tmp; - parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec) + parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec); XNFasprintf(&tmp, "Screen%d", screennum); ptr->scrn_identifier = tmp; @@ -205,7 +206,7 @@ configureScreenSection(int screennum) XNFasprintf(&tmp, "Card%d", screennum); ptr->scrn_device_str = tmp; - for (i = 0; i < sizeof(depths) / sizeof(depths[0]); i++) { + for (i = 0; i < ARRAY_SIZE(depths); i++) { XF86ConfDisplayPtr conf_display; conf_display = calloc(1, sizeof(XF86ConfDisplayRec)); @@ -254,9 +255,9 @@ configureDeviceSection(int screennum) int i = 0; char *identifier; - parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec) + parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec); - /* Move device info to parser structure */ + /* Move device info to parser structure */ if (asprintf(&identifier, "Card%d", screennum) == -1) identifier = NULL; ptr->dev_identifier = identifier; @@ -267,7 +268,6 @@ configureDeviceSection(int screennum) for (i = 0; i < MAXDACSPEEDS; i++) ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i]; ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam; - ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase; ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase; ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase; ptr->dev_clockchip = DevToConfig[screennum].GDev.clockchip; @@ -326,9 +326,9 @@ configureLayoutSection(void) { int scrnum = 0; - parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec) + parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec); - ptr->lay_identifier = "X.org Configured"; + ptr->lay_identifier = "X.org Configured"; { XF86ConfInputrefPtr iptr; @@ -389,9 +389,9 @@ configureLayoutSection(void) static XF86ConfFlagsPtr configureFlagsSection(void) { - parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec) + parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec); - return ptr; + return ptr; } static XF86ConfModulePtr @@ -399,15 +399,9 @@ configureModuleSection(void) { const char **elist, **el; - /* Find the list of extension & font modules. */ - const char *esubdirs[] = { - "extensions", - "fonts", - NULL - }; - parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec) + parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec); - elist = LoaderListDirs(esubdirs, NULL); + elist = LoaderListDir("extensions", NULL); if (elist) { for (el = elist; *el; el++) { XF86LoadPtr module; @@ -427,9 +421,9 @@ configureModuleSection(void) static XF86ConfFilesPtr configureFilesSection(void) { - parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec) + parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec); - if (xf86ModulePath) + if (xf86ModulePath) ptr->file_modulepath = xnfstrdup(xf86ModulePath); if (defaultFontPath) ptr->file_fontpath = xnfstrdup(defaultFontPath); @@ -441,7 +435,7 @@ static XF86ConfMonitorPtr configureMonitorSection(int screennum) { char *tmp; - parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) + parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec); XNFasprintf(&tmp, "Monitor%d", screennum); ptr->mon_identifier = tmp; @@ -486,7 +480,7 @@ configureDDCMonitorSection(int screennum) int displaySizeLen; char *tmp; - parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) + parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec); XNFasprintf(&tmp, "Monitor%d", screennum); ptr->mon_identifier = tmp; @@ -534,6 +528,69 @@ configureDDCMonitorSection(int screennum) return ptr; } +static int +is_fallback(const char *s) +{ + /* later entries are less preferred */ + const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; + int i; + + for (i = 0; fallback[i]; i++) + if (strstr(s, fallback[i])) + return i; + + return -1; +} + +static int +driver_sort(const void *_l, const void *_r) +{ + const char *l = *(const char **)_l; + const char *r = *(const char **)_r; + int left = is_fallback(l); + int right = is_fallback(r); + + /* neither is a fallback, asciibetize */ + if (left == -1 && right == -1) + return strcmp(l, r); + + /* left is a fallback, right is not */ + if (left >= 0 && right == -1) + return 1; + + /* right is a fallback, left is not */ + if (right >= 0 && left == -1) + return -1; + + /* both are fallbacks, decide which is worse */ + return left - right; +} + +static void +fixup_video_driver_list(const char **drivers) +{ + const char **end; + + /* walk to the end of the list */ + for (end = drivers; *end && **end; end++); + + qsort(drivers, end - drivers, sizeof(const char *), driver_sort); +} + +static const char ** +GenerateDriverList(void) +{ + const char **ret; + static const char *patlist[] = { "(.*)_drv\\.so", NULL }; + ret = LoaderListDir("drivers", patlist); + + /* fix up the probe order for video drivers */ + if (ret != NULL) + fixup_video_driver_list(ret); + + return ret; +} + void DoConfigure(void) { @@ -545,7 +602,7 @@ DoConfigure(void) const char **vlist, **vl; int *dev2screen; - vlist = xf86DriverlistFromCompile(); + vlist = GenerateDriverList(); if (!vlist) { ErrorF("Missing output drivers. Configuration failed.\n"); @@ -645,7 +702,7 @@ DoConfigure(void) xf86DoConfigurePass1 = FALSE; - dev2screen = xnfcalloc(xf86NumDrivers, sizeof(int)); + dev2screen = xnfcalloc(nDevToConfig, sizeof(int)); { Bool *driverProbed = xnfcalloc(xf86NumDrivers, sizeof(Bool)); @@ -717,7 +774,8 @@ DoConfigure(void) ConfiguredMonitor = NULL; - if ((*xf86Screens[dev2screen[j]]->PreInit) (xf86Screens[dev2screen[j]], + if ((*xf86Screens[dev2screen[j]]->PreInit) && + (*xf86Screens[dev2screen[j]]->PreInit) (xf86Screens[dev2screen[j]], PROBE_DETECT) && ConfiguredMonitor) { monitor_ptr = configureDDCMonitorSection(j); @@ -785,7 +843,7 @@ DoShowOptions(void) char *pSymbol = 0; XF86ModuleData *initData = 0; - if (!(vlist = xf86DriverlistFromCompile())) { + if (!(vlist = GenerateDriverList())) { ErrorF("Missing output drivers\n"); goto bail; } diff --git a/xserver/hw/xfree86/common/xf86DGA.c b/xserver/hw/xfree86/common/xf86DGA.c index 039f38dfa..505b01917 100644 --- a/xserver/hw/xfree86/common/xf86DGA.c +++ b/xserver/hw/xfree86/common/xf86DGA.c @@ -2063,7 +2063,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client) #endif /* DGA_PROTOCOL_OLD_SUPPORT */ -static int +static int _X_COLD SProcXDGADispatch(ClientPtr client) { return DGAErrorBase + XF86DGAClientNotLocal; diff --git a/xserver/hw/xfree86/common/xf86DPMS.c b/xserver/hw/xfree86/common/xf86DPMS.c index 2b5a3ed1e..ee495483e 100644 --- a/xserver/hw/xfree86/common/xf86DPMS.c +++ b/xserver/hw/xfree86/common/xf86DPMS.c @@ -48,10 +48,16 @@ #endif #ifdef DPMSExtension -static DevPrivateKeyRec DPMSKeyRec; -static DevPrivateKey DPMSKey; -static Bool DPMSClose(ScreenPtr pScreen); -static int DPMSCount = 0; +static void +xf86DPMS(ScreenPtr pScreen, int level) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + if (pScrn->DPMSSet && pScrn->vtSema) { + xf86VGAarbiterLock(pScrn); + pScrn->DPMSSet(pScrn, level, 0); + xf86VGAarbiterUnlock(pScrn); + } +} #endif Bool @@ -59,160 +65,27 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) { #ifdef DPMSExtension ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - DPMSPtr pDPMS; void *DPMSOpt; - MessageType enabled_from; + MessageType enabled_from = X_DEFAULT; + Bool enabled = TRUE; - DPMSKey = &DPMSKeyRec; - - if (!dixRegisterPrivateKey(&DPMSKeyRec, PRIVATE_SCREEN, sizeof(DPMSRec))) - return FALSE; - - pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); - pScrn->DPMSSet = set; - pDPMS->Flags = flags; DPMSOpt = xf86FindOption(pScrn->options, "dpms"); if (DPMSDisabledSwitch) { enabled_from = X_CMDLINE; - DPMSEnabled = FALSE; + enabled = FALSE; } else if (DPMSOpt) { enabled_from = X_CONFIG; - DPMSEnabled = xf86CheckBoolOption(pScrn->options, "dpms", FALSE); + enabled = xf86CheckBoolOption(pScrn->options, "dpms", FALSE); xf86MarkOptionUsed(DPMSOpt); } - else { - enabled_from = X_DEFAULT; - DPMSEnabled = TRUE; - } - if (DPMSEnabled) + if (enabled) { xf86DrvMsg(pScreen->myNum, enabled_from, "DPMS enabled\n"); - pDPMS->Enabled = DPMSEnabled; - pDPMS->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = DPMSClose; - DPMSCount++; + pScrn->DPMSSet = set; + pScreen->DPMS = xf86DPMS; + } return TRUE; #else return FALSE; #endif } - -#ifdef DPMSExtension - -static Bool -DPMSClose(ScreenPtr pScreen) -{ - DPMSPtr pDPMS; - ScrnInfoPtr pScrn; - /* This shouldn't happen */ - if (DPMSKey == NULL) - return FALSE; - - pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); - - /* This shouldn't happen */ - if (!pDPMS) - return FALSE; - - pScreen->CloseScreen = pDPMS->CloseScreen; - pScrn = xf86ScreenToScrn(pScreen); - /* - * Turn on DPMS when shutting down. If this function can be used - * depends on the order the driver wraps things. If this is called - * after the driver has shut down everything the driver will have - * to deal with this internally. - */ - if (pScrn->vtSema && pScrn->DPMSSet) { - pScrn->DPMSSet(pScrn, DPMSModeOn, 0); - } - - if (--DPMSCount == 0) - DPMSKey = NULL; - return pScreen->CloseScreen(pScreen); -} - -static void -DPMSSetScreen(ScrnInfoPtr pScrn, int level) -{ - ScreenPtr pScreen = xf86ScrnToScreen(pScrn); - DPMSPtr pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); - - if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) { - xf86VGAarbiterLock(pScrn); - pScrn->DPMSSet(pScrn, level, 0); - xf86VGAarbiterUnlock(pScrn); - } -} - -/* - * DPMSSet -- - * Device dependent DPMS mode setting hook. This is called whenever - * the DPMS mode is to be changed. - */ -int -DPMSSet(ClientPtr client, int level) -{ - int rc, i; - - DPMSPowerLevel = level; - - if (DPMSKey == NULL) - return Success; - - if (level != DPMSModeOn) { - if (xf86IsUnblank(screenIsSaved)) { - rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive); - if (rc != Success) - return rc; - } - } else if (!xf86IsUnblank(screenIsSaved)) { - rc = dixSaveScreens(client, SCREEN_SAVER_OFF, ScreenSaverReset); - if (rc != Success) - return rc; - } - - /* For each screen, set the DPMS level */ - for (i = 0; i < xf86NumScreens; i++) { - DPMSSetScreen(xf86Screens[i], level); - } - for (i = 0; i < xf86NumGPUScreens; i++) { - DPMSSetScreen(xf86GPUScreens[i], level); - } - return Success; -} - -static Bool -DPMSSupportedOnScreen(ScrnInfoPtr pScrn) -{ - ScreenPtr pScreen = xf86ScrnToScreen(pScrn); - DPMSPtr pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); - - return pDPMS && pScrn->DPMSSet; -} - -/* - * DPMSSupported -- - * Return TRUE if any screen supports DPMS. - */ -Bool -DPMSSupported(void) -{ - int i; - - if (DPMSKey == NULL) { - return FALSE; - } - - /* For each screen, check if DPMS is supported */ - for (i = 0; i < xf86NumScreens; i++) { - if (DPMSSupportedOnScreen(xf86Screens[i])) - return TRUE; - } - for (i = 0; i < xf86NumGPUScreens; i++) { - if (DPMSSupportedOnScreen(xf86GPUScreens[i])) - return TRUE; - } - return FALSE; -} - -#endif /* DPMSExtension */ diff --git a/xserver/hw/xfree86/common/xf86Events.c b/xserver/hw/xfree86/common/xf86Events.c index 9a8f432a0..8a800bd8f 100644 --- a/xserver/hw/xfree86/common/xf86Events.c +++ b/xserver/hw/xfree86/common/xf86Events.c @@ -86,20 +86,6 @@ #include "xf86platformBus.h" #include "systemd-logind.h" -/* - * This is a toggling variable: - * FALSE = No VT switching keys have been pressed last time around - * TRUE = Possible VT switch Pending - * (DWH - 12/2/93) - * - * This has been generalised to work with Linux and *BSD+syscons (DHD) - */ - -Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for - *BSD and for avoiding VT - switches when using the DRI - automatic full screen mode.*/ - #ifdef XF86PM extern void (*xf86OSPMClose) (void); #endif @@ -197,7 +183,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) xf86ZoomViewport(xf86Info.currentScreen, -1); break; case ACTION_SWITCHSCREEN: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { + if (!xf86Info.dontVTSwitch && arg) { int vtno = *((int *) arg); if (vtno != xf86Info.vtno) { @@ -209,7 +195,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) } break; case ACTION_SWITCHSCREEN_NEXT: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { + if (!xf86Info.dontVTSwitch) { if (!xf86VTActivate(xf86Info.vtno + 1)) { /* If first try failed, assume this is the last VT and * try wrapping around to the first vt. @@ -222,7 +208,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) } break; case ACTION_SWITCHSCREEN_PREV: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) { + if (!xf86Info.dontVTSwitch && xf86Info.vtno > 0) { if (!xf86VTActivate(xf86Info.vtno - 1)) { /* Don't know what the maximum VT is, so can't wrap around */ ErrorF("Failed to switch from vt%02d to previous vt: %s\n", @@ -281,44 +267,6 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo) InputThreadUnregisterDev(pInfo->fd); } -static int *xf86SignalIntercept = NULL; - -void -xf86InterceptSignals(int *signo) -{ - if ((xf86SignalIntercept = signo)) - *signo = -1; -} - -static void (*xf86SigIllHandler) (void) = NULL; - -void -xf86InterceptSigIll(void (*sigillhandler) (void)) -{ - xf86SigIllHandler = sigillhandler; -} - -/* - * xf86SigWrapper -- - * Catch unexpected signals and exit or continue cleanly. - */ -int -xf86SigWrapper(int signo) -{ - if ((signo == SIGILL) && xf86SigIllHandler) { - (*xf86SigIllHandler) (); - return 0; /* continue */ - } - - if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) { - *xf86SignalIntercept = signo; - return 0; /* continue */ - } - - xf86Info.caughtSignal = TRUE; - return 1; /* abort */ -} - /* * xf86PrintBacktrace -- * Print a stack backtrace for debugging purposes. @@ -445,8 +393,6 @@ xf86VTLeave(void) for (i = 0; i < xf86NumGPUScreens; i++) xf86GPUScreens[i]->LeaveVT(xf86GPUScreens[i]); - xf86AccessLeave(); /* We need this here, otherwise */ - if (!xf86VTSwitchAway()) goto switch_failed; @@ -472,7 +418,6 @@ xf86VTLeave(void) switch_failed: DebugF("xf86VTSwitch: Leave failed\n"); - xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { if (!xf86Screens[i]->EnterVT(xf86Screens[i])) FatalError("EnterVT failed for screen %d\n", i); @@ -517,7 +462,6 @@ xf86VTEnter(void) if (xorgHWAccess) xf86EnableIO(); - xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->vtSema = TRUE; if (!xf86Screens[i]->EnterVT(xf86Screens[i])) @@ -774,28 +718,6 @@ xf86EnableGeneralHandler(void *handler) SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } -/* - * As used currently by the DRI, the return value is ignored. - */ -Bool -xf86EnableVTSwitch(Bool new) -{ - static Bool def = TRUE; - Bool old; - - old = VTSwitchEnabled; - if (!new) { - /* Disable VT switching */ - def = VTSwitchEnabled; - VTSwitchEnabled = FALSE; - } - else { - /* Restore VT switching to default */ - VTSwitchEnabled = def; - } - return old; -} - void DDXRingBell(int volume, int pitch, int duration) { diff --git a/xserver/hw/xfree86/common/xf86Globals.c b/xserver/hw/xfree86/common/xf86Globals.c index 07cfabf89..7cc7401a2 100644 --- a/xserver/hw/xfree86/common/xf86Globals.c +++ b/xserver/hw/xfree86/common/xf86Globals.c @@ -53,6 +53,8 @@ DevPrivateKeyRec xf86ScreenKeyRec; ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */ ScrnInfoPtr *xf86GPUScreens = NULL; /* List of ScrnInfos */ +int xf86DRMMasterFd = -1; /* Command line argument for DRM master file descriptor */ + const unsigned char byte_reversed[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, @@ -107,7 +109,6 @@ xf86InfoRec xf86Info = { .dontZap = FALSE, .dontZoom = FALSE, .notrapSignals = FALSE, - .caughtSignal = FALSE, .currentScreen = NULL, #ifdef CSRG_BASED .consType = -1, @@ -117,11 +118,7 @@ xf86InfoRec xf86Info = { .vidModeAllowNonLocal = FALSE, .miscModInDevEnabled = TRUE, .miscModInDevAllowNonLocal = FALSE, - .pixmap24 = Pix24DontCare, - .pix24From = X_DEFAULT, .pmFlag = TRUE, - .disableRandR = FALSE, - .randRFrom = X_DEFAULT, #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) .forceInputDevices = FALSE, .autoAddDevices = TRUE, @@ -152,6 +149,7 @@ XF86ConfigPtr xf86configptr = NULL; Bool xf86Resetting = FALSE; Bool xf86Initialising = FALSE; Bool xf86DoConfigure = FALSE; +Bool xf86ProbeIgnorePrimary = FALSE; Bool xf86DoShowOptions = FALSE; DriverPtr *xf86DriverList = NULL; int xf86NumDrivers = 0; @@ -188,7 +186,6 @@ char *xf86KeyboardName = NULL; int xf86Verbose = DEFAULT_VERBOSE; int xf86LogVerbose = DEFAULT_LOG_VERBOSE; int xf86FbBpp = -1; -Pix24Flags xf86Pix24 = Pix24DontCare; int xf86Depth = -1; rgb xf86Weight = { 0, 0, 0 }; diff --git a/xserver/hw/xfree86/common/xf86Helper.c b/xserver/hw/xfree86/common/xf86Helper.c index 6f3a6086b..95a90ad88 100644 --- a/xserver/hw/xfree86/common/xf86Helper.c +++ b/xserver/hw/xfree86/common/xf86Helper.c @@ -79,14 +79,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags) xf86DriverList = xnfreallocarray(xf86DriverList, xf86NumDrivers, sizeof(DriverPtr)); xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec)); - if (flags & HaveDriverFuncs) - *xf86DriverList[xf86NumDrivers - 1] = *driver; - else { - (void) memset(xf86DriverList[xf86NumDrivers - 1], 0, sizeof(DriverRec)); - (void) memcpy(xf86DriverList[xf86NumDrivers - 1], driver, - sizeof(DriverRec1)); - - } + *xf86DriverList[xf86NumDrivers - 1] = *driver; xf86DriverList[xf86NumDrivers - 1]->module = module; xf86DriverList[xf86NumDrivers - 1]->refCount = 0; } @@ -351,33 +344,15 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) * Also find a Display subsection matching the depth/bpp found. * * Sets the following ScrnInfoRec fields: - * bitsPerPixel, pixmap24, depth, display, imageByteOrder, + * bitsPerPixel, depth, display, imageByteOrder, * bitmapScanlinePad, bitmapScanlineUnit, bitmapBitOrder, numFormats, * formats, fbFormat. */ -/* Can the screen handle 24 bpp pixmaps */ -#define DO_PIX24(f) ((f & Support24bppFb) || \ - ((f & Support32bppFb) && (f & SupportConvert24to32))) - /* Can the screen handle 32 bpp pixmaps */ #define DO_PIX32(f) ((f & Support32bppFb) || \ ((f & Support24bppFb) && (f & SupportConvert32to24))) -/* Does the screen prefer 32bpp fb for 24bpp pixmaps */ -#define CHOOSE32FOR24(f) ((f & Support32bppFb) && (f & SupportConvert24to32) \ - && (f & PreferConvert24to32)) - -/* Does the screen prefer 24bpp fb for 32bpp pixmaps */ -#define CHOOSE24FOR32(f) ((f & Support24bppFb) && (f & SupportConvert32to24) \ - && (f & PreferConvert32to24)) - -/* Can the screen handle 32bpp pixmaps for 24bpp fb */ -#define DO_PIX32FOR24(f) ((f & Support24bppFb) && (f & SupportConvert32to24)) - -/* Can the screen handle 24bpp pixmaps for 32bpp fb */ -#define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32)) - #ifndef GLOBAL_DEFAULT_DEPTH #define GLOBAL_DEFAULT_DEPTH 24 #endif @@ -388,16 +363,15 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, { int i; DispPtr disp; - Pix24Flags pix24 = xf86Info.pixmap24; - Bool nomatch = FALSE; scrp->bitsPerPixel = -1; scrp->depth = -1; - scrp->pixmap24 = Pix24DontCare; scrp->bitsPerPixelFrom = X_DEFAULT; scrp->depthFrom = X_DEFAULT; if (xf86FbBpp > 0) { + if (xf86FbBpp == 24) /* lol no */ + xf86FbBpp = 32; scrp->bitsPerPixel = xf86FbBpp; scrp->bitsPerPixelFrom = X_CMDLINE; } @@ -476,57 +450,14 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, scrp->bitsPerPixel = 8; else if (scrp->depth <= 16) scrp->bitsPerPixel = 16; - else if (scrp->depth <= 24) { - /* - * Figure out if a choice is possible based on the depth24 - * and pix24 flags. - */ - /* Check pix24 first */ - if (pix24 != Pix24DontCare) { - if (pix24 == Pix24Use32) { - if (DO_PIX32(depth24flags)) { - if (CHOOSE24FOR32(depth24flags)) - scrp->bitsPerPixel = 24; - else - scrp->bitsPerPixel = 32; - } - else { - nomatch = TRUE; - } - } - else if (pix24 == Pix24Use24) { - if (DO_PIX24(depth24flags)) { - if (CHOOSE32FOR24(depth24flags)) - scrp->bitsPerPixel = 32; - else - scrp->bitsPerPixel = 24; - } - else { - nomatch = TRUE; - } - } - } - else { - if (DO_PIX32(depth24flags)) { - if (CHOOSE24FOR32(depth24flags)) - scrp->bitsPerPixel = 24; - else - scrp->bitsPerPixel = 32; - } - else if (DO_PIX24(depth24flags)) { - if (CHOOSE32FOR24(depth24flags)) - scrp->bitsPerPixel = 32; - else - scrp->bitsPerPixel = 24; - } - } + else if (scrp->depth <= 24 && DO_PIX32(depth24flags)) { + scrp->bitsPerPixel = 32; } else if (scrp->depth <= 32) scrp->bitsPerPixel = 32; else { xf86DrvMsg(scrp->scrnIndex, X_ERROR, - "Specified depth (%d) is greater than 32\n", - scrp->depth); + "No bpp for depth (%d)\n", scrp->depth); return FALSE; } } @@ -537,11 +468,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, return FALSE; } if (scrp->bitsPerPixel < 0) { - if (nomatch) - xf86DrvMsg(scrp->scrnIndex, X_ERROR, - "Driver can't support depth 24 pixmap format (%d)\n", - PIX24TOBPP(pix24)); - else if ((depth24flags & (Support24bppFb | Support32bppFb)) == + if ((depth24flags & (Support24bppFb | Support32bppFb)) == NoDepth24Support) xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Driver can't support depth 24\n"); @@ -579,7 +506,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, case 4: case 8: case 16: - case 24: case 32: break; default: @@ -595,14 +521,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, return FALSE; } - /* set scrp->pixmap24 if the driver isn't flexible */ - if (scrp->bitsPerPixel == 24 && !DO_PIX32FOR24(depth24flags)) { - scrp->pixmap24 = Pix24Use24; - } - if (scrp->bitsPerPixel == 32 && !DO_PIX24FOR32(depth24flags)) { - scrp->pixmap24 = Pix24Use32; - } - /* * Find the Display subsection matching the depth/fbbpp and initialise * scrp->display with it. @@ -1462,12 +1380,6 @@ xf86GetVerbosity(void) return max(xf86Verbose, xf86LogVerbose); } -Pix24Flags -xf86GetPix24(void) -{ - return xf86Info.pixmap24; -} - int xf86GetDepth(void) { @@ -1516,12 +1428,6 @@ xf86ServerIsOnlyDetecting(void) return xf86DoConfigure; } -Bool -xf86CaughtSignal(void) -{ - return xf86Info.caughtSignal; -} - Bool xf86GetVidModeAllowNonLocal(void) { @@ -1552,13 +1458,6 @@ xf86GetAllowMouseOpenFail(void) return xf86Info.allowMouseOpenFail; } -void -xf86DisableRandR(void) -{ - xf86Info.disableRandR = TRUE; - xf86Info.randRFrom = X_PROBED; -} - CARD32 xf86GetModuleVersion(void *module) { @@ -1597,7 +1496,7 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) void * xf86LoadOneModule(const char *name, void *opt) { - int errmaj, errmin; + int errmaj; char *Name; void *mod; @@ -1615,9 +1514,9 @@ xf86LoadOneModule(const char *name, void *opt) return NULL; } - mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); + mod = LoadModule(Name, opt, NULL, &errmaj); if (!mod) - LoaderErrorMsg(NULL, Name, errmaj, errmin); + LoaderErrorMsg(NULL, Name, errmaj, 0); free(Name); return mod; } @@ -1752,10 +1651,6 @@ xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, const char *port_name, return NULL; } -/* Rather than duplicate loader's get OS function, just include it directly */ -#define LoaderGetOS xf86GetOS -#include "loader/os.c" - static void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, EntityProc enter, EntityProc leave, void *private) @@ -1764,7 +1659,6 @@ xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, if ((pScrn = xf86FindScreenForEntity(pEnt->index))) xf86RemoveEntityFromScreen(pScrn, pEnt->index); - xf86SetEntityFuncs(pEnt->index, init, enter, leave, private); } ScrnInfoPtr @@ -1774,6 +1668,9 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); + if (init || enter || leave) + FatalError("Legacy entity access functions are unsupported\n"); + if (!pEnt) return pScrn; @@ -1792,8 +1689,6 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag); xf86AddEntityToScreen(pScrn, entityIndex); - xf86SetEntityFuncs(entityIndex, init, enter, leave, private); - free(pEnt); return pScrn; } diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index 2a04da045..8ac7ca508 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -77,7 +77,8 @@ #include "xf86Xinput.h" #include "xf86InPriv.h" #include "picturestr.h" - +#include "randrstr.h" +#include "glxvndabi.h" #include "xf86Bus.h" #ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" @@ -168,11 +169,7 @@ xf86PrintBanner(void) #ifdef XORG_CUSTOM_VERSION xf86ErrorFVerb(0, " (%s)", XORG_CUSTOM_VERSION); #endif -#ifndef XORG_DATE -#define XORG_DATE "Unknown" -#endif - xf86ErrorFVerb(0, "\nRelease Date: %s\n", XORG_DATE); - xf86ErrorFVerb(0, "X Protocol Version %d, Revision %d\n", + xf86ErrorFVerb(0, "\nX Protocol Version %d, Revision %d\n", X_PROTOCOL, X_PROTOCOL_REVISION); xf86ErrorFVerb(0, "Build Operating System: %s %s\n", OSNAME, OSVENDOR); #ifdef HAS_UTSNAME @@ -187,7 +184,7 @@ xf86PrintBanner(void) xf86ErrorFVerb(0, "Current Operating System: %s %s %s %s %s\n", name.sysname, name.nodename, name.release, name.version, name.machine); -#ifdef linux +#ifdef __linux__ do { char buf[80]; int fd = open("/proc/cmdline", O_RDONLY); @@ -241,77 +238,13 @@ xf86PrintBanner(void) Bool xf86PrivsElevated(void) { - static Bool privsTested = FALSE; - static Bool privsElevated = TRUE; - - if (!privsTested) { -#if defined(WIN32) - privsElevated = FALSE; -#else - if ((getuid() != geteuid()) || (getgid() != getegid())) { - privsElevated = TRUE; - } - else { -#if defined(HAVE_ISSETUGID) - privsElevated = issetugid(); -#elif defined(HAVE_GETRESUID) - uid_t ruid, euid, suid; - gid_t rgid, egid, sgid; - - if ((getresuid(&ruid, &euid, &suid) == 0) && - (getresgid(&rgid, &egid, &sgid) == 0)) { - privsElevated = (euid != suid) || (egid != sgid); - } - else { - printf("Failed getresuid or getresgid"); - /* Something went wrong, make defensive assumption */ - privsElevated = TRUE; - } -#else - if (getuid() == 0) { - /* running as root: uid==euid==0 */ - privsElevated = FALSE; - } - else { - /* - * If there are saved ID's the process might still be privileged - * even though the above test succeeded. If issetugid() and - * getresgid() aren't available, test this by trying to set - * euid to 0. - */ - unsigned int oldeuid; - - oldeuid = geteuid(); - - if (seteuid(0) != 0) { - privsElevated = FALSE; - } - else { - if (seteuid(oldeuid) != 0) { - FatalError("Failed to drop privileges. Exiting\n"); - } - privsElevated = TRUE; - } - } -#endif - } -#endif - privsTested = TRUE; - } - return privsElevated; + return PrivsElevated(); } static void -InstallSignalHandlers(void) +TrapSignals(void) { - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal = FALSE; - if (!xf86Info.notrapSignals) { - OsRegisterSigWrapper(xf86SigWrapper); - } - else { + if (xf86Info.notrapSignals) { OsSignal(SIGSEGV, SIG_DFL); OsSignal(SIGABRT, SIG_DFL); OsSignal(SIGILL, SIG_DFL); @@ -374,6 +307,16 @@ xf86ScreenInit(ScreenPtr pScreen, int argc, char **argv) return pScrn->ScreenInit (pScreen, argc, argv); } +static void +xf86EnsureRANDR(ScreenPtr pScreen) +{ +#ifdef RANDR + if (!dixPrivateKeyRegistered(rrPrivKey) || + !rrGetScrPriv(pScreen)) + xf86RandRInit(pScreen); +#endif +} + /* * InitOutput -- * Initialize screenInfo for all actually accessible framebuffers. @@ -386,9 +329,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) int i, j, k, scr_index; const char **modulelist; void **optionlist; - Pix24Flags screenpix24, pix24; - MessageType pix24From = X_DEFAULT; - Bool pix24Fail = FALSE; Bool autoconfig = FALSE; Bool sigio_blocked = FALSE; Bool want_hw_access = FALSE; @@ -430,7 +370,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } } - InstallSignalHandlers(); + TrapSignals(); /* Initialise the loader */ LoaderInit(); @@ -641,7 +581,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) * Collect all pixmap formats and check for conflicts at the display * level. Should we die here? Or just delete the offending screens? */ - screenpix24 = Pix24DontCare; for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->imageByteOrder != xf86Screens[0]->imageByteOrder) @@ -657,38 +596,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) if (xf86Screens[i]->bitmapBitOrder != xf86Screens[0]->bitmapBitOrder) FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); - - /* Determine the depth 24 pixmap format the screens would like */ - if (xf86Screens[i]->pixmap24 != Pix24DontCare) { - if (screenpix24 == Pix24DontCare) - screenpix24 = xf86Screens[i]->pixmap24; - else if (screenpix24 != xf86Screens[i]->pixmap24) - FatalError - ("Inconsistent depth 24 pixmap format. Exiting\n"); - } } - /* check if screenpix24 is consistent with the config/cmdline */ - if (xf86Info.pixmap24 != Pix24DontCare) { - pix24 = xf86Info.pixmap24; - pix24From = xf86Info.pix24From; - if (screenpix24 != Pix24DontCare && - screenpix24 != xf86Info.pixmap24) - pix24Fail = TRUE; - } - else if (screenpix24 != Pix24DontCare) { - pix24 = screenpix24; - pix24From = X_PROBED; - } - else - pix24 = Pix24Use32; - - if (pix24Fail) - FatalError("Screen(s) can't use the required depth 24 pixmap format" - " (%d). Exiting\n", PIX24TOBPP(pix24)); - - /* Initialise the depth 24 format */ - for (j = 0; j < numFormats && formats[j].depth != 24; j++); - formats[j].bitsPerPixel = PIX24TOBPP(pix24); /* Collect additional formats */ for (i = 0; i < xf86NumScreens; i++) { @@ -714,15 +622,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } } formatsDone = TRUE; - - /* If a screen uses depth 24, show what the pixmap format is */ - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->depth == 24) { - xf86Msg(pix24From, "Depth 24 pixmap format is %d bpp\n", - PIX24TOBPP(pix24)); - break; - } - } } else { /* @@ -775,7 +674,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) #ifdef HAS_USL_VTS ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif - xf86AccessEnter(); input_lock(); sigio_blocked = TRUE; } @@ -865,12 +763,12 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) SubPixelHorizontalRGB : SubPixelNone) : SubPixelUnknown); } -#ifdef RANDR - if (!xf86Info.disableRandR) - xf86RandRInit(screenInfo.screens[scr_index]); - xf86Msg(xf86Info.randRFrom, "RandR %s\n", - xf86Info.disableRandR ? "disabled" : "enabled"); -#endif + + /* + * If the driver hasn't set up its own RANDR support, install the + * fallback support. + */ + xf86EnsureRANDR(xf86Screens[i]->pScreen); } for (i = 0; i < xf86NumGPUScreens; i++) @@ -955,7 +853,7 @@ OsVendorInit(void) #ifdef O_NONBLOCK if (!beenHere) { - if (xf86PrivsElevated()) { + if (PrivsElevated()) { int status; status = fcntl(fileno(stderr), F_GETFL, 0); @@ -1015,10 +913,6 @@ ddxGiveUp(enum ExitCode error) dbus_core_fini(); xf86CloseLog(error); - - /* If an unexpected signal was caught, dump a core for debugging */ - if (xf86Info.caughtSignal) - OsAbort(); } /* @@ -1056,8 +950,6 @@ AbortDDX(enum ExitCode error) } } - xf86AccessLeave(); - /* * This is needed for an abnormal server exit, since the normal exit stuff * MUST also be performed (i.e. the vt must be left in a defined state) @@ -1116,7 +1008,7 @@ xf86PrintDefaultLibraryPath(void) static void xf86CheckPrivs(const char *option, const char *arg) { - if (xf86PrivsElevated() && !xf86PathIsSafe(arg)) { + if (PrivsElevated() && !xf86PathIsSafe(arg)) { FatalError("\nInvalid argument for %s - \"%s\"\n" "\tWith elevated privileges %s must specify a relative path\n" "\twithout any \"..\" elements.\n\n", option, arg, option); @@ -1264,12 +1156,8 @@ ddxProcessArgument(int argc, char **argv, int i) xf86sFlag = TRUE; return 0; } - if (!strcmp(argv[i], "-pixmap24")) { - xf86Pix24 = Pix24Use24; - return 1; - } - if (!strcmp(argv[i], "-pixmap32")) { - xf86Pix24 = Pix24Use32; + if (!strcmp(argv[i], "-pixmap32") || !strcmp(argv[i], "-pixmap24")) { + /* silently accept */ return 1; } if (!strcmp(argv[i], "-fbbpp")) { @@ -1427,27 +1315,25 @@ ddxUseMsg(void) ErrorF("\n"); ErrorF("\n"); ErrorF("Device Dependent Usage\n"); - if (!xf86PrivsElevated()) { + if (!PrivsElevated()) { ErrorF("-modulepath paths specify the module search path\n"); ErrorF("-logfile file specify a log file name\n"); ErrorF("-configure probe for devices and write an " - __XCONFIGFILE__ "\n"); + XCONFIGFILE "\n"); ErrorF ("-showopts print available options for all installed drivers\n"); } ErrorF ("-config file specify a configuration file, relative to the\n"); - ErrorF(" " __XCONFIGFILE__ + ErrorF(" " XCONFIGFILE " search path, only root can use absolute\n"); ErrorF ("-configdir dir specify a configuration directory, relative to the\n"); - ErrorF(" " __XCONFIGDIR__ + ErrorF(" " XCONFIGDIR " search path, only root can use absolute\n"); ErrorF("-verbose [n] verbose startup messages\n"); ErrorF("-logverbose [n] verbose log messages\n"); ErrorF("-quiet minimal startup messages\n"); - ErrorF("-pixmap24 use 24bpp pixmaps for depth 24\n"); - ErrorF("-pixmap32 use 32bpp pixmaps for depth 24\n"); ErrorF("-fbbpp n set bpp for the framebuffer. Default: 8\n"); ErrorF("-depth n set colour depth. Default: 8\n"); ErrorF @@ -1497,7 +1383,7 @@ ddxUseMsg(void) Bool xf86LoadModules(const char **list, void **optlist) { - int errmaj, errmin; + int errmaj; void *opt; int i; char *name; @@ -1527,8 +1413,8 @@ xf86LoadModules(const char **list, void **optlist) else opt = NULL; - if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { - LoaderErrorMsg(NULL, name, errmaj, errmin); + if (!LoadModule(name, opt, NULL, &errmaj)) { + LoaderErrorMsg(NULL, name, errmaj, 0); failed = TRUE; } free(name); @@ -1542,30 +1428,6 @@ PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) { int i; - static PixmapFormatRec format; /* XXX not reentrant */ - - /* - * When the formats[] list initialisation isn't complete, check the - * depth 24 pixmap config/cmdline options and screen-specified formats. - */ - - if (!formatsDone) { - if (depth == 24) { - Pix24Flags pix24 = Pix24DontCare; - - format.depth = 24; - format.scanlinePad = BITMAP_SCANLINE_PAD; - if (xf86Info.pixmap24 != Pix24DontCare) - pix24 = xf86Info.pixmap24; - else if (pScrn->pixmap24 != Pix24DontCare) - pix24 = pScrn->pixmap24; - if (pix24 == Pix24Use24) - format.bitsPerPixel = 24; - else - format.bitsPerPixel = 32; - return &format; - } - } for (i = 0; i < numFormats; i++) if (formats[i].depth == depth) diff --git a/xserver/hw/xfree86/common/xf86MatchDrivers.h b/xserver/hw/xfree86/common/xf86MatchDrivers.h new file mode 100644 index 000000000..4663af478 --- /dev/null +++ b/xserver/hw/xfree86/common/xf86MatchDrivers.h @@ -0,0 +1,40 @@ +/* + * Copyright © 2015 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifndef _xf86_match_drivers_h +#define _xf86_match_drivers_h + +#define MATCH_DRIVERS_LIMIT 20 + +typedef struct _XF86MatchedDrivers { + char *matches[MATCH_DRIVERS_LIMIT]; + int nmatches; +} XF86MatchedDrivers; + +/* + * prototypes + */ +void xf86AddMatchedDriver(XF86MatchedDrivers *, const char *); + +#endif /* _xf86_match_drivers_h */ + diff --git a/xserver/hw/xfree86/common/xf86Mode.c b/xserver/hw/xfree86/common/xf86Mode.c index 3f446ae3b..484cde7ab 100644 --- a/xserver/hw/xfree86/common/xf86Mode.c +++ b/xserver/hw/xfree86/common/xf86Mode.c @@ -86,6 +86,7 @@ #include #include "xf86Modes.h" +#include "xf86Crtc.h" #include "os.h" #include "servermd.h" #include "globals.h" @@ -477,7 +478,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, M_T_DRIVER, 0 }; - const int ntypes = sizeof(types) / sizeof(int); + const int ntypes = ARRAY_SIZE(types); strategy &= ~(LOOKUP_CLKDIV2 | LOOKUP_OPTIONAL_TOLERANCES); @@ -840,8 +841,6 @@ xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y) * monitor pointer to structure for monitor section * fbFormat pixel format for the framebuffer * videoRam video memory size (in kB) - * maxHValue maximum horizontal timing value - * maxVValue maximum vertical timing value */ static ModeStatus @@ -888,12 +887,6 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, if (virtualY > 0 && mode->VDisplay > virtualY) return MODE_VIRTUAL_Y; - if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue) - return MODE_BAD_HVALUE; - - if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue) - return MODE_BAD_VVALUE; - /* * The use of the DisplayModeRec's Crtc* and SynthClock elements below is * provisional, in that they are later reused by the driver at mode-set @@ -985,8 +978,6 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, * flags not (currently) used * * In addition, the following fields from the ScrnInfoRec are used: - * maxHValue maximum horizontal timing value - * maxVValue maximum vertical timing value * virtualX virtual width * virtualY virtual height * clockRanges allowable clock ranges @@ -1021,12 +1012,6 @@ xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags) if (mode->VDisplay > scrp->virtualY) return MODE_VIRTUAL_Y; - if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue) - return MODE_BAD_HVALUE; - - if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue) - return MODE_BAD_VVALUE; - for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) { /* DivFactor and MulFactor must be > 0 */ cp->ClockDivFactor = max(1, cp->ClockDivFactor); @@ -1333,8 +1318,6 @@ scanLineWidth(unsigned int xsize, /* pixels */ * monitor pointer to structure for monitor section * fbFormat format of the framebuffer * videoRam video memory size - * maxHValue maximum horizontal timing value - * maxVValue maximum vertical timing value * xInc horizontal timing increment (defaults to 8 pixels) * * The function fills in the following ScrnInfoRec fields: @@ -1526,8 +1509,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } } - /* Initial check of virtual size against other constraints */ - scrp->virtualFrom = X_PROBED; /* * Initialise virtX and virtY if the values are fixed. */ @@ -1579,7 +1560,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, virtX = virtualX; virtY = virtualY; - scrp->virtualFrom = X_CONFIG; } else if (!modeNames || !*modeNames) { /* No virtual size given in the config, try to infer */ @@ -1664,12 +1644,8 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } /* Lookup each mode */ -#ifdef RANDR - if (!xf86Info.disableRandR #ifdef PANORAMIX - && noPanoramiXExtension -#endif - ) + if (noPanoramiXExtension) validateAllDefaultModes = TRUE; #endif @@ -1874,7 +1850,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, M_T_DRIVER, 0 }; - const int ntypes = sizeof(types) / sizeof(int); + const int ntypes = ARRAY_SIZE(types); int n; /* @@ -2085,9 +2061,8 @@ xf86PrintModes(ScrnInfoPtr scrp) if (scrp == NULL) return; - xf86DrvMsg(scrp->scrnIndex, scrp->virtualFrom, "Virtual size is %dx%d " - "(pitch %d)\n", scrp->virtualX, scrp->virtualY, - scrp->displayWidth); + xf86DrvMsg(scrp->scrnIndex, X_INFO, "Virtual size is %dx%d (pitch %d)\n", + scrp->virtualX, scrp->virtualY, scrp->displayWidth); p = scrp->modes; if (p == NULL) diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h index e0212cf3c..dd4d5f958 100644 --- a/xserver/hw/xfree86/common/xf86Module.h +++ b/xserver/hw/xfree86/common/xf86Module.h @@ -41,19 +41,14 @@ #ifndef _XF86MODULE_H #define _XF86MODULE_H -#include "misc.h" -#include "extension.h" +#include +#include +#include + #ifndef NULL #define NULL ((void *)0) #endif -typedef enum { - LD_RESOLV_IFDONE = 0, /* only check if no more - delays pending */ - LD_RESOLV_NOW = 1, /* finish one delay step */ - LD_RESOLV_FORCE = 2 /* force checking... */ -} LoaderResolveOptions; - #define DEFAULT_LIST ((char *)-1) /* Built-in ABI classes. These definitions must not be changed. */ @@ -79,7 +74,7 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(23, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(24, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 1) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) @@ -90,19 +85,13 @@ typedef enum { #define MODULEVENDORSTRING "X.Org Foundation" #endif -/* Error return codes for errmaj. New codes must only be added at the end. */ +/* Error return codes for errmaj */ typedef enum { LDR_NOERROR = 0, LDR_NOMEM, /* memory allocation failed */ LDR_NOENT, /* Module file does not exist */ - LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */ - LDR_NOSPACE, /* internal module array full */ - LDR_NOMODOPEN, /* module file could not be opened (check errmin) */ - LDR_UNKTYPE, /* file is not a recognized module type */ LDR_NOLOAD, /* type specific loader failed */ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */ - LDR_NOPORTOPEN, /* could not open port (check errmin) */ - LDR_NOHARDWARE, /* could not query/initialize the hardware device */ LDR_MISMATCH, /* the module didn't match the spec'd requirments */ LDR_BADUSAGE, /* LoadModule is called with bad arguments */ LDR_INVALID, /* The module doesn't have a valid ModuleData object */ @@ -152,12 +141,6 @@ typedef struct { const char *moduleclass; /* module class */ } XF86ModReqInfo; -/* values to indicate unspecified fields in XF86ModReqInfo. */ -#define MAJOR_UNSPEC 0xFF -#define MINOR_UNSPEC 0xFF -#define PATCH_UNSPEC 0xFFFF -#define ABI_VERS_UNSPEC 0xFFFFFFFF - #define MODULE_VERSION_NUMERIC(maj, min, patch) \ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF)) #define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF) @@ -173,11 +156,7 @@ extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **, extern _X_EXPORT void UnloadSubModule(void *); extern _X_EXPORT void UnloadModule(void *); extern _X_EXPORT void *LoaderSymbol(const char *); -extern _X_EXPORT const char **LoaderListDirs(const char **, const char **); -extern _X_EXPORT void LoaderFreeDirList(char **); extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int); -extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, - int *teeny); extern _X_EXPORT Bool LoaderShouldIgnoreABI(void); extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass); diff --git a/xserver/hw/xfree86/common/xf86Option.c b/xserver/hw/xfree86/common/xf86Option.c index e9393fa16..06973bca3 100644 --- a/xserver/hw/xfree86/common/xf86Option.c +++ b/xserver/hw/xfree86/common/xf86Option.c @@ -44,6 +44,7 @@ #include "xf86Xinput.h" #include "xf86Optrec.h" #include "xf86Parser.h" +#include "xf86platformBus.h" /* For OutputClass functions */ #include "optionstr.h" static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, @@ -64,7 +65,7 @@ static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, * * The order of precedence for options is: * - * extraOpts, display, confScreen, monitor, device + * extraOpts, display, confScreen, monitor, device, outputClassOptions */ void @@ -79,6 +80,8 @@ xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts) pScrn->options = NULL; for (i = pScrn->numEntities - 1; i >= 0; i--) { + xf86MergeOutputClassOptions(pScrn->entityList[i], &pScrn->options); + device = xf86GetDevFromEntity(pScrn->entityList[i], pScrn->entityInstanceList[i]); if (device && device->options) { diff --git a/xserver/hw/xfree86/common/xf86PM.c b/xserver/hw/xfree86/common/xf86PM.c index 3f08c8166..ed7bdbd9f 100644 --- a/xserver/hw/xfree86/common/xf86PM.c +++ b/xserver/hw/xfree86/common/xf86PM.c @@ -116,8 +116,6 @@ suspend(pmEvent event, Bool undo) xf86Screens[i]->vtSema = FALSE; } } - xf86AccessLeave(); - } static void @@ -126,7 +124,6 @@ resume(pmEvent event, Bool undo) int i; InputInfoPtr pInfo; - xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); diff --git a/xserver/hw/xfree86/common/xf86Priv.h b/xserver/hw/xfree86/common/xf86Priv.h index c1f8a18d7..393af3900 100644 --- a/xserver/hw/xfree86/common/xf86Priv.h +++ b/xserver/hw/xfree86/common/xf86Priv.h @@ -67,7 +67,6 @@ extern _X_EXPORT char *xf86PointerName; extern _X_EXPORT char *xf86KeyboardName; extern _X_EXPORT int xf86FbBpp; extern _X_EXPORT int xf86Depth; -extern _X_EXPORT Pix24Flags xf86Pix24; extern _X_EXPORT rgb xf86Weight; extern _X_EXPORT Bool xf86FlipPixels; extern _X_EXPORT Gamma xf86Gamma; @@ -94,6 +93,7 @@ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ extern ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */ extern int xf86NumGPUScreens; +extern _X_EXPORT int xf86DRMMasterFd; /* Command line argument for DRM master file descriptor */ #ifndef DEFAULT_VERBOSE #define DEFAULT_VERBOSE 0 #endif @@ -110,8 +110,6 @@ extern int xf86NumGPUScreens; /* xf86Bus.c */ extern _X_EXPORT Bool xf86BusConfig(void); extern _X_EXPORT void xf86BusProbe(void); -extern _X_EXPORT void xf86AccessEnter(void); -extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86PostProbe(void); extern _X_EXPORT void xf86ClearEntityListForScreen(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); @@ -138,8 +136,6 @@ DoShowOptions(void) extern _X_EXPORT void xf86Wakeup(void *blockData, int err); -extern _X_HIDDEN int -xf86SigWrapper(int signo); extern _X_EXPORT void xf86HandlePMEvents(int fd, void *data); extern _X_EXPORT int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, diff --git a/xserver/hw/xfree86/common/xf86Privstr.h b/xserver/hw/xfree86/common/xf86Privstr.h index c29b3ccc8..21c2e1fe4 100644 --- a/xserver/hw/xfree86/common/xf86Privstr.h +++ b/xserver/hw/xfree86/common/xf86Privstr.h @@ -64,7 +64,6 @@ typedef struct { Bool dontZap; Bool dontZoom; Bool notrapSignals; /* don't exit cleanly - die at fault */ - Bool caughtSignal; /* graphics part */ ScreenPtr currentScreen; @@ -81,11 +80,7 @@ typedef struct { * changed */ Bool miscModInDevAllowNonLocal; Bool useSIGIO; /* Use SIGIO for handling DRI1 swaps */ - Pix24Flags pixmap24; - MessageType pix24From; Bool pmFlag; - Bool disableRandR; - MessageType randRFrom; MessageType iglxFrom; XF86_GlxVisuals glxVisuals; MessageType glxVisualsFrom; @@ -102,17 +97,9 @@ typedef struct { MessageType dri2From; Bool autoAddGPU; + const char *debug; } xf86InfoRec, *xf86InfoPtr; -#ifdef DPMSExtension -/* Private info for DPMS */ -typedef struct { - CloseScreenProcPtr CloseScreen; - Bool Enabled; - int Flags; -} DPMSRec, *DPMSPtr; -#endif - /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ #define XLED1 ((unsigned long) 0x00000001) #define XLED2 ((unsigned long) 0x00000002) diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c index 136bf50ff..75235b368 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.c +++ b/xserver/hw/xfree86/common/xf86Xinput.c @@ -1181,7 +1181,7 @@ xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute, { int stolen = 0; -#if XFreeXDGA +#ifdef XFreeXDGA ScreenPtr scr = NULL; int idx = 0, i; @@ -1375,7 +1375,7 @@ xf86PostButtonEventM(DeviceIntPtr device, flags = POINTER_RELATIVE | POINTER_ACCELERATE; } -#if XFreeXDGA +#ifdef XFreeXDGA if (miPointerGetScreen(device)) { int index = miPointerGetScreen(device)->myNum; @@ -1406,7 +1406,7 @@ xf86PostKeyEventP(DeviceIntPtr device, void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down) { -#if XFreeXDGA +#ifdef XFreeXDGA DeviceIntPtr pointer; /* Some pointers send key events, paired device is wrong then. */ diff --git a/xserver/hw/xfree86/common/xf86pciBus.c b/xserver/hw/xfree86/common/xf86pciBus.c index d8a79cb1a..f371ab124 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.c +++ b/xserver/hw/xfree86/common/xf86pciBus.c @@ -155,8 +155,8 @@ xf86PciProbe(void) if (xf86IsPrimaryPci(info)) prim = "*"; - xf86Msg(X_PROBED, "PCI:%s(%u:%u:%u:%u) %04x:%04x:%04x:%04x ", prim, - info->domain, info->bus, info->dev, info->func, + xf86Msg(X_PROBED, "PCI:%s(%u@%u:%u:%u) %04x:%04x:%04x:%04x ", prim, + info->bus, info->domain, info->dev, info->func, info->vendor_id, info->device_id, info->subvendor_id, info->subdevice_id); @@ -352,6 +352,10 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func) Bool xf86IsPrimaryPci(struct pci_device *pPci) { + /* Add max. 1 screen for the IgnorePrimary fallback path */ + if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) + return TRUE; + if (primaryBus.type == BUS_PCI) return pPci == primaryBus.id.pci; #ifdef XSERVER_PLATFORM_BUS @@ -855,7 +859,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID PCI:%u@%u:%u:%u) found\n", - driverName, pPci->domain, pPci->bus, pPci->dev, + driverName, pPci->bus, pPci->domain, pPci->dev, pPci->func); } } @@ -1019,9 +1023,6 @@ xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip, if ((pScrn = xf86FindScreenForEntity(pEnt->index))) xf86RemoveEntityFromScreen(pScrn, pEnt->index); - - /* shared resources are only needed when entity is active: remove */ - xf86SetEntityFuncs(pEnt->index, init, enter, leave, private); } ScrnInfoPtr @@ -1031,6 +1032,9 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); + if (dummy || init || enter || leave) + FatalError("Legacy entity access functions are unsupported\n"); + if (!pEnt) return pScrn; @@ -1056,14 +1060,11 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, } free(pEnt); - xf86SetEntityFuncs(entityIndex, init, enter, leave, private); - return pScrn; } -int -xf86VideoPtrToDriverList(struct pci_device *dev, - char *returnList[], int returnListMax) +void +xf86VideoPtrToDriverList(struct pci_device *dev, XF86MatchedDrivers *md) { int i; @@ -1212,7 +1213,7 @@ xf86VideoPtrToDriverList(struct pci_device *dev, { int idx = 0; -#ifdef __linux__ +#if defined(__linux__) || defined(__NetBSD__) driverList[idx++] = "nouveau"; #endif driverList[idx++] = "nv"; @@ -1289,10 +1290,9 @@ xf86VideoPtrToDriverList(struct pci_device *dev, default: break; } - for (i = 0; (i < returnListMax) && (driverList[i] != NULL); i++) { - returnList[i] = xnfstrdup(driverList[i]); + for (i = 0; driverList[i] != NULL; i++) { + xf86AddMatchedDriver(md, driverList[i]); } - return i; /* Number of entries added */ } #ifdef __linux__ @@ -1316,23 +1316,23 @@ xchomp(char *line) * don't export their PCI ID's properly. If distros don't end up using this * feature it can and should be removed because the symbol-based resolution * scheme should be the primary one */ -int +void xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, - char *matches[], int nmatches) + XF86MatchedDrivers *md) { DIR *idsdir; FILE *fp; struct dirent *direntry; - char *line = NULL; + char *line = NULL, *tmpMatch; size_t len; ssize_t read; char path_name[512], vendor_str[5], chip_str[5]; uint16_t vendor, chip; - int i = 0, j; + int j; idsdir = opendir(PCI_TXT_IDS_PATH); if (!idsdir) - return 0; + return; xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", @@ -1383,10 +1383,10 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, } } if (vendor == match_vendor && chip == match_chip) { - matches[i] = + tmpMatch = (char *) malloc(sizeof(char) * strlen(direntry->d_name) - 3); - if (!matches[i]) { + if (!tmpMatch) { xf86Msg(X_ERROR, "Could not allocate space for the module name. Exiting.\n"); goto end; @@ -1396,16 +1396,17 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, * taking off anything after the first '.' */ for (j = 0; j < (strlen(direntry->d_name) - 3); j++) { if (direntry->d_name[j] == '.') { - matches[i][j] = '\0'; + tmpMatch[j] = '\0'; break; } else { - matches[i][j] = direntry->d_name[j]; + tmpMatch[j] = direntry->d_name[j]; } } + xf86AddMatchedDriver(md, tmpMatch); xf86Msg(X_INFO, "Matched %s from file name %s\n", - matches[i], direntry->d_name); - i++; + tmpMatch, direntry->d_name); + free(tmpMatch); } } else { @@ -1419,18 +1420,12 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, end: free(line); closedir(idsdir); - return i; } #endif /* __linux__ */ -/** - * @return The numbers of found devices that match with the current system - * drivers. - */ -int -xf86PciMatchDriver(char *matches[], int nmatches) +void +xf86PciMatchDriver(XF86MatchedDrivers *md) { - int i = 0; struct pci_device *info = NULL; struct pci_device_iterator *iter; @@ -1445,15 +1440,12 @@ xf86PciMatchDriver(char *matches[], int nmatches) pci_iterator_destroy(iter); #ifdef __linux__ if (info) - i += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, - matches, nmatches); + xf86MatchDriverFromFiles(info->vendor_id, info->device_id, md); #endif - if ((info != NULL) && (i < nmatches)) { - i += xf86VideoPtrToDriverList(info, &(matches[i]), nmatches - i); + if (info != NULL) { + xf86VideoPtrToDriverList(info, md); } - - return i; } Bool @@ -1480,11 +1472,7 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, pVideo = (struct pci_device *) busData; - if (pVideo->bus < 256) - snprintf(busnum, sizeof(busnum), "%d", pVideo->bus); - else - snprintf(busnum, sizeof(busnum), "%d@%d", - pVideo->bus & 0x00ff, pVideo->bus >> 8); + snprintf(busnum, sizeof(busnum), "%d", pVideo->bus); XNFasprintf(&tmp, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func); @@ -1496,3 +1484,15 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, if (*chipset < 0) *chipset = (pVideo->vendor_id << 16) | pVideo->device_id; } + +char * +DRICreatePCIBusID(const struct pci_device *dev) +{ + char *busID; + + if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", + dev->domain, dev->bus, dev->dev, dev->func) == -1) + return NULL; + + return busID; +} diff --git a/xserver/hw/xfree86/common/xf86pciBus.h b/xserver/hw/xfree86/common/xf86pciBus.h index 45b5a0fee..14ae9760e 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.h +++ b/xserver/hw/xfree86/common/xf86pciBus.h @@ -33,11 +33,13 @@ #ifndef _XF86_PCI_BUS_H #define _XF86_PCI_BUS_H +#include "xf86MatchDrivers.h" + void xf86PciProbe(void); Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciProbeDev(DriverPtr drvp); void xf86PciIsolateDevice(const char *argument); -int xf86PciMatchDriver(char *matches[], int nmatches); +void xf86PciMatchDriver(XF86MatchedDrivers *md); Bool xf86PciConfigure(void *busData, struct pci_device *pDev); void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, GDevRec * GDev, int *chipset); @@ -47,10 +49,9 @@ void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, ((x)->func == (y)->func) && \ ((x)->dev == (y)->dev)) -int +void xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, - char *matches[], int nmatches); -int -xf86VideoPtrToDriverList(struct pci_device *dev, - char *returnList[], int returnListMax); + XF86MatchedDrivers *md); +void +xf86VideoPtrToDriverList(struct pci_device *dev, XF86MatchedDrivers *md); #endif /* _XF86_PCI_BUS_H */ diff --git a/xserver/hw/xfree86/common/xf86platformBus.c b/xserver/hw/xfree86/common/xf86platformBus.c index 39fb1dd36..cef47da03 100644 --- a/xserver/hw/xfree86/common/xf86platformBus.c +++ b/xserver/hw/xfree86/common/xf86platformBus.c @@ -40,6 +40,7 @@ #include "hotplug.h" #include "systemd-logind.h" +#include "loaderProcs.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Priv.h" @@ -114,6 +115,10 @@ xf86_find_platform_device_by_devnum(int major, int minor) static Bool xf86IsPrimaryPlatform(struct xf86_platform_device *plat) { + /* Add max. 1 screen for the IgnorePrimary fallback path */ + if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) + return TRUE; + if (primaryBus.type == BUS_PLATFORM) return plat == primaryBus.id.plat; #ifdef XSERVER_LIBPCIACCESS @@ -141,16 +146,9 @@ platform_find_pci_info(struct xf86_platform_device *pd, char *busid) iter = pci_slot_match_iterator_create(&devmatch); info = pci_device_next(iter); - if (info) { + if (info) pd->pdev = info; - pci_device_probe(info); - if (pci_device_is_boot_vga(info)) { - primaryBus.type = BUS_PLATFORM; - primaryBus.id.plat = pd; - } - } pci_iterator_destroy(iter); - } static Bool @@ -210,9 +208,10 @@ MatchToken(const char *value, struct xorg_list *patterns, } static Bool -OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) +OutputClassMatches(const XF86ConfOutputClassPtr oclass, + struct xf86_platform_device *dev) { - char *driver = xf86_platform_odev_attributes(index)->driver; + char *driver = dev->attribs->driver; if (!MatchToken(driver, &oclass->match_driver, strcmp)) return FALSE; @@ -220,41 +219,32 @@ OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) return TRUE; } -static int -xf86OutputClassDriverList(int index, char *matches[], int nmatches) +static void +xf86OutputClassDriverList(int index, XF86MatchedDrivers *md) { XF86ConfOutputClassPtr cl; - int i = 0; - - if (nmatches == 0) - return 0; for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { - if (OutputClassMatches(cl, index)) { + if (OutputClassMatches(cl, &xf86_platform_devices[index])) { char *path = xf86_platform_odev_attributes(index)->path; xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", cl->identifier, path); xf86Msg(X_NONE, "\tloading driver: %s\n", cl->driver); - matches[i++] = xstrdup(cl->driver); + xf86AddMatchedDriver(md, cl->driver); } - - if (i >= nmatches) - break; } - - return i; } /** * @return The numbers of found devices that match with the current system * drivers. */ -int -xf86PlatformMatchDriver(char *matches[], int nmatches) +void +xf86PlatformMatchDriver(XF86MatchedDrivers *md) { - int i, j = 0; + int i; struct pci_device *info = NULL; int pass = 0; @@ -266,21 +256,19 @@ xf86PlatformMatchDriver(char *matches[], int nmatches) else if (!xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 0)) continue; - j += xf86OutputClassDriverList(i, &matches[j], nmatches - j); + xf86OutputClassDriverList(i, md); info = xf86_platform_devices[i].pdev; #ifdef __linux__ if (info) - j += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, - &matches[j], nmatches - j); + xf86MatchDriverFromFiles(info->vendor_id, info->device_id, md); #endif - if ((info != NULL) && (j < nmatches)) { - j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j); + if (info != NULL) { + xf86VideoPtrToDriverList(info, md); } } } - return j; } int @@ -288,6 +276,9 @@ xf86platformProbe(void) { int i; Bool pci = TRUE; + XF86ConfOutputClassPtr cl, cl_head = (xf86configptr) ? + xf86configptr->conf_outputclass_lst : NULL; + char *old_path, *path = NULL; config_odev_probe(xf86PlatformDeviceProbe); @@ -301,10 +292,105 @@ xf86platformProbe(void) if (pci && (strncmp(busid, "pci:", 4) == 0)) { platform_find_pci_info(&xf86_platform_devices[i], busid); } + + /* + * Deal with OutputClass ModulePath directives, these must be + * processed before we do any module loading. + */ + for (cl = cl_head; cl; cl = cl->list.next) { + if (!OutputClassMatches(cl, &xf86_platform_devices[i])) + continue; + + if (cl->modulepath && xf86ModPathFrom != X_CMDLINE) { + old_path = path; + XNFasprintf(&path, "%s,%s", cl->modulepath, + path ? path : xf86ModulePath); + free(old_path); + xf86Msg(X_CONFIG, "OutputClass \"%s\" ModulePath extended to \"%s\"\n", + cl->identifier, path); + LoaderSetPath(path); + } + } } + + free(path); + + /* First see if there is an OutputClass match marking a device as primary */ + for (i = 0; i < xf86_num_platform_devices; i++) { + struct xf86_platform_device *dev = &xf86_platform_devices[i]; + for (cl = cl_head; cl; cl = cl->list.next) { + if (!OutputClassMatches(cl, dev)) + continue; + + if (xf86CheckBoolOption(cl->option_lst, "PrimaryGPU", FALSE)) { + xf86Msg(X_CONFIG, "OutputClass \"%s\" setting %s as PrimaryGPU\n", + cl->identifier, dev->attribs->path); + primaryBus.type = BUS_PLATFORM; + primaryBus.id.plat = dev; + return 0; + } + } + } + + /* Then check for pci_device_is_boot_vga() */ + for (i = 0; i < xf86_num_platform_devices; i++) { + struct xf86_platform_device *dev = &xf86_platform_devices[i]; + + if (!dev->pdev) + continue; + + pci_device_probe(dev->pdev); + if (pci_device_is_boot_vga(dev->pdev)) { + primaryBus.type = BUS_PLATFORM; + primaryBus.id.plat = dev; + } + } + return 0; } +void +xf86MergeOutputClassOptions(int entityIndex, void **options) +{ + const EntityPtr entity = xf86Entities[entityIndex]; + struct xf86_platform_device *dev = NULL; + XF86ConfOutputClassPtr cl; + XF86OptionPtr classopts; + int i = 0; + + switch (entity->bus.type) { + case BUS_PLATFORM: + dev = entity->bus.id.plat; + break; + case BUS_PCI: + for (i = 0; i < xf86_num_platform_devices; i++) { + if (MATCH_PCI_DEVICES(xf86_platform_devices[i].pdev, + entity->bus.id.pci)) { + dev = &xf86_platform_devices[i]; + break; + } + } + break; + default: + xf86Msg(X_DEBUG, "xf86MergeOutputClassOptions unsupported bus type %d\n", + entity->bus.type); + } + + if (!dev) + return; + + for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { + if (!OutputClassMatches(cl, dev) || !cl->option_lst) + continue; + + xf86Msg(X_INFO, "Applying OutputClass \"%s\" options to %s\n", + cl->identifier, dev->attribs->path); + + classopts = xf86optionListDup(cl->option_lst); + *options = xf86optionListMerge(*options, classopts); + } +} + static int xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp, int chipset, GDevPtr dev, Bool active) @@ -475,6 +561,23 @@ xf86platformProbeDev(DriverPtr drvp) isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); } + free(devList); + + return foundScreen; +} + +int +xf86platformAddGPUDevices(DriverPtr drvp) +{ + Bool foundScreen = FALSE; + GDevPtr *devList; + int j; + + if (!drvp->platformProbe) + return FALSE; + + xf86MatchDevice(drvp->driverName, &devList); + /* if autoaddgpu devices is enabled then go find any unclaimed platform * devices and add them as GPU screens */ if (xf86Info.autoAddGPU) { @@ -486,6 +589,8 @@ xf86platformProbeDev(DriverPtr drvp) } } + free(devList); + return foundScreen; } diff --git a/xserver/hw/xfree86/common/xf86platformBus.h b/xserver/hw/xfree86/common/xf86platformBus.h index a7335b9da..1e75e6352 100644 --- a/xserver/hw/xfree86/common/xf86platformBus.h +++ b/xserver/hw/xfree86/common/xf86platformBus.h @@ -25,6 +25,7 @@ #define XF86_PLATFORM_BUS_H #include "hotplug.h" +#include "xf86MatchDrivers.h" struct xf86_platform_device { struct OdevAttributes *attribs; @@ -41,6 +42,8 @@ struct xf86_platform_device { #ifdef XSERVER_PLATFORM_BUS int xf86platformProbe(void); int xf86platformProbeDev(DriverPtr drvp); +int xf86platformAddGPUDevices(DriverPtr drvp); +void xf86MergeOutputClassOptions(int entityIndex, void **options); extern int xf86_num_platform_devices; extern struct xf86_platform_device *xf86_platform_devices; @@ -151,11 +154,17 @@ _xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int at extern _X_EXPORT Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid); -extern _X_EXPORT int -xf86PlatformMatchDriver(char *matches[], int nmatches); +extern _X_EXPORT void +xf86PlatformMatchDriver(XF86MatchedDrivers *); extern void xf86platformVTProbe(void); extern void xf86platformPrimary(void); + +#else + +static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; } +static inline void xf86MergeOutputClassOptions(int index, void **options) {} + #endif #endif diff --git a/xserver/hw/xfree86/common/xf86str.h b/xserver/hw/xfree86/common/xf86str.h index bfcb75ec0..edd91c745 100644 --- a/xserver/hw/xfree86/common/xf86str.h +++ b/xserver/hw/xfree86/common/xf86str.h @@ -209,16 +209,6 @@ typedef CARD32 xorgHWFlags; */ struct _DriverRec; -typedef struct { - int driverVersion; - const char *driverName; - void (*Identify) (int flags); - Bool (*Probe) (struct _DriverRec * drv, int flags); - const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); - void *module; - int refCount; -} DriverRec1; - struct _SymTabRec; struct _PciChipsets; @@ -259,7 +249,7 @@ typedef struct _DriverRec { */ /* Tolerate prior #include */ -#if defined(linux) +#if defined(__linux__) #undef BUS_NONE #undef BUS_PCI #undef BUS_SBUS @@ -313,7 +303,6 @@ typedef struct { Bool active; Bool inUse; int videoRam; - unsigned long BiosBase; /* Base address of video BIOS */ unsigned long MemBase; /* Frame buffer base address */ unsigned long IOBase; int chipID; @@ -421,23 +410,15 @@ typedef struct _confdrirec { confDRIBufferRec *bufs; } confDRIRec, *confDRIPtr; -/* These values should be adjusted when new fields are added to ScrnInfoRec */ -#define NUM_RESERVED_INTS 16 -#define NUM_RESERVED_POINTERS 14 -#define NUM_RESERVED_FUNCS 10 +#define NUM_RESERVED_INTS 4 +#define NUM_RESERVED_POINTERS 4 +#define NUM_RESERVED_FUNCS 4 /* let clients know they can use this */ #define XF86_SCRN_HAS_PREFER_CLONE 1 typedef void *(*funcPointer) (void); -/* flags for depth 24 pixmap options */ -typedef enum { - Pix24DontCare = 0, - Pix24Use24, - Pix24Use32 -} Pix24Flags; - /* Power management events: so far we only support APM */ typedef enum { @@ -579,11 +560,7 @@ typedef void xf86ModeSetProc(ScrnInfoPtr); * ScrnInfoRec * * There is one of these for each screen, and it holds all the screen-specific - * information. - * - * Note: the size and layout must be kept the same across versions. New - * fields are to be added in place of the "reserved*" fields. No fields - * are to be dependent on compile-time defines. + * information. Note: No fields are to be dependent on compile-time defines. */ typedef struct _ScrnInfoRec { @@ -608,7 +585,6 @@ typedef struct _ScrnInfoRec { PixmapFormatRec fbFormat; int bitsPerPixel; /* fb bpp */ - Pix24Flags pixmap24; /* pixmap pref for depth 24 */ int depth; /* depth of default visual */ MessageType depthFrom; /* set from config? */ MessageType bitsPerPixelFrom; /* set from config? */ @@ -618,12 +594,9 @@ typedef struct _ScrnInfoRec { int rgbBits; /* Number of bits in r/g/b */ Gamma gamma; /* Gamma of the monitor */ int defaultVisual; /* default visual class */ - int maxHValue; /* max horizontal timing */ - int maxVValue; /* max vertical timing value */ int virtualX; /* Virtual width */ int virtualY; /* Virtual height */ int xInc; /* Horizontal timing increment */ - MessageType virtualFrom; /* set from config? */ int displayWidth; /* memory pitch */ int frameX0; /* viewport position */ int frameY0; @@ -665,16 +638,11 @@ typedef struct _ScrnInfoRec { int numClocks; /* number of clocks */ int clock[MAXCLOCKS]; /* list of clock frequencies */ int videoRam; /* amount of video ram (kb) */ - unsigned long biosBase; /* Base address of video BIOS */ unsigned long memPhysBase; /* Physical address of FB */ unsigned long fbOffset; /* Offset of FB in the above */ - int memClk; /* memory clock */ Bool flipPixels; /* swap default black/white */ void *options; - int chipID; - int chipRev; - /* Allow screens to be enabled/disabled individually */ Bool vtSema; @@ -688,18 +656,12 @@ typedef struct _ScrnInfoRec { /* initial rightof support disable */ int preferClone; - /* - * These can be used when the minor ABI version is incremented. - * The NUM_* parameters must be reduced appropriately to keep the - * structure size and alignment unchanged. - */ - int reservedInt[NUM_RESERVED_INTS]; + Bool is_gpu; + uint32_t capabilities; int *entityInstanceList; struct pci_device *vgaDev; - void *reservedPtr[NUM_RESERVED_POINTERS]; - /* * Driver entry points. * @@ -725,15 +687,9 @@ typedef struct _ScrnInfoRec { xorgDriverFuncProc *DriverFunc; xf86ModeSetProc *ModeSet; - /* - * This can be used when the minor ABI version is incremented. - * The NUM_* parameter must be reduced appropriately to keep the - * structure size and alignment unchanged. - */ + int reservedInt[NUM_RESERVED_INTS]; + void *reservedPtr[NUM_RESERVED_POINTERS]; funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; - - Bool is_gpu; - uint32_t capabilities; } ScrnInfoRec; typedef struct { diff --git a/xserver/hw/xfree86/ddc/Makefile.in b/xserver/hw/xfree86/ddc/Makefile.in index 85c293657..404505db4 100644 --- a/xserver/hw/xfree86/ddc/Makefile.in +++ b/xserver/hw/xfree86/ddc/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -338,6 +338,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -356,15 +357,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -372,6 +376,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -443,8 +449,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/dixmods/Makefile.in b/xserver/hw/xfree86/dixmods/Makefile.in index a7b514d45..151dc7312 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.in +++ b/xserver/hw/xfree86/dixmods/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -378,6 +378,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -396,15 +397,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -412,6 +416,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -483,8 +489,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/dixmods/glxmodule.c b/xserver/hw/xfree86/dixmods/glxmodule.c index bf7e65911..2215c8867 100644 --- a/xserver/hw/xfree86/dixmods/glxmodule.c +++ b/xserver/hw/xfree86/dixmods/glxmodule.c @@ -47,10 +47,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -static const ExtensionModule GLXExt[] = { - { GlxExtensionInit, "GLX", &noGlxExtension }, -}; - static XF86ModuleVersionInfo VersRec = { "glx", MODULEVENDORSTRING, @@ -83,8 +79,7 @@ glxSetup(void *module, void *opts, int *errmaj, int *errmin) provider = LoaderSymbol("__glXDRI2Provider"); if (provider) GlxPushProvider(provider); - - LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE); + xorgGlxCreateVendor(); return module; } diff --git a/xserver/hw/xfree86/doc/Makefile.in b/xserver/hw/xfree86/doc/Makefile.in index e1cd937ee..9dd621cda 100644 --- a/xserver/hw/xfree86/doc/Makefile.in +++ b/xserver/hw/xfree86/doc/Makefile.in @@ -87,7 +87,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -296,6 +296,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -314,15 +315,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -330,6 +334,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -401,8 +407,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/doc/ddxDesign.xml b/xserver/hw/xfree86/doc/ddxDesign.xml index f7d66285e..367844136 100644 --- a/xserver/hw/xfree86/doc/ddxDesign.xml +++ b/xserver/hw/xfree86/doc/ddxDesign.xml @@ -145,7 +145,8 @@ following changes: purpose is to identify particular cards in a multi-headed configuration. The format of the argument is intentionally vague, and may be architecture dependent. For a PCI bus, it - is something like "bus:slot:func". + is something like "bus@domain:slot:func". The "@domain" part + can be left out for domain 0. @@ -819,13 +820,11 @@ Here is what InitOutput() does: like probing for other details such as the amount of memory installed, etc. It is recommended that the xf86MatchPciInstances() helper function be used - for identifying matching PCI devices, and similarly the - xf86MatchIsaInstances() for ISA (non-PCI) devices + for identifying matching PCI devices (see the RAC section). These helpers also checks and claims the appropriate entity. When not using the helper, that should be done with xf86CheckPciSlot() - and xf86ClaimPciSlot() for PCI devices and - xf86ClaimIsaSlot() for ISA devices (see the + and xf86ClaimPciSlot() for PCI devices (see the RAC section). @@ -834,14 +833,8 @@ Here is what InitOutput() does: stage. If a resource conflict is found between exclusive resources the driver will fail immediately. This is usually best done with the xf86ConfigPciEntity() helper function - for PCI and xf86ConfigIsaEntity() for ISA - (see the RAC section). It is possible to - register some entity specific functions with those helpers. When - not using the helpers, the xf86AddEntityToScreen() - xf86ClaimFixedResources() and - xf86SetEntityFuncs() should be used instead (see - the RAC section). - + for PCI. + If a chipset is specified in an active device section which the @@ -860,8 +853,7 @@ Here is what InitOutput() does: Allocate a ScrnInfoRec for each active instance of the hardware found, and fill in the basic information, including the other driver entry points. This is best done with the - xf86ConfigIsaEntity() helper function for ISA - instances or xf86ConfigPciEntity() for PCI instances. + xf86ConfigPciEntity() for PCI instances. These functions allocate a ScrnInfoRec for active entities. Optionally xf86AllocateScreen() function may also be used to allocate the ScrnInfoRec. @@ -1115,16 +1107,6 @@ Here is what InitOutput() does: them. - - All additional resources that the screen needs must be registered - here. This should be done with - xf86RegisterResources(). If some of the fixed - resources registered in the Probe phase are not needed or not - decoded by the hardware when in the OPERATING server state, their - status should be updated with - xf86SetOperatingState(). - - Modules may be loaded at any point in this function, and all modules that the driver will need must be loaded before the end @@ -1190,8 +1172,6 @@ Here is what InitOutput() does: rgbBits (8bpp only) gamma defaultVisual - maxHValue - maxVValue virtualX virtualY displayWidth @@ -1210,9 +1190,7 @@ Here is what InitOutput() does: numClocks (if not programmable) clock[] (if not programmable) videoRam - biosBase memBase - memClk driverPrivate chipID chipRev @@ -2063,16 +2041,6 @@ functions is as follows: -
- - Bool xf86CaughtSignal(); - -
- Returns TRUE if the server has caught a signal, - and FALSE otherwise. -
- -
@@ -2511,53 +2479,6 @@ xorg.conf file to the devices: return value of -1 indicates an internal error. The returned foundEntities array should be freed by the driver with xfree() when it is no longer - needed in cases where the return value is greater than zero. - - - - -
- - int xf86MatchIsaInstances(const char *driverName, - SymTabPtr chipsets, IsaChipsets *ISAchipsets, - DriverPtr drvp, FindIsaDevProc FindIsaDevice, - GDevPtr *devList, int numDevs, - int **foundEntities); - -
- This function finds matches between ISA cards that a driver supports - and config file device sections. It is intended for use in the - ChipProbe() function of drivers for ISA cards. - devList and numDevs are - typically those found from calling xf86MatchDevice(), - and represent the active config file device sections relevant to - the driver. ISAchipsets is a table that provides - a mapping between the driver's internal chipset tokens and the - resource classes. FindIsaDevice is a - driver-provided function that probes the hardware and returns the - chipset token corresponding to what was detected, and - -1 if nothing was detected. - - - - If the config file device section contains a chipset entry, then - it is checked against the chipsets list. When - no chipset entry is present, the FindIsaDevice - function is called instead. - - - - Entity index numbers for confirmed matches are returned as an - array via foundEntities. The chipset token and - device section for each match are found in the - EntityInfoRec referenced by the indices. - - - - The function return value is the number of confirmed matches. A - return value of -1 indicates an internal error. - The returned foundEntities array should be freed - by the driver with xfree() when it is no longer needed in cases where the return value is greater than zero. @@ -2601,18 +2522,6 @@ available at the driver level:
-
- - Bool xf86ParseIsaBusString(const char *busID); - -
- Compares a BusID string with the ISA bus ID string - ("ISA" or "ISA:"). If they match TRUE is returned, - and FALSE if they don't. - - -
-
Bool xf86CheckPciSlot(int bus, int device, int func); @@ -2652,30 +2561,6 @@ available at the driver level:
-
- - int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, - GDevPtr dev, Bool active); - -
- This allocates an entity record entity and initialise the data - structures. The return value is the index of the newly allocated - entity record. - - -
- -
- - Bool xf86IsPrimaryIsa(void); - -
- This function returns TRUE if the primary card is - an ISA (non-PCI) device, and FALSE otherwise. - - -
- Two helper functions are provided to aid configuring entities: @@ -2685,41 +2570,17 @@ Two helper functions are provided to aid configuring entities: ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, PciChipsets *p_chip, - resList res, EntityProc init, + void *res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); - ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, - int scrnFlag, int entityIndex, - IsaChipsets *i_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private);
- These functions are used to register the non-relocatable resources - for an entity, and the optional entity-specific Init, Enter and - Leave functions. Usually the list of fixed resources is obtained - from the Isa/PciChipsets lists. However an additional list of - resources may be passed. Generally this is not required. + This functions is used to register the entity. The res, init, enter, and leave arguments are unused, and should be NULL. For active entities a ScrnInfoRec is allocated if the pScrn argument is NULL. The - return value is TRUE when successful. The init, enter, leave - functions are defined as follows: - -
- - typedef void (*EntityProc)(int entityIndex, - pointer private); - -
- - They are passed the entity index and a pointer to a private scratch - area. This can be set up during Probe() and - its address can be passed to - xf86ConfigIsaEntity() and - xf86ConfigPciEntity() as the last argument. + return value is TRUE when successful.
@@ -2728,33 +2589,6 @@ The These two helper functions make use of several core functions that are available at the driver level: -
- - void xf86ClaimFixedResources(resList list, int entityIndex); - -
- This function registers the non-relocatable resources which cannot - be disabled and which therefore would cause the server to fail - immediately if they were found to conflict. It also records - non-relocatable but sharable resources for processing after the - Probe() phase. - - -
- -
- - Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, - EntityProc enter, EntityProc leave, pointer); - -
- This function registers with an entity the init, - enter, leave functions along - with the pointer to their private area. - - -
-
void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex); @@ -2834,52 +2668,6 @@ Several functions are provided to simplify resource registration:
- -The primary function for registration of resources is: -
- - resPtr xf86RegisterResources(int entityIndex, resList list, - int access); - -
- This function tries to register the resources in - list. If list is NULL it tries - to determine the resources automatically. This only works for - entities that provide a generic way to read out the resource ranges - they decode. So far this is only the case for PCI devices. By - default the PCI resources are registered as shared - (ResShared) if the driver wants to set a different - access type it can do so by specifying the access flags in the - third argument. A value of 0 means to use the - default settings. If for any reason the resource broker is not - able to register some of the requested resources the function will - return a pointer to a list of the failed ones. In this case the - driver may be able to move the resource to different locations. - In case of PCI bus entities this is done by passing the list of - failed resources to xf86ReallocatePciResources(). - When the registration succeeds, the return value is - NULL. - - -
-
- -
- - resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); - -
- This function takes a list of PCI resources that need to be - reallocated and returns NULL when all relocations are - successful. - xf86RegisterResources() should be called again to - register the relocated resources with the broker. - If the reallocation fails, a list of the resources that could not be - relocated is returned. - - -
- Two functions are provided to obtain a resource range of a given type:
@@ -2922,34 +2710,6 @@ Two functions are provided to obtain a resource range of a given type: -Some PCI devices are broken in the sense that they return invalid size -information for a certain resource. In this case the driver can supply -the correct size and make sure that the resource range allocated for -the card is large enough to hold the address range decoded by the card. -The function xf86FixPciResource() can be used to do this: -
- - Bool xf86FixPciResource(int entityIndex, unsigned int prt, - CARD32 alignment, long type); - -
- This function fixes a PCI resource allocation. The - prt parameter contains the number of the PCI base - register that needs to be fixed (0-5, and - 6 for the BIOS base register). The size is - specified by the alignment. Since PCI resources need to span an - integral range of size 2ˆn, the alignm ent also - specifies the number of addresses that will be decoded. If the - driver specifies a type mask it can override the default type for - PCI resources which is ResShared. The resource - broker needs to know that to find a matching resource range. This - function should be called before calling - xf86RegisterResources(). The return value is - TRUE when the function succeeds. - - -
-
Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base); @@ -2965,93 +2725,6 @@ The function xf86FixPciResource() can be used to do this:
- -The driver may replace the generic access control functions for an entity. -This is done with the xf86SetAccessFuncs(): -
- - void xf86SetAccessFuncs(EntityInfoPtr pEnt, - xf86SetAccessFuncPtr funcs, - xf86SetAccessFuncPtr oldFuncs); - - with: - - typedef struct { - xf86AccessPtr mem; - xf86AccessPtr io; - xf86AccessPtr io_mem; - } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr; - -
- The driver can pass three functions: one for I/O access, one for - memory access and one for combined memory and I/O access. If the - memory access and combined access functions are identical the - common level assumes that the memory access cannot be controlled - independently of I/O access, if the I/O access function and the - combined access functions are the same it is assumed that I/O can - not be controlled independently. If memory and I/O have to be - controlled together all three values should be the same. If a - non NULL value is passed as third argument it is - interpreted as an address where to store the old access record. - If the third argument is NULL it will be assumed - that the generic access should be enabled before replacing the - access functions. Otherwise it will be disabled. The driver may - enable them itself using the returned values. It should do this - from its replacement access functions as the generic access may - be disabled by the common level on certain occasions. If replacement - functions are specified they must control all resources of the - specific type registered for the entity. - - -
-
- - -To find out if a specific resource range conflicts with another -resource the xf86ChkConflict() function may be used: -
- - memType xf86ChkConflict(resRange *rgp, int entityIndex); - -
- This function checks if the resource range rgp of - for the specified entity conflicts with with another resource. - If a conflict is found, the address of the start of the conflict - is returned. The return value is zero when there is no conflict. - - -
-
- - -The OPERATING state properties of previously registered fixed resources -can be set with the xf86SetOperatingState() function: -
- - resPtr xf86SetOperatingState(resList list, int entityIndex, - int mask); - -
- This function is used to set the status of a resource during - OPERATING state. list holds a list to which - mask is to be applied. The parameter - mask may have the value ResUnusedOpr - and ResDisableOpr. The first one should be used - if a resource isn't used by the driver during OPERATING state - although it is decoded by the device, while the latter one indicates - that the resource is not decoded during OPERATING state. Note - that the resource ranges have to match those specified during - registration. If a range has been specified starting at - A and ending at B and suppose - C us a value satisfying - A < C < B one may not - specify the resource range (A,B) by splitting it - into two ranges (A,C) and (C,B). - - -
-
- The following two functions are provided for special cases:
@@ -3066,17 +2739,6 @@ The following two functions are provided for special cases:
- -
- - void xf86DeallocateResourcesForEntity(int entityIndex, long type); - -
- This function deallocates all resources of a given type registered - for a certain entity from the resource broker list. - - -
@@ -5210,10 +4872,8 @@ XFree86 common layer.
- pointer LoadModule(const char *module, const char *path, - const char **subdirlist, const char **patternlist, - pointer options, const XF86ModReqInfo * modreq, - int *errmaj, int *errmin); + pointer LoadModule(const char *module, pointer options, + const XF86ModReqInfo * modreq, int *errmaj);
The LoadModule() function loads the module called @@ -5226,48 +4886,6 @@ XFree86 common layer. This might change. The other parameters are: - - path - - An optional comma-separated list of module search paths. - When NULL, the default search path is used. - - - - - subdirlist - - An optional NULL terminated list of - subdirectories to search. When NULL, - the default built-in list is used (refer to - stdSubdirs in loadmod.c). - The default list is also substituted for entries in - subdirlist with the value - DEFAULT_LIST. This makes is possible - to augment the default list instead of replacing it. - Subdir elements must be relative, and must not contain - "..". If any violate this requirement, - the load fails. - - - - - patternlist - - An optional NULL terminated list of - POSIX regular expressions used to connect module - filenames with canonical module names. Each regex - should contain exactly one subexpression that corresponds - to the canonical module name. When NULL, - the default built-in list is used (refer to - stdPatterns in - loadmod.c). The default list is also - substituted for entries in patternlist - with the value DEFAULT_LIST. This - makes it possible to augment the default list instead - of replacing it. - - options @@ -5299,12 +4917,12 @@ XFree86 common layer. as follows: typedef struct { - CARD8 majorversion; /* MAJOR_UNSPEC */ - CARD8 minorversion; /* MINOR_UNSPEC */ - CARD16 patchlevel; /* PATCH_UNSPEC */ - const char * abiclass; /* ABI_CLASS_NONE */ - CARD32 abiversion; /* ABI_VERS_UNSPEC */ - const char * moduleclass; /* MOD_CLASS_NONE */ + CARD8 majorversion; + CARD8 minorversion; + CARD16 patchlevel; + const char * abiclass; + CARD32 abiversion; + const char * moduleclass; } XF86ModReqInfo; @@ -5329,8 +4947,8 @@ typedef struct { The module's minor version must be no less than this value. This comparison is only made if - majorversion is - specified and matches. + majorversion + matches. @@ -5339,8 +4957,8 @@ typedef struct { The module's patchlevel must be no less than this value. This comparison is only made if - minorversion is - specified and matches. + minorversion + matches. @@ -5377,13 +4995,6 @@ typedef struct { LoadModule() fails. - - errmin - - Like errmaj, but for the minor part - of the error code. - -
@@ -5695,11 +5306,7 @@ the server, and may also be used from within modules. described above, except that the module loaded is registered as a child of the calling module. The parent parameter is the calling module's handle. Modules loaded with this function - are automatically unloaded when the parent module is unloaded. The - other difference is that the path parameter may not be specified. - The module search path used for modules loaded with this function - is the default search path as initialised with - LoaderSetPath(). + are automatically unloaded when the parent module is unloaded.
@@ -5872,7 +5479,7 @@ These may be moved out of the loader at some point.
- void LoadExtensionList(const ExtensionModule ext[]); + void LoadExtensionList(const ExtensionModule ext[], int size, Bool builtin);
This registers the entry points for the extension array identified by @@ -6650,16 +6257,6 @@ be catered for the by the helpers. total video memory size (in bytes) - - maxHValue - - Maximum horizontal timing value allowed - - - maxVValue - - Maximum vertical timing value allowed - xInc @@ -6707,12 +6304,6 @@ be catered for the by the helpers. The resulting line pitch. - - virtualFrom - - Where the virtual size was determined from. - - @@ -8394,37 +7985,6 @@ ZZZProbe(DriverPtr drv, int flags) xfree(usedChips); } -#ifdef HAS_ISA_DEVS - /* - * If the driver supports ISA hardware, the following block - * can be included too. - */ - numUsed = xf86MatchIsaInstances(ZZZ_NAME, ZZZChipsets, - ZZZIsaChipsets, drv, ZZZFindIsaDevice, - devSections, numDevSections, &usedChips); - for (i = 0; i < numUsed; i++) { - ScrnInfoPtr pScrn = NULL; - if ((pScrn = xf86ConfigIsaEntity(pScrn, flags, usedChips[i], - ZZZIsaChipsets, NULL, NULL, NULL, - NULL, NULL))) { - pScrn->driverVersion = VERSION; - pScrn->driverName = ZZZ_DRIVER_NAME; - pScrn->name = ZZZ_NAME; - pScrn->Probe = ZZZProbe; - pScrn->PreInit = ZZZPreInit; - pScrn->ScreenInit = ZZZScreenInit; - pScrn->SwitchMode = ZZZSwitchMode; - pScrn->AdjustFrame = ZZZAdjustFrame; - pScrn->EnterVT = ZZZEnterVT; - pScrn->LeaveVT = ZZZLeaveVT; - pScrn->FreeScreen = ZZZFreeScreen; - pScrn->ValidMode = ZZZValidMode; - foundScreen = TRUE; - } - } - xfree(usedChips); -#endif /* HAS_ISA_DEVS */ - xfree(devSections); return foundScreen; diff --git a/xserver/hw/xfree86/dri/Makefile.in b/xserver/hw/xfree86/dri/Makefile.in index d9cce8ef8..4a1f66e84 100644 --- a/xserver/hw/xfree86/dri/Makefile.in +++ b/xserver/hw/xfree86/dri/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -337,6 +337,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -355,15 +356,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -371,6 +375,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -442,8 +448,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/dri/dri.c b/xserver/hw/xfree86/dri/dri.c index acc5bca58..c2a7b80e1 100644 --- a/xserver/hw/xfree86/dri/dri.c +++ b/xserver/hw/xfree86/dri/dri.c @@ -2379,15 +2379,3 @@ DRIMoveBuffersHelper(ScreenPtr pScreen, *xdir = 1; } - -char * -DRICreatePCIBusID(const struct pci_device *dev) -{ - char *busID; - - if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", - dev->domain, dev->bus, dev->dev, dev->func) == -1) - return NULL; - - return busID; -} diff --git a/xserver/hw/xfree86/dri/dri.h b/xserver/hw/xfree86/dri/dri.h index dfd2f827e..2ec1c76ea 100644 --- a/xserver/hw/xfree86/dri/dri.h +++ b/xserver/hw/xfree86/dri/dri.h @@ -325,8 +325,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, int dy, int *xdir, int *ydir, RegionPtr reg); -extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); - extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); diff --git a/xserver/hw/xfree86/dri/xf86dri.c b/xserver/hw/xfree86/dri/xf86dri.c index 65f368efd..d356db990 100644 --- a/xserver/hw/xfree86/dri/xf86dri.c +++ b/xserver/hw/xfree86/dri/xf86dri.c @@ -558,7 +558,7 @@ ProcXF86DRIDispatch(register ClientPtr client) } } -static int +static int _X_COLD SProcXF86DRIQueryVersion(register ClientPtr client) { REQUEST(xXF86DRIQueryVersionReq); @@ -566,7 +566,7 @@ SProcXF86DRIQueryVersion(register ClientPtr client) return ProcXF86DRIQueryVersion(client); } -static int +static int _X_COLD SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) { REQUEST(xXF86DRIQueryDirectRenderingCapableReq); @@ -576,7 +576,7 @@ SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) return ProcXF86DRIQueryDirectRenderingCapable(client); } -static int +static int _X_COLD SProcXF86DRIDispatch(register ClientPtr client) { REQUEST(xReq); @@ -600,14 +600,7 @@ XFree86DRIExtensionInit(void) { ExtensionEntry *extEntry; -#ifdef XF86DRI_EVENTS - EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent"); -#endif - if (DRIExtensionInit() && -#ifdef XF86DRI_EVENTS - EventType && ScreenPrivateIndex != -1 && -#endif (extEntry = AddExtension(XF86DRINAME, XF86DRINumberEvents, XF86DRINumberErrors, diff --git a/xserver/hw/xfree86/dri2/Makefile.in b/xserver/hw/xfree86/dri2/Makefile.in index 60270506c..7c8052de3 100644 --- a/xserver/hw/xfree86/dri2/Makefile.in +++ b/xserver/hw/xfree86/dri2/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -375,6 +375,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -393,15 +394,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -409,6 +413,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -480,8 +486,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/dri2/dri2.c b/xserver/hw/xfree86/dri2/dri2.c index 2165603d9..6619e3aa7 100644 --- a/xserver/hw/xfree86/dri2/dri2.c +++ b/xserver/hw/xfree86/dri2/dri2.c @@ -1440,21 +1440,17 @@ get_prime_id(void) static char * dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - struct pci_device *pdev = NULL; +#ifdef WITH_LIBDRM int i, j; + char *driver = NULL; + drmDevicePtr dev; - if (pEnt) - pdev = xf86GetPciInfoForEntity(pEnt->index); - - /* For non-PCI devices, just assume that the 3D driver is named - * the same as the kernel driver. This is currently true for vc4 - * and msm (freedreno). + /* For non-PCI devices and drmGetDevice fail, just assume that + * the 3D driver is named the same as the kernel driver. This is + * currently true for vc4 and msm (freedreno). */ - if (!pdev) { + if (drmGetDevice(info->fd, &dev) || dev->bustype != DRM_BUS_PCI) { drmVersionPtr version = drmGetVersion(info->fd); - char *kernel_driver; if (!version) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -1463,29 +1459,38 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) return NULL; } - kernel_driver = strndup(version->name, version->name_len); + driver = strndup(version->name, version->name_len); drmFreeVersion(version); - return kernel_driver; + return driver; } for (i = 0; driver_map[i].driver; i++) { - if (pdev->vendor_id != driver_map[i].vendor_id) + if (dev->deviceinfo.pci->vendor_id != driver_map[i].vendor_id) continue; - if (driver_map[i].num_chips_ids == -1) - return strdup(driver_map[i].driver); + if (driver_map[i].num_chips_ids == -1) { + driver = strdup(driver_map[i].driver); + goto out; + } for (j = 0; j < driver_map[i].num_chips_ids; j++) { - if (driver_map[i].chip_ids[j] == pdev->device_id) - return strdup(driver_map[i].driver); + if (driver_map[i].chip_ids[j] == dev->deviceinfo.pci->device_id) { + driver = strdup(driver_map[i].driver); + goto out; + } } } xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] No driver mapping found for PCI device " "0x%04x / 0x%04x\n", - pdev->vendor_id, pdev->device_id); + dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id); +out: + drmFreeDevice(&dev); + return driver; +#else return NULL; +#endif } Bool @@ -1533,6 +1538,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) ds->CreateBuffer = info->CreateBuffer; ds->DestroyBuffer = info->DestroyBuffer; ds->CopyRegion = info->CopyRegion; + cur_minor = 1; if (info->version >= 4) { ds->ScheduleSwap = info->ScheduleSwap; @@ -1540,13 +1546,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) ds->GetMSC = info->GetMSC; cur_minor = 3; } - else { - cur_minor = 1; - } - if (info->version >= 8) { - ds->AuthMagic = info->AuthMagic2; - } if (info->version >= 5) { ds->LegacyAuthMagic = info->AuthMagic; } @@ -1561,6 +1561,10 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 4; } + if (info->version >= 8) { + ds->AuthMagic = info->AuthMagic2; + } + if (info->version >= 9) { ds->CreateBuffer2 = info->CreateBuffer2; if (info->CreateBuffer2 && pScreen->isGPU) { @@ -1629,7 +1633,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) pScreen->SetWindowPixmap = DRI2SetWindowPixmap; xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n"); - for (i = 0; i < sizeof(driverTypeNames) / sizeof(driverTypeNames[0]); i++) { + for (i = 0; i < ARRAY_SIZE(driverTypeNames); i++) { if (i < ds->numDrivers && ds->driverNames[i]) { xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] %s driver: %s\n", driverTypeNames[i], ds->driverNames[i]); diff --git a/xserver/hw/xfree86/dri2/dri2ext.c b/xserver/hw/xfree86/dri2/dri2ext.c index 520b7cfb8..529de7515 100644 --- a/xserver/hw/xfree86/dri2/dri2ext.c +++ b/xserver/hw/xfree86/dri2/dri2ext.c @@ -634,7 +634,7 @@ ProcDRI2Dispatch(ClientPtr client) } } -static int +static int _X_COLD SProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); @@ -659,7 +659,7 @@ SProcDRI2Connect(ClientPtr client) return Success; } -static int +static int _X_COLD SProcDRI2Dispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in index 118ff6fb4..3e19f7a56 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in +++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in @@ -66,7 +66,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -273,6 +273,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -291,15 +292,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -307,6 +311,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -378,8 +384,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h index b91abd7a3..1ef1a0edf 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h +++ b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h @@ -156,6 +156,7 @@ CHIPSET(0x5912, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") CHIPSET(0x5916, kbl_gt2, "Intel(R) HD Graphics 620 (Kaby Lake GT2)") CHIPSET(0x591A, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") CHIPSET(0x591B, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") +CHIPSET(0x591C, kbl_gt2, "Intel(R) Kaby Lake GT2") CHIPSET(0x591D, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") CHIPSET(0x591E, kbl_gt2, "Intel(R) HD Graphics 615 (Kaby Lake GT2)") CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F") @@ -163,32 +164,28 @@ CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3") CHIPSET(0x5926, kbl_gt3, "Intel(R) Iris Plus Graphics 640 (Kaby Lake GT3e)") CHIPSET(0x5927, kbl_gt3, "Intel(R) Iris Plus Graphics 650 (Kaby Lake GT3e)") CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x591C, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") -CHIPSET(0x87C0, kbl_gt2, "Intel(R) Amber Lake (Kabylake) GT2") -CHIPSET(0x87CA, cfl_gt2, "Intel(R) Amber Lake (Coffeelake) GT2") CHIPSET(0x3184, glk, "Intel(R) UHD Graphics 605 (Geminilake)") CHIPSET(0x3185, glk_2x6, "Intel(R) UHD Graphics 600 (Geminilake 2x6)") CHIPSET(0x3E90, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") CHIPSET(0x3E93, cfl_gt1, "Intel(R) UHD Graphics 610 (Coffeelake 2x6 GT1)") CHIPSET(0x3E99, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") -CHIPSET(0x3E9C, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") CHIPSET(0x3E91, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") CHIPSET(0x3E92, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") CHIPSET(0x3E96, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") -CHIPSET(0x3E98, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3E98, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") CHIPSET(0x3E9A, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") CHIPSET(0x3E9B, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)") CHIPSET(0x3E94, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") CHIPSET(0x3EA9, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") -CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 2x6 GT1)") -CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT1)") -CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") -CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)") -CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)") CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") @@ -204,10 +201,6 @@ CHIPSET(0x5A54, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") CHIPSET(0x8A50, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") CHIPSET(0x8A51, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") CHIPSET(0x8A52, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)") -CHIPSET(0x8A56, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") -CHIPSET(0x8A57, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") -CHIPSET(0x8A58, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") -CHIPSET(0x8A59, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") CHIPSET(0x8A5A, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") CHIPSET(0x8A5B, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)") CHIPSET(0x8A5C, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)") diff --git a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h index feb0ceffa..664d35d04 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h +++ b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h @@ -217,6 +217,36 @@ CHIPSET(0x6995, POLARIS12_, POLARIS12) CHIPSET(0x6997, POLARIS12_, POLARIS12) CHIPSET(0x699F, POLARIS12_, POLARIS12) +CHIPSET(0x694C, VEGAM_, VEGAM) +CHIPSET(0x694E, VEGAM_, VEGAM) + +CHIPSET(0x6860, VEGA10_, VEGA10) +CHIPSET(0x6861, VEGA10_, VEGA10) +CHIPSET(0x6862, VEGA10_, VEGA10) +CHIPSET(0x6863, VEGA10_, VEGA10) +CHIPSET(0x6864, VEGA10_, VEGA10) +CHIPSET(0x6867, VEGA10_, VEGA10) +CHIPSET(0x6868, VEGA10_, VEGA10) +CHIPSET(0x687F, VEGA10_, VEGA10) +CHIPSET(0x686C, VEGA10_, VEGA10) + +CHIPSET(0x69A0, VEGA12_, VEGA12) +CHIPSET(0x69A1, VEGA12_, VEGA12) +CHIPSET(0x69A2, VEGA12_, VEGA12) +CHIPSET(0x69A3, VEGA12_, VEGA12) +CHIPSET(0x69AF, VEGA12_, VEGA12) + +CHIPSET(0x15DD, RAVEN_, RAVEN) + +CHIPSET(0x6980, POLARIS12_, POLARIS12) +CHIPSET(0x6981, POLARIS12_, POLARIS12) +CHIPSET(0x6985, POLARIS12_, POLARIS12) +CHIPSET(0x6986, POLARIS12_, POLARIS12) +CHIPSET(0x6987, POLARIS12_, POLARIS12) +CHIPSET(0x6995, POLARIS12_, POLARIS12) +CHIPSET(0x6997, POLARIS12_, POLARIS12) +CHIPSET(0x699F, POLARIS12_, POLARIS12) + CHIPSET(0x694C, VEGAM_, VEGAM) CHIPSET(0x694E, VEGAM_, VEGAM) CHIPSET(0x694F, VEGAM_, VEGAM) diff --git a/xserver/hw/xfree86/drivers/Makefile.in b/xserver/hw/xfree86/drivers/Makefile.in index f386f1691..3bb4abea7 100644 --- a/xserver/hw/xfree86/drivers/Makefile.in +++ b/xserver/hw/xfree86/drivers/Makefile.in @@ -67,7 +67,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -314,6 +314,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -332,15 +333,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -348,6 +352,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -419,8 +425,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.am b/xserver/hw/xfree86/drivers/modesetting/Makefile.am index 44823b0fb..e0411ef51 100644 --- a/xserver/hw/xfree86/drivers/modesetting/Makefile.am +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.am @@ -51,8 +51,6 @@ modesetting_drv_la_SOURCES = \ dumb_bo.c \ dumb_bo.h \ present.c \ - sh3224.c \ - sh3224.h \ vblank.c \ pageflip.c \ $(NULL) diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.in b/xserver/hw/xfree86/drivers/modesetting/Makefile.in index ed8bf34d9..baca8fbc8 100644 --- a/xserver/hw/xfree86/drivers/modesetting/Makefile.in +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.in @@ -95,7 +95,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -132,7 +132,7 @@ LTLIBRARIES = $(modesetting_drv_la_LTLIBRARIES) am__DEPENDENCIES_1 = modesetting_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_modesetting_drv_la_OBJECTS = dri2.lo driver.lo drmmode_display.lo \ - dumb_bo.lo present.lo sh3224.lo vblank.lo pageflip.lo + dumb_bo.lo present.lo vblank.lo pageflip.lo modesetting_drv_la_OBJECTS = $(am_modesetting_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -370,6 +370,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -388,15 +389,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -404,6 +408,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -475,8 +481,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -566,8 +570,6 @@ modesetting_drv_la_SOURCES = \ dumb_bo.c \ dumb_bo.h \ present.c \ - sh3224.c \ - sh3224.h \ vblank.c \ pageflip.c \ $(NULL) @@ -663,7 +665,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumb_bo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pageflip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh3224.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vblank.Plo@am__quote@ .c.o: diff --git a/xserver/hw/xfree86/drivers/modesetting/dri2.c b/xserver/hw/xfree86/drivers/modesetting/dri2.c index 8944ef136..96eaaaaf7 100644 --- a/xserver/hw/xfree86/drivers/modesetting/dri2.c +++ b/xserver/hw/xfree86/drivers/modesetting/dri2.c @@ -42,7 +42,7 @@ #include "driver.h" #include "dri2.h" -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM enum ms_dri2_frame_event_type { MS_DRI2_QUEUE_SWAP, @@ -511,11 +511,14 @@ update_front(DrawablePtr draw, DRI2BufferPtr front) ms_dri2_buffer_private_ptr priv = front->driverPrivate; CARD32 size; CARD16 pitch; + int name; - front->name = glamor_name_from_pixmap(pixmap, &pitch, &size); - if (front->name < 0) + name = glamor_name_from_pixmap(pixmap, &pitch, &size); + if (name < 0) return FALSE; + front->name = name; + (*screen->DestroyPixmap) (priv->pixmap); front->pitch = pixmap->devKind; front->cpp = pixmap->drawable.bitsPerPixel / 8; @@ -695,19 +698,16 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, { ScreenPtr screen = draw->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); ms_dri2_frame_event_ptr wait_info; - drmVBlank vbl; int ret; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); - drmmode_crtc_private_ptr drmmode_crtc; CARD64 current_msc, current_ust, request_msc; uint32_t seq; + uint64_t queued_msc; /* Drawable not visible, return immediately */ if (!crtc) goto out_complete; - drmmode_crtc = crtc->driver_private; wait_info = calloc(1, sizeof(*wait_info)); if (!wait_info) @@ -747,14 +747,9 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, if (current_msc >= target_msc) target_msc = current_msc; - vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - drmmode_crtc->vblank_pipe); - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, target_msc); - vbl.request.signal = (unsigned long)seq; - ret = drmWaitVBlank(ms->fd, &vbl); - if (ret) { + ret = ms_queue_vblank(crtc, MS_QUEUE_ABSOLUTE, target_msc, &queued_msc, seq); + if (!ret) { static int limit = 5; if (limit) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -766,7 +761,7 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, goto out_free; } - wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + wait_info->frame = queued_msc; DRI2BlockClient(client, draw); return TRUE; } @@ -775,9 +770,6 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, * If we get here, target_msc has already passed or we don't have one, * so we queue an event that will satisfy the divisor/remainder equation. */ - vbl.request.type = - DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; - request_msc = current_msc - (current_msc % divisor) + remainder; /* @@ -795,11 +787,7 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, if (!seq) goto out_free; - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); - vbl.request.signal = (unsigned long)seq; - - ret = drmWaitVBlank(ms->fd, &vbl); - if (ret) { + if (!ms_queue_vblank(crtc, MS_QUEUE_ABSOLUTE, request_msc, &queued_msc, seq)) { static int limit = 5; if (limit) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -811,7 +799,8 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, goto out_free; } - wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + wait_info->frame = queued_msc; + DRI2BlockClient(client, draw); return TRUE; @@ -839,20 +828,18 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, { ScreenPtr screen = draw->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - drmVBlank vbl; int ret, flip = 0; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); - drmmode_crtc_private_ptr drmmode_crtc; ms_dri2_frame_event_ptr frame_info = NULL; uint64_t current_msc, current_ust; uint64_t request_msc; uint32_t seq; + ms_queue_flag ms_flag = MS_QUEUE_ABSOLUTE; + uint64_t queued_msc; /* Drawable not displayed... just complete the swap */ if (!crtc) goto blit_fallback; - drmmode_crtc = crtc->driver_private; frame_info = calloc(1, sizeof(*frame_info)); if (!frame_info) @@ -878,6 +865,8 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, ms_dri2_reference_buffer(back); ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); + if (ret != Success) + goto blit_fallback; /* Flips need to be submitted one frame before */ if (can_flip(scrn, draw, front, back)) { @@ -892,22 +881,19 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, if (*target_msc > 0) *target_msc -= flip; + /* If non-pageflipping, but blitting/exchanging, we need to use + * DRM_VBLANK_NEXTONMISS to avoid unreliable timestamping later + * on. + */ + if (flip == 0) + ms_flag |= MS_QUEUE_NEXT_ON_MISS; + /* * If divisor is zero, or current_msc is smaller than target_msc * we just need to make sure target_msc passes before initiating * the swap. */ if (divisor == 0 || current_msc < *target_msc) { - vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - drmmode_crtc->vblank_pipe); - - /* If non-pageflipping, but blitting/exchanging, we need to use - * DRM_VBLANK_NEXTONMISS to avoid unreliable timestamping later - * on. - */ - if (flip == 0) - vbl.request.type |= DRM_VBLANK_NEXTONMISS; /* If target_msc already reached or passed, set it to * current_msc to ensure we return a reasonable value back @@ -922,19 +908,14 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, if (!seq) goto blit_fallback; - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, *target_msc); - vbl.request.signal = (unsigned long)seq; - - ret = drmWaitVBlank(ms->fd, &vbl); - if (ret) { + if (!ms_queue_vblank(crtc, ms_flag, *target_msc, &queued_msc, seq)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "divisor 0 get vblank counter failed: %s\n", strerror(errno)); goto blit_fallback; } - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, - vbl.reply.sequence + flip); + *target_msc = queued_msc + flip; frame_info->frame = *target_msc; return TRUE; @@ -945,11 +926,6 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, * and we need to queue an event that will satisfy the divisor/remainder * equation. */ - vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - drmmode_crtc->vblank_pipe); - if (flip == 0) - vbl.request.type |= DRM_VBLANK_NEXTONMISS; request_msc = current_msc - (current_msc % divisor) + remainder; @@ -966,7 +942,6 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, if (request_msc <= current_msc) request_msc += divisor; - seq = ms_drm_queue_alloc(crtc, frame_info, ms_dri2_frame_event_handler, ms_dri2_frame_event_abort); @@ -974,11 +949,7 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, goto blit_fallback; /* Account for 1 frame extra pageflip delay if flip > 0 */ - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc) - flip; - vbl.request.signal = (unsigned long)seq; - - ret = drmWaitVBlank(ms->fd, &vbl); - if (ret) { + if (!ms_queue_vblank(crtc, ms_flag, request_msc - flip, &queued_msc, seq)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "final get vblank counter failed: %s\n", strerror(errno)); @@ -986,7 +957,7 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, } /* Adjust returned value for 1 fame pageflip offset of flip > 0 */ - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence + flip); + *target_msc = queued_msc + flip; frame_info->frame = *target_msc; return TRUE; @@ -1113,4 +1084,4 @@ ms_dri2_close_screen(ScreenPtr screen) DRI2CloseScreen(screen); } -#endif /* GLAMOR */ +#endif /* GLAMOR_HAS_GBM */ diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.c b/xserver/hw/xfree86/drivers/modesetting/driver.c index c604ebc09..da140095d 100644 --- a/xserver/hw/xfree86/drivers/modesetting/driver.c +++ b/xserver/hw/xfree86/drivers/modesetting/driver.c @@ -36,6 +36,7 @@ #include #include #include "xf86.h" +#include "xf86Priv.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86Pci.h" @@ -55,12 +56,11 @@ #ifdef XSERVER_PLATFORM_BUS #include "xf86platformBus.h" #endif -#if XSERVER_LIBPCIACCESS +#ifdef XSERVER_LIBPCIACCESS #include #endif #include "driver.h" -#include "sh3224.h" #ifdef X_PRIVSEP extern int priv_open_device(const char *); @@ -201,11 +201,24 @@ modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn) return pPriv->ptr; } +static int +get_passed_fd(void) +{ + if (xf86DRMMasterFd >= 0) { + xf86DrvMsg(-1, X_INFO, "Using passed DRM master file descriptor %d\n", xf86DRMMasterFd); + return dup(xf86DRMMasterFd); + } + return -1; +} + static int open_hw(const char *dev) { int fd; + if ((fd = get_passed_fd()) != -1) + return fd; + if (dev) fd = priv_open_device(dev); else { @@ -234,7 +247,7 @@ check_outputs(int fd, int *count) *count = res->count_connectors; ret = res->count_connectors > 0; -#if defined DRM_CAP_PRIME && GLAMOR_HAS_GBM_LINEAR +#if defined(GLAMOR_HAS_GBM_LINEAR) if (ret == FALSE) { uint64_t value = 0; if (drmGetCap(fd, DRM_CAP_PRIME, &value) == 0 && @@ -251,7 +264,7 @@ probe_hw(const char *dev, struct xf86_platform_device *platform_dev) { int fd; -#if XF86_PDEV_SERVER_FD +#ifdef XF86_PDEV_SERVER_FD if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) { fd = xf86_platform_device_odev_attributes(platform_dev)->fd; if (fd == -1) @@ -373,7 +386,7 @@ ms_setup_entity(ScrnInfoPtr scrn, int entity_num) pPriv->ptr = xnfcalloc(sizeof(modesettingEntRec), 1); } -#if XSERVER_LIBPCIACCESS +#ifdef XSERVER_LIBPCIACCESS static Bool ms_pci_probe(DriverPtr driver, int entity_num, struct pci_device *dev, intptr_t match_data) @@ -592,7 +605,6 @@ dispatch_slave_dirty(ScreenPtr pScreen) static void redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout) { - modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); RegionRec pixregion; PixmapRegionInit(&pixregion, dirty->slave_dst); @@ -600,7 +612,8 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout) PixmapSyncDirtyHelper(dirty); if (!screen->isGPU) { -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); /* * When copying from the master framebuffer to the shared pixmap, * we must ensure the copy is complete before the slave starts a @@ -633,20 +646,22 @@ ms_dirty_update(ScreenPtr screen, int *timeout) xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { region = DamageRegion(ent->damage); if (RegionNotEmpty(region)) { - msPixmapPrivPtr ppriv = - msGetPixmapPriv(&ms->drmmode, ent->slave_dst); + if (!screen->isGPU) { + msPixmapPrivPtr ppriv = + msGetPixmapPriv(&ms->drmmode, ent->slave_dst->master_pixmap); - if (ppriv->notify_on_damage) { - ppriv->notify_on_damage = FALSE; + if (ppriv->notify_on_damage) { + ppriv->notify_on_damage = FALSE; - ent->slave_dst->drawable.pScreen-> - SharedPixmapNotifyDamage(ent->slave_dst); + ent->slave_dst->drawable.pScreen-> + SharedPixmapNotifyDamage(ent->slave_dst); + } + + /* Requested manual updating */ + if (ppriv->defer_dirty_update) + continue; } - /* Requested manual updating */ - if (ppriv->defer_dirty_update) - continue; - redisplay_dirty(screen, ent, timeout); DamageEmpty(ent->damage); } @@ -745,7 +760,7 @@ try_enable_glamor(ScrnInfoPtr pScrn) ms->drmmode.glamor = FALSE; -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM if (ms->drmmode.force_24_32) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cannot use glamor with 24bpp packed fb\n"); return; @@ -805,21 +820,12 @@ msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms) return ret; } -#ifndef DRM_CAP_CURSOR_WIDTH -#define DRM_CAP_CURSOR_WIDTH 0x8 -#endif - -#ifndef DRM_CAP_CURSOR_HEIGHT -#define DRM_CAP_CURSOR_HEIGHT 0x9 -#endif - static Bool ms_get_drm_master_fd(ScrnInfoPtr pScrn) { EntityInfoPtr pEnt; modesettingPtr ms; modesettingEntPtr ms_ent; - char *BusID = NULL; ms = modesettingPTR(pScrn); ms_ent = ms_ent_priv(pScrn); @@ -834,7 +840,13 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) return TRUE; } -#if XSERVER_PLATFORM_BUS + ms->fd_passed = FALSE; + if ((ms->fd = get_passed_fd()) >= 0) { + ms->fd_passed = TRUE; + return TRUE; + } + +#ifdef XSERVER_PLATFORM_BUS if (pEnt->location.type == BUS_PLATFORM) { #ifdef XF86_PDEV_SERVER_FD if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD) @@ -852,25 +864,22 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) } else #endif +#ifdef XSERVER_LIBPCIACCESS if (pEnt->location.type == BUS_PCI) { - ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); - if (ms->PciInfo) { - BusID = XNFalloc(64); - sprintf(BusID, "PCI:%d:%d:%d", -#if XSERVER_LIBPCIACCESS - ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), - ms->PciInfo->dev, ms->PciInfo->func -#else - ((pciConfigPtr) ms->PciInfo->thisCard)->busnum, - ((pciConfigPtr) ms->PciInfo->thisCard)->devnum, - ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum -#endif - ); + char *BusID = NULL; + struct pci_device *PciInfo; + + PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); + if (PciInfo) { + if ((BusID = ms_DRICreatePCIBusID(PciInfo)) != NULL) { + ms->fd = drmOpen(NULL, BusID); + free(BusID); + } } - ms->fd = drmOpen(NULL, BusID); - free(BusID); } - else { + else +#endif + { const char *devicename; devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev"); ms->fd = open_hw(devicename); @@ -897,8 +906,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->numEntities != 1) return FALSE; - pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - if (flags & PROBE_DETECT) { return FALSE; } @@ -907,6 +914,8 @@ PreInit(ScrnInfoPtr pScrn, int flags) if (!GetRec(pScrn)) return FALSE; + pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + ms = modesettingPTR(pScrn); ms->SaveGeneration = -1; ms->pEnt = pEnt; @@ -939,7 +948,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) "Using 24bpp hw front buffer with 32bpp shadow\n"); defaultbpp = 32; } else { - ms->drmmode.kbpp = defaultbpp; + ms->drmmode.kbpp = 0; } bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; @@ -951,6 +960,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) case 15: case 16: case 24: + case 30: break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -959,6 +969,8 @@ PreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } xf86PrintDepthBpp(pScrn); + if (!ms->drmmode.kbpp) + ms->drmmode.kbpp = pScrn->bitsPerPixel; /* Process the options */ xf86CollectOptions(pScrn, NULL); @@ -1019,7 +1031,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE); pScrn->capabilities = 0; -#ifdef DRM_CAP_PRIME ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); if (ret == 0) { if (connector_count && (value & DRM_PRIME_CAP_IMPORT)) { @@ -1027,12 +1038,19 @@ PreInit(ScrnInfoPtr pScrn, int flags) if (ms->drmmode.glamor) pScrn->capabilities |= RR_Capability_SinkOffload; } -#if GLAMOR_HAS_GBM_LINEAR +#ifdef GLAMOR_HAS_GBM_LINEAR if (value & DRM_PRIME_CAP_EXPORT && ms->drmmode.glamor) pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload; #endif } -#endif + + ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); + ms->atomic_modeset = (ret == 0); + + ms->kms_has_modifiers = FALSE; + ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value); + if (ret == 0 && value != 0) + ms->kms_has_modifiers = TRUE; if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n"); @@ -1130,7 +1148,7 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); - Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; + Bool use_3224 = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do { RegionPtr damage = DamageRegion(pBuf->pDamage), tiles; @@ -1172,8 +1190,8 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) free(prect); } while (0); - if (use_ms_shadow) - ms_shadowUpdate32to24(pScreen, pBuf); + if (use_3224) + shadowUpdate32to24(pScreen, pBuf); else shadowUpdatePacked(pScreen, pBuf); } @@ -1198,7 +1216,7 @@ msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back) if (ms->drmmode.reverse_prime_offload_mode) return FALSE; -#if XSERVER_PLATFORM_BUS +#ifdef XSERVER_PLATFORM_BUS if (pEnt->location.type == BUS_PLATFORM) { char *syspath = xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> @@ -1233,16 +1251,16 @@ msDisableSharedPixmapFlipping(RRCrtcPtr crtc) } static Bool -msStartFlippingPixmapTracking(RRCrtcPtr crtc, PixmapPtr src, +msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src, PixmapPtr slave_dst1, PixmapPtr slave_dst2, int x, int y, int dst_x, int dst_y, Rotation rotation) { - ScreenPtr pScreen = src->drawable.pScreen; + ScreenPtr pScreen = src->pScreen; modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); - msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), - ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap); if (!PixmapStartDirtyTracking(src, slave_dst1, x, y, dst_x, dst_y, rotation)) { @@ -1270,15 +1288,15 @@ msStartFlippingPixmapTracking(RRCrtcPtr crtc, PixmapPtr src, static Bool msPresentSharedPixmap(PixmapPtr slave_dst) { - ScreenPtr pScreen = slave_dst->drawable.pScreen; + ScreenPtr pScreen = slave_dst->master_pixmap->drawable.pScreen; modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); - msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst); + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst->master_pixmap); RegionPtr region = DamageRegion(ppriv->dirty->damage); if (RegionNotEmpty(region)) { - redisplay_dirty(ppriv->slave_src->drawable.pScreen, ppriv->dirty, NULL); + redisplay_dirty(ppriv->slave_src->pScreen, ppriv->dirty, NULL); DamageEmpty(ppriv->dirty->damage); return TRUE; @@ -1288,14 +1306,14 @@ msPresentSharedPixmap(PixmapPtr slave_dst) } static Bool -msStopFlippingPixmapTracking(PixmapPtr src, +msStopFlippingPixmapTracking(DrawablePtr src, PixmapPtr slave_dst1, PixmapPtr slave_dst2) { - ScreenPtr pScreen = src->drawable.pScreen; + ScreenPtr pScreen = src->pScreen; modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); - msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), - ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap); Bool ret = TRUE; @@ -1424,7 +1442,7 @@ msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle) static Bool msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) { -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM ScreenPtr screen = ppix->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); @@ -1461,7 +1479,7 @@ msRequestSharedPixmapNotifyDamage(PixmapPtr ppix) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); - msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix->master_pixmap); ppriv->notify_on_damage = TRUE; @@ -1513,6 +1531,9 @@ SetMaster(ScrnInfoPtr pScrn) return TRUE; #endif + if (ms->fd_passed) + return TRUE; + ret = drmSetMaster(ms->fd); if (ret) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n", @@ -1613,15 +1634,11 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) fbPictureInit(pScreen, NULL, 0); -#ifdef GLAMOR - if (ms->drmmode.glamor) { - if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to initialize glamor at ScreenInit() time.\n"); - return FALSE; - } + if (drmmode_init(pScrn, &ms->drmmode) == FALSE) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize glamor at ScreenInit() time.\n"); + return FALSE; } -#endif if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n"); @@ -1678,9 +1695,12 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) if (!drmmode_setup_colormap(pScreen, pScrn)) return FALSE; - xf86DPMSInit(pScreen, xf86DPMSSet, 0); + if (ms->atomic_modeset) + xf86DPMSInit(pScreen, drmmode_set_dpms, 0); + else + xf86DPMSInit(pScreen, xf86DPMSSet, 0); -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM if (ms->drmmode.glamor) { XF86VideoAdaptorPtr glamor_adaptor; @@ -1702,14 +1722,14 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) return FALSE; } -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM if (ms->drmmode.glamor) { - if (!ms_dri2_screen_init(pScreen)) { + if (!(ms->drmmode.dri2_enable = ms_dri2_screen_init(pScreen))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the DRI2 extension.\n"); } - if (!ms_present_screen_init(pScreen)) { + if (!(ms->drmmode.present_enable = ms_present_screen_init(pScreen))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the Present extension.\n"); } @@ -1766,7 +1786,8 @@ LeaveVT(ScrnInfoPtr pScrn) return; #endif - drmDropMaster(ms->fd); + if (!ms->fd_passed) + drmDropMaster(ms->fd); } /* @@ -1803,8 +1824,8 @@ CloseScreen(ScreenPtr pScreen) /* Clear mask of assigned crtc's in this generation */ ms_ent->assigned_crtcs = 0; -#ifdef GLAMOR - if (ms->drmmode.glamor) { +#ifdef GLAMOR_HAS_GBM + if (ms->drmmode.dri2_enable) { ms_dri2_close_screen(pScreen); } #endif @@ -1824,6 +1845,7 @@ CloseScreen(ScreenPtr pScreen) free(ms->drmmode.shadow_fb2); ms->drmmode.shadow_fb2 = NULL; } + drmmode_uevent_fini(pScrn, &ms->drmmode); drmmode_free_bos(pScrn, &ms->drmmode); diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.h b/xserver/hw/xfree86/drivers/modesetting/driver.h index eee96e50f..c8db4b8a4 100644 --- a/xserver/hw/xfree86/drivers/modesetting/driver.h +++ b/xserver/hw/xfree86/drivers/modesetting/driver.h @@ -32,17 +32,15 @@ #include #include #include +#include -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM #define GLAMOR_FOR_XORG 1 #include "glamor.h" -#ifdef GLAMOR_HAS_GBM #include #endif -#endif #include "drmmode_display.h" -#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg); #define MS_LOGLEVEL_DEBUG 4 typedef enum { @@ -86,15 +84,10 @@ struct ms_drm_queue { typedef struct _modesettingRec { int fd; + Bool fd_passed; int Chipset; EntityInfoPtr pEnt; -#if XSERVER_LIBPCIACCESS - struct pci_device *PciInfo; -#else - pciVideoPtr PciInfo; - PCITAG PciTag; -#endif Bool noAccel; CloseScreenProcPtr CloseScreen; @@ -113,12 +106,20 @@ typedef struct _modesettingRec { * Page flipping stuff. * @{ */ + Bool atomic_modeset; + Bool pending_modeset; /** @} */ DamagePtr damage; Bool dirty_enabled; uint32_t cursor_width, cursor_height; + + Bool has_queue_sequence; + Bool tried_queue_sequence; + + Bool kms_has_modifiers; + } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) @@ -129,6 +130,15 @@ uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc, ms_drm_handler_proc handler, ms_drm_abort_proc abort); +typedef enum ms_queue_flag { + MS_QUEUE_ABSOLUTE = 0, + MS_QUEUE_RELATIVE = 1, + MS_QUEUE_NEXT_ON_MISS = 2 +} ms_queue_flag; + +Bool ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, + uint64_t msc, uint64_t *msc_queued, uint32_t seq); + void ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data); @@ -140,8 +150,7 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); -uint32_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect); -uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence); +uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence, Bool is64bit); Bool ms_dri2_screen_init(ScreenPtr screen); @@ -152,7 +161,7 @@ void ms_vblank_close_screen(ScreenPtr screen); Bool ms_present_screen_init(ScreenPtr screen); -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms, uint64_t frame, diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c index 41dddaa1a..676b855ec 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -42,10 +42,13 @@ #include "micmap.h" #include "xf86cmap.h" #include "xf86DDC.h" +#include +#include #include #include "xf86Crtc.h" #include "drmmode_display.h" +#include "present.h" #include @@ -57,6 +60,164 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height); static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); + +static inline uint32_t * +formats_ptr(struct drm_format_modifier_blob *blob) +{ + return (uint32_t *)(((char *)blob) + blob->formats_offset); +} + +static inline struct drm_format_modifier * +modifiers_ptr(struct drm_format_modifier_blob *blob) +{ + return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset); +} + +static uint32_t +get_opaque_format(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_ARGB8888: + return DRM_FORMAT_XRGB8888; + case DRM_FORMAT_ARGB2101010: + return DRM_FORMAT_XRGB2101010; + default: + return format; + } +} + +Bool +drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t modifier) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c, i, j; + + /* BO are imported as opaque surface, so let's pretend there is no alpha */ + format = get_opaque_format(format); + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + Bool found = FALSE; + + if (!crtc->enabled) + continue; + + if (drmmode_crtc->num_formats == 0) + continue; + + for (i = 0; i < drmmode_crtc->num_formats; i++) { + drmmode_format_ptr iter = &drmmode_crtc->formats[i]; + + if (iter->format != format) + continue; + + if (modifier == DRM_FORMAT_MOD_INVALID || + iter->num_modifiers == 0) { + found = TRUE; + break; + } + + for (j = 0; j < iter->num_modifiers; j++) { + if (iter->modifiers[j] == modifier) { + found = TRUE; + break; + } + } + + break; + } + + if (!found) + return FALSE; + } + + return TRUE; +} + +#ifdef GBM_BO_WITH_MODIFIERS +static uint32_t +get_modifiers_set(ScrnInfoPtr scrn, uint32_t format, uint64_t **modifiers, + Bool enabled_crtc_only, Bool exclude_multiplane) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; + int c, i, j, k, count_modifiers = 0; + uint64_t *tmp, *ret = NULL; + + /* BOs are imported as opaque surfaces, so pretend the same thing here */ + format = get_opaque_format(format); + + *modifiers = NULL; + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (enabled_crtc_only && !crtc->enabled) + continue; + + for (i = 0; i < drmmode_crtc->num_formats; i++) { + drmmode_format_ptr iter = &drmmode_crtc->formats[i]; + + if (iter->format != format) + continue; + + for (j = 0; j < iter->num_modifiers; j++) { + Bool found = FALSE; + + /* Don't choose multi-plane formats for our screen pixmap. + * These will get used with frontbuffer rendering, which will + * lead to worse-than-tearing with multi-plane formats, as the + * primary and auxiliary planes go out of sync. */ + if (exclude_multiplane && + gbm_device_get_format_modifier_plane_count(drmmode->gbm, + format, + iter->modifiers[j]) > 1) { + continue; + } + + for (k = 0; k < count_modifiers; k++) { + if (iter->modifiers[j] == ret[k]) + found = TRUE; + } + if (!found) { + count_modifiers++; + tmp = realloc(ret, count_modifiers * sizeof(uint64_t)); + if (!tmp) { + free(ret); + return 0; + } + ret = tmp; + ret[count_modifiers - 1] = iter->modifiers[j]; + } + } + } + } + + *modifiers = ret; + return count_modifiers; +} + +static Bool +get_drawable_modifiers(DrawablePtr draw, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen); + modesettingPtr ms = modesettingPTR(scrn); + + if (!present_can_window_flip((WindowPtr) draw) || + !ms->drmmode.pageflip || ms->drmmode.dri2_flipping || !scrn->vtSema) { + *num_modifiers = 0; + *modifiers = NULL; + return TRUE; + } + + *num_modifiers = get_modifiers_set(scrn, format, modifiers, TRUE, FALSE); + return TRUE; +} +#endif + static Bool drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name) { @@ -78,6 +239,649 @@ drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name return ret; } +static uint64_t +drmmode_prop_get_value(drmmode_prop_info_ptr info, + drmModeObjectPropertiesPtr props, + uint64_t def) +{ + unsigned int i; + + if (info->prop_id == 0) + return def; + + for (i = 0; i < props->count_props; i++) { + unsigned int j; + + if (props->props[i] != info->prop_id) + continue; + + /* Simple (non-enum) types can return the value directly */ + if (info->num_enum_values == 0) + return props->prop_values[i]; + + /* Map from raw value to enum value */ + for (j = 0; j < info->num_enum_values; j++) { + if (!info->enum_values[j].valid) + continue; + if (info->enum_values[j].value != props->prop_values[i]) + continue; + + return j; + } + } + + return def; +} + +static uint32_t +drmmode_prop_info_update(drmmode_ptr drmmode, + drmmode_prop_info_ptr info, + unsigned int num_infos, + drmModeObjectProperties *props) +{ + drmModePropertyRes *prop; + uint32_t valid_mask = 0; + unsigned i, j; + + assert(num_infos <= 32 && "update return type"); + + for (i = 0; i < props->count_props; i++) { + Bool props_incomplete = FALSE; + unsigned int k; + + for (j = 0; j < num_infos; j++) { + if (info[j].prop_id == props->props[i]) + break; + if (!info[j].prop_id) + props_incomplete = TRUE; + } + + /* We've already discovered this property. */ + if (j != num_infos) + continue; + + /* We haven't found this property ID, but as we've already + * found all known properties, we don't need to look any + * further. */ + if (!props_incomplete) + break; + + prop = drmModeGetProperty(drmmode->fd, props->props[i]); + if (!prop) + continue; + + for (j = 0; j < num_infos; j++) { + if (!strcmp(prop->name, info[j].name)) + break; + } + + /* We don't know/care about this property. */ + if (j == num_infos) { + drmModeFreeProperty(prop); + continue; + } + + info[j].prop_id = props->props[i]; + valid_mask |= 1U << j; + + if (info[j].num_enum_values == 0) { + drmModeFreeProperty(prop); + continue; + } + + if (!(prop->flags & DRM_MODE_PROP_ENUM)) { + xf86DrvMsg(drmmode->scrn->scrnIndex, X_WARNING, + "expected property %s to be an enum," + " but it is not; ignoring\n", prop->name); + drmModeFreeProperty(prop); + continue; + } + + for (k = 0; k < info[j].num_enum_values; k++) { + int l; + + if (info[j].enum_values[k].valid) + continue; + + for (l = 0; l < prop->count_enums; l++) { + if (!strcmp(prop->enums[l].name, + info[j].enum_values[k].name)) + break; + } + + if (l == prop->count_enums) + continue; + + info[j].enum_values[k].valid = TRUE; + info[j].enum_values[k].value = prop->enums[l].value; + } + + drmModeFreeProperty(prop); + } + + return valid_mask; +} + +static Bool +drmmode_prop_info_copy(drmmode_prop_info_ptr dst, + const drmmode_prop_info_rec *src, + unsigned int num_props, + Bool copy_prop_id) +{ + unsigned int i; + + memcpy(dst, src, num_props * sizeof(*dst)); + + for (i = 0; i < num_props; i++) { + unsigned int j; + + if (copy_prop_id) + dst[i].prop_id = src[i].prop_id; + else + dst[i].prop_id = 0; + + if (src[i].num_enum_values == 0) + continue; + + dst[i].enum_values = + malloc(src[i].num_enum_values * + sizeof(*dst[i].enum_values)); + if (!dst[i].enum_values) + goto err; + + memcpy(dst[i].enum_values, src[i].enum_values, + src[i].num_enum_values * sizeof(*dst[i].enum_values)); + + for (j = 0; j < dst[i].num_enum_values; j++) + dst[i].enum_values[j].valid = FALSE; + } + + return TRUE; + +err: + while (i--) + free(dst[i].enum_values); + return FALSE; +} + +static void +drmmode_prop_info_free(drmmode_prop_info_ptr info, int num_props) +{ + int i; + + for (i = 0; i < num_props; i++) + free(info[i].enum_values); +} + +static void +drmmode_ConvertToKMode(ScrnInfoPtr scrn, + drmModeModeInfo * kmode, DisplayModePtr mode); + + +static int +plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, + enum drmmode_plane_property prop, uint64_t val) +{ + drmmode_prop_info_ptr info = &drmmode_crtc->props_plane[prop]; + int ret; + + if (!info) + return -1; + + ret = drmModeAtomicAddProperty(req, drmmode_crtc->plane_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; +} + +static int +plane_add_props(drmModeAtomicReq *req, xf86CrtcPtr crtc, + uint32_t fb_id, int x, int y) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + int ret = 0; + + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_FB_ID, + fb_id); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_ID, + fb_id ? drmmode_crtc->mode_crtc->crtc_id : 0); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x << 16); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y << 16); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W, + crtc->mode.HDisplay << 16); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H, + crtc->mode.VDisplay << 16); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W, + crtc->mode.HDisplay); + ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H, + crtc->mode.VDisplay); + + return ret; +} + +static int +crtc_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc, + enum drmmode_crtc_property prop, uint64_t val) +{ + drmmode_prop_info_ptr info = &drmmode_crtc->props[prop]; + int ret; + + if (!info) + return -1; + + ret = drmModeAtomicAddProperty(req, drmmode_crtc->mode_crtc->crtc_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; +} + +static int +connector_add_prop(drmModeAtomicReq *req, drmmode_output_private_ptr drmmode_output, + enum drmmode_connector_property prop, uint64_t val) +{ + drmmode_prop_info_ptr info = &drmmode_output->props_connector[prop]; + int ret; + + if (!info) + return -1; + + ret = drmModeAtomicAddProperty(req, drmmode_output->output_id, + info->prop_id, val); + return (ret <= 0) ? -1 : 0; +} + +static int +drmmode_CompareKModes(drmModeModeInfo * kmode, drmModeModeInfo * other) +{ + return memcmp(kmode, other, sizeof(*kmode)); +} + +static int +drm_mode_ensure_blob(xf86CrtcPtr crtc, drmModeModeInfo mode_info) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_mode_ptr mode; + int ret; + + if (drmmode_crtc->current_mode && + drmmode_CompareKModes(&drmmode_crtc->current_mode->mode_info, &mode_info) == 0) + return 0; + + mode = calloc(sizeof(drmmode_mode_rec), 1); + if (!mode) + return -1; + + mode->mode_info = mode_info; + ret = drmModeCreatePropertyBlob(ms->fd, + &mode->mode_info, + sizeof(mode->mode_info), + &mode->blob_id); + drmmode_crtc->current_mode = mode; + xorg_list_add(&mode->entry, &drmmode_crtc->mode_list); + + return ret; +} + +static int +crtc_add_dpms_props(drmModeAtomicReq *req, xf86CrtcPtr crtc, + int new_dpms, Bool *active) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + Bool crtc_active = FALSE; + int i; + int ret = 0; + + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + if (output->crtc != crtc) { + if (drmmode_output->current_crtc == crtc) { + ret |= connector_add_prop(req, drmmode_output, + DRMMODE_CONNECTOR_CRTC_ID, 0); + } + continue; + } + + if (drmmode_output->output_id == -1) + continue; + + if (new_dpms == DPMSModeOn) + crtc_active = TRUE; + + ret |= connector_add_prop(req, drmmode_output, + DRMMODE_CONNECTOR_CRTC_ID, + crtc_active ? + drmmode_crtc->mode_crtc->crtc_id : 0); + } + + if (crtc_active) { + drmModeModeInfo kmode; + + drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->mode); + ret |= drm_mode_ensure_blob(crtc, kmode); + + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_ACTIVE, 1); + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_MODE_ID, + drmmode_crtc->current_mode->blob_id); + } else { + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_ACTIVE, 0); + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_MODE_ID, 0); + } + + if (active) + *active = crtc_active; + + return ret; +} + +static void +drm_mode_destroy(xf86CrtcPtr crtc, drmmode_mode_ptr mode) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + if (mode->blob_id) + drmModeDestroyPropertyBlob(ms->fd, mode->blob_id); + xorg_list_del(&mode->entry); + free(mode); +} + +static int +drmmode_crtc_can_test_mode(xf86CrtcPtr crtc) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + + return ms->atomic_modeset; +} + +static Bool +drmmode_crtc_get_fb_id(xf86CrtcPtr crtc, uint32_t *fb_id, int *x, int *y) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + int ret; + + *fb_id = 0; + + if (drmmode_crtc->prime_pixmap) { + if (!drmmode->reverse_prime_offload_mode) { + msPixmapPrivPtr ppriv = + msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap); + *fb_id = ppriv->fb_id; + *x = 0; + } else + *x = drmmode_crtc->prime_pixmap_x; + *y = 0; + } + else if (drmmode_crtc->rotate_fb_id) { + *fb_id = drmmode_crtc->rotate_fb_id; + *x = *y = 0; + } + else { + *fb_id = drmmode->fb_id; + *x = crtc->x; + *y = crtc->y; + } + + if (*fb_id == 0) { + ret = drmmode_bo_import(drmmode, &drmmode->front_bo, + &drmmode->fb_id); + if (ret < 0) { + ErrorF("failed to add fb %d\n", ret); + return FALSE; + } + *fb_id = drmmode->fb_id; + } + + return TRUE; +} + +void +drmmode_set_dpms(ScrnInfoPtr scrn, int dpms, int flags) +{ + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + drmModeAtomicReq *req = drmModeAtomicAlloc(); + uint32_t mode_flags = DRM_MODE_ATOMIC_ALLOW_MODESET; + int ret = 0; + int i; + + assert(ms->atomic_modeset); + + if (!req) + return; + + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + if (output->crtc != NULL) + continue; + + ret = connector_add_prop(req, drmmode_output, + DRMMODE_CONNECTOR_CRTC_ID, 0); + } + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + Bool active = FALSE; + + ret |= crtc_add_dpms_props(req, crtc, dpms, &active); + + if (dpms == DPMSModeOn && active && drmmode_crtc->need_modeset) { + uint32_t fb_id; + int x, y; + + if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) + continue; + ret |= plane_add_props(req, crtc, fb_id, x, y); + drmmode_crtc->need_modeset = FALSE; + } + } + + if (ret == 0) + drmModeAtomicCommit(ms->fd, req, mode_flags, NULL); + drmModeAtomicFree(req); + + ms->pending_modeset = TRUE; + xf86DPMSSet(scrn, dpms, flags); + ms->pending_modeset = FALSE; +} + +static int +drmmode_output_disable(xf86OutputPtr output) +{ + modesettingPtr ms = modesettingPTR(output->scrn); + drmmode_output_private_ptr drmmode_output = output->driver_private; + xf86CrtcPtr crtc = drmmode_output->current_crtc; + drmModeAtomicReq *req = drmModeAtomicAlloc(); + uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; + int ret = 0; + + assert(ms->atomic_modeset); + + if (!req) + return 1; + + ret |= connector_add_prop(req, drmmode_output, + DRMMODE_CONNECTOR_CRTC_ID, 0); + if (crtc) + ret |= crtc_add_dpms_props(req, crtc, DPMSModeOff, NULL); + + if (ret == 0) + ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); + + if (ret == 0) + drmmode_output->current_crtc = NULL; + + drmModeAtomicFree(req); + return ret; +} + +static int +drmmode_crtc_disable(xf86CrtcPtr crtc) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmModeAtomicReq *req = drmModeAtomicAlloc(); + uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; + int ret = 0; + + assert(ms->atomic_modeset); + + if (!req) + return 1; + + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_ACTIVE, 0); + ret |= crtc_add_prop(req, drmmode_crtc, + DRMMODE_CRTC_MODE_ID, 0); + + if (ret == 0) + ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); + + drmModeAtomicFree(req); + return ret; +} + +static int +drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + drmModeModeInfo kmode; + int output_count = 0; + uint32_t *output_ids = NULL; + uint32_t fb_id; + int x, y; + int i, ret = 0; + + if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) + return 1; + + if (ms->atomic_modeset) { + drmModeAtomicReq *req = drmModeAtomicAlloc(); + Bool active; + uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET; + + if (!req) + return 1; + + ret |= crtc_add_dpms_props(req, crtc, DPMSModeOn, &active); + ret |= plane_add_props(req, crtc, active ? fb_id : 0, x, y); + + /* Orphaned CRTCs need to be disabled right now in atomic mode */ + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr other_crtc = xf86_config->crtc[i]; + drmmode_crtc_private_ptr other_drmmode_crtc = other_crtc->driver_private; + int lost_outputs = 0; + int remaining_outputs = 0; + int j; + + if (other_crtc == crtc) + continue; + + for (j = 0; j < xf86_config->num_output; j++) { + xf86OutputPtr output = xf86_config->output[j]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + if (drmmode_output->current_crtc == other_crtc) { + if (output->crtc == crtc) + lost_outputs++; + else + remaining_outputs++; + } + } + + if (lost_outputs > 0 && remaining_outputs == 0) { + ret |= crtc_add_prop(req, other_drmmode_crtc, + DRMMODE_CRTC_ACTIVE, 0); + ret |= crtc_add_prop(req, other_drmmode_crtc, + DRMMODE_CRTC_MODE_ID, 0); + } + } + + if (test_only) + flags |= DRM_MODE_ATOMIC_TEST_ONLY; + + if (ret == 0) + ret = drmModeAtomicCommit(ms->fd, req, flags, NULL); + + if (ret == 0 && !test_only) { + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + if (output->crtc == crtc) + drmmode_output->current_crtc = crtc; + else if (drmmode_output->current_crtc == crtc) + drmmode_output->current_crtc = NULL; + } + } + + drmModeAtomicFree(req); + return ret; + } + + output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); + if (!output_ids) + return -1; + + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + drmmode_output_private_ptr drmmode_output; + + if (output->crtc != crtc) + continue; + + drmmode_output = output->driver_private; + if (drmmode_output->output_id == -1) + continue; + output_ids[output_count] = drmmode_output->output_id; + output_count++; + } + + drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->mode); + ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + fb_id, x, y, output_ids, output_count, &kmode); + + free(output_ids); + return ret; +} + +int +drmmode_crtc_flip(xf86CrtcPtr crtc, uint32_t fb_id, uint32_t flags, void *data) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + int ret; + + if (ms->atomic_modeset) { + drmModeAtomicReq *req = drmModeAtomicAlloc(); + + if (!req) + return 1; + + ret = plane_add_props(req, crtc, fb_id, crtc->x, crtc->y); + flags |= DRM_MODE_ATOMIC_NONBLOCK; + if (ret == 0) + ret = drmModeAtomicCommit(ms->fd, req, flags, data); + drmModeAtomicFree(req); + return ret; + } + + return drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id, + fb_id, flags, data); +} + int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo) { @@ -152,15 +956,90 @@ drmmode_bo_map(drmmode_ptr drmmode, drmmode_bo *bo) return bo->dumb->ptr; } +int +drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo, + uint32_t *fb_id) +{ +#ifdef GBM_BO_WITH_MODIFIERS + modesettingPtr ms = modesettingPTR(drmmode->scrn); + if (bo->gbm && ms->kms_has_modifiers && + gbm_bo_get_modifier(bo->gbm) != DRM_FORMAT_MOD_INVALID) { + int num_fds; + + num_fds = gbm_bo_get_plane_count(bo->gbm); + if (num_fds > 0) { + int i; + uint32_t format; + uint32_t handles[4]; + uint32_t strides[4]; + uint32_t offsets[4]; + uint64_t modifiers[4]; + + memset(handles, 0, sizeof(handles)); + memset(strides, 0, sizeof(strides)); + memset(offsets, 0, sizeof(offsets)); + memset(modifiers, 0, sizeof(modifiers)); + + format = gbm_bo_get_format(bo->gbm); + format = get_opaque_format(format); + for (i = 0; i < num_fds; i++) { + handles[i] = gbm_bo_get_handle_for_plane(bo->gbm, i).u32; + strides[i] = gbm_bo_get_stride_for_plane(bo->gbm, i); + offsets[i] = gbm_bo_get_offset(bo->gbm, i); + modifiers[i] = gbm_bo_get_modifier(bo->gbm); + } + + return drmModeAddFB2WithModifiers(drmmode->fd, bo->width, bo->height, + format, handles, strides, + offsets, modifiers, fb_id, + DRM_MODE_FB_MODIFIERS); + } + } +#endif + return drmModeAddFB(drmmode->fd, bo->width, bo->height, + drmmode->scrn->depth, drmmode->kbpp, + drmmode_bo_get_pitch(bo), + drmmode_bo_get_handle(bo), fb_id); +} + static Bool drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo, unsigned width, unsigned height, unsigned bpp) { + bo->width = width; + bo->height = height; + #ifdef GLAMOR_HAS_GBM if (drmmode->glamor) { - bo->gbm = gbm_bo_create(drmmode->gbm, width, height, - GBM_FORMAT_ARGB8888, + uint32_t format; + + if (drmmode->scrn->depth == 30) + format = GBM_FORMAT_ARGB2101010; + else + format = GBM_FORMAT_ARGB8888; + +#ifdef GBM_BO_WITH_MODIFIERS + uint32_t num_modifiers; + uint64_t *modifiers = NULL; + + num_modifiers = get_modifiers_set(drmmode->scrn, format, &modifiers, + FALSE, TRUE); + if (num_modifiers > 0 && + !(num_modifiers == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID)) { + bo->gbm = gbm_bo_create_with_modifiers(drmmode->gbm, width, height, + format, modifiers, + num_modifiers); + free(modifiers); + if (bo->gbm) { + bo->used_modifiers = TRUE; + return TRUE; + } + } +#endif + + bo->gbm = gbm_bo_create(drmmode->gbm, width, height, format, GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); + bo->used_modifiers = FALSE; return bo->gbm != NULL; } #endif @@ -270,8 +1149,6 @@ drmmode_SharedPixmapPresentOnVBlank(PixmapPtr ppix, xf86CrtcPtr crtc, { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); - - drmVBlank vbl; struct vblank_event_args *event_args; if (ppix == drmmode_crtc->prime_pixmap) @@ -294,12 +1171,7 @@ drmmode_SharedPixmapPresentOnVBlank(PixmapPtr ppix, xf86CrtcPtr crtc, drmmode_SharedPixmapVBlankEventHandler, drmmode_SharedPixmapVBlankEventAbort); - vbl.request.type = - DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; - vbl.request.sequence = 1; - vbl.request.signal = (unsigned long) ppriv->flip_seq; - - return drmWaitVBlank(drmmode->fd, &vbl) >= 0; + return ms_queue_vblank(crtc, MS_QUEUE_RELATIVE, 1, NULL, ppriv->flip_seq); } Bool @@ -483,17 +1355,29 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn, static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) { + modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + /* XXX Check if DPMS mode is already the right one */ + drmmode_crtc->dpms_mode = mode; + + if (ms->atomic_modeset) { + if (mode != DPMSModeOn && !ms->pending_modeset) + drmmode_crtc_disable(crtc); + } else if (crtc->enabled == FALSE) { + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); + } } -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM static PixmapPtr create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id) { PixmapPtr pixmap = drmmode->fbcon_pixmap; drmModeFBPtr fbcon; - struct drm_gem_flink flink; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); Bool ret; @@ -509,12 +1393,6 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id) fbcon->height != pScrn->virtualY) goto out_free_fb; - flink.handle = fbcon->handle; - if (ioctl(drmmode->fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't flink fbcon handle\n"); - goto out_free_fb; - } - pixmap = drmmode_create_pixmap_header(pScreen, fbcon->width, fbcon->height, fbcon->depth, fbcon->bpp, fbcon->pitch, NULL); @@ -537,7 +1415,7 @@ out_free_fb: void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn); PixmapPtr src, dst; @@ -591,19 +1469,16 @@ static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { - ScrnInfoPtr pScrn = crtc->scrn; + modesettingPtr ms = modesettingPTR(crtc->scrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; int saved_x, saved_y; Rotation saved_rotation; DisplayModeRec saved_mode; - uint32_t *output_ids = NULL; - int output_count = 0; Bool ret = TRUE; + Bool can_test; int i; - uint32_t fb_id = 0; - drmModeModeInfo kmode; saved_mode = crtc->mode; saved_x = crtc->x; @@ -615,71 +1490,16 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, crtc->x = x; crtc->y = y; crtc->rotation = rotation; - } - - output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); - if (!output_ids) { - ret = FALSE; - goto done; - } - - if (mode) { - for (i = 0; i < xf86_config->num_output; i++) { - xf86OutputPtr output = xf86_config->output[i]; - drmmode_output_private_ptr drmmode_output; - - if (output->crtc != crtc) - continue; - - drmmode_output = output->driver_private; - if (drmmode_output->output_id == -1) - continue; - output_ids[output_count] = - drmmode_output->mode_output->connector_id; - output_count++; - } if (!xf86CrtcRotate(crtc)) { goto done; } + crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); - drmmode_ConvertToKMode(crtc->scrn, &kmode, mode); - - fb_id = drmmode->fb_id; - if (drmmode_crtc->prime_pixmap) { - if (!drmmode->reverse_prime_offload_mode) { - msPixmapPrivPtr ppriv = - msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap); - fb_id = ppriv->fb_id; - x = 0; - } else - x = drmmode_crtc->prime_pixmap_x; - y = 0; - } - else if (drmmode_crtc->rotate_fb_id) { - fb_id = drmmode_crtc->rotate_fb_id; - x = y = 0; - } - - if (fb_id == 0) { - ret = drmModeAddFB(drmmode->fd, - pScrn->virtualX, pScrn->virtualY, - pScrn->depth, drmmode->kbpp, - drmmode_bo_get_pitch(&drmmode->front_bo), - drmmode_bo_get_handle(&drmmode->front_bo), - &drmmode->fb_id); - if (ret < 0) { - ErrorF("failed to add fb %d\n", ret); - ret = FALSE; - goto done; - } - fb_id = drmmode->fb_id; - } - - if (drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, - fb_id, x, y, output_ids, output_count, &kmode)) { + can_test = drmmode_crtc_can_test_mode(crtc); + if (drmmode_crtc_set_mode(crtc, can_test)) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set mode: %s\n", strerror(errno)); ret = FALSE; @@ -690,6 +1510,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, if (crtc->scrn->pScreen) xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen); + ms->pending_modeset = TRUE; drmmode_crtc->need_modeset = FALSE; crtc->funcs->dpms(crtc, DPMSModeOn); @@ -709,6 +1530,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, continue; output->funcs->dpms(output, DPMSModeOn); } + + /* if we only tested the mode previously, really set it now */ + if (can_test) + drmmode_crtc_set_mode(crtc, FALSE); + ms->pending_modeset = FALSE; } done: @@ -720,8 +1546,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } else crtc->active = TRUE; - free(output_ids); - return ret; } @@ -747,37 +1571,36 @@ drmmode_set_cursor(xf86CrtcPtr crtc) drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; modesettingPtr ms = modesettingPTR(crtc->scrn); + CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen); int ret = -EINVAL; - if (!drmmode_crtc->set_cursor2_failed) { - CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen); + if (cursor == NullCursor) + return TRUE; - ret = - drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, - handle, ms->cursor_width, ms->cursor_height, - cursor->bits->xhot, cursor->bits->yhot); - if (!ret) - return TRUE; - - /* -EINVAL can mean that an old kernel supports drmModeSetCursor but - * not drmModeSetCursor2, though it can mean other things too. */ - if (ret == -EINVAL) - drmmode_crtc->set_cursor2_failed = TRUE; - } + ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + handle, ms->cursor_width, ms->cursor_height, + cursor->bits->xhot, cursor->bits->yhot); + /* -EINVAL can mean that an old kernel supports drmModeSetCursor but + * not drmModeSetCursor2, though it can mean other things too. */ if (ret == -EINVAL) ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height); - if (ret) { + /* -ENXIO normally means that the current drm driver supports neither + * cursor_set nor cursor_set2. Disable hardware cursor support for + * the rest of the session in that case. */ + if (ret == -ENXIO) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; cursor_info->MaxWidth = cursor_info->MaxHeight = 0; drmmode_crtc->drmmode->sw_cursor = TRUE; + } + + if (ret) /* fallback to swcursor */ return FALSE; - } return TRUE; } @@ -804,13 +1627,8 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) ptr[i] = image[i]; // cpu_to_le32(image[i]); - if (drmmode_crtc->cursor_up || !drmmode_crtc->first_cursor_load_done) { - Bool ret = drmmode_set_cursor(crtc); - if (!drmmode_crtc->cursor_up) - drmmode_hide_cursor(crtc); - drmmode_crtc->first_cursor_load_done = TRUE; - return ret; - } + if (drmmode_crtc->cursor_up) + return drmmode_set_cursor(crtc); return TRUE; } @@ -826,12 +1644,12 @@ drmmode_hide_cursor(xf86CrtcPtr crtc) ms->cursor_width, ms->cursor_height); } -static void +static Bool drmmode_show_cursor(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_crtc->cursor_up = TRUE; - drmmode_set_cursor(crtc); + return drmmode_set_cursor(crtc); } static void @@ -857,7 +1675,7 @@ drmmode_set_target_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix, int c, total_width = 0, max_height = 0, this_x = 0; if (*target) { - PixmapStopDirtyTracking(*target, screenpix); + PixmapStopDirtyTracking(&(*target)->drawable, screenpix); if (drmmode->fb_id) { drmModeRmFB(drmmode->fd, drmmode->fb_id); drmmode->fb_id = 0; @@ -897,7 +1715,8 @@ drmmode_set_target_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix, screen->height = screenpix->drawable.height = max_height; } drmmode_crtc->prime_pixmap_x = this_x; - PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0); + PixmapStartDirtyTracking(&ppix->drawable, screenpix, 0, 0, this_x, 0, + RR_Rotate_0); *target = ppix; return TRUE; } @@ -988,11 +1807,8 @@ drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) return NULL; } - ret = drmModeAddFB(drmmode->fd, width, height, crtc->scrn->depth, - drmmode->kbpp, - drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo), - drmmode_bo_get_handle(&drmmode_crtc->rotate_bo), - &drmmode_crtc->rotate_fb_id); + ret = drmmode_bo_import(drmmode, &drmmode_crtc->rotate_bo, + &drmmode_crtc->rotate_fb_id); if (ret) { ErrorF("failed to add rotate fb\n"); @@ -1094,17 +1910,33 @@ drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) } } +static void +drmmode_crtc_destroy(xf86CrtcPtr crtc) +{ + drmmode_mode_ptr iterator, next; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + modesettingPtr ms = modesettingPTR(crtc->scrn); + + if (!ms->atomic_modeset) + return; + + drmmode_prop_info_free(drmmode_crtc->props_plane, DRMMODE_PLANE__COUNT); + xorg_list_for_each_entry_safe(iterator, next, &drmmode_crtc->mode_list, entry) { + drm_mode_destroy(crtc, iterator); + } +} + static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .dpms = drmmode_crtc_dpms, .set_mode_major = drmmode_set_mode_major, .set_cursor_colors = drmmode_set_cursor_colors, .set_cursor_position = drmmode_set_cursor_position, - .show_cursor = drmmode_show_cursor, + .show_cursor_check = drmmode_show_cursor, .hide_cursor = drmmode_hide_cursor, .load_cursor_argb_check = drmmode_load_cursor_argb_check, .gamma_set = drmmode_crtc_gamma_set, - .destroy = NULL, /* XXX */ + .destroy = drmmode_crtc_destroy, .set_scanout_pixmap = drmmode_set_scanout_pixmap, .shadow_allocate = drmmode_shadow_allocate, .shadow_create = drmmode_shadow_create, @@ -1122,23 +1954,261 @@ drmmode_crtc_vblank_pipe(int crtc_id) return 0; } +static Bool +is_plane_assigned(ScrnInfoPtr scrn, int plane_id) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr iter = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = iter->driver_private; + if (drmmode_crtc->plane_id == plane_id) + return TRUE; + } + + return FALSE; +} + +/** + * Populates the formats array, and the modifiers of each format for a drm_plane. + */ +static Bool +populate_format_modifiers(xf86CrtcPtr crtc, const drmModePlane *kplane, + uint32_t blob_id) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + unsigned i, j; + drmModePropertyBlobRes *blob; + struct drm_format_modifier_blob *fmt_mod_blob; + uint32_t *blob_formats; + struct drm_format_modifier *blob_modifiers; + + if (!blob_id) + return FALSE; + + blob = drmModeGetPropertyBlob(drmmode->fd, blob_id); + if (!blob) + return FALSE; + + fmt_mod_blob = blob->data; + blob_formats = formats_ptr(fmt_mod_blob); + blob_modifiers = modifiers_ptr(fmt_mod_blob); + + assert(drmmode_crtc->num_formats == fmt_mod_blob->count_formats); + + for (i = 0; i < fmt_mod_blob->count_formats; i++) { + uint32_t num_modifiers = 0; + uint64_t *modifiers = NULL; + uint64_t *tmp; + for (j = 0; j < fmt_mod_blob->count_modifiers; j++) { + struct drm_format_modifier *mod = &blob_modifiers[j]; + + if ((i < mod->offset) || (i > mod->offset + 63)) + continue; + if (!(mod->formats & (1 << (i - mod->offset)))) + continue; + + num_modifiers++; + tmp = realloc(modifiers, num_modifiers * sizeof(modifiers[0])); + if (!tmp) { + free(modifiers); + drmModeFreePropertyBlob(blob); + return FALSE; + } + modifiers = tmp; + modifiers[num_modifiers - 1] = mod->modifier; + } + + drmmode_crtc->formats[i].format = blob_formats[i]; + drmmode_crtc->formats[i].modifiers = modifiers; + drmmode_crtc->formats[i].num_modifiers = num_modifiers; + } + + drmModeFreePropertyBlob(blob); + + return TRUE; +} + +static void +drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + drmModePlaneRes *kplane_res; + drmModePlane *kplane, *best_kplane = NULL; + drmModeObjectProperties *props; + uint32_t i, type, blob_id; + int current_crtc, best_plane = 0; + + static drmmode_prop_enum_info_rec plane_type_enums[] = { + [DRMMODE_PLANE_TYPE_PRIMARY] = { + .name = "Primary", + }, + [DRMMODE_PLANE_TYPE_OVERLAY] = { + .name = "Overlay", + }, + [DRMMODE_PLANE_TYPE_CURSOR] = { + .name = "Cursor", + }, + }; + static const drmmode_prop_info_rec plane_props[] = { + [DRMMODE_PLANE_TYPE] = { + .name = "type", + .enum_values = plane_type_enums, + .num_enum_values = DRMMODE_PLANE_TYPE__COUNT, + }, + [DRMMODE_PLANE_FB_ID] = { .name = "FB_ID", }, + [DRMMODE_PLANE_CRTC_ID] = { .name = "CRTC_ID", }, + [DRMMODE_PLANE_IN_FORMATS] = { .name = "IN_FORMATS", }, + [DRMMODE_PLANE_SRC_X] = { .name = "SRC_X", }, + [DRMMODE_PLANE_SRC_Y] = { .name = "SRC_Y", }, + [DRMMODE_PLANE_SRC_W] = { .name = "SRC_W", }, + [DRMMODE_PLANE_SRC_H] = { .name = "SRC_H", }, + [DRMMODE_PLANE_CRTC_X] = { .name = "CRTC_X", }, + [DRMMODE_PLANE_CRTC_Y] = { .name = "CRTC_Y", }, + [DRMMODE_PLANE_CRTC_W] = { .name = "CRTC_W", }, + [DRMMODE_PLANE_CRTC_H] = { .name = "CRTC_H", }, + }; + drmmode_prop_info_rec tmp_props[DRMMODE_PLANE__COUNT]; + + if (!drmmode_prop_info_copy(tmp_props, plane_props, DRMMODE_PLANE__COUNT, 0)) { + xf86DrvMsg(drmmode->scrn->scrnIndex, X_ERROR, + "failed to copy plane property info\n"); + drmmode_prop_info_free(tmp_props, DRMMODE_PLANE__COUNT); + return; + } + + kplane_res = drmModeGetPlaneResources(drmmode->fd); + if (!kplane_res) { + xf86DrvMsg(drmmode->scrn->scrnIndex, X_ERROR, + "failed to get plane resources: %s\n", strerror(errno)); + drmmode_prop_info_free(tmp_props, DRMMODE_PLANE__COUNT); + return; + } + + for (i = 0; i < kplane_res->count_planes; i++) { + int plane_id; + + kplane = drmModeGetPlane(drmmode->fd, kplane_res->planes[i]); + if (!kplane) + continue; + + if (!(kplane->possible_crtcs & (1 << num)) || + is_plane_assigned(drmmode->scrn, kplane->plane_id)) { + drmModeFreePlane(kplane); + continue; + } + + plane_id = kplane->plane_id; + + props = drmModeObjectGetProperties(drmmode->fd, plane_id, + DRM_MODE_OBJECT_PLANE); + if (!props) { + xf86DrvMsg(drmmode->scrn->scrnIndex, X_ERROR, + "couldn't get plane properties\n"); + drmModeFreePlane(kplane); + continue; + } + + drmmode_prop_info_update(drmmode, tmp_props, DRMMODE_PLANE__COUNT, props); + + /* Only primary planes are important for atomic page-flipping */ + type = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_TYPE], + props, DRMMODE_PLANE_TYPE__COUNT); + if (type != DRMMODE_PLANE_TYPE_PRIMARY) { + drmModeFreePlane(kplane); + drmModeFreeObjectProperties(props); + continue; + } + + /* Check if plane is already on this CRTC */ + current_crtc = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_CRTC_ID], + props, 0); + if (current_crtc == drmmode_crtc->mode_crtc->crtc_id) { + if (best_plane) { + drmModeFreePlane(best_kplane); + drmmode_prop_info_free(drmmode_crtc->props_plane, DRMMODE_PLANE__COUNT); + } + best_plane = plane_id; + best_kplane = kplane; + blob_id = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_IN_FORMATS], + props, 0); + drmmode_prop_info_copy(drmmode_crtc->props_plane, tmp_props, + DRMMODE_PLANE__COUNT, 1); + drmModeFreeObjectProperties(props); + break; + } + + if (!best_plane) { + best_plane = plane_id; + best_kplane = kplane; + blob_id = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_IN_FORMATS], + props, 0); + drmmode_prop_info_copy(drmmode_crtc->props_plane, tmp_props, + DRMMODE_PLANE__COUNT, 1); + } else { + drmModeFreePlane(kplane); + } + + drmModeFreeObjectProperties(props); + } + + drmmode_crtc->plane_id = best_plane; + if (best_kplane) { + drmmode_crtc->num_formats = best_kplane->count_formats; + drmmode_crtc->formats = calloc(sizeof(drmmode_format_rec), + best_kplane->count_formats); + if (!populate_format_modifiers(crtc, best_kplane, blob_id)) { + for (i = 0; i < best_kplane->count_formats; i++) + drmmode_crtc->formats[i].format = best_kplane->formats[i]; + } + drmModeFreePlane(best_kplane); + } + + drmmode_prop_info_free(tmp_props, DRMMODE_PLANE__COUNT); + drmModeFreePlaneResources(kplane_res); +} + static unsigned int drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num) { xf86CrtcPtr crtc; drmmode_crtc_private_ptr drmmode_crtc; modesettingEntPtr ms_ent = ms_ent_priv(pScrn); + modesettingPtr ms = modesettingPTR(pScrn); + drmModeObjectPropertiesPtr props; + static const drmmode_prop_info_rec crtc_props[] = { + [DRMMODE_CRTC_ACTIVE] = { .name = "ACTIVE" }, + [DRMMODE_CRTC_MODE_ID] = { .name = "MODE_ID" }, + }; crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); if (crtc == NULL) return 0; - drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); + crtc->driver_private = drmmode_crtc; drmmode_crtc->mode_crtc = drmModeGetCrtc(drmmode->fd, mode_res->crtcs[num]); drmmode_crtc->drmmode = drmmode; drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num); - crtc->driver_private = drmmode_crtc; + xorg_list_init(&drmmode_crtc->mode_list); + + if (ms->atomic_modeset) { + props = drmModeObjectGetProperties(drmmode->fd, mode_res->crtcs[num], + DRM_MODE_OBJECT_CRTC); + if (!props || !drmmode_prop_info_copy(drmmode_crtc->props, crtc_props, + DRMMODE_CRTC__COUNT, 0)) { + xf86CrtcDestroy(crtc); + return 0; + } + + drmmode_prop_info_update(drmmode, drmmode_crtc->props, + DRMMODE_CRTC__COUNT, props); + drmModeFreeObjectProperties(props); + drmmode_crtc_create_planes(crtc, num); + } /* Hide any cursors which may be active from previous users */ drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0); @@ -1151,6 +2221,67 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res return 1; } +/* + * Update all of the property values for an output + */ +static void +drmmode_output_update_properties(xf86OutputPtr output) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + int i, j, k; + int err; + drmModeConnectorPtr koutput; + + /* Use the most recently fetched values from the kernel */ + koutput = drmmode_output->mode_output; + + if (!koutput) + return; + + for (i = 0; i < drmmode_output->num_props; i++) { + drmmode_prop_ptr p = &drmmode_output->props[i]; + + for (j = 0; koutput && j < koutput->count_props; j++) { + if (koutput->props[j] == p->mode_prop->prop_id) { + + /* Check to see if the property value has changed */ + if (koutput->prop_values[j] != p->value) { + + p->value = koutput->prop_values[j]; + + if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { + INT32 value = p->value; + + err = RRChangeOutputProperty(output->randr_output, p->atoms[0], + XA_INTEGER, 32, PropModeReplace, 1, + &value, FALSE, TRUE); + + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", err); + } + } + else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { + for (k = 0; k < p->mode_prop->count_enums; k++) + if (p->mode_prop->enums[k].value == p->value) + break; + if (k < p->mode_prop->count_enums) { + err = RRChangeOutputProperty(output->randr_output, p->atoms[0], + XA_ATOM, 32, PropModeReplace, 1, + &p->atoms[k + 1], FALSE, TRUE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", err); + } + } + } + } + break; + } + } + } +} + static xf86OutputStatus drmmode_output_detect(xf86OutputPtr output) { @@ -1166,8 +2297,13 @@ drmmode_output_detect(xf86OutputPtr output) drmmode_output->mode_output = drmModeGetConnector(drmmode->fd, drmmode_output->output_id); - if (!drmmode_output->mode_output) + + if (!drmmode_output->mode_output) { + drmmode_output->output_id = -1; return XF86OutputStatusDisconnected; + } + + drmmode_output_update_properties(output); switch (drmmode_output->mode_output->connection) { case DRM_MODE_CONNECTED: @@ -1190,13 +2326,57 @@ drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes) return MODE_OK; } +static int +koutput_get_prop_idx(int fd, drmModeConnectorPtr koutput, + int type, const char *name) +{ + int idx = -1; + + for (int i = 0; i < koutput->count_props; i++) { + drmModePropertyPtr prop = drmModeGetProperty(fd, koutput->props[i]); + + if (!prop) + continue; + + if (drm_property_type_is(prop, type) && !strcmp(prop->name, name)) + idx = i; + + drmModeFreeProperty(prop); + + if (idx > -1) + break; + } + + return idx; +} + +static int +koutput_get_prop_id(int fd, drmModeConnectorPtr koutput, + int type, const char *name) +{ + int idx = koutput_get_prop_idx(fd, koutput, type, name); + + return (idx > -1) ? koutput->props[idx] : -1; +} + +static drmModePropertyBlobPtr +koutput_get_prop_blob(int fd, drmModeConnectorPtr koutput, const char *name) +{ + drmModePropertyBlobPtr blob = NULL; + int idx = koutput_get_prop_idx(fd, koutput, DRM_MODE_PROP_BLOB, name); + + if (idx > -1) + blob = drmModeGetPropertyBlob(fd, koutput->prop_values[idx]); + + return blob; +} + static void drmmode_output_attach_tile(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; - int i; struct xf86CrtcTileInfo tile_info, *set = NULL; if (!koutput) { @@ -1204,25 +2384,12 @@ drmmode_output_attach_tile(xf86OutputPtr output) return; } + drmModeFreePropertyBlob(drmmode_output->tile_blob); + /* look for a TILE property */ - for (i = 0; i < koutput->count_props; i++) { - drmModePropertyPtr props; - props = drmModeGetProperty(drmmode->fd, koutput->props[i]); - if (!props) - continue; + drmmode_output->tile_blob = + koutput_get_prop_blob(drmmode->fd, koutput, "TILE"); - if (!(props->flags & DRM_MODE_PROP_BLOB)) { - drmModeFreeProperty(props); - continue; - } - - if (!strcmp(props->name, "TILE")) { - drmModeFreePropertyBlob(drmmode_output->tile_blob); - drmmode_output->tile_blob = - drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]); - } - drmModeFreeProperty(props); - } if (drmmode_output->tile_blob) { if (xf86OutputParseKMSTile(drmmode_output->tile_blob->data, drmmode_output->tile_blob->length, &tile_info) == TRUE) set = &tile_info; @@ -1236,26 +2403,15 @@ has_panel_fitter(xf86OutputPtr output) drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; - int i; + int idx; /* Presume that if the output supports scaling, then we have a * panel fitter capable of adjust any mode to suit. */ - for (i = 0; i < koutput->count_props; i++) { - drmModePropertyPtr props; - Bool found = FALSE; + idx = koutput_get_prop_idx(drmmode->fd, koutput, + DRM_MODE_PROP_ENUM, "scaling mode"); - props = drmModeGetProperty(drmmode->fd, koutput->props[i]); - if (props) { - found = strcmp(props->name, "scaling mode") == 0; - drmModeFreeProperty(props); - } - - if (found) - return TRUE; - } - - return FALSE; + return (idx > -1); } static DisplayModePtr @@ -1309,26 +2465,16 @@ drmmode_output_get_modes(xf86OutputPtr output) drmmode_ptr drmmode = drmmode_output->drmmode; int i; DisplayModePtr Modes = NULL, Mode; - drmModePropertyPtr props; xf86MonPtr mon = NULL; if (!koutput) return NULL; + drmModeFreePropertyBlob(drmmode_output->edid_blob); + /* look for an EDID property */ - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(drmmode->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_BLOB)) { - if (!strcmp(props->name, "EDID")) { - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob(drmmode_output->edid_blob); - drmmode_output->edid_blob = - drmModeGetPropertyBlob(drmmode->fd, - koutput->prop_values[i]); - } - drmModeFreeProperty(props); - } - } + drmmode_output->edid_blob = + koutput_get_prop_blob(drmmode->fd, koutput, "EDID"); if (drmmode_output->edid_blob) { mon = xf86InterpretEDID(output->scrn->scrnIndex, @@ -1358,8 +2504,9 @@ drmmode_output_destroy(xf86OutputPtr output) drmmode_output_private_ptr drmmode_output = output->driver_private; int i; - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob(drmmode_output->edid_blob); + drmModeFreePropertyBlob(drmmode_output->edid_blob); + drmModeFreePropertyBlob(drmmode_output->tile_blob); + for (i = 0; i < drmmode_output->num_props; i++) { drmModeFreeProperty(drmmode_output->props[i].mode_prop); free(drmmode_output->props[i].atoms); @@ -1379,16 +2526,26 @@ drmmode_output_destroy(xf86OutputPtr output) static void drmmode_output_dpms(xf86OutputPtr output, int mode) { + modesettingPtr ms = modesettingPTR(output->scrn); drmmode_output_private_ptr drmmode_output = output->driver_private; + drmmode_ptr drmmode = drmmode_output->drmmode; xf86CrtcPtr crtc = output->crtc; drmModeConnectorPtr koutput = drmmode_output->mode_output; - drmmode_ptr drmmode = drmmode_output->drmmode; if (!koutput) return; - drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, - drmmode_output->dpms_enum_id, mode); + /* XXX Check if DPMS mode is already the right one */ + + drmmode_output->dpms = mode; + + if (ms->atomic_modeset) { + if (mode != DPMSModeOn && !ms->pending_modeset) + drmmode_output_disable(output); + } else { + drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, + drmmode_output->dpms_enum_id, mode); + } if (crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; @@ -1418,7 +2575,8 @@ drmmode_property_ignore(drmModePropertyPtr prop) if (prop->flags & DRM_MODE_PROP_BLOB) return TRUE; /* ignore standard property */ - if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS")) + if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS") || + !strcmp(prop->name, "CRTC_ID")) return TRUE; return FALSE; @@ -1453,6 +2611,29 @@ drmmode_output_create_resources(xf86OutputPtr output) j++; } + /* Create CONNECTOR_ID property */ + { + Atom name = MakeAtom("CONNECTOR_ID", 12, TRUE); + INT32 value = mode_output->connector_id; + + if (name != BAD_RESOURCE) { + err = RRConfigureOutputProperty(output->randr_output, name, + FALSE, FALSE, TRUE, + 1, &value); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRConfigureOutputProperty error, %d\n", err); + } + err = RRChangeOutputProperty(output->randr_output, name, + XA_INTEGER, 32, PropModeReplace, 1, + &value, FALSE, FALSE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", err); + } + } + } + for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; @@ -1668,6 +2849,7 @@ static const char *const output_names[] = { "eDP", "Virtual", "DSI", + "DPI", }; static xf86OutputPtr find_output(ScrnInfoPtr pScrn, int id) @@ -1707,7 +2889,7 @@ static int parse_path_blob(drmModePropertyBlobPtr path_blob, int *conn_base_id, if (len + 1> 5) return -1; memcpy(conn_id, blob_data + 4, len); - conn_id[len + 1] = '\0'; + conn_id[len] = '\0'; id = strtoul(conn_id, NULL, 10); *conn_base_id = id; @@ -1737,7 +2919,7 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnectorPtr koutput, char *name, return; fallback: - if (koutput->connector_type >= MS_ARRAY_SIZE(output_names)) + if (koutput->connector_type >= ARRAY_SIZE(output_names)) snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, koutput->connector_type_id); else if (pScrn->is_gpu) snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id); @@ -1750,30 +2932,29 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r { xf86OutputPtr output; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + modesettingPtr ms = modesettingPTR(pScrn); drmModeConnectorPtr koutput; drmModeEncoderPtr *kencoders = NULL; drmmode_output_private_ptr drmmode_output; - drmModePropertyPtr props; char name[32]; int i; + Bool nonDesktop = FALSE; drmModePropertyBlobPtr path_blob = NULL; const char *s; + drmModeObjectPropertiesPtr props; + static const drmmode_prop_info_rec connector_props[] = { + [DRMMODE_CONNECTOR_CRTC_ID] = { .name = "CRTC_ID", }, + }; + koutput = drmModeGetConnector(drmmode->fd, mode_res->connectors[num]); if (!koutput) return 0; - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(drmmode->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_BLOB)) { - if (!strcmp(props->name, "PATH")) { - path_blob = drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]); - drmModeFreeProperty(props); - break; - } - drmModeFreeProperty(props); - } - } + path_blob = koutput_get_prop_blob(drmmode->fd, koutput, "PATH"); + i = koutput_get_prop_idx(drmmode->fd, koutput, DRM_MODE_PROP_RANGE, RR_PROPERTY_NON_DESKTOP); + if (i >= 0) + nonDesktop = koutput->prop_values[i] != 0; drmmode_create_name(pScrn, koutput, name, path_blob); @@ -1792,6 +2973,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r drmmode_output = output->driver_private; drmmode_output->output_id = mode_res->connectors[num]; drmmode_output->mode_output = koutput; + output->non_desktop = nonDesktop; return 1; } } @@ -1842,6 +3024,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r output->interlaceAllowed = TRUE; output->doubleScanAllowed = TRUE; output->driver_private = drmmode_output; + output->non_desktop = nonDesktop; output->possible_crtcs = 0x7f; for (i = 0; i < koutput->count_encoders; i++) { @@ -1850,16 +3033,21 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r /* work out the possible clones later */ output->possible_clones = 0; - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(drmmode->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_ENUM)) { - if (!strcmp(props->name, "DPMS")) { - drmmode_output->dpms_enum_id = koutput->props[i]; - drmModeFreeProperty(props); - break; - } - drmModeFreeProperty(props); + if (ms->atomic_modeset) { + if (!drmmode_prop_info_copy(drmmode_output->props_connector, + connector_props, DRMMODE_CONNECTOR__COUNT, + 0)) { + goto out_free_encoders; } + props = drmModeObjectGetProperties(drmmode->fd, + drmmode_output->output_id, + DRM_MODE_OBJECT_CONNECTOR); + drmmode_prop_info_update(drmmode, drmmode_output->props_connector, + DRMMODE_CONNECTOR__COUNT, props); + } else { + drmmode_output->dpms_enum_id = + koutput_get_prop_id(drmmode->fd, koutput, DRM_MODE_PROP_ENUM, + "DPMS"); } if (dynamic) @@ -1941,27 +3129,17 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, drmModeResPtr mode_re static Bool drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo) { -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM ScrnInfoPtr scrn = drmmode->scrn; if (!drmmode->glamor) return TRUE; -#ifdef GLAMOR_HAS_GBM - if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); + if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm, + bo->used_modifiers)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create pixmap\n"); return FALSE; } -#else - if (!glamor_egl_create_textured_pixmap(pixmap, - drmmode_bo_get_handle(&drmmode->front_bo), - scrn->displayWidth * - scrn->bitsPerPixel / 8)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "glamor_egl_create_textured_pixmap() failed\n"); - return FALSE; - } -#endif #endif return TRUE; @@ -1976,11 +3154,6 @@ drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode) if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo)) return FALSE; -#ifdef GLAMOR - if (drmmode->glamor) - glamor_set_screen_pixmap(screen_pixmap, NULL); -#endif - return TRUE; } @@ -2078,8 +3251,140 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) return FALSE; } +static void +drmmode_validate_leases(ScrnInfoPtr scrn) +{ + ScreenPtr screen = scrn->pScreen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; + drmModeLesseeListPtr lessees; + RRLeasePtr lease, next; + int l; + + /* We can't talk to the kernel about leases when VT switched */ + if (!scrn->vtSema) + return; + + lessees = drmModeListLessees(drmmode->fd); + if (!lessees) + return; + + xorg_list_for_each_entry_safe(lease, next, &scr_priv->leases, list) { + drmmode_lease_private_ptr lease_private = lease->devPrivate; + + for (l = 0; l < lessees->count; l++) { + if (lessees->lessees[l] == lease_private->lessee_id) + break; + } + + /* check to see if the lease has gone away */ + if (l == lessees->count) { + free(lease_private); + lease->devPrivate = NULL; + xf86CrtcLeaseTerminated(lease); + } + } + + free(lessees); +} + +static int +drmmode_create_lease(RRLeasePtr lease, int *fd) +{ + ScreenPtr screen = lease->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; + int ncrtc = lease->numCrtcs; + int noutput = lease->numOutputs; + int nobjects; + int c, o; + int i; + int lease_fd; + uint32_t *objects; + drmmode_lease_private_ptr lease_private; + + nobjects = ncrtc + noutput; + + if (ms->atomic_modeset) + nobjects += ncrtc; /* account for planes as well */ + + if (nobjects == 0) + return BadValue; + + lease_private = calloc(1, sizeof (drmmode_lease_private_rec)); + if (!lease_private) + return BadAlloc; + + objects = xallocarray(nobjects, sizeof (uint32_t)); + + if (!objects) { + free(lease_private); + return BadAlloc; + } + + i = 0; + + /* Add CRTC and plane ids */ + for (c = 0; c < ncrtc; c++) { + xf86CrtcPtr crtc = lease->crtcs[c]->devPrivate; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + objects[i++] = drmmode_crtc->mode_crtc->crtc_id; + if (ms->atomic_modeset) + objects[i++] = drmmode_crtc->plane_id; + } + + /* Add connector ids */ + + for (o = 0; o < noutput; o++) { + xf86OutputPtr output = lease->outputs[o]->devPrivate; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + objects[i++] = drmmode_output->mode_output->connector_id; + } + + /* call kernel to create lease */ + assert (i == nobjects); + + lease_fd = drmModeCreateLease(drmmode->fd, objects, nobjects, 0, &lease_private->lessee_id); + + free(objects); + + if (lease_fd < 0) { + free(lease_private); + return BadMatch; + } + + lease->devPrivate = lease_private; + + xf86CrtcLeaseStarted(lease); + + *fd = lease_fd; + return Success; +} + +static void +drmmode_terminate_lease(RRLeasePtr lease) +{ + ScreenPtr screen = lease->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; + drmmode_lease_private_ptr lease_private = lease->devPrivate; + + if (drmModeRevokeLease(drmmode->fd, lease_private->lessee_id) == 0) { + free(lease_private); + lease->devPrivate = NULL; + xf86CrtcLeaseTerminated(lease); + } +} + static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = { - drmmode_xf86crtc_resize + .resize = drmmode_xf86crtc_resize, + .create_lease = drmmode_create_lease, + .terminate_lease = drmmode_terminate_lease }; Bool @@ -2141,6 +3446,25 @@ drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) return TRUE; } +Bool +drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ +#ifdef GLAMOR_HAS_GBM + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + + if (drmmode->glamor) { + if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) { + return FALSE; + } +#ifdef GBM_BO_WITH_MODIFIERS + glamor_set_drawable_modifiers_func(pScreen, get_drawable_modifiers); +#endif + } +#endif + + return TRUE; +} + void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y) { @@ -2215,6 +3539,10 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) return FALSE; } } + + /* Validate leases on VT re-entry */ + drmmode_validate_leases(pScrn); + return TRUE; } @@ -2285,16 +3613,17 @@ drmmode_load_palette(ScrnInfoPtr pScrn, int numColors, Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) { - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, "Initializing kms color map\n"); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, + "Initializing kms color map for depth %d, %d bpc.\n", + pScrn->depth, pScrn->rgbBits); if (!miCreateDefColormap(pScreen)) return FALSE; - /* all radeons support 10 bit CLUTs */ - if (!xf86HandleColormaps(pScreen, 256, 10, - drmmode_load_palette, NULL, CMAP_PALETTED_TRUECOLOR -#if 0 /* This option messes up text mode! (eich@suse.de) */ - | CMAP_LOAD_EVEN_IF_OFFSCREEN -#endif - | CMAP_RELOAD_ON_MODE_SWITCH)) + + /* Adapt color map size and depth to color depth of screen. */ + if (!xf86HandleColormaps(pScreen, 1 << pScrn->rgbBits, 10, + drmmode_load_palette, NULL, + CMAP_PALETTED_TRUECOLOR | + CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE; return TRUE; } @@ -2344,38 +3673,34 @@ drmmode_handle_uevents(int fd, void *closure) for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; drmmode_output_private_ptr drmmode_output = output->driver_private; - uint32_t con_id; - drmModeConnectorPtr koutput; - if (drmmode_output->mode_output == NULL) - continue; - con_id = drmmode_output->mode_output->connector_id; + drmmode_output_detect(output); + /* Get an updated view of the properties for the current connector and * look for the link-status property */ - koutput = drmModeGetConnectorCurrent(drmmode->fd, con_id); - for (j = 0; koutput && j < koutput->count_props; j++) { - drmModePropertyPtr props; - props = drmModeGetProperty(drmmode->fd, koutput->props[j]); - if (props && props->flags & DRM_MODE_PROP_ENUM && - !strcmp(props->name, "link-status") && - koutput->prop_values[j] == DRM_MODE_LINK_STATUS_BAD) { - xf86CrtcPtr crtc = output->crtc; - if (!crtc) - continue; + for (j = 0; j < drmmode_output->num_props; j++) { + drmmode_prop_ptr p = &drmmode_output->props[j]; - /* the connector got a link failure, re-set the current mode */ - drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, - crtc->x, crtc->y); + if (!strcmp(p->mode_prop->name, "link-status")) { + if (p->value == DRM_MODE_LINK_STATUS_BAD) { + xf86CrtcPtr crtc = output->crtc; + if (!crtc) + continue; - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "hotplug event: connector %u's link-state is BAD, " - "tried resetting the current mode. You may be left" - "with a black screen if this fails...\n", con_id); + /* the connector got a link failure, re-set the current mode */ + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, + crtc->x, crtc->y); + + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "hotplug event: connector %u's link-state is BAD, " + "tried resetting the current mode. You may be left" + "with a black screen if this fails...\n", + drmmode_output->mode_output->connector_id); + } + break; } - drmModeFreeProperty(props); } - drmModeFreeConnector(koutput); } mode_res = drmModeGetResources(drmmode->fd); @@ -2432,6 +3757,9 @@ drmmode_handle_uevents(int fd, void *closure) drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0); } + /* Check to see if a lessee has disappeared */ + drmmode_validate_leases(scrn); + if (changed) { RRSetChanged(xf86ScrnToScreen(scrn)); RRTellChanged(xf86ScrnToScreen(scrn)); diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h index 0412b3553..7a5e98431 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -36,9 +36,46 @@ struct gbm_device; +enum drmmode_plane_property { + DRMMODE_PLANE_TYPE = 0, + DRMMODE_PLANE_FB_ID, + DRMMODE_PLANE_IN_FORMATS, + DRMMODE_PLANE_CRTC_ID, + DRMMODE_PLANE_SRC_X, + DRMMODE_PLANE_SRC_Y, + DRMMODE_PLANE_SRC_W, + DRMMODE_PLANE_SRC_H, + DRMMODE_PLANE_CRTC_X, + DRMMODE_PLANE_CRTC_Y, + DRMMODE_PLANE_CRTC_W, + DRMMODE_PLANE_CRTC_H, + DRMMODE_PLANE__COUNT +}; + +enum drmmode_plane_type { + DRMMODE_PLANE_TYPE_PRIMARY = 0, + DRMMODE_PLANE_TYPE_CURSOR, + DRMMODE_PLANE_TYPE_OVERLAY, + DRMMODE_PLANE_TYPE__COUNT +}; + +enum drmmode_connector_property { + DRMMODE_CONNECTOR_CRTC_ID, + DRMMODE_CONNECTOR__COUNT +}; + +enum drmmode_crtc_property { + DRMMODE_CRTC_ACTIVE, + DRMMODE_CRTC_MODE_ID, + DRMMODE_CRTC__COUNT +}; + typedef struct { + uint32_t width; + uint32_t height; struct dumb_bo *dumb; #ifdef GLAMOR_HAS_GBM + Bool used_modifiers; struct gbm_bo *gbm; #endif } drmmode_bo; @@ -86,8 +123,36 @@ typedef struct { Bool dri2_flipping; Bool present_flipping; + + Bool dri2_enable; + Bool present_enable; } drmmode_rec, *drmmode_ptr; +typedef struct { + const char *name; + Bool valid; + uint64_t value; +} drmmode_prop_enum_info_rec, *drmmode_prop_enum_info_ptr; + +typedef struct { + const char *name; + uint32_t prop_id; + unsigned int num_enum_values; + drmmode_prop_enum_info_rec *enum_values; +} drmmode_prop_info_rec, *drmmode_prop_info_ptr; + +typedef struct { + drmModeModeInfo mode_info; + uint32_t blob_id; + struct xorg_list entry; +} drmmode_mode_rec, *drmmode_mode_ptr; + +typedef struct { + uint32_t format; + uint32_t num_modifiers; + uint64_t *modifiers; +} drmmode_format_rec, *drmmode_format_ptr; + typedef struct { drmmode_ptr drmmode; drmModeCrtcPtr mode_crtc; @@ -95,10 +160,15 @@ typedef struct { int dpms_mode; struct dumb_bo *cursor_bo; Bool cursor_up; - Bool set_cursor2_failed; - Bool first_cursor_load_done; uint16_t lut_r[256], lut_g[256], lut_b[256]; + drmmode_prop_info_rec props[DRMMODE_CRTC__COUNT]; + drmmode_prop_info_rec props_plane[DRMMODE_PLANE__COUNT]; + uint32_t plane_id; + drmmode_mode_ptr current_mode; + uint32_t num_formats; + drmmode_format_rec *formats; + drmmode_bo rotate_bo; unsigned rotate_fb_id; @@ -113,12 +183,12 @@ typedef struct { * lies, and we need to give a reliable 64-bit msc for GL, so we * have to track and convert to a userland-tracked 64-bit msc. */ - int32_t vblank_offset; uint32_t msc_prev; uint64_t msc_high; /** @} */ Bool need_modeset; + struct xorg_list mode_list; Bool enable_flipping; Bool flipping_active; @@ -139,12 +209,19 @@ typedef struct { drmModePropertyBlobPtr edid_blob; drmModePropertyBlobPtr tile_blob; int dpms_enum_id; + int dpms; int num_props; drmmode_prop_ptr props; + drmmode_prop_info_rec props_connector[DRMMODE_CONNECTOR__COUNT]; int enc_mask; int enc_clone_mask; + xf86CrtcPtr current_crtc; } drmmode_output_private_rec, *drmmode_output_private_ptr; +typedef struct { + uint32_t lessee_id; +} drmmode_lease_private_rec, *drmmode_lease_private_ptr; + typedef struct _msPixmapPriv { uint32_t fb_id; struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ @@ -158,7 +235,7 @@ typedef struct _msPixmapPriv { /** Source fields for flipping shared pixmaps */ Bool defer_dirty_update; /* if we want to manually update */ PixmapDirtyUpdatePtr dirty; /* cached dirty ent to avoid searching list */ - PixmapPtr slave_src; /* if we exported shared pixmap, dirty tracking src */ + DrawablePtr slave_src; /* if we exported shared pixmap, dirty tracking src */ Bool notify_on_damage; /* if sink has requested damage notification */ } msPixmapPrivRec, *msPixmapPrivPtr; @@ -168,6 +245,10 @@ extern DevPrivateKeyRec msPixmapPrivateKeyRec; #define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) +Bool drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, + uint64_t modifier); +int drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo, + uint32_t *fb_id); int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo); uint32_t drmmode_bo_get_pitch(drmmode_bo *bo); uint32_t drmmode_bo_get_handle(drmmode_bo *bo); @@ -186,6 +267,7 @@ Bool drmmode_SharedPixmapFlip(PixmapPtr frontTarget, xf86CrtcPtr crtc, void drmmode_DisableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode); extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); +extern Bool drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw); extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); @@ -201,13 +283,9 @@ void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, int *depth, int *bpp); void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode); -#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH -#define DRM_CAP_DUMB_PREFERRED_DEPTH 3 -#endif -#ifndef DRM_CAP_DUMB_PREFER_SHADOW -#define DRM_CAP_DUMB_PREFER_SHADOW 4 -#endif -#define MS_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +int drmmode_crtc_flip(xf86CrtcPtr crtc, uint32_t fb_id, uint32_t flags, void *data); + +void drmmode_set_dpms(ScrnInfoPtr scrn, int PowerManagementMode, int flags); #endif diff --git a/xserver/hw/xfree86/drivers/modesetting/modesetting.man b/xserver/hw/xfree86/drivers/modesetting/modesetting.man index a42da1c1f..d530d7c4c 100644 --- a/xserver/hw/xfree86/drivers/modesetting/modesetting.man +++ b/xserver/hw/xfree86/drivers/modesetting/modesetting.man @@ -1,6 +1,6 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH MODESETTING __drivermansuffix__ __vendorversion__ +.TH MODESETTING @drivermansuffix@ @vendorversion@ .SH NAME modesetting \- video driver for framebuffer device .SH SYNOPSIS @@ -14,17 +14,20 @@ modesetting \- video driver for framebuffer device .fi .SH DESCRIPTION .B modesetting -is an __xservername__ driver for KMS devices. This is a non-accelerated -driver, the following framebuffer depths are supported: 8, 15, 16, 24. -All visual types are supported for depth 8, and TrueColor visual is -supported for the other depths. RandR 1.2 is supported. +is an @xservername@ driver for KMS devices. This driver supports +TrueColor visuals at framebuffer depths of 15, 16, 24, and 30. RandR +1.2 is supported for multi-head configurations. Acceleration is available +through glamor for devices supporting at least OpenGL ES 2.0 or OpenGL 2.1. +If glamor is not enabled, a shadow framebuffer is configured based on the +KMS drivers' preference (unless the framebuffer is 24 bits per pixel, in +which case the shadow framebuffer is always used). .SH SUPPORTED HARDWARE The .B modesetting driver supports all hardware where a KMS driver is available. modesetting uses the Linux DRM KMS ioctls and dumb object create/map. .SH CONFIGURATION DETAILS -Please refer to __xconfigfile__(__filemansuffix__) for general configuration +Please refer to @xconfigfile@(@filemansuffix@) for general configuration details. This section only covers configuration details specific to this driver. .PP @@ -51,8 +54,18 @@ The framebuffer device to use. Default: /dev/dri/card0. .BI "Option \*qShadowFB\*q \*q" boolean \*q Enable or disable use of the shadow framebuffer layer. Default: on. .TP +.BI "Option \*qDoubleShadow\*q \*q" boolean \*q +Double-buffer shadow updates. When enabled, the driver will keep two copies of +the shadow framebuffer. When the shadow framebuffer is flushed, the old and new +versions of the shadow are compared, and only tiles that have actually changed +are uploaded to the device. This is an optimization for server-class GPUs with +a remote display function (typically VNC), where remote updates are triggered +by any framebuffer write, so minimizing the amount of data uploaded is crucial. +This defaults to enabled for ASPEED and Matrox G200 devices, and disabled +otherwise. +.TP .BI "Option \*qAccelMethod\*q \*q" string \*q -One of \*qglamor\*q or \*qnone\*q. Default: glamor +One of \*qglamor\*q or \*qnone\*q. Default: glamor. .TP .BI "Option \*qPageFlip\*q \*q" boolean \*q Enable DRI3 page flipping. The default is @@ -69,7 +82,7 @@ Option \*qZaphodHeads\*q \*qLVDS,VGA-0\*q will assign xrandr outputs LVDS and VGA-0 to this instance of the driver. .TP .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), -X(__miscmansuffix__) +@xservername@(@appmansuffix@), @xconfigfile@(@filemansuffix@), Xserver(@appmansuffix@), +X(@miscmansuffix@) .SH AUTHORS Authors include: Dave Airlie diff --git a/xserver/hw/xfree86/drivers/modesetting/pageflip.c b/xserver/hw/xfree86/drivers/modesetting/pageflip.c index 4dc05ec81..9667f132d 100644 --- a/xserver/hw/xfree86/drivers/modesetting/pageflip.c +++ b/xserver/hw/xfree86/drivers/modesetting/pageflip.c @@ -63,7 +63,7 @@ ms_flush_drm_events(ScreenPtr screen) return 1; } -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM /* * Event data for an in progress flip. @@ -159,6 +159,14 @@ ms_pageflip_abort(void *data) ms_pageflip_free(flip); } +static Bool +do_queue_flip_on_crtc(modesettingPtr ms, xf86CrtcPtr crtc, + uint32_t flags, uint32_t seq) +{ + return drmmode_crtc_flip(crtc, ms->drmmode.fb_id, flags, + (void *) (uintptr_t) seq); +} + static Bool queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, struct ms_flipdata *flipdata, @@ -193,8 +201,7 @@ queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, /* take a reference on flipdata for use in flip */ flipdata->flip_count++; - while (drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id, - ms->drmmode.fb_id, flags, (void *) (uintptr_t) seq)) { + while (do_queue_flip_on_crtc(ms, crtc, flags, seq)) { err = errno; /* We may have failed because the event queue was full. Flush it * and retry. If there was nothing to flush, then we failed for @@ -240,6 +247,7 @@ ms_do_pageflip(ScreenPtr screen, new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front); new_front_bo.dumb = NULL; + if (!new_front_bo.gbm) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to get GBM bo for flip to new front.\n"); @@ -270,14 +278,12 @@ ms_do_pageflip(ScreenPtr screen, /* Create a new handle for the back buffer */ flipdata->old_fb_id = ms->drmmode.fb_id; - if (drmModeAddFB(ms->fd, scrn->virtualX, scrn->virtualY, - scrn->depth, scrn->bitsPerPixel, - drmmode_bo_get_pitch(&new_front_bo), - drmmode_bo_get_handle(&new_front_bo), &ms->drmmode.fb_id)) { - goto error_out; - } - drmmode_bo_destroy(&ms->drmmode, &new_front_bo); + new_front_bo.width = new_front->drawable.width; + new_front_bo.height = new_front->drawable.height; + if (drmmode_bo_import(&ms->drmmode, &new_front_bo, + &ms->drmmode.fb_id)) + goto error_out; flags = DRM_MODE_PAGE_FLIP_EVENT; if (async) @@ -305,6 +311,8 @@ ms_do_pageflip(ScreenPtr screen, } } + drmmode_bo_destroy(&ms->drmmode, &new_front_bo); + /* * Do we have more than our local reference, * if so and no errors, then drop our local @@ -330,6 +338,7 @@ error_undo: error_out: xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", strerror(errno)); + drmmode_bo_destroy(&ms->drmmode, &new_front_bo); /* if only the local reference - free the structure, * else drop the local reference and return */ if (flipdata->flip_count == 1) diff --git a/xserver/hw/xfree86/drivers/modesetting/present.c b/xserver/hw/xfree86/drivers/modesetting/present.c index 55b622cbc..dda7cc064 100644 --- a/xserver/hw/xfree86/drivers/modesetting/present.c +++ b/xserver/hw/xfree86/drivers/modesetting/present.c @@ -109,13 +109,7 @@ ms_present_queue_vblank(RRCrtcPtr crtc, uint64_t msc) { xf86CrtcPtr xf86_crtc = crtc->devPrivate; - ScreenPtr screen = crtc->pScreen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; struct ms_present_vblank_event *event; - drmVBlank vbl; - int ret; uint32_t seq; event = calloc(sizeof(struct ms_present_vblank_event), 1); @@ -130,22 +124,9 @@ ms_present_queue_vblank(RRCrtcPtr crtc, return BadAlloc; } - vbl.request.type = - DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(xf86_crtc, msc); - vbl.request.signal = seq; - for (;;) { - ret = drmWaitVBlank(ms->fd, &vbl); - if (!ret) - break; - /* If we hit EBUSY, then try to flush events. If we can't, then - * this is an error. - */ - if (errno != EBUSY || ms_flush_drm_events(screen) < 0) { - ms_drm_abort_seq(scrn, seq); - return BadAlloc; - } - } + if (!ms_queue_vblank(xf86_crtc, MS_QUEUE_ABSOLUTE, msc, NULL, seq)) + return BadAlloc; + DebugPresent(("\t\tmq %lld seq %u msc %llu (hw msc %u)\n", (long long) event_id, seq, (long long) msc, vbl.request.sequence)); @@ -180,7 +161,7 @@ ms_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) static void ms_present_flush(WindowPtr window) { -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); @@ -190,7 +171,7 @@ ms_present_flush(WindowPtr window) #endif } -#ifdef GLAMOR +#ifdef GLAMOR_HAS_GBM /** * Callback for the DRM event queue when a flip has completed on all pipes @@ -233,7 +214,8 @@ static Bool ms_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, - Bool sync_flip) + Bool sync_flip, + PresentFlipReason *reason) { ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -241,6 +223,7 @@ ms_present_check_flip(RRCrtcPtr crtc, xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int num_crtcs_on = 0; int i; + struct gbm_bo *gbm; if (!ms->drmmode.pageflip) return FALSE; @@ -255,10 +238,8 @@ ms_present_check_flip(RRCrtcPtr crtc, drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private; /* Don't do pageflipping if CRTCs are rotated. */ -#ifdef GLAMOR_HAS_GBM if (drmmode_crtc->rotate_bo.gbm) return FALSE; -#endif if (ms_crtc_on(config->crtc[i])) num_crtcs_on++; @@ -269,9 +250,29 @@ ms_present_check_flip(RRCrtcPtr crtc, return FALSE; /* Check stride, can't change that on flip */ - if (pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo)) + if (!ms->atomic_modeset && + pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo)) return FALSE; +#ifdef GBM_BO_WITH_MODIFIERS + /* Check if buffer format/modifier is supported by all active CRTCs */ + gbm = glamor_gbm_bo_from_pixmap(screen, pixmap); + if (gbm) { + uint32_t format; + uint64_t modifier; + + format = gbm_bo_get_format(gbm); + modifier = gbm_bo_get_modifier(gbm); + gbm_bo_destroy(gbm); + + if (!drmmode_is_format_supported(scrn, format, modifier)) { + if (reason) + *reason = PRESENT_FLIP_REASON_BUFFER_FORMAT; + return FALSE; + } + } +#endif + /* Make sure there's a bo we can get to */ /* XXX: actually do this. also...is it sufficient? * if (!glamor_get_pixmap_private(pixmap)) @@ -300,7 +301,7 @@ ms_present_flip(RRCrtcPtr crtc, Bool ret; struct ms_present_vblank_event *event; - if (!ms_present_check_flip(crtc, screen->root, pixmap, sync_flip)) + if (!ms_present_check_flip(crtc, screen->root, pixmap, sync_flip, NULL)) return FALSE; event = calloc(1, sizeof(struct ms_present_vblank_event)); @@ -343,7 +344,7 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id) event->event_id = event_id; event->unflip = TRUE; - if (ms_present_check_flip(NULL, screen->root, pixmap, TRUE) && + if (ms_present_check_flip(NULL, screen->root, pixmap, TRUE, NULL) && ms_do_pageflip(screen, pixmap, event, -1, FALSE, ms_present_flip_handler, ms_present_flip_abort)) { return; @@ -387,8 +388,9 @@ static present_screen_info_rec ms_present_screen_info = { .flush = ms_present_flush, .capabilities = PresentCapabilityNone, -#ifdef GLAMOR - .check_flip = ms_present_check_flip, +#ifdef GLAMOR_HAS_GBM + .check_flip = NULL, + .check_flip2 = ms_present_check_flip, .flip = ms_present_flip, .unflip = ms_present_unflip, #endif diff --git a/xserver/hw/xfree86/drivers/modesetting/sh3224.h b/xserver/hw/xfree86/drivers/modesetting/sh3224.h deleted file mode 100644 index fc301f99d..000000000 --- a/xserver/hw/xfree86/drivers/modesetting/sh3224.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SH3224_H -#define SH3224_H - -void -ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); - -#endif diff --git a/xserver/hw/xfree86/drivers/modesetting/vblank.c b/xserver/hw/xfree86/drivers/modesetting/vblank.c index 8682f4d91..561229f30 100644 --- a/xserver/hw/xfree86/drivers/modesetting/vblank.c +++ b/xserver/hw/xfree86/drivers/modesetting/vblank.c @@ -173,7 +173,7 @@ ms_dri2_crtc_covering_drawable(DrawablePtr pDraw) static Bool ms_get_kernel_ust_msc(xf86CrtcPtr crtc, - uint32_t *msc, uint64_t *ust) + uint64_t *msc, uint64_t *ust) { ScreenPtr screen = crtc->randr_crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -182,6 +182,19 @@ ms_get_kernel_ust_msc(xf86CrtcPtr crtc, drmVBlank vbl; int ret; + if (ms->has_queue_sequence || !ms->tried_queue_sequence) { + uint64_t ns; + ms->tried_queue_sequence = TRUE; + + ret = drmCrtcGetSequence(ms->fd, drmmode_crtc->mode_crtc->crtc_id, + msc, &ns); + if (ret != -1 || (errno != ENOTTY && errno != EINVAL)) { + ms->has_queue_sequence = TRUE; + if (ret == 0) + *ust = ns / 1000; + return ret == 0; + } + } /* Get current count */ vbl.request.type = DRM_VBLANK_RELATIVE | drmmode_crtc->vblank_pipe; vbl.request.sequence = 0; @@ -198,68 +211,127 @@ ms_get_kernel_ust_msc(xf86CrtcPtr crtc, } } +Bool +ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, + uint64_t msc, uint64_t *msc_queued, uint32_t seq) +{ + ScreenPtr screen = crtc->randr_crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmVBlank vbl; + int ret; + + for (;;) { + /* Queue an event at the specified sequence */ + if (ms->has_queue_sequence || !ms->tried_queue_sequence) { + uint32_t drm_flags = 0; + uint64_t kernel_queued; + + ms->tried_queue_sequence = TRUE; + + if (flags & MS_QUEUE_RELATIVE) + drm_flags |= DRM_CRTC_SEQUENCE_RELATIVE; + if (flags & MS_QUEUE_NEXT_ON_MISS) + drm_flags |= DRM_CRTC_SEQUENCE_NEXT_ON_MISS; + + ret = drmCrtcQueueSequence(ms->fd, drmmode_crtc->mode_crtc->crtc_id, + drm_flags, msc, &kernel_queued, seq); + if (ret == 0) { + if (msc_queued) + *msc_queued = ms_kernel_msc_to_crtc_msc(crtc, kernel_queued, TRUE); + ms->has_queue_sequence = TRUE; + return TRUE; + } + + if (ret != -1 || (errno != ENOTTY && errno != EINVAL)) { + ms->has_queue_sequence = TRUE; + goto check; + } + } + vbl.request.type = DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; + if (flags & MS_QUEUE_RELATIVE) + vbl.request.type |= DRM_VBLANK_RELATIVE; + else + vbl.request.type |= DRM_VBLANK_ABSOLUTE; + if (flags & MS_QUEUE_NEXT_ON_MISS) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; + + vbl.request.sequence = msc; + vbl.request.signal = seq; + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret == 0) { + if (msc_queued) + *msc_queued = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence, FALSE); + return TRUE; + } + check: + if (errno != EBUSY) { + ms_drm_abort_seq(scrn, seq); + return FALSE; + } + ms_flush_drm_events(screen); + } +} + /** - * Convert a 32-bit kernel MSC sequence number to a 64-bit local sequence - * number, adding in the vblank_offset and high 32 bits, and dealing - * with 64-bit wrapping + * Convert a 32-bit or 64-bit kernel MSC sequence number to a 64-bit local + * sequence number, adding in the high 32 bits, and dealing with 32-bit + * wrapping if needed. */ uint64_t -ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence) +ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence, Bool is64bit) { drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; - sequence += drmmode_crtc->vblank_offset; - if ((int32_t) (sequence - drmmode_crtc->msc_prev) < -0x40000000) - drmmode_crtc->msc_high += 0x100000000L; + if (!is64bit) { + /* sequence is provided as a 32 bit value from one of the 32 bit apis, + * e.g., drmWaitVBlank(), classic vblank events, or pageflip events. + * + * Track and handle 32-Bit wrapping, somewhat robust against occasional + * out-of-order not always monotonically increasing sequence values. + */ + if ((int64_t) sequence < ((int64_t) drmmode_crtc->msc_prev - 0x40000000)) + drmmode_crtc->msc_high += 0x100000000L; + + if ((int64_t) sequence > ((int64_t) drmmode_crtc->msc_prev + 0x40000000)) + drmmode_crtc->msc_high -= 0x100000000L; + + drmmode_crtc->msc_prev = sequence; + + return drmmode_crtc->msc_high + sequence; + } + + /* True 64-Bit sequence from Linux 4.15+ 64-Bit drmCrtcGetSequence / + * drmCrtcQueueSequence apis and events. Pass through sequence unmodified, + * but update the 32-bit tracking variables with reliable ground truth. + * + * With 64-Bit api in use, the only !is64bit input is from pageflip events, + * and any pageflip event is usually preceeded by some is64bit input from + * swap scheduling, so this should provide reliable mapping for pageflip + * events based on true 64-bit input as baseline as well. + */ drmmode_crtc->msc_prev = sequence; - return drmmode_crtc->msc_high + sequence; + drmmode_crtc->msc_high = sequence & 0xffffffff00000000; + + return sequence; } int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc) { - uint32_t kernel_msc; + ScreenPtr screen = crtc->randr_crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + uint64_t kernel_msc; if (!ms_get_kernel_ust_msc(crtc, &kernel_msc, ust)) return BadMatch; - *msc = ms_kernel_msc_to_crtc_msc(crtc, kernel_msc); + *msc = ms_kernel_msc_to_crtc_msc(crtc, kernel_msc, ms->has_queue_sequence); return Success; } -#define MAX_VBLANK_OFFSET 1000 - -/** - * Convert a 64-bit adjusted MSC value into a 32-bit kernel sequence number, - * removing the high 32 bits and subtracting out the vblank_offset term. - * - * This also updates the vblank_offset when it notices that the value should - * change. - */ -uint32_t -ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect) -{ - drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; - uint64_t msc; - uint64_t ust; - int64_t diff; - - if (ms_get_crtc_ust_msc(crtc, &ust, &msc) == Success) { - diff = expect - msc; - - /* We're way off here, assume that the kernel has lost its mind - * and smack the vblank back to something sensible - */ - if (diff < -MAX_VBLANK_OFFSET || MAX_VBLANK_OFFSET < diff) { - drmmode_crtc->vblank_offset += (int32_t) diff; - if (drmmode_crtc->vblank_offset > -MAX_VBLANK_OFFSET && - drmmode_crtc->vblank_offset < MAX_VBLANK_OFFSET) - drmmode_crtc->vblank_offset = 0; - } - } - return (uint32_t) (expect - drmmode_crtc->vblank_offset); -} - /** * Check for pending DRM events and process them. */ @@ -375,25 +447,40 @@ ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), * drm event queue and calls the handler for it. */ static void -ms_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, - void *user_ptr) +ms_drm_sequence_handler(int fd, uint64_t frame, uint64_t ns, Bool is64bit, uint64_t user_data) { struct ms_drm_queue *q, *tmp; - uint32_t user_data = (uint32_t) (intptr_t) user_ptr; + uint32_t seq = (uint32_t) user_data; xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { - if (q->seq == user_data) { + if (q->seq == seq) { uint64_t msc; - msc = ms_kernel_msc_to_crtc_msc(q->crtc, frame); + msc = ms_kernel_msc_to_crtc_msc(q->crtc, frame, is64bit); xorg_list_del(&q->list); - q->handler(msc, (uint64_t) sec * 1000000 + usec, q->data); + q->handler(msc, ns / 1000, q->data); free(q); break; } } } +static void +ms_drm_sequence_handler_64bit(int fd, uint64_t frame, uint64_t ns, uint64_t user_data) +{ + /* frame is true 64 bit wrapped into 64 bit */ + ms_drm_sequence_handler(fd, frame, ns, TRUE, user_data); +} + +static void +ms_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, + void *user_ptr) +{ + /* frame is 32 bit wrapped into 64 bit */ + ms_drm_sequence_handler(fd, frame, ((uint64_t) sec * 1000000 + usec) * 1000, + FALSE, (uint32_t) (uintptr_t) user_ptr); +} + Bool ms_vblank_screen_init(ScreenPtr screen) { @@ -402,9 +489,10 @@ ms_vblank_screen_init(ScreenPtr screen) modesettingEntPtr ms_ent = ms_ent_priv(scrn); xorg_list_init(&ms_drm_queue); - ms->event_context.version = 2; + ms->event_context.version = 4; ms->event_context.vblank_handler = ms_drm_handler; ms->event_context.page_flip_handler = ms_drm_handler; + ms->event_context.sequence_handler = ms_drm_sequence_handler_64bit; /* We need to re-register the DRM fd for the synchronisation * feedback on every server generation, so perform the diff --git a/xserver/hw/xfree86/exa/Makefile.in b/xserver/hw/xfree86/exa/Makefile.in index ed5242185..b3ce5f0ad 100644 --- a/xserver/hw/xfree86/exa/Makefile.in +++ b/xserver/hw/xfree86/exa/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -377,6 +377,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -395,15 +396,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -411,6 +415,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -482,8 +488,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/exa/examodule.c b/xserver/hw/xfree86/exa/examodule.c index 76f780ab6..0bbd93e34 100644 --- a/xserver/hw/xfree86/exa/examodule.c +++ b/xserver/hw/xfree86/exa/examodule.c @@ -25,7 +25,7 @@ * */ -#ifdef HAVE_CONFIG_H +#ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/exa/man/Makefile.in b/xserver/hw/xfree86/exa/man/Makefile.in index b1b288a25..de4f13fc7 100644 --- a/xserver/hw/xfree86/exa/man/Makefile.in +++ b/xserver/hw/xfree86/exa/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/exa/man/exa.man b/xserver/hw/xfree86/exa/man/exa.man index 42a8de31d..c051b998b 100644 --- a/xserver/hw/xfree86/exa/man/exa.man +++ b/xserver/hw/xfree86/exa/man/exa.man @@ -1,6 +1,6 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH EXA __drivermansuffix__ __vendorversion__ +.TH EXA @drivermansuffix@ @vendorversion@ .SH NAME exa \- new 2D acceleration architecture for X.Org .SH DESCRIPTION @@ -36,7 +36,7 @@ default is intended to be the best performing one for general use, though others may help with specific use cases. Available options include \*qalways\*q, \*qgreedy\*q, and \*qsmart\*q. Default: always. .SH "SEE ALSO" -.BR Xorg (__appmansuffix__), -.BR xorg.conf(__filemansuffix__). +.BR Xorg (@appmansuffix@), +.BR xorg.conf(@filemansuffix@). .SH AUTHORS Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.in b/xserver/hw/xfree86/fbdevhw/Makefile.in index 22b75922a..8007e59dc 100644 --- a/xserver/hw/xfree86/fbdevhw/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -380,6 +380,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -398,15 +399,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -414,6 +418,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -485,8 +491,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhw.c b/xserver/hw/xfree86/fbdevhw/fbdevhw.c index b50ae5ed2..95089515c 100644 --- a/xserver/hw/xfree86/fbdevhw/fbdevhw.c +++ b/xserver/hw/xfree86/fbdevhw/fbdevhw.c @@ -120,7 +120,7 @@ fbdevHWGetFD(ScrnInfoPtr pScrn) /* -------------------------------------------------------------------- */ /* some helpers for printing debug informations */ -#if DEBUG +#ifdef DEBUG static void print_fbdev_mode(const char *txt, struct fb_var_screeninfo *var) { @@ -329,6 +329,22 @@ fbdev_open(int scrnIndex, const char *dev, char **namep) return -1; } + /* only touch non-PCI devices on this path */ + { + char buf[PATH_MAX]; + char *sysfs_path = NULL; + char *node = strrchr(dev, '/') + 1; + + if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 || + readlink(sysfs_path, buf, sizeof(buf)) < 0 || + strstr(buf, "devices/pci")) { + free(sysfs_path); + close(fd); + return -1; + } + free(sysfs_path); + } + if (namep) { if (-1 == ioctl(fd, FBIOGET_FSCREENINFO, (void *) (&fix))) { *namep = NULL; @@ -466,7 +482,7 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool check) xfree2fbdev_fblayout(pScrn, &req_var); xfree2fbdev_timing(mode, &req_var); -#if DEBUG +#ifdef DEBUG print_xfree_mode("init", mode); print_fbdev_mode("init", &req_var); #endif @@ -486,7 +502,7 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool check) if (!check) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUT_VSCREENINFO succeeded but modified " "mode\n"); -#if DEBUG +#ifdef DEBUG print_fbdev_mode("returned", &set_var); #endif return FALSE; diff --git a/xserver/hw/xfree86/fbdevhw/man/Makefile.in b/xserver/hw/xfree86/fbdevhw/man/Makefile.in index 7613ec3a6..ef00c72ff 100644 --- a/xserver/hw/xfree86/fbdevhw/man/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man b/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man index fa46df08f..f9e8aaf41 100644 --- a/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man +++ b/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man @@ -1,5 +1,5 @@ .\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $ -.TH FBDEVHW __drivermansuffix__ __vendorversion__ +.TH FBDEVHW @drivermansuffix@ @vendorversion@ .SH NAME fbdevhw \- os-specific submodule for framebuffer device access .SH DESCRIPTION @@ -10,13 +10,13 @@ A .B fbdevhw module is currently available for linux framebuffer devices. .PP -fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the +fbdev(@drivermansuffix@) is a non-accelerated driver which runs on top of the fbdevhw module. fbdevhw can be used by other drivers too, this is usually activated with `Option "UseFBDev"' in the device section. .SH "SEE ALSO" -Xorg(__appmansuffix__), xorg.conf(__filemansuffix__), -xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), -fbdev(__drivermansuffix__) +Xorg(@appmansuffix@), xorg.conf(@filemansuffix@), +xorgconfig(@appmansuffix@), Xserver(@appmansuffix@), X(@miscmansuffix@), +fbdev(@drivermansuffix@) .SH AUTHORS Authors include: Gerd Knorr, based on the XF68_FBDev Server code (Martin Schaller, Geert Uytterhoeven). diff --git a/xserver/hw/xfree86/glamor_egl/Makefile.in b/xserver/hw/xfree86/glamor_egl/Makefile.in index 2030fbd06..60e042a11 100644 --- a/xserver/hw/xfree86/glamor_egl/Makefile.in +++ b/xserver/hw/xfree86/glamor_egl/Makefile.in @@ -89,7 +89,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -361,6 +361,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -379,15 +380,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -395,6 +399,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -466,8 +472,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c b/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c index 8535fa0c9..5f8bb8f15 100644 --- a/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c +++ b/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c @@ -44,10 +44,10 @@ #include #include "fourcc.h" -#define NUM_FORMATS 3 +#define NUM_FORMATS 4 static XF86VideoFormatRec Formats[NUM_FORMATS] = { - {15, TrueColor}, {16, TrueColor}, {24, TrueColor} + {15, TrueColor}, {16, TrueColor}, {24, TrueColor}, {30, TrueColor} }; static void diff --git a/xserver/hw/xfree86/i2c/Makefile.in b/xserver/hw/xfree86/i2c/Makefile.in index fe12e2fb2..ac8d770d8 100644 --- a/xserver/hw/xfree86/i2c/Makefile.in +++ b/xserver/hw/xfree86/i2c/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -337,6 +337,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -355,15 +356,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -371,6 +375,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -442,8 +448,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/int10/Makefile.in b/xserver/hw/xfree86/int10/Makefile.in index a55c2743c..9c16c6e70 100644 --- a/xserver/hw/xfree86/int10/Makefile.in +++ b/xserver/hw/xfree86/int10/Makefile.in @@ -70,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -356,6 +356,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -374,15 +375,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -390,6 +394,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -461,8 +467,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/loader/Makefile.am b/xserver/hw/xfree86/loader/Makefile.am index 9218cab83..3529a7acd 100644 --- a/xserver/hw/xfree86/loader/Makefile.am +++ b/xserver/hw/xfree86/loader/Makefile.am @@ -14,7 +14,6 @@ EXTRA_DIST = \ libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ - loadmod.c \ - os.c + loadmod.c libloader_la_LIBADD = $(DLOPEN_LIBS) diff --git a/xserver/hw/xfree86/loader/Makefile.in b/xserver/hw/xfree86/loader/Makefile.in index 75e358893..f572bb976 100644 --- a/xserver/hw/xfree86/loader/Makefile.in +++ b/xserver/hw/xfree86/loader/Makefile.in @@ -68,14 +68,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libloader_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libloader_la_OBJECTS = loader.lo loadmod.lo os.lo +am_libloader_la_OBJECTS = loader.lo loadmod.lo libloader_la_OBJECTS = $(am_libloader_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -308,6 +308,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -326,15 +327,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -342,6 +346,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -413,8 +419,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -494,8 +498,7 @@ EXTRA_DIST = \ libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ - loadmod.c \ - os.c + loadmod.c libloader_la_LIBADD = $(DLOPEN_LIBS) all: all-am @@ -554,7 +557,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadmod.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/hw/xfree86/loader/loader.c b/xserver/hw/xfree86/loader/loader.c index c8d7540b5..503c47e3a 100644 --- a/xserver/hw/xfree86/loader/loader.c +++ b/xserver/hw/xfree86/loader/loader.c @@ -50,21 +50,10 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include #include -#include - #include "os.h" #include "loader.h" #include "loaderProcs.h" -#include "xf86.h" -#include "xf86Priv.h" #ifdef HAVE_DLFCN_H @@ -75,32 +64,36 @@ #error i have no dynamic linker and i must scream #endif +#ifndef XORG_NO_SDKSYMS extern void *xorg_symbols[]; +#endif void LoaderInit(void) { - xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols); - xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n"); - xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC, - GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion), - GET_ABI_MINOR(LoaderVersionInfo.ansicVersion)); - xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV, - GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion), - GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion)); - xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT, - GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion), - GET_ABI_MINOR(LoaderVersionInfo.xinputVersion)); - xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION, - GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), - GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); +#ifndef XORG_NO_SDKSYMS + LogMessageVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols); +#endif + LogMessageVerb(X_INFO, 2, "Module ABI versions:\n"); + LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC, + GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion), + GET_ABI_MINOR(LoaderVersionInfo.ansicVersion)); + LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV, + GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion), + GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion)); + LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT, + GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion), + GET_ABI_MINOR(LoaderVersionInfo.xinputVersion)); + LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION, + GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), + GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); } /* Public Interface to the loader. */ void * -LoaderOpen(const char *module, int *errmaj, int *errmin) +LoaderOpen(const char *module, int *errmaj) { void *ret; @@ -108,14 +101,12 @@ LoaderOpen(const char *module, int *errmaj, int *errmin) ErrorF("LoaderOpen(%s)\n", module); #endif - xf86Msg(X_INFO, "Loading %s\n", module); + LogMessage(X_INFO, "Loading %s\n", module); if (!(ret = dlopen(module, RTLD_LAZY | RTLD_GLOBAL))) { - xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror()); + LogMessage(X_ERROR, "Failed to load %s: %s\n", module, dlerror()); if (errmaj) *errmaj = LDR_NOLOAD; - if (errmin) - *errmin = LDR_NOLOAD; return NULL; } diff --git a/xserver/hw/xfree86/loader/loader.h b/xserver/hw/xfree86/loader/loader.h index c89c6410a..5a2fe6c60 100644 --- a/xserver/hw/xfree86/loader/loader.h +++ b/xserver/hw/xfree86/loader/loader.h @@ -71,7 +71,7 @@ extern const ModuleVersions LoaderVersionInfo; extern unsigned long LoaderOptions; /* Internal Functions */ -void *LoaderOpen(const char *, int *, int *); +void *LoaderOpen(const char *, int *); void *LoaderSymbolFromModule(void *, const char *); #endif /* _LOADER_H */ diff --git a/xserver/hw/xfree86/loader/loaderProcs.h b/xserver/hw/xfree86/loader/loaderProcs.h index cfc4d8069..8b16cb7ea 100644 --- a/xserver/hw/xfree86/loader/loaderProcs.h +++ b/xserver/hw/xfree86/loader/loaderProcs.h @@ -59,8 +59,6 @@ typedef struct module_desc { struct module_desc *child; struct module_desc *sib; struct module_desc *parent; - char *name; - char *path; void *handle; ModuleSetupProc SetupProc; ModuleTearDownProc TearDownProc; @@ -72,11 +70,7 @@ typedef struct module_desc { void LoaderInit(void); -ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *, - int *); -ModuleDescPtr LoadModule(const char *, const char *, const char **, - const char **, void *, const XF86ModReqInfo *, - int *, int *); +ModuleDescPtr LoadModule(const char *, void *, const XF86ModReqInfo *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); void UnloadDriver(ModuleDescPtr); void LoaderSetPath(const char *path); @@ -87,6 +81,8 @@ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod); void LoaderResetOptions(void); void LoaderSetOptions(unsigned long); +const char **LoaderListDir(const char *, const char **); + /* Options for LoaderSetOptions */ #define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001 diff --git a/xserver/hw/xfree86/loader/loadmod.c b/xserver/hw/xfree86/loader/loadmod.c index 8bf6836d6..a6356bd8f 100644 --- a/xserver/hw/xfree86/loader/loadmod.c +++ b/xserver/hw/xfree86/loader/loadmod.c @@ -50,19 +50,13 @@ #include #endif +#include "dix.h" #include "os.h" -/* For stat() and related stuff */ -#define NO_OSLIB_PROTOTYPES -#include "xf86_OSlib.h" -#define LOADERDECLARATIONS #include "loaderProcs.h" -#include "misc.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Xinput.h" +#include "xf86Module.h" #include "loader.h" -#include "xf86Optrec.h" +#include #include #include #include @@ -74,7 +68,7 @@ typedef struct _pattern { } PatternRec, *PatternPtr; /* Prototypes for static functions */ -static char *FindModule(const char *, const char *, const char **, PatternPtr); +static char *FindModule(const char *, const char *, PatternPtr); static Bool CheckVersion(const char *, XF86ModuleVersionInfo *, const XF86ModReqInfo *); static char *LoaderGetCanonicalName(const char *, PatternPtr); @@ -127,9 +121,6 @@ InitPathList(const char *path) int addslash; int n = 0; - if (!path) - return defaultPathList; - fullpath = strdup(path); if (!fullpath) return NULL; @@ -171,19 +162,13 @@ InitPathList(const char *path) return list; } -static void -FreePathList(char **pathlist) -{ - if (pathlist && pathlist != defaultPathList) - FreeStringList(pathlist); -} - void LoaderSetPath(const char *path) { if (!path) return; + FreeStringList(defaultPathList); defaultPathList = InitPathList(path); } @@ -193,7 +178,6 @@ static const char *stdSubdirs[] = { "input/", "drivers/", "extensions/", - "internal/", NULL }; @@ -242,7 +226,7 @@ InitPatterns(const char **patternlist) if (patternlist) { for (i = 0, s = patternlist; *s; i++, s++) if (*s == DEFAULT_LIST) - i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1; + i += ARRAY_SIZE(stdPatterns) - 1 - 1; patterns = xallocarray(i + 1, sizeof(PatternRec)); if (!patterns) { return NULL; @@ -278,111 +262,6 @@ FreePatterns(PatternPtr patterns) free(patterns); } -static const char ** -InitSubdirs(const char **subdirlist) -{ - int i; - const char **tmp_subdirlist = NULL; - char **subdirs = NULL; - const char **s, **stmp = NULL; - const char *osname; - const char *slash; - int oslen = 0, len; - Bool indefault; - - if (subdirlist == NULL) { - subdirlist = tmp_subdirlist = malloc(2 * sizeof(char *)); - if (subdirlist == NULL) - return NULL; - subdirlist[0] = DEFAULT_LIST; - subdirlist[1] = NULL; - } - - LoaderGetOS(&osname, NULL, NULL, NULL); - oslen = strlen(osname); - - { - /* Count number of entries and check for invalid paths */ - for (i = 0, s = subdirlist; *s; i++, s++) { - if (*s == DEFAULT_LIST) { - i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1; - } - else { - /* - * Path validity check. Don't allow absolute paths, or - * paths containing "..". To catch absolute paths on - * platforms that use driver letters, don't allow the ':' - * character to appear at all. - */ - if (**s == '/' || **s == '\\' || strchr(*s, ':') || - strstr(*s, "..")) { - xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s); - free(tmp_subdirlist); - return NULL; - } - } - } - subdirs = xallocarray(i * 2 + 1, sizeof(char *)); - if (!subdirs) { - free(tmp_subdirlist); - return NULL; - } - i = 0; - s = subdirlist; - indefault = FALSE; - while (*s) { - if (*s == DEFAULT_LIST) { - /* Divert to the default list */ - indefault = TRUE; - stmp = ++s; - s = stdSubdirs; - } - len = strlen(*s); - if (**s && (*s)[len - 1] != '/') { - slash = "/"; - len++; - } - else - slash = ""; - len += oslen + 2; - if (!(subdirs[i] = malloc(len))) { - while (--i >= 0) - free(subdirs[i]); - free(subdirs); - free(tmp_subdirlist); - return NULL; - } - /* tack on the OS name */ - sprintf(subdirs[i], "%s%s%s/", *s, slash, osname); - i++; - /* path as given */ - subdirs[i] = strdup(*s); - i++; - s++; - if (indefault && !s) { - /* revert back to the main list */ - indefault = FALSE; - s = stmp; - } - } - subdirs[i] = NULL; - } - free(tmp_subdirlist); - return (const char **) subdirs; -} - -static void -FreeSubdirs(const char **subdirs) -{ - const char **s; - - if (subdirs) { - for (s = subdirs; *s; s++) - free((char *) *s); - free(subdirs); - } -} - static char * FindModuleInSubdir(const char *dirpath, const char *module) { @@ -447,43 +326,30 @@ FindModuleInSubdir(const char *dirpath, const char *module) } static char * -FindModule(const char *module, const char *dirname, const char **subdirlist, - PatternPtr patterns) +FindModule(const char *module, const char *dirname, PatternPtr patterns) { char buf[PATH_MAX + 1]; char *name = NULL; - const char **subdirs = NULL; const char **s; if (strlen(dirname) > PATH_MAX) return NULL; - subdirs = InitSubdirs(subdirlist); - if (!subdirs) - return NULL; - - for (s = subdirs; *s; s++) { - if ((strlen(dirname) + strlen(*s)) > PATH_MAX) - continue; - strcpy(buf, dirname); - strcat(buf, *s); + for (s = stdSubdirs; *s; s++) { + snprintf(buf, PATH_MAX, "%s%s", dirname, *s); if ((name = FindModuleInSubdir(buf, module))) break; } - FreeSubdirs(subdirs); - return name; } const char ** -LoaderListDirs(const char **subdirlist, const char **patternlist) +LoaderListDir(const char *subdir, const char **patternlist) { char buf[PATH_MAX + 1]; char **pathlist; char **elem; - const char **subdirs; - const char **s; PatternPtr patterns = NULL; PatternPtr p; DIR *d; @@ -497,64 +363,54 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) char **ret = NULL; int n = 0; - if (!(pathlist = InitPathList(NULL))) + if (!(pathlist = defaultPathList)) return NULL; - if (!(subdirs = InitSubdirs(subdirlist))) - goto bail; if (!(patterns = InitPatterns(patternlist))) goto bail; for (elem = pathlist; *elem; elem++) { - for (s = subdirs; *s; s++) { - if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX) - continue; - strcpy(buf, *elem); - strcat(buf, *s); - fp = buf + dirlen; - if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && - (d = opendir(buf))) { - if (buf[dirlen - 1] != '/') { - buf[dirlen++] = '/'; - fp++; - } - while ((dp = readdir(d))) { - if (dirlen + strlen(dp->d_name) > PATH_MAX) - continue; - strcpy(fp, dp->d_name); - if (!(stat(buf, &stat_buf) == 0 && - S_ISREG(stat_buf.st_mode))) - continue; - for (p = patterns; p->pattern; p++) { - if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && - match[1].rm_so != -1) { - len = match[1].rm_eo - match[1].rm_so; - save = listing; - listing = reallocarray(listing, n + 2, - sizeof(char *)); - if (!listing) { - if (save) { - save[n] = NULL; - FreeStringList(save); - } - closedir(d); - goto bail; + dirlen = snprintf(buf, PATH_MAX, "%s/%s", *elem, subdir); + fp = buf + dirlen; + if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && + (d = opendir(buf))) { + if (buf[dirlen - 1] != '/') { + buf[dirlen++] = '/'; + fp++; + } + while ((dp = readdir(d))) { + if (dirlen + strlen(dp->d_name) > PATH_MAX) + continue; + strcpy(fp, dp->d_name); + if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))) + continue; + for (p = patterns; p->pattern; p++) { + if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && + match[1].rm_so != -1) { + len = match[1].rm_eo - match[1].rm_so; + save = listing; + listing = reallocarray(listing, n + 2, sizeof(char *)); + if (!listing) { + if (save) { + save[n] = NULL; + FreeStringList(save); } - listing[n] = malloc(len + 1); - if (!listing[n]) { - FreeStringList(listing); - closedir(d); - goto bail; - } - strncpy(listing[n], dp->d_name + match[1].rm_so, - len); - listing[n][len] = '\0'; - n++; - break; + closedir(d); + goto bail; } + listing[n] = malloc(len + 1); + if (!listing[n]) { + FreeStringList(listing); + closedir(d); + goto bail; + } + strncpy(listing[n], dp->d_name + match[1].rm_so, len); + listing[n][len] = '\0'; + n++; + break; } } - closedir(d); } + closedir(d); } } if (listing) @@ -563,17 +419,9 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) bail: FreePatterns(patterns); - FreeSubdirs(subdirs); - FreePathList(pathlist); return (const char **) ret; } -void -LoaderFreeDirList(char **list) -{ - FreeStringList(list); -} - static Bool CheckVersion(const char *module, XF86ModuleVersionInfo * data, const XF86ModReqInfo * req) @@ -582,22 +430,22 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, long ver = data->xf86version; MessageType errtype; - xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n", - data->modname ? data->modname : "UNKNOWN!", - data->vendor ? data->vendor : "UNKNOWN!"); + LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n", + data->modname ? data->modname : "UNKNOWN!", + data->vendor ? data->vendor : "UNKNOWN!"); vercode[0] = ver / 10000000; vercode[1] = (ver / 100000) % 100; vercode[2] = (ver / 1000) % 100; vercode[3] = ver % 1000; - xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]); + LogWrite(1, "\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]); if (vercode[3] != 0) - xf86ErrorF(".%d", vercode[3]); - xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, - data->minorversion, data->patchlevel); + LogWrite(1, ".%d", vercode[3]); + LogWrite(1, ", module version = %d.%d.%d\n", data->majorversion, + data->minorversion, data->patchlevel); if (data->moduleclass) - xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass); + LogWrite(2, "\tModule class: %s\n", data->moduleclass); ver = -1; if (data->abiclass) { @@ -615,8 +463,8 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, abimaj = GET_ABI_MAJOR(data->abiversion); abimin = GET_ABI_MINOR(data->abiversion); - xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n", - data->abiclass, abimaj, abimin); + LogWrite(2, "\tABI class: %s, version %d.%d\n", + data->abiclass, abimaj, abimin); if (ver != -1) { vermaj = GET_ABI_MAJOR(ver); vermin = GET_ABI_MINOR(ver); @@ -625,10 +473,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, errtype = X_WARNING; else errtype = X_ERROR; - xf86MsgVerb(errtype, 0, - "%s: module ABI major version (%d) doesn't" - " match the server's version (%d)\n", - module, abimaj, vermaj); + LogMessageVerb(errtype, 0, "%s: module ABI major version (%d) " + "doesn't match the server's version (%d)\n", + module, abimaj, vermaj); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -637,10 +484,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, errtype = X_WARNING; else errtype = X_ERROR; - xf86MsgVerb(errtype, 0, - "%s: module ABI minor version (%d) is " - "newer than the server's version " - "(%d)\n", module, abimin, vermin); + LogMessageVerb(errtype, 0, "%s: module ABI minor version (%d) " + "is newer than the server's version (%d)\n", + module, abimin, vermin); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -649,54 +495,45 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, /* Check against requirements that the caller has specified */ if (req) { - if (req->majorversion != MAJOR_UNSPEC) { - if (data->majorversion != req->majorversion) { - xf86MsgVerb(X_WARNING, 2, "%s: module major version (%d) " - "doesn't match required major version (%d)\n", - module, data->majorversion, req->majorversion); - return FALSE; - } - else if (req->minorversion != MINOR_UNSPEC) { - if (data->minorversion < req->minorversion) { - xf86MsgVerb(X_WARNING, 2, "%s: module minor version (%d) " - "is less than the required minor version (%d)\n", - module, data->minorversion, req->minorversion); - return FALSE; - } - else if (data->minorversion == req->minorversion && - req->patchlevel != PATCH_UNSPEC) { - if (data->patchlevel < req->patchlevel) { - xf86MsgVerb(X_WARNING, 2, "%s: module patch level (%d) " - "is less than the required patch level (%d)\n", - module, data->patchlevel, req->patchlevel); - return FALSE; - } - } - } + if (data->majorversion != req->majorversion) { + LogMessageVerb(X_WARNING, 2, "%s: module major version (%d) " + "doesn't match required major version (%d)\n", + module, data->majorversion, req->majorversion); + return FALSE; + } + else if (data->minorversion < req->minorversion) { + LogMessageVerb(X_WARNING, 2, "%s: module minor version (%d) is " + "less than the required minor version (%d)\n", + module, data->minorversion, req->minorversion); + return FALSE; + } + else if (data->minorversion == req->minorversion && + data->patchlevel < req->patchlevel) { + LogMessageVerb(X_WARNING, 2, "%s: module patch level (%d) " + "is less than the required patch level " + "(%d)\n", module, data->patchlevel, req->patchlevel); + return FALSE; } if (req->moduleclass) { if (!data->moduleclass || strcmp(req->moduleclass, data->moduleclass)) { - xf86MsgVerb(X_WARNING, 2, "%s: Module class (%s) doesn't match " - "the required class (%s)\n", - module, - data->moduleclass ? data->moduleclass : "", - req->moduleclass); + LogMessageVerb(X_WARNING, 2, "%s: Module class (%s) doesn't " + "match the required class (%s)\n", module, + data->moduleclass ? data->moduleclass : "", + req->moduleclass); return FALSE; } } else if (req->abiclass != ABI_CLASS_NONE) { if (!data->abiclass || strcmp(req->abiclass, data->abiclass)) { - xf86MsgVerb(X_WARNING, 2, "%s: ABI class (%s) doesn't match the " - "required ABI class (%s)\n", - module, - data->abiclass ? data->abiclass : "", - req->abiclass); + LogMessageVerb(X_WARNING, 2, "%s: ABI class (%s) doesn't match" + " the required ABI class (%s)\n", module, + data->abiclass ? data->abiclass : "", + req->abiclass); return FALSE; } } - if ((req->abiclass != ABI_CLASS_NONE) && - req->abiversion != ABI_VERS_UNSPEC) { + if (req->abiclass != ABI_CLASS_NONE) { int reqmaj, reqmin, maj, min; reqmaj = GET_ABI_MAJOR(req->abiversion); @@ -704,16 +541,16 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, maj = GET_ABI_MAJOR(data->abiversion); min = GET_ABI_MINOR(data->abiversion); if (maj != reqmaj) { - xf86MsgVerb(X_WARNING, 2, "%s: ABI major version (%d) doesn't " - "match the required ABI major version (%d)\n", - module, maj, reqmaj); + LogMessageVerb(X_WARNING, 2, "%s: ABI major version (%d) " + "doesn't match the required ABI major version " + "(%d)\n", module, maj, reqmaj); return FALSE; } /* XXX Maybe this should be the other way around? */ if (min > reqmin) { - xf86MsgVerb(X_WARNING, 2, "%s: module ABI minor version (%d) " - "is newer than that available (%d)\n", - module, min, reqmin); + LogMessageVerb(X_WARNING, 2, "%s: module ABI minor version " + "(%d) is newer than that available (%d)\n", + module, min, reqmin); return FALSE; } } @@ -737,12 +574,11 @@ LoadSubModule(void *_parent, const char *module, ModuleDescPtr submod; ModuleDescPtr parent = (ModuleDescPtr) _parent; - xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module); + LogMessageVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module); if (PathIsAbsolute(module)) { - xf86Msg(X_ERROR, - "LoadSubModule: Absolute module path not permitted: \"%s\"\n", - module); + LogMessage(X_ERROR, "LoadSubModule: " + "Absolute module path not permitted: \"%s\"\n", module); if (errmaj) *errmaj = LDR_BADUSAGE; if (errmin) @@ -750,8 +586,7 @@ LoadSubModule(void *_parent, const char *module, return NULL; } - submod = LoadModule(module, NULL, subdirlist, patternlist, options, - modreq, errmaj, errmin); + submod = LoadModule(module, options, modreq, errmaj); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); submod->parent = parent; @@ -759,17 +594,6 @@ LoadSubModule(void *_parent, const char *module, return submod; } -static ModuleDescPtr -NewModuleDesc(const char *name) -{ - ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc)); - - if (mdp) - mdp->name = xstrdup(name); - - return mdp; -} - ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) { @@ -778,7 +602,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) if (!mod) return NULL; - ret = NewModuleDesc(mod->name); + ret = calloc(1, sizeof(ModuleDesc)); if (ret == NULL) return NULL; @@ -791,7 +615,6 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) ret->sib = DuplicateModule(mod->sib, parent); ret->parent = parent; ret->VersionInfo = mod->VersionInfo; - ret->path = strdup(mod->path); return ret; } @@ -805,10 +628,10 @@ static const char *compiled_in_modules[] = { "extmod", "dri", "dri2", -#if DRI3 +#ifdef DRI3 "dri3", #endif -#if PRESENT +#ifdef PRESENT "present", #endif NULL @@ -820,16 +643,6 @@ static const char *compiled_in_modules[] = { * module The module name. Normally this is not a filename but the * module's "canonical name. A full pathname is, however, * also accepted. - * path A comma separated list of module directories. - * subdirlist A NULL terminated list of subdirectories to search. When - * NULL, the default "stdSubdirs" list is used. The default - * list is also substituted for entries with value DEFAULT_LIST. - * patternlist A NULL terminated list of regular expressions used to find - * module filenames. Each regex should contain exactly one - * subexpression that corresponds to the canonical module name. - * When NULL, the default "stdPatterns" list is used. The - * default list is also substituted for entries with value - * DEFAULT_LIST. * options A NULL terminated list of Options that are passed to the * module's SetupProc function. * modreq An optional XF86ModReqInfo* containing @@ -848,13 +661,11 @@ static const char *compiled_in_modules[] = { * string * "don't care" values are ~0 for numbers, and NULL for strings * errmaj Major error return. - * errmin Minor error return. * */ ModuleDescPtr -LoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, void *options, - const XF86ModReqInfo * modreq, int *errmaj, int *errmin) +LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq, + int *errmaj) { XF86ModuleData *initdata = NULL; char **pathlist = NULL; @@ -868,26 +679,26 @@ LoadModule(const char *module, const char *path, const char **subdirlist, char *m = NULL; const char **cim; - xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module); + LogMessageVerb(X_INFO, 3, "LoadModule: \"%s\"", module); - patterns = InitPatterns(patternlist); + patterns = InitPatterns(NULL); name = LoaderGetCanonicalName(module, patterns); noncanonical = (name && strcmp(module, name) != 0); if (noncanonical) { - xf86ErrorFVerb(3, " (%s)\n", name); - xf86MsgVerb(X_WARNING, 1, - "LoadModule: given non-canonical module name \"%s\"\n", - module); + LogWrite(3, " (%s)\n", name); + LogMessageVerb(X_WARNING, 1, + "LoadModule: given non-canonical module name \"%s\"\n", + module); m = name; } else { - xf86ErrorFVerb(3, "\n"); + LogWrite(3, "\n"); m = (char *) module; } for (cim = compiled_in_modules; *cim; cim++) if (!strcmp(m, *cim)) { - xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m); + LogMessageVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m); ret = (ModuleDescPtr) 1; goto LoadModule_exit; } @@ -895,26 +706,20 @@ LoadModule(const char *module, const char *path, const char **subdirlist, if (!name) { if (errmaj) *errmaj = LDR_BADUSAGE; - if (errmin) - *errmin = 0; goto LoadModule_fail; } - ret = NewModuleDesc(name); + ret = calloc(1, sizeof(ModuleDesc)); if (!ret) { if (errmaj) *errmaj = LDR_NOMEM; - if (errmin) - *errmin = 0; goto LoadModule_fail; } - pathlist = InitPathList(path); + pathlist = defaultPathList; if (!pathlist) { /* This could be a malloc failure too */ if (errmaj) *errmaj = LDR_BADUSAGE; - if (errmin) - *errmin = 1; goto LoadModule_fail; } @@ -926,7 +731,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist, found = xstrdup(module); path_elem = pathlist; while (!found && *path_elem != NULL) { - found = FindModule(m, *path_elem, subdirlist, patterns); + found = FindModule(m, *path_elem, patterns); path_elem++; /* * When the module name isn't the canonical name, search for the @@ -942,17 +747,14 @@ LoadModule(const char *module, const char *path, const char **subdirlist, * did we find the module? */ if (!found) { - xf86Msg(X_WARNING, "Warning, couldn't open module %s\n", module); + LogMessage(X_WARNING, "Warning, couldn't open module %s\n", module); if (errmaj) *errmaj = LDR_NOENT; - if (errmin) - *errmin = 0; goto LoadModule_fail; } - ret->handle = LoaderOpen(found, errmaj, errmin); + ret->handle = LoaderOpen(found, errmaj); if (ret->handle == NULL) goto LoadModule_fail; - ret->path = strdup(found); /* drop any explicit suffix from the module name */ p = strchr(name, '.'); @@ -967,8 +769,6 @@ LoadModule(const char *module, const char *path, const char **subdirlist, p = NULL; if (errmaj) *errmaj = LDR_NOMEM; - if (errmin) - *errmin = 0; goto LoadModule_fail; } initdata = LoaderSymbolFromModule(ret->handle, p); @@ -985,19 +785,14 @@ LoadModule(const char *module, const char *path, const char **subdirlist, if (!CheckVersion(module, vers, modreq)) { if (errmaj) *errmaj = LDR_MISMATCH; - if (errmin) - *errmin = 0; goto LoadModule_fail; } } else { - xf86Msg(X_ERROR, - "LoadModule: Module %s does not supply" - " version information\n", module); + LogMessage(X_ERROR, "LoadModule: Module %s does not supply" + " version information\n", module); if (errmaj) *errmaj = LDR_INVALID; - if (errmin) - *errmin = 0; goto LoadModule_fail; } if (setup) @@ -1008,23 +803,21 @@ LoadModule(const char *module, const char *path, const char **subdirlist, } else { /* no initdata, fail the load */ - xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s " - "data object.\n", module, p); + LogMessage(X_ERROR, "LoadModule: Module %s does not have a %s " + "data object.\n", module, p); if (errmaj) *errmaj = LDR_INVALID; - if (errmin) - *errmin = 0; goto LoadModule_fail; } if (ret->SetupProc) { - ret->TearDownData = ret->SetupProc(ret, options, errmaj, errmin); + ret->TearDownData = ret->SetupProc(ret, options, errmaj, NULL); if (!ret->TearDownData) { goto LoadModule_fail; } } else if (options) { - xf86Msg(X_WARNING, "Module Options present, but no SetupProc " - "available for %s\n", module); + LogMessage(X_WARNING, "Module Options present, but no SetupProc " + "available for %s\n", module); } goto LoadModule_exit; @@ -1033,7 +826,6 @@ LoadModule(const char *module, const char *path, const char **subdirlist, ret = NULL; LoadModule_exit: - FreePathList(pathlist); FreePatterns(patterns); free(found); free(name); @@ -1050,27 +842,28 @@ UnloadModule(void *_mod) if (mod == (ModuleDescPtr) 1) return; - if (mod == NULL || mod->name == NULL) + if (mod == NULL) return; - if (mod->parent) - LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", - mod->name); - else - LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name); + if (mod->VersionInfo) { + const char *name = mod->VersionInfo->modname; - if (mod->TearDownData != ModuleDuplicated) { - if ((mod->TearDownProc) && (mod->TearDownData)) - mod->TearDownProc(mod->TearDownData); - LoaderUnload(mod->name, mod->handle); + if (mod->parent) + LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", name); + else + LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", name); + + if (mod->TearDownData != ModuleDuplicated) { + if ((mod->TearDownProc) && (mod->TearDownData)) + mod->TearDownProc(mod->TearDownData); + LoaderUnload(name, mod->handle); + } } if (mod->child) UnloadModule(mod->child); if (mod->sib) UnloadModule(mod->sib); - free(mod->path); - free(mod->name); free(mod); } @@ -1130,18 +923,6 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin) case LDR_NOENT: msg = "module does not exist"; break; - case LDR_NOSUBENT: - msg = "a required submodule could not be loaded"; - break; - case LDR_NOSPACE: - msg = "too many modules"; - break; - case LDR_NOMODOPEN: - msg = "open failed"; - break; - case LDR_UNKTYPE: - msg = "unknown module type"; - break; case LDR_NOLOAD: msg = "loader failed"; break; @@ -1149,12 +930,6 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin) msg = "already loaded"; type = X_INFO; break; - case LDR_NOPORTOPEN: - msg = "port open failed"; - break; - case LDR_NOHARDWARE: - msg = "no hardware found"; - break; case LDR_MISMATCH: msg = "module requirement mismatch"; break; @@ -1174,11 +949,11 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin) msg = "unknown error"; } if (name) - xf86Msg(type, "%s: Failed to load module \"%s\" (%s, %d)\n", - name, modname, msg, errmin); + LogMessage(type, "%s: Failed to load module \"%s\" (%s, %d)\n", + name, modname, msg, errmin); else - xf86Msg(type, "Failed to load module \"%s\" (%s, %d)\n", - modname, msg, errmin); + LogMessage(type, "Failed to load module \"%s\" (%s, %d)\n", + modname, msg, errmin); } /* Given a module path or file name, return the module's canonical name */ diff --git a/xserver/hw/xfree86/loader/os.c b/xserver/hw/xfree86/loader/os.c deleted file mode 100644 index 8d037217b..000000000 --- a/xserver/hw/xfree86/loader/os.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1999-2002 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s) - * and author(s) 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 copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "loaderProcs.h" - -/* - * OSNAME is a standard form of the OS name that may be used by the - * loader and by OS-specific modules. OSNAME here is different from what's in - * dix-config.h - */ - -#undef OSNAME -#if defined(__linux__) -#define OSNAME "linux" -#elif defined(__FreeBSD__) -#define OSNAME "freebsd" -#elif defined(__DragonFly__) -#define OSNAME "dragonfly" -#elif defined(__NetBSD__) -#define OSNAME "netbsd" -#elif defined(__OpenBSD__) -#define OSNAME "openbsd" -#elif defined(__GNU__) -#define OSNAME "hurd" -#elif defined(SVR4) && defined(__sun) -#define OSNAME "solaris" -#elif defined(SVR5) -#define OSNAME "svr5" -#elif defined(SVR4) -#define OSNAME "svr4" -#else -#define OSNAME "unknown" -#endif - -/* Return the OS name, and run-time OS version */ - -void -LoaderGetOS(const char **name, int *major, int *minor, int *teeny) -{ - if (name) - *name = OSNAME; - - /* reporting runtime versions isn't supported yet */ -} diff --git a/xserver/hw/xfree86/loader/symbol-test.c b/xserver/hw/xfree86/loader/symbol-test.c new file mode 100644 index 000000000..1d7d84635 --- /dev/null +++ b/xserver/hw/xfree86/loader/symbol-test.c @@ -0,0 +1,52 @@ +/* + * Copyright © 2017 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +/* Small test program to see if we can successfully resolve all + * symbols of a set of X.Org modules when they're loaded in order. + */ + +#include +#include +#include + +int main (int argc, char**argv) +{ + void *ret; + + if (argc < 2) { + fprintf(stderr, + "Must pass path any modules to be loaded.\n"); + exit(1); + } + + for (int i = 1; i < argc; i++) { + fprintf(stderr, "opening %s\n", argv[i]); + ret = dlopen(argv[i], RTLD_GLOBAL | RTLD_NOW); + if (!ret) { + fprintf(stderr, "dlopen error: %s\n", dlerror()); + exit(1); + } + } + + return 0; +} diff --git a/xserver/hw/xfree86/man/Makefile.in b/xserver/hw/xfree86/man/Makefile.in index 82ba96717..a1876c2b4 100644 --- a/xserver/hw/xfree86/man/Makefile.in +++ b/xserver/hw/xfree86/man/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -266,22 +266,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -325,6 +339,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -343,15 +358,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -359,6 +377,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -430,8 +450,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/man/Xorg.man b/xserver/hw/xfree86/man/Xorg.man index ddb6af8c7..4338a1fe2 100644 --- a/xserver/hw/xfree86/man/Xorg.man +++ b/xserver/hw/xfree86/man/Xorg.man @@ -1,7 +1,7 @@ .\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH Xorg __appmansuffix__ __vendorversion__ +.TH Xorg @appmansuffix@ @vendorversion@ .SH NAME Xorg - X11R7 X server .SH SYNOPSIS @@ -33,8 +33,8 @@ free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD, OpenBSD, and Solaris. Commercial UNIX operating systems such as UnixWare are also supported. Other supported operating systems include GNU Hurd. Mac OS X is supported with the -Xquartz(__appmansuffix__) X server. Win32/Cygwin is supported with the -XWin(__appmansuffix__) X server. +Xquartz(@appmansuffix@) X server. Win32/Cygwin is supported with the +XWin(@appmansuffix@) X server. .PP .SH "NETWORK CONNECTIONS" .B Xorg @@ -45,7 +45,7 @@ byte-streams: On most platforms, the "Local" connection type is a UNIX-domain socket. On some System V platforms, the "local" connection types also include STREAMS pipes, named pipes, and some other mechanisms. See the -"LOCAL CONNECTIONS" section of X(__miscmansuffix__) for details. +"LOCAL CONNECTIONS" section of X(@miscmansuffix@) for details. .TP 4 .I TCP/IP .B Xorg @@ -61,20 +61,20 @@ option (see the Xserver(1) man page for details). .B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the -xorg.conf(__filemansuffix__) configuration files, auto-detection, and +xorg.conf(@filemansuffix@) configuration files, auto-detection, and fallback defaults. When the same information is supplied in more than one way, the highest precedence mechanism is used. The list of mechanisms is ordered from highest precedence to lowest. Note that not all parameters can be supplied via all methods. The available command line options and environment variables (and some defaults) are described here and in -the Xserver(__appmansuffix__) manual page. Most configuration file +the Xserver(@appmansuffix@) manual page. Most configuration file parameters, with their defaults, are described in the -xorg.conf(__filemansuffix__) manual page. Driver and module specific +xorg.conf(@filemansuffix@) manual page. Driver and module specific configuration parameters are described in the relevant driver or module manual page. .PP In addition to the normal server options described in the -Xserver(__appmansuffix__) manual page, +Xserver(@appmansuffix@) manual page, .B Xorg accepts the following command line switches: .TP 8 @@ -92,14 +92,14 @@ as Linux, BSD, OpenSolaris, SVR3, and SVR4. Allow the server to start up even if the mouse device can't be opened or initialised. This is equivalent to the .B AllowMouseOpenFail -xorg.conf(__filemansuffix__) file option. +xorg.conf(@filemansuffix@) file option. .TP 8 .B \-allowNonLocalXvidtune Make the VidMode extension available to remote clients. This allows the xvidtune client to connect from another host. This is equivalent to the .B AllowNonLocalXvidtune -xorg.conf(__filemansuffix__) file option. By default non-local +xorg.conf(@filemansuffix@) file option. By default non-local connections are not allowed. .TP 8 .BI \-bgamma " value" @@ -149,7 +149,7 @@ Disable the parts of the VidMode extension (used by the xvidtune client) that can be used to change the video modes. This is equivalent to the .B DisableVidModeExtension -xorg.conf(__filemansuffix__) file option. +xorg.conf(@filemansuffix@) file option. .TP 8 .B \-fbbpp \fIn\fP Sets the number of framebuffer bits per pixel. You should only set this @@ -224,7 +224,7 @@ want to use systemd-logind integration you must specify this option. Not all platforms support (or can use) this option. .TP 8 .BI \-keyboard " keyboard-name" -Use the xorg.conf(__filemansuffix__) file +Use the xorg.conf(@filemansuffix@) file .B InputDevice section called .I keyboard-name @@ -236,7 +236,7 @@ section and this option, the first relevant section is used for the core keyboard. .TP 8 .BI \-layout " layout-name" -Use the xorg.conf(__filemansuffix__) file +Use the xorg.conf(@filemansuffix@) file .B Layout section called .IR layout-name . @@ -250,7 +250,7 @@ Use the file called as the .B Xorg server log file. The default log file when running as root is -.BI __logdir__/Xorg. n .log +.BI @logdir@/Xorg. n .log and for non root it is .BI $XDG_DATA_HOME/xorg/Xorg. n .log where @@ -288,23 +288,8 @@ Disable Silken Mouse support. Disable the automatic switching on X server reset and shutdown to the VT that was active when the server started, if supported by the OS. .TP 8 -.B \-pixmap24 -Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel. -The default is usually 32 bits per pixel. There is normally little -reason to use this option. Some client applications don't like this -pixmap format, even though it is a perfectly legal format. This is -equivalent to the -.B Pixmap -xorg.conf(__filemansuffix__) file option. -.TP 8 -.B \-pixmap32 -Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel. -This is usually the default. This is equivalent to the -.B Pixmap -xorg.conf(__filemansuffix__) file option. -.TP 8 .BI \-pointer " pointer-name" -Use the xorg.conf(__filemansuffix__) file +Use the xorg.conf(@filemansuffix@) file .B InputDevice section called .I pointer-name @@ -334,7 +319,7 @@ options. Share virtual terminals with another X server, if supported by the OS. .TP 8 .BI \-screen " screen-name" -Use the xorg.conf(__filemansuffix__) file +Use the xorg.conf(@filemansuffix@) file .B Screen section called .IR screen-name . @@ -398,7 +383,7 @@ keymap. Immediately kills the server -- no questions asked. It can be disabled by setting the .B DontZap -xorg.conf(__filemansuffix__) file option to a TRUE value. +xorg.conf(@filemansuffix@) file option to a TRUE value. .PP .RS 8 It should be noted that zapping is triggered by the @@ -412,20 +397,20 @@ but can be enabled with the XKB option Change video mode to next one specified in the configuration file. This can be disabled with the .B DontZoom -xorg.conf(__filemansuffix__) file option. +xorg.conf(@filemansuffix@) file option. .TP 8 .B Ctrl+Alt+Keypad-Minus Change video mode to previous one specified in the configuration file. This can be disabled with the .B DontZoom -xorg.conf(__filemansuffix__) file option. +xorg.conf(@filemansuffix@) file option. .TP 8 .B Ctrl+Alt+F1...F12 For systems with virtual terminal support, these keystroke combinations are used to switch to virtual terminals 1 through 12, respectively. This can be disabled with the .B DontVTSwitch -xorg.conf(__filemansuffix__) file option. +xorg.conf(@filemansuffix@) file option. .SH CONFIGURATION .B Xorg typically uses a configuration file called @@ -433,9 +418,9 @@ typically uses a configuration file called and configuration files with the suffix .I .conf in a directory called -.B __xconfigdir__ +.B @xconfigdir@ for its initial setup. -Refer to the xorg.conf(__filemansuffix__) manual page for information +Refer to the xorg.conf(@filemansuffix@) manual page for information about the format of this file. .PP .B Xorg @@ -443,7 +428,7 @@ has a mechanism for automatically generating a built-in configuration at run-time when no .B xorg.conf file or -.B __xconfigdir__ +.B @xconfigdir@ files are present. The current version of this automatic configuration mechanism works in two ways. .PP @@ -467,7 +452,7 @@ supported by Xorg. Enhancements are planned for future releases. The .B Xorg server config files can be found in a range of locations. These are -documented fully in the xorg.conf(__filemansuffix__) manual page. The +documented fully in the xorg.conf(@filemansuffix@) manual page. The most commonly used locations are shown here. .TP 30 .B /etc/X11/xorg.conf @@ -479,95 +464,95 @@ Server configuration file. .B /etc/xorg.conf Server configuration file. .TP 30 -.B __projectroot__/etc/xorg.conf +.B @projectroot@/etc/xorg.conf Server configuration file. .TP 30 -.B __projectroot__/lib/X11/xorg.conf +.B @projectroot@/lib/X11/xorg.conf Server configuration file. .TP 30 -.B /etc/X11/__xconfigdir__ +.B /etc/X11/@xconfigdir@ Server configuration directory. .TP 30 -.B /etc/X11/__xconfigdir__-4 +.B /etc/X11/@xconfigdir@-4 Server configuration directory. .TP 30 -.B /etc/__xconfigdir__ +.B /etc/@xconfigdir@ Server configuration directory. .TP 30 -.B __projectroot__/etc/__xconfigdir__ +.B @projectroot@/etc/@xconfigdir@ Server configuration directory. .TP 30 -.B __projectroot__/lib/X11/__xconfigdir__ +.B @projectroot@/lib/X11/@xconfigdir@ Server configuration directory. .TP 30 -.BI __logdir__/Xorg. n .log +.BI @logdir@/Xorg. n .log Server log file for display .IR n . .TP 30 -.B __projectroot__/bin/\(** +.B @projectroot@/bin/\(** Client binaries. .TP 30 -.B __projectroot__/include/\(** +.B @projectroot@/include/\(** Header files. .TP 30 -.B __projectroot__/lib/\(** +.B @projectroot@/lib/\(** Libraries. .TP 30 -.B __datadir__/fonts/X11/\(** +.B @datadir@/fonts/X11/\(** Fonts. .TP 30 -.B __projectroot__/share/X11/XErrorDB +.B @projectroot@/share/X11/XErrorDB Client error message database. .TP 30 -.B __projectroot__/lib/X11/app-defaults/\(** +.B @projectroot@/lib/X11/app-defaults/\(** Client resource specifications. .TP 30 -.B __mandir__/man?/\(** +.B @mandir@/man?/\(** Manual pages. .TP 30 .BI /etc/X n .hosts Initial access control list for display .IR n . .SH "SEE ALSO" -X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__), -xorg.conf(__filemansuffix__), xvidtune(__appmansuffix__), -xkeyboard-config (__miscmansuffix__), -apm(__drivermansuffix__), -ati(__drivermansuffix__), -chips(__drivermansuffix__), -cirrus(__drivermansuffix__), -cyrix(__drivermansuffix__), -fbdev(__drivermansuffix__), -glide(__drivermansuffix__), -glint(__drivermansuffix__), -i128(__drivermansuffix__), -i740(__drivermansuffix__), -imstt(__drivermansuffix__), -intel(__drivermansuffix__), -mga(__drivermansuffix__), -neomagic(__drivermansuffix__), -nsc(__drivermansuffix__), -nv(__drivermansuffix__), -openchrome (__drivermansuffix__), -r128(__drivermansuffix__), -rendition(__drivermansuffix__), -s3virge(__drivermansuffix__), -siliconmotion(__drivermansuffix__), -sis(__drivermansuffix__), -sunbw2(__drivermansuffix__), -suncg14(__drivermansuffix__), -suncg3(__drivermansuffix__), -suncg6(__drivermansuffix__), -sunffb(__drivermansuffix__), -sunleo(__drivermansuffix__), -suntcx(__drivermansuffix__), -tdfx(__drivermansuffix__), -tga(__drivermansuffix__), -trident(__drivermansuffix__), -tseng(__drivermansuffix__), -v4l(__drivermansuffix__), -vesa(__drivermansuffix__), -vmware(__drivermansuffix__), +X(@miscmansuffix@), Xserver(@appmansuffix@), xdm(@appmansuffix@), xinit(@appmansuffix@), +xorg.conf(@filemansuffix@), xvidtune(@appmansuffix@), +xkeyboard-config (@miscmansuffix@), +apm(@drivermansuffix@), +ati(@drivermansuffix@), +chips(@drivermansuffix@), +cirrus(@drivermansuffix@), +cyrix(@drivermansuffix@), +fbdev(@drivermansuffix@), +glide(@drivermansuffix@), +glint(@drivermansuffix@), +i128(@drivermansuffix@), +i740(@drivermansuffix@), +imstt(@drivermansuffix@), +intel(@drivermansuffix@), +mga(@drivermansuffix@), +neomagic(@drivermansuffix@), +nsc(@drivermansuffix@), +nv(@drivermansuffix@), +openchrome (@drivermansuffix@), +r128(@drivermansuffix@), +rendition(@drivermansuffix@), +s3virge(@drivermansuffix@), +siliconmotion(@drivermansuffix@), +sis(@drivermansuffix@), +sunbw2(@drivermansuffix@), +suncg14(@drivermansuffix@), +suncg3(@drivermansuffix@), +suncg6(@drivermansuffix@), +sunffb(@drivermansuffix@), +sunleo(@drivermansuffix@), +suntcx(@drivermansuffix@), +tdfx(@drivermansuffix@), +tga(@drivermansuffix@), +trident(@drivermansuffix@), +tseng(@drivermansuffix@), +v4l(@drivermansuffix@), +vesa(@drivermansuffix@), +vmware(@drivermansuffix@), .br Web site .IR . diff --git a/xserver/hw/xfree86/man/Xorg.wrap.man b/xserver/hw/xfree86/man/Xorg.wrap.man index f3f30a6c4..a8ee5eae8 100644 --- a/xserver/hw/xfree86/man/Xorg.wrap.man +++ b/xserver/hw/xfree86/man/Xorg.wrap.man @@ -1,4 +1,4 @@ -.\" Xwrapper.wrap.__appmansuffix__ +.\" Xwrapper.wrap.@appmansuffix@ .\" .\" Copyright 2014 Red Hat, Inc. .\" @@ -26,14 +26,14 @@ .\" .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH Xorg.wrap __appmansuffix__ __xorgversion__ +.TH Xorg.wrap @appmansuffix@ @xorgversion@ .SH NAME Xorg.wrap \- Xorg X server binary wrapper .SH DESCRIPTION The Xorg X server may need root rights to function properly. To start the Xorg X server with these rights your system is using a suid root wrapper -installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real -X server which is installed as __suid_wrapper_dir__/Xorg. +installed as @suid_wrapper_dir@/Xorg.wrap which will execute the real +X server which is installed as @suid_wrapper_dir@/Xorg. .PP By default Xorg.wrap will autodetect if root rights are necessary, and if not it will drop its elevated rights before starting the real X server. @@ -42,7 +42,7 @@ sessions on a physical console. .SH CONFIG FILE Xorg.wrap's default behavior can be overridden from the -\fI__sysconfdir__/X11/Xwrapper.config\fP config file. Lines starting with a +\fI@sysconfdir@/X11/Xwrapper.config\fP config file. Lines starting with a \fB#\fP in Xwrapper.config are considered comments and will be ignored. Any other non empty lines must take the form of \fBkey\fP = \fIvalue\fP. .TP 8 diff --git a/xserver/hw/xfree86/man/Xwrapper.config.man b/xserver/hw/xfree86/man/Xwrapper.config.man index 5c777c940..46bc65e2c 100644 --- a/xserver/hw/xfree86/man/Xwrapper.config.man +++ b/xserver/hw/xfree86/man/Xwrapper.config.man @@ -1 +1 @@ -.so man__appmansuffix__/Xorg.wrap.__appmansuffix__ +.so man@appmansuffix@/Xorg.wrap.@appmansuffix@ diff --git a/xserver/hw/xfree86/man/xorg.conf.d.man b/xserver/hw/xfree86/man/xorg.conf.d.man index 6b3379ece..9ac2dbfbb 100644 --- a/xserver/hw/xfree86/man/xorg.conf.d.man +++ b/xserver/hw/xfree86/man/xorg.conf.d.man @@ -1 +1 @@ -.so man__filemansuffix__/xorg.conf.__filemansuffix__ +.so man@filemansuffix@/xorg.conf.@filemansuffix@ diff --git a/xserver/hw/xfree86/man/xorg.conf.man b/xserver/hw/xfree86/man/xorg.conf.man index 7d0c52495..958926243 100644 --- a/xserver/hw/xfree86/man/xorg.conf.man +++ b/xserver/hw/xfree86/man/xorg.conf.man @@ -1,21 +1,21 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH xorg.conf __filemansuffix__ __vendorversion__ +.TH xorg.conf @filemansuffix@ @vendorversion@ .SH NAME -xorg.conf, __xconfigdir__ \- configuration files for +xorg.conf, @xconfigdir@ \- configuration files for Xorg X server .SH INTRODUCTION .B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the -xorg.conf and __xconfigdir__ configuration files, auto-detection, +xorg.conf and @xconfigdir@ configuration files, auto-detection, and fallback defaults. When the same information is supplied in more than one way, the highest precedence mechanism is used. The list of mechanisms is ordered from highest precedence to lowest. Note that not all parameters can be supplied via all methods. The available command line options and environment variables (and some defaults) are -described in the Xserver(__appmansuffix__) and -Xorg(__appmansuffix__) manual pages. Most configuration file +described in the Xserver(@appmansuffix@) and +Xorg(@appmansuffix@) manual pages. Most configuration file parameters, with their defaults, are described below. Driver and module specific configuration parameters are described in the relevant driver or module manual page. @@ -26,7 +26,7 @@ uses a configuration file called and files ending in the suffix .I .conf from the directory -.I __xconfigdir__ +.I @xconfigdir@ for its initial setup. The .I xorg.conf @@ -36,15 +36,15 @@ server is started as a normal user: .RS 4 .nf .IR /etc/X11/ -.IR __projectroot__/etc/X11/ +.IR @projectroot@/etc/X11/ .IB /etc/X11/ $XORGCONFIG -.IB __projectroot__/etc/X11/ $XORGCONFIG +.IB @projectroot@/etc/X11/ $XORGCONFIG .I /etc/X11/xorg.conf .I /etc/xorg.conf -.IR __projectroot__/etc/X11/xorg.conf. -.I __projectroot__/etc/X11/xorg.conf -.IR __projectroot__/lib/X11/xorg.conf. -.I __projectroot__/lib/X11/xorg.conf +.IR @projectroot@/etc/X11/xorg.conf. +.I @projectroot@/etc/X11/xorg.conf +.IR @projectroot@/lib/X11/xorg.conf. +.I @projectroot@/lib/X11/xorg.conf .fi .RE .PP @@ -58,7 +58,7 @@ is the relative path (with no \(lq..\(rq components) specified by that environment variable, and .I is the machine's hostname as reported by -.BR gethostname (__libmansuffix__). +.BR gethostname (@libmansuffix@). .PP When the Xorg server is started by the \(lqroot\(rq user, the config file search locations are as follows: @@ -67,16 +67,16 @@ search locations are as follows: .nf .IR /etc/X11/ -.IR __projectroot__/etc/X11/ +.IR @projectroot@/etc/X11/ .B $XORGCONFIG .IB /etc/X11/ $XORGCONFIG -.IB __projectroot__/etc/X11/ $XORGCONFIG +.IB @projectroot@/etc/X11/ $XORGCONFIG .I /etc/X11/xorg.conf .I /etc/xorg.conf -.IR __projectroot__/etc/X11/xorg.conf. -.I __projectroot__/etc/X11/xorg.conf -.IR __projectroot__/lib/X11/xorg.conf. -.I __projectroot__/lib/X11/xorg.conf +.IR @projectroot@/etc/X11/xorg.conf. +.I @projectroot@/etc/X11/xorg.conf +.IR @projectroot@/lib/X11/xorg.conf. +.I @projectroot@/lib/X11/xorg.conf .fi .RE .PP @@ -93,7 +93,7 @@ is the path specified by that environment variable (usually the home directory), and .I is the machine's hostname as reported by -.BR gethostname (__libmansuffix__). +.BR gethostname (@libmansuffix@). .PP Additional configuration files are searched for in the following directories when the server is started as a normal user: @@ -101,9 +101,9 @@ directories when the server is started as a normal user: .RS 4 .nf .IR /etc/X11/ -.IR __sysconfdir__/X11/ -.I /etc/X11/__xconfigdir__ -.I __sysconfdir__/X11/__xconfigdir__ +.IR @sysconfdir@/X11/ +.I /etc/X11/@xconfigdir@ +.I @sysconfdir@/X11/@xconfigdir@ .fi .RE .PP @@ -120,9 +120,9 @@ config directory search locations are as follows: .nf .IR /etc/X11/ -.IR __sysconfdir__/X11/ -.I /etc/X11/__xconfigdir__ -.I __sysconfdir__/X11/__xconfigdir__ +.IR @sysconfdir@/X11/ +.I /etc/X11/@xconfigdir@ +.I @sysconfdir@/X11/@xconfigdir@ .fi .RE .PP @@ -140,14 +140,14 @@ These files are found in the following directory: .PP .RS 4 .nf -.I __datadir__/X11/__xconfigdir__ +.I @datadir@/X11/@xconfigdir@ .fi .RE .PP The .I xorg.conf and -.I __xconfigdir__ +.I @xconfigdir@ files are composed of a number of sections which may be present in any order, or omitted to use default configuration values. Each section has the form: @@ -330,9 +330,9 @@ The .B Files section is used to specify some path names required by the server. Some of these paths can also be set from the command line (see -.BR Xserver (__appmansuffix__) +.BR Xserver (@appmansuffix@) and -.BR Xorg (__appmansuffix__)). +.BR Xorg (@appmansuffix@)). The command line settings override the values specified in the config file. The @@ -413,12 +413,12 @@ font path elements (which can be set inside a catalogue directory): .PP .RS 4 .nf -.I __datadir__/fonts/X11/misc/ -.I __datadir__/fonts/X11/TTF/ -.I __datadir__/fonts/X11/OTF/ -.I __datadir__/fonts/X11/Type1/ -.I __datadir__/fonts/X11/100dpi/ -.I __datadir__/fonts/X11/75dpi/ +.I @datadir@/fonts/X11/misc/ +.I @datadir@/fonts/X11/TTF/ +.I @datadir@/fonts/X11/OTF/ +.I @datadir@/fonts/X11/Type1/ +.I @datadir@/fonts/X11/100dpi/ +.I @datadir@/fonts/X11/75dpi/ .fi .RE .PP @@ -436,7 +436,7 @@ entries may be specified, and they will be concatenated to build the module search path used by the server. The default module path is .PP .RS 11 -__modulepath__ +@modulepath@ .RE .\" The LogFile keyword is not currently implemented .ig @@ -446,7 +446,7 @@ sets the name of the Xorg server log file. The default log file name when running as root is .PP .RS 11 -.RI __logdir__/Xorg. .log +.RI @logdir@/Xorg. .log .RE and for non root it is .RS 11 @@ -465,7 +465,7 @@ sets the base directory for keyboard layout files. The command line option can be used to override this. The default directory is .PP .RS 11 -__xkbdir__ +@xkbdir@ .RE .SH "SERVERFLAGS SECTION" In addition to options specific to this section (described below), the @@ -495,6 +495,13 @@ Options with command line equivalents are overridden when their command line equivalent is used. The options recognised by this section are: .TP 7 +.BI "Option \*qDebug\*q \*q" string \*q +This comma-separated list provides a way to control various debugging switches +from the config file. +At the moment the only defined value is +.B dmabuf_capable +which instructs glamor to enable some unstable buffer management code. +.TP 7 .BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q This specifies the default .B ServerLayout @@ -553,9 +560,9 @@ extension) to connect from another host. Default: off. .TP 7 .BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q -This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) +This tells the mousedrv(@drivermansuffix@) and vmmouse(@drivermansuffix@) drivers to not report failure if the mouse device can't be opened/initialised. -It has no effect on the evdev(__drivermansuffix__) or other drivers. +It has no effect on the evdev(@drivermansuffix@) or other drivers. Default: false. .TP 7 .BI "Option \*qBlankTime\*q \*q" time \*q @@ -567,7 +574,7 @@ is in minutes. This is equivalent to the Xorg server's .B \-s flag, and the value can be changed at run\-time with -.BR xset(__appmansuffix__). +.BR xset(@appmansuffix@). Default: 10 minutes. .TP 7 .BI "Option \*qStandbyTime\*q \*q" time \*q @@ -576,7 +583,7 @@ sets the inactivity timeout for the phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with -.BR xset(__appmansuffix__). +.BR xset(@appmansuffix@). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. @@ -590,7 +597,7 @@ sets the inactivity timeout for the phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with -.BR xset(__appmansuffix__). +.BR xset(@appmansuffix@). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. @@ -604,7 +611,7 @@ sets the inactivity timeout for the phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with -.BR xset(__appmansuffix__). +.BR xset(@appmansuffix@). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. @@ -616,14 +623,6 @@ option set (see the MONITOR section below). Set the maximum number of clients allowed to connect to the X server. Acceptable values are 64, 128, 256 or 512. .TP 7 -.BI "Option \*qPixmap\*q \*q" bpp \*q -This sets the pixmap format to use for depth 24. -Allowed values for -.I bpp -are 24 and 32. -Default: 32 unless driver constraints don't allow this (which is rare). -Note: some clients don't behave well when this value is set to 24. -.TP 7 .BI "Option \*qNoPM\*q \*q" boolean \*q Disables something to do with power management events. Default: PM enabled on platforms that support it. @@ -762,7 +761,7 @@ subdirectory under: .PP .RS 4 .nf -__modulepath__ +@modulepath@ .fi .RE .PP @@ -879,11 +878,11 @@ or command line options, or if it is selected implicitly as the core pointer or keyboard device in the absence of such explicit references. The most commonly used input drivers are -.BR evdev (__drivermansuffix__) +.BR evdev (@drivermansuffix@) on Linux systems, and -.BR kbd (__drivermansuffix__) +.BR kbd (@drivermansuffix@) and -.BR mousedrv (__drivermansuffix__) +.BR mousedrv (@drivermansuffix@) on other platforms. .PP .PP @@ -1280,6 +1279,42 @@ For example: Check the case-sensitive string .RI \*q matchdriver \*q against the kernel driver of the device. +.PP +When an output device has been matched to the +.B OutputClass +section, any +.B Option +entries are applied to the device. One +.B OutputClass +specific +.B Option +is recognized. See the +.B Device +section below for a description of the remaining +.B Option +entries. +.TP 7 +.BI "Option \*qPrimaryGPU\*q \*q" boolean \*q +This option specifies that the matched device should be treated as the +primary GPU, replacing the selection of the GPU used as output by the +firmware. If multiple output devices match an OutputClass section with +the PrimaryGPU option set, the first one enumerated becomes the primary GPU. +.PP +A +.B OutputClass +Section may contain +.B ModulePath +entries. When an output device matches an +.B OutputClass +section, any +.B ModulePath +entries in that +.B OutputClass +are pre-pended to the search path for loadable Xorg server modules. See +.B ModulePath +in the +.B Files +section for more info. .SH "DEVICE SECTION" The config file may have multiple .B Device @@ -1348,10 +1383,10 @@ For PCI/AGP cards, the .I bus\-id string has the form -.BI PCI: bus : device : function -(e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card). -This field is usually optional in single-head configurations when using -the primary graphics card. +.BI PCI: bus @ domain : device : function +(e.g., \(lqPCI:1@0:0:0\(rq might be appropriate for an AGP card). The +"@domain" part can be left out for PCI domain 0. This field is usually +optional in single-head configurations when using the primary graphics card. In multi-head configurations, or when using a secondary graphics card in a single-head configuration, this entry is mandatory. Its main purpose is to make an unambiguous connection between the device @@ -1434,12 +1469,6 @@ In most cases this is not required because the Xorg server probes the graphics board to determine this quantity. The driver-specific documentation should indicate when it might be needed. .TP 7 -.BI "BiosBase " "baseaddress" -This optional entry specifies the base address of the video BIOS for -the VGA board. -This address is normally auto-detected, and should only be specified if the -driver-specific documentation recommends it. -.TP 7 .BI "MemBase " "baseaddress" This optional entry specifies the memory base address of a graphics board's linear frame buffer. @@ -1473,6 +1502,11 @@ option. .BI "Option \*qModeDebug\*q \*q" boolean \*q Enable printing of additional debugging information about modesetting to the server log. +.TP 7 +.BI "Option \*qPreferCloneMode\*q \*q" boolean \*q +If enabled, bring up monitors of a screen in clone mode instead of horizontal +extended layout by default. (Defaults to off; the video driver can change the +default value, but this option can always override it) .ig .TP 7 This optional entry allows an IRQ number to be specified. @@ -2132,7 +2166,7 @@ formats. This may also be specified from the command line with the .B \-weight option (see -.BR Xorg(__appmansuffix__)). +.BR Xorg(@appmansuffix@)). .TP 7 .BI "Virtual " "xdim ydim" This optional entry specifies the virtual screen resolution to be used. @@ -2183,7 +2217,7 @@ built-in VESA standard modes. .BI "Visual \*q" visual\-name \*q This optional entry sets the default root visual type. This may also be specified from the command line (see the -.BR Xserver(__appmansuffix__) +.BR Xserver(@appmansuffix@) man page). The visual types available for depth 8 are (default is .BR PseudoColor ): @@ -2482,78 +2516,79 @@ The data therein is not used in this release. .PP .SH "SEE ALSO" General: -.BR X (__miscmansuffix__), -.BR Xserver (__appmansuffix__), -.BR Xorg (__appmansuffix__), -.BR cvt (__appmansuffix__), -.BR gtf (__appmansuffix__). +.BR X (@miscmansuffix@), +.BR Xserver (@appmansuffix@), +.BR Xorg (@appmansuffix@), +.BR cvt (@appmansuffix@), +.BR gtf (@appmansuffix@). .PP .B "Not all modules or interfaces are available on all platforms." .PP Display drivers: -.BR apm (__drivermansuffix__), -.BR ati (__drivermansuffix__), -.BR chips (__drivermansuffix__), -.BR cirrus (__drivermansuffix__), -.BR cyrix (__drivermansuffix__), -.BR fbdev (__drivermansuffix__), -.BR glide (__drivermansuffix__), -.BR glint (__drivermansuffix__), -.BR i128 (__drivermansuffix__), -.BR i740 (__drivermansuffix__), -.BR imstt (__drivermansuffix__), -.BR intel (__drivermansuffix__), -.BR mga (__drivermansuffix__), -.BR neomagic (__drivermansuffix__), -.BR nv (__drivermansuffix__), -.BR openchrome (__drivermansuffix__), -.BR r128 (__drivermansuffix__), -.BR radeon (__drivermansuffix__), -.BR rendition (__drivermansuffix__), -.BR savage (__drivermansuffix__), -.BR s3virge (__drivermansuffix__), -.BR siliconmotion (__drivermansuffix__), -.BR sis (__drivermansuffix__), -.BR sisusb (__drivermansuffix__), -.BR sunbw2 (__drivermansuffix__), -.BR suncg14 (__drivermansuffix__), -.BR suncg3 (__drivermansuffix__), -.BR suncg6 (__drivermansuffix__), -.BR sunffb (__drivermansuffix__), -.BR sunleo (__drivermansuffix__), -.BR suntcx (__drivermansuffix__), -.BR tdfx (__drivermansuffix__), -.\" .BR tga (__drivermansuffix__), -.BR trident (__drivermansuffix__), -.BR tseng (__drivermansuffix__), -.BR vesa (__drivermansuffix__), -.BR vmware (__drivermansuffix__), -.BR voodoo (__drivermansuffix__), -.BR wsfb (__drivermansuffix__), -.BR xgi (__drivermansuffix__), -.BR xgixp (__drivermansuffix__). +.BR apm (@drivermansuffix@), +.BR ati (@drivermansuffix@), +.BR chips (@drivermansuffix@), +.BR cirrus (@drivermansuffix@), +.BR cyrix (@drivermansuffix@), +.BR fbdev (@drivermansuffix@), +.BR glide (@drivermansuffix@), +.BR glint (@drivermansuffix@), +.BR i128 (@drivermansuffix@), +.BR i740 (@drivermansuffix@), +.BR imstt (@drivermansuffix@), +.BR intel (@drivermansuffix@), +.BR mga (@drivermansuffix@), +.BR neomagic (@drivermansuffix@), +.BR nv (@drivermansuffix@), +.BR openchrome (@drivermansuffix@), +.BR r128 (@drivermansuffix@), +.BR radeon (@drivermansuffix@), +.BR rendition (@drivermansuffix@), +.BR savage (@drivermansuffix@), +.BR s3virge (@drivermansuffix@), +.BR siliconmotion (@drivermansuffix@), +.BR sis (@drivermansuffix@), +.BR sisusb (@drivermansuffix@), +.BR sunbw2 (@drivermansuffix@), +.BR suncg14 (@drivermansuffix@), +.BR suncg3 (@drivermansuffix@), +.BR suncg6 (@drivermansuffix@), +.BR sunffb (@drivermansuffix@), +.BR sunleo (@drivermansuffix@), +.BR suntcx (@drivermansuffix@), +.BR tdfx (@drivermansuffix@), +.\" .BR tga (@drivermansuffix@), +.BR trident (@drivermansuffix@), +.BR tseng (@drivermansuffix@), +.BR vesa (@drivermansuffix@), +.BR vmware (@drivermansuffix@), +.BR voodoo (@drivermansuffix@), +.BR wsfb (@drivermansuffix@), +.BR xgi (@drivermansuffix@), +.BR xgixp (@drivermansuffix@). .PP Input drivers: -.BR acecad (__drivermansuffix__), -.BR citron (__drivermansuffix__), -.BR elographics (__drivermansuffix__), -.BR evdev (__drivermansuffix__), -.BR fpit (__drivermansuffix__), -.BR joystick (__drivermansuffix__), -.BR kbd (__drivermansuffix__), -.BR mousedrv (__drivermansuffix__), -.BR mutouch (__drivermansuffix__), -.BR penmount (__drivermansuffix__), -.BR synaptics (__drivermansuffix__), -.BR vmmouse (__drivermansuffix__), -.BR void (__drivermansuffix__), -.BR wacom (__drivermansuffix__). +.BR acecad (@drivermansuffix@), +.BR citron (@drivermansuffix@), +.BR elographics (@drivermansuffix@), +.BR evdev (@drivermansuffix@), +.BR fpit (@drivermansuffix@), +.BR joystick (@drivermansuffix@), +.BR kbd (@drivermansuffix@), +.BR libinput (@drivermansuffix@), +.BR mousedrv (@drivermansuffix@), +.BR mutouch (@drivermansuffix@), +.BR penmount (@drivermansuffix@), +.BR synaptics (@drivermansuffix@), +.BR vmmouse (@drivermansuffix@), +.BR void (@drivermansuffix@), +.BR wacom (@drivermansuffix@). .PP Other modules and interfaces: -.BR exa (__drivermansuffix__), -.BR fbdevhw (__drivermansuffix__), -.\" .BR shadowfb (__drivermansuffix__), -.BR v4l (__drivermansuffix__). +.BR exa (@drivermansuffix@), +.BR fbdevhw (@drivermansuffix@), +.\" .BR shadowfb (@drivermansuffix@), +.BR v4l (@drivermansuffix@). .br .SH AUTHORS This manual page was largely rewritten by David Dawes diff --git a/xserver/hw/xfree86/modes/Makefile.in b/xserver/hw/xfree86/modes/Makefile.in index 902d50aa5..82cea4400 100644 --- a/xserver/hw/xfree86/modes/Makefile.in +++ b/xserver/hw/xfree86/modes/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -343,6 +343,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -361,15 +362,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -377,6 +381,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -448,8 +454,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/modes/xf86Crtc.c b/xserver/hw/xfree86/modes/xf86Crtc.c index 966a16891..37a45bb3a 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.c +++ b/xserver/hw/xfree86/modes/xf86Crtc.c @@ -23,10 +23,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include @@ -178,6 +174,32 @@ xf86CrtcInUse(xf86CrtcPtr crtc) return FALSE; } +/** + * Return whether the crtc is leased by a client + */ + +static Bool +xf86CrtcIsLeased(xf86CrtcPtr crtc) +{ + /* If the DIX structure hasn't been created, it can't have been leased */ + if (!crtc->randr_crtc) + return FALSE; + return RRCrtcIsLeased(crtc->randr_crtc); +} + +/** + * Return whether the output is leased by a client + */ + +static Bool +xf86OutputIsLeased(xf86OutputPtr output) +{ + /* If the DIX structure hasn't been created, it can't have been leased */ + if (!output->randr_output) + return FALSE; + return RROutputIsLeased(output->randr_output); +} + void xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen) { @@ -258,7 +280,7 @@ xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode, RRTransformRec saved_transform; Bool saved_transform_present; - crtc->enabled = xf86CrtcInUse(crtc); + crtc->enabled = xf86CrtcInUse(crtc) && !xf86CrtcIsLeased(crtc); /* We only hit this if someone explicitly sends a "disabled" modeset. */ if (!crtc->enabled) { @@ -415,6 +437,10 @@ xf86CrtcSetOrigin(xf86CrtcPtr crtc, int x, int y) crtc->x = x; crtc->y = y; + + if (xf86CrtcIsLeased(crtc)) + return; + if (crtc->funcs->set_origin) { if (!xf86CrtcRotate(crtc)) return; @@ -473,10 +499,12 @@ static OptionInfoRec xf86OutputOptions[] = { enum { OPTION_MODEDEBUG, + OPTION_PREFER_CLONEMODE, }; static OptionInfoRec xf86DeviceOptions[] = { {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_PREFER_CLONEMODE, "PreferCloneMode", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; @@ -540,9 +568,9 @@ xf86OutputEnabled(xf86OutputPtr output, Bool strict) return FALSE; } - /* If not, try to only light up the ones we know are connected */ + /* If not, try to only light up the ones we know are connected which are supposed to be on the desktop */ if (strict) { - enable = output->status == XF86OutputStatusConnected; + enable = output->status == XF86OutputStatusConnected && !output->non_desktop; } /* But if that fails, try to light up even outputs we're unsure of */ else { @@ -732,14 +760,11 @@ xf86CrtcCloseScreen(ScreenPtr screen) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o, c; - screen->CloseScreen = config->CloseScreen; - - xf86RotateCloseScreen(screen); - - xf86RandR12CloseScreen(screen); - - screen->CloseScreen(screen); - + /* The randr_output and randr_crtc pointers are already invalid as + * the DIX resources were freed when the associated resources were + * freed. Clear them now; referencing through them during the rest + * of the CloseScreen sequence will not end well. + */ for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; @@ -750,6 +775,15 @@ xf86CrtcCloseScreen(ScreenPtr screen) crtc->randr_crtc = NULL; } + + screen->CloseScreen = config->CloseScreen; + + xf86RotateCloseScreen(screen); + + xf86RandR12CloseScreen(screen); + + screen->CloseScreen(screen); + /* detach any providers */ if (config->randr_provider) { RRProviderDestroy(config->randr_provider); @@ -773,9 +807,6 @@ xf86CrtcScreenInit(ScreenPtr screen) int c; /* Rotation */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); - xf86DisableRandR(); /* Disable old RandR extension support */ xf86RandR12Init(screen); /* support all rotations if every crtc has the shadow alloc funcs */ @@ -2138,6 +2169,8 @@ xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, Bool has_tile = FALSE; uint32_t configured_outputs; + xf86GetOptValBool(config->options, OPTION_PREFER_CLONEMODE, + &scrn->preferClone); if (scrn->preferClone) return FALSE; @@ -2651,6 +2684,17 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) return success; } +/* Turn a CRTC off, using the DPMS function and disabling the cursor */ +static void +xf86DisableCrtc(xf86CrtcPtr crtc) +{ + if (xf86CrtcIsLeased(crtc)) + return; + + crtc->funcs->dpms(crtc, DPMSModeOff); + xf86_crtc_hide_cursor(crtc); +} + /* * Check the CRTC we're going to map each output to vs. it's current * CRTC. If they don't match, we have to disable the output and the CRTC @@ -2665,6 +2709,9 @@ xf86PrepareOutputs(ScrnInfoPtr scrn) for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; + if (xf86OutputIsLeased(output)) + continue; + #if RANDR_GET_CRTC_INTERFACE /* Disable outputs that are unused or will be re-routed */ if (!output->funcs->get_crtc || @@ -2682,12 +2729,15 @@ xf86PrepareCrtcs(ScrnInfoPtr scrn) int c; for (c = 0; c < config->num_crtc; c++) { -#if RANDR_GET_CRTC_INTERFACE xf86CrtcPtr crtc = config->crtc[c]; +#if RANDR_GET_CRTC_INTERFACE xf86OutputPtr output = NULL; uint32_t desired_outputs = 0, current_outputs = 0; int o; + if (xf86CrtcIsLeased(crtc)) + continue; + for (o = 0; o < config->num_output; o++) { output = config->output[o]; if (output->crtc == crtc) @@ -2706,9 +2756,12 @@ xf86PrepareCrtcs(ScrnInfoPtr scrn) * we need to disable it */ if (desired_outputs != current_outputs || !desired_outputs) - (*crtc->funcs->dpms) (crtc, DPMSModeOff); + xf86DisableCrtc(crtc); #else - (*crtc->funcs->dpms) (crtc, DPMSModeOff); + if (xf86CrtcIsLeased(crtc)) + continue; + + xf86DisableCrtc(crtc); #endif } } @@ -2943,7 +2996,7 @@ xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) + if (!xf86OutputIsLeased(output) && output->crtc != NULL) (*output->funcs->dpms) (output, mode); } } @@ -2959,7 +3012,7 @@ xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) + if (!xf86OutputIsLeased(output) && output->crtc != NULL) (*output->funcs->dpms) (output, mode); } } @@ -3004,7 +3057,7 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) xf86CrtcPtr crtc = xf86_config->crtc[c]; if (!crtc->enabled) { - crtc->funcs->dpms(crtc, DPMSModeOff); + xf86DisableCrtc(crtc); memset(&crtc->mode, 0, sizeof(crtc->mode)); xf86RotateDestroy(crtc); crtc->active = FALSE; @@ -3252,6 +3305,7 @@ xf86ConnectorGetName(xf86ConnectorType connector) return _xf86ConnectorNames[connector]; } +#ifdef XV static void x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) { @@ -3283,7 +3337,6 @@ xf86_crtc_box_area(BoxPtr box) return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); } -#ifdef XV /* * Return the crtc covering 'box'. If two crtcs cover a portion of * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc @@ -3455,7 +3508,7 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn) RRCrtcDetachScanoutPixmap(crtc->randr_crtc); /* dpms off */ - (*crtc->funcs->dpms) (crtc, DPMSModeOff); + xf86DisableCrtc(crtc); /* force a reset the next time its used */ crtc->randr_crtc->mode = NULL; crtc->mode.HDisplay = 0; diff --git a/xserver/hw/xfree86/modes/xf86Crtc.h b/xserver/hw/xfree86/modes/xf86Crtc.h index 14ba9d714..1d1124a1b 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.h +++ b/xserver/hw/xfree86/modes/xf86Crtc.h @@ -47,6 +47,7 @@ typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr; typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr; +typedef struct _xf86Lease xf86LeaseRec, *xf86LeasePtr; /* define a standard for connector types */ typedef enum _xf86ConnectorType { @@ -195,6 +196,8 @@ typedef struct _xf86CrtcFuncs { */ void (*show_cursor) (xf86CrtcPtr crtc); + Bool + (*show_cursor_check) (xf86CrtcPtr crtc); /** * Hide cursor @@ -245,7 +248,7 @@ typedef struct _xf86CrtcFuncs { } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 7 +#define XF86_CRTC_VERSION 8 struct _xf86Crtc { /** @@ -625,6 +628,11 @@ struct _xf86Output { /** Whether to use the old per-screen Monitor config section */ Bool use_screen_monitor; + /** For pre-init, whether the output should be excluded from the + * desktop when there are other viable outputs to use + */ + Bool non_desktop; + #ifdef RANDR_12_INTERFACE /** * RandR 1.2 output structure. @@ -670,6 +678,54 @@ typedef struct _xf86ProviderFuncs { } xf86ProviderFuncsRec, *xf86ProviderFuncsPtr; +#define XF86_LEASE_VERSION 1 + +struct _xf86Lease { + /** + * ABI versioning + */ + int version; + + /** + * Associated ScrnInfo + */ + ScrnInfoPtr scrn; + + /** + * Driver private + */ + void *driver_private; + + /** + * RandR lease + */ + RRLeasePtr randr_lease; + + /* + * Contents of the lease + */ + + /** + * Number of leased CRTCs + */ + int num_crtc; + + /** + * Number of leased outputs + */ + int num_output; + + /** + * Array of pointers to leased CRTCs + */ + RRCrtcPtr *crtcs; + + /** + * Array of pointers to leased outputs + */ + RROutputPtr *outputs; +}; + typedef struct _xf86CrtcConfigFuncs { /** * Requests that the driver resize the screen. @@ -685,8 +741,29 @@ typedef struct _xf86CrtcConfigFuncs { */ Bool (*resize) (ScrnInfoPtr scrn, int width, int height); + + /** + * Requests that the driver create a lease + */ + int (*create_lease)(RRLeasePtr lease, int *fd); + + /** + * Ask the driver to terminate a lease, freeing all + * driver resources + */ + void (*terminate_lease)(RRLeasePtr lease); } xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr; +/* + * The driver calls this when it detects that a lease + * has been terminated + */ +extern _X_EXPORT void +xf86CrtcLeaseTerminated(RRLeasePtr lease); + +extern _X_EXPORT void +xf86CrtcLeaseStarted(RRLeasePtr lease); + typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen); typedef struct _xf86CrtcConfig { @@ -993,9 +1070,21 @@ static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {} /** * Called from EnterVT to turn the cursors back on */ -extern _X_EXPORT void +extern _X_EXPORT Bool xf86_show_cursors(ScrnInfoPtr scrn); +/** + * Called by the driver to turn a single crtc's cursor off + */ +extern _X_EXPORT void +xf86_crtc_hide_cursor(xf86CrtcPtr crtc); + +/** + * Called by the driver to turn a single crtc's cursor on + */ +extern _X_EXPORT Bool +xf86_crtc_show_cursor(xf86CrtcPtr crtc); + /** * Called by the driver to turn cursors off */ diff --git a/xserver/hw/xfree86/modes/xf86Cursors.c b/xserver/hw/xfree86/modes/xf86Cursors.c index 1bc2b27c3..dba5f8877 100644 --- a/xserver/hw/xfree86/modes/xf86Cursors.c +++ b/xserver/hw/xfree86/modes/xf86Cursors.c @@ -23,10 +23,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include @@ -210,8 +206,14 @@ set_bit(CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) /* * Wrappers to deal with API compatibility with drivers that don't expose - * load_cursor_*_check + * *_cursor_*_check */ +static inline Bool +xf86_driver_has_show_cursor(xf86CrtcPtr crtc) +{ + return crtc->funcs->show_cursor_check || crtc->funcs->show_cursor; +} + static inline Bool xf86_driver_has_load_cursor_image(xf86CrtcPtr crtc) { @@ -224,6 +226,15 @@ xf86_driver_has_load_cursor_argb(xf86CrtcPtr crtc) return crtc->funcs->load_cursor_argb_check || crtc->funcs->load_cursor_argb; } +static inline Bool +xf86_driver_show_cursor(xf86CrtcPtr crtc) +{ + if (crtc->funcs->show_cursor_check) + return crtc->funcs->show_cursor_check(crtc); + crtc->funcs->show_cursor(crtc); + return TRUE; +} + static inline Bool xf86_driver_load_cursor_image(xf86CrtcPtr crtc, CARD8 *cursor_image) { @@ -309,7 +320,7 @@ xf86_set_cursor_colors(ScrnInfoPtr scrn, int bg, int fg) } } -static void +void xf86_crtc_hide_cursor(xf86CrtcPtr crtc) { if (crtc->cursor_shown) { @@ -333,16 +344,21 @@ xf86_hide_cursors(ScrnInfoPtr scrn) } } -static void +Bool xf86_crtc_show_cursor(xf86CrtcPtr crtc) { - if (!crtc->cursor_shown && crtc->cursor_in_range) { - crtc->funcs->show_cursor(crtc); - crtc->cursor_shown = TRUE; + if (!crtc->cursor_in_range) { + crtc->funcs->hide_cursor(crtc); + return TRUE; } + + if (!crtc->cursor_shown) + crtc->cursor_shown = xf86_driver_show_cursor(crtc); + + return crtc->cursor_shown; } -void +Bool xf86_show_cursors(ScrnInfoPtr scrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -352,9 +368,11 @@ xf86_show_cursors(ScrnInfoPtr scrn) for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; - if (crtc->enabled) - xf86_crtc_show_cursor(crtc); + if (crtc->enabled && !xf86_crtc_show_cursor(crtc)) + return FALSE; } + + return TRUE; } static void @@ -653,7 +671,7 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) cursor_info->SetCursorPosition = xf86_set_cursor_position; cursor_info->LoadCursorImageCheck = xf86_load_cursor_image; cursor_info->HideCursor = xf86_hide_cursors; - cursor_info->ShowCursor = xf86_show_cursors; + cursor_info->ShowCursorCheck = xf86_show_cursors; cursor_info->UseHWCursor = xf86_use_hw_cursor; if (flags & HARDWARE_CURSOR_ARGB) { cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb; diff --git a/xserver/hw/xfree86/modes/xf86DiDGA.c b/xserver/hw/xfree86/modes/xf86DiDGA.c index 645727441..368649852 100644 --- a/xserver/hw/xfree86/modes/xf86DiDGA.c +++ b/xserver/hw/xfree86/modes/xf86DiDGA.c @@ -22,10 +22,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include "xf86.h" diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c index f903496f5..96249ac3a 100644 --- a/xserver/hw/xfree86/modes/xf86EdidModes.c +++ b/xserver/hw/xfree86/modes/xf86EdidModes.c @@ -29,10 +29,6 @@ */ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #define _PARSE_EDID_ @@ -434,7 +430,7 @@ FindDMTMode(int hsize, int vsize, int refresh, Bool rb) int i; const DisplayModeRec *ret; - for (i = 0; i < sizeof(DMTModes) / sizeof(DisplayModeRec); i++) { + for (i = 0; i < ARRAY_SIZE(DMTModes); i++) { ret = &DMTModes[i]; if (!rb && xf86ModeIsReduced(ret)) @@ -466,21 +462,38 @@ FindDMTMode(int hsize, int vsize, int refresh, Bool rb) * for modes in this section, but does say that CVT is preferred. */ static DisplayModePtr -DDCModesFromStandardTiming(struct std_timings *timing, ddc_quirk_t quirks, +DDCModesFromStandardTiming(DisplayModePtr pool, struct std_timings *timing, + ddc_quirk_t quirks, int timing_level, Bool rb) { DisplayModePtr Modes = NULL, Mode = NULL; int i, hsize, vsize, refresh; for (i = 0; i < STD_TIMINGS; i++) { + DisplayModePtr p = NULL; hsize = timing[i].hsize; vsize = timing[i].vsize; refresh = timing[i].refresh; - /* HDTV hack, because you can't say 1366 */ + /* HDTV hack, part one */ if (refresh == 60 && ((hsize == 1360 && vsize == 765) || (hsize == 1368 && vsize == 769))) { + hsize = 1366; + vsize = 768; + } + + /* If we already have a detailed timing for this size, don't add more */ + for (p = pool; p; p = p->next) { + if (p->HDisplay == hsize && p->VDisplay == vsize && + refresh == round(xf86ModeVRefresh(p))) + break; + } + if (p) + continue; + + /* HDTV hack, because you can't say 1366 */ + if (refresh == 60 && hsize == 1366 && vsize == 768) { Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE); Mode->HDisplay = 1366; Mode->HSyncStart--; @@ -531,11 +544,9 @@ DDCModeDoInterlaceQuirks(DisplayModePtr mode) {1440, 576}, {2880, 576}, }; - static const int n_modes = - sizeof(cea_interlaced) / sizeof(cea_interlaced[0]); int i; - for (i = 0; i < n_modes; i++) { + for (i = 0; i < ARRAY_SIZE(cea_interlaced); i++) { if ((mode->HDisplay == cea_interlaced[i].w) && (mode->VDisplay == cea_interlaced[i].h / 2)) { mode->VDisplay *= 2; @@ -1019,7 +1030,8 @@ handle_detailed_modes(struct detailed_monitor_section *det_mon, void *data) p->Modes = xf86ModesAdd(p->Modes, Mode); break; case DS_STD_TIMINGS: - Mode = DDCModesFromStandardTiming(det_mon->section.std_t, + Mode = DDCModesFromStandardTiming(p->Modes, + det_mon->section.std_t, p->quirks, p->timing_level, p->rb); p->Modes = xf86ModesAdd(p->Modes, Mode); break; @@ -1071,16 +1083,17 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) xf86ForEachDetailedBlock(DDC, handle_detailed_modes, &p); Modes = p.Modes; + /* Add cea-extension mode timings */ + Mode = DDCModesFromCEAExtension(scrnIndex, DDC); + Modes = xf86ModesAdd(Modes, Mode); + /* Add established timings */ Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1, quirks); Modes = xf86ModesAdd(Modes, Mode); /* Add standard timings */ - Mode = DDCModesFromStandardTiming(DDC->timings2, quirks, timing_level, rb); - Modes = xf86ModesAdd(Modes, Mode); - - /* Add cea-extension mode timings */ - Mode = DDCModesFromCEAExtension(scrnIndex, DDC); + Mode = DDCModesFromStandardTiming(Modes, DDC->timings2, quirks, + timing_level, rb); Modes = xf86ModesAdd(Modes, Mode); if (quirks & DDC_QUIRK_PREFER_LARGE_60) @@ -1198,21 +1211,19 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) if (!Monitor->nHsync || !Monitor->nVrefresh) DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); - /* look for last Mode */ - Mode = Modes; - - while (Mode->next) - Mode = Mode->next; - /* add to MonPtr */ if (Monitor->Modes) { Monitor->Last->next = Modes; Modes->prev = Monitor->Last; - Monitor->Last = Mode; } else { Monitor->Modes = Modes; - Monitor->Last = Mode; } + + Monitor->Modes = xf86PruneDuplicateModes(Monitor->Modes); + + /* Update pointer to last mode */ + for (Mode = Monitor->Modes; Mode && Mode->next; Mode = Mode->next) {} + Monitor->Last = Mode; } } diff --git a/xserver/hw/xfree86/modes/xf86Modes.c b/xserver/hw/xfree86/modes/xf86Modes.c index 43b223307..5651f1ef8 100644 --- a/xserver/hw/xfree86/modes/xf86Modes.c +++ b/xserver/hw/xfree86/modes/xf86Modes.c @@ -27,10 +27,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include "xf86Modes.h" diff --git a/xserver/hw/xfree86/modes/xf86RandR12.c b/xserver/hw/xfree86/modes/xf86RandR12.c index 2f6f92211..efe04d0c9 100644 --- a/xserver/hw/xfree86/modes/xf86RandR12.c +++ b/xserver/hw/xfree86/modes/xf86RandR12.c @@ -22,10 +22,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include "xf86.h" @@ -1263,40 +1259,82 @@ xf86RandR12CrtcComputeGamma(xf86CrtcPtr crtc, LOCO *palette, for (shift = 0; (gamma_size << shift) < (1 << 16); shift++); - gamma_slots = crtc->gamma_size / palette_red_size; - for (i = 0; i < palette_red_size; i++) { - value = palette[i].red; - if (gamma_red) - value = gamma_red[value]; - else - value <<= shift; + if (crtc->gamma_size >= palette_red_size) { + /* Upsampling of smaller palette to larger hw lut size */ + gamma_slots = crtc->gamma_size / palette_red_size; + for (i = 0; i < palette_red_size; i++) { + value = palette[i].red; + if (gamma_red) + value = gamma_red[value]; + else + value <<= shift; - for (j = 0; j < gamma_slots; j++) - crtc->gamma_red[i * gamma_slots + j] = value; + for (j = 0; j < gamma_slots; j++) + crtc->gamma_red[i * gamma_slots + j] = value; + } + } else { + /* Downsampling of larger palette to smaller hw lut size */ + for (i = 0; i < crtc->gamma_size; i++) { + value = palette[i * (palette_red_size - 1) / (crtc->gamma_size - 1)].red; + if (gamma_red) + value = gamma_red[value]; + else + value <<= shift; + + crtc->gamma_red[i] = value; + } } - gamma_slots = crtc->gamma_size / palette_green_size; - for (i = 0; i < palette_green_size; i++) { - value = palette[i].green; - if (gamma_green) - value = gamma_green[value]; - else - value <<= shift; + if (crtc->gamma_size >= palette_green_size) { + /* Upsampling of smaller palette to larger hw lut size */ + gamma_slots = crtc->gamma_size / palette_green_size; + for (i = 0; i < palette_green_size; i++) { + value = palette[i].green; + if (gamma_green) + value = gamma_green[value]; + else + value <<= shift; - for (j = 0; j < gamma_slots; j++) - crtc->gamma_green[i * gamma_slots + j] = value; + for (j = 0; j < gamma_slots; j++) + crtc->gamma_green[i * gamma_slots + j] = value; + } + } else { + /* Downsampling of larger palette to smaller hw lut size */ + for (i = 0; i < crtc->gamma_size; i++) { + value = palette[i * (palette_green_size - 1) / (crtc->gamma_size - 1)].green; + if (gamma_green) + value = gamma_green[value]; + else + value <<= shift; + + crtc->gamma_green[i] = value; + } } - gamma_slots = crtc->gamma_size / palette_blue_size; - for (i = 0; i < palette_blue_size; i++) { - value = palette[i].blue; - if (gamma_blue) - value = gamma_blue[value]; - else - value <<= shift; + if (crtc->gamma_size >= palette_blue_size) { + /* Upsampling of smaller palette to larger hw lut size */ + gamma_slots = crtc->gamma_size / palette_blue_size; + for (i = 0; i < palette_blue_size; i++) { + value = palette[i].blue; + if (gamma_blue) + value = gamma_blue[value]; + else + value <<= shift; - for (j = 0; j < gamma_slots; j++) - crtc->gamma_blue[i * gamma_slots + j] = value; + for (j = 0; j < gamma_slots; j++) + crtc->gamma_blue[i * gamma_slots + j] = value; + } + } else { + /* Downsampling of larger palette to smaller hw lut size */ + for (i = 0; i < crtc->gamma_size; i++) { + value = palette[i * (palette_blue_size - 1) / (crtc->gamma_size - 1)].blue; + if (gamma_blue) + value = gamma_blue[value]; + else + value <<= shift; + + crtc->gamma_blue[i] = value; + } } } @@ -1982,7 +2020,7 @@ xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) RRCrtcPtr randr_crtc = xf86CompatRRCrtc(pScrn); int size; - if (!randr_crtc) + if (!randr_crtc || pScrn->LoadPalette == xf86RandR12LoadPalette) return Success; size = max(0, randr_crtc->gammaSize); @@ -2168,6 +2206,131 @@ xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider) config->randr_provider = NULL; } +static void +xf86CrtcCheckReset(xf86CrtcPtr crtc) { + if (xf86CrtcInUse(crtc)) { + RRTransformPtr transform; + + if (crtc->desiredTransformPresent) + transform = &crtc->desiredTransform; + else + transform = NULL; + xf86CrtcSetModeTransform(crtc, &crtc->desiredMode, + crtc->desiredRotation, transform, + crtc->desiredX, crtc->desiredY); + xf86_crtc_show_cursor(crtc); + } +} + +void +xf86CrtcLeaseTerminated(RRLeasePtr lease) +{ + int c; + int o; + + RRLeaseTerminated(lease); + /* + * Force a full mode set on any crtc in the expiring lease which + * was running before the lease started + */ + for (c = 0; c < lease->numCrtcs; c++) { + RRCrtcPtr randr_crtc = lease->crtcs[c]; + xf86CrtcPtr crtc = randr_crtc->devPrivate; + + xf86CrtcCheckReset(crtc); + } + + /* Check to see if any leased output is using a crtc which + * was not reset in the above loop + */ + for (o = 0; o < lease->numOutputs; o++) { + RROutputPtr randr_output = lease->outputs[o]; + xf86OutputPtr output = randr_output->devPrivate; + xf86CrtcPtr crtc = output->crtc; + + if (crtc) { + for (c = 0; c < lease->numCrtcs; c++) + if (lease->crtcs[c] == crtc->randr_crtc) + break; + if (c != lease->numCrtcs) + continue; + xf86CrtcCheckReset(crtc); + } + } + RRLeaseFree(lease); +} + +static Bool +xf86CrtcSoleOutput(xf86CrtcPtr crtc, xf86OutputPtr output) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr other = config->output[o]; + + if (other != output && other->crtc == crtc) + return FALSE; + } + return TRUE; +} + +void +xf86CrtcLeaseStarted(RRLeasePtr lease) +{ + int c; + int o; + + for (c = 0; c < lease->numCrtcs; c++) { + RRCrtcPtr randr_crtc = lease->crtcs[c]; + xf86CrtcPtr crtc = randr_crtc->devPrivate; + + if (crtc->enabled) { + /* + * Leave the primary plane enabled so we can + * flip without blanking the screen. Hide + * the cursor so it doesn't remain on the screen + * while the lease is active + */ + xf86_crtc_hide_cursor(crtc); + crtc->enabled = FALSE; + } + } + for (o = 0; o < lease->numOutputs; o++) { + RROutputPtr randr_output = lease->outputs[o]; + xf86OutputPtr output = randr_output->devPrivate; + xf86CrtcPtr crtc = output->crtc; + + if (crtc) + if (xf86CrtcSoleOutput(crtc, output)) + crtc->enabled = FALSE; + } +} + +static int +xf86RandR16CreateLease(ScreenPtr screen, RRLeasePtr randr_lease, int *fd) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + if (config->funcs->create_lease) + return config->funcs->create_lease(randr_lease, fd); + else + return BadMatch; +} + + +static void +xf86RandR16TerminateLease(ScreenPtr screen, RRLeasePtr randr_lease) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + if (config->funcs->terminate_lease) + config->funcs->terminate_lease(randr_lease); +} + static Bool xf86RandR12Init12(ScreenPtr pScreen) { @@ -2197,6 +2360,9 @@ xf86RandR12Init12(ScreenPtr pScreen) rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap; rp->rrProviderDestroy = xf86RandR14ProviderDestroy; + rp->rrCreateLease = xf86RandR16CreateLease; + rp->rrTerminateLease = xf86RandR16TerminateLease; + pScrn->PointerMoved = xf86RandR12PointerMoved; pScrn->ChangeGamma = xf86RandR12ChangeGamma; diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c index 13e5a5059..85ab9b8c7 100644 --- a/xserver/hw/xfree86/modes/xf86Rotate.c +++ b/xserver/hw/xfree86/modes/xf86Rotate.c @@ -23,10 +23,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include diff --git a/xserver/hw/xfree86/modes/xf86cvt.c b/xserver/hw/xfree86/modes/xf86cvt.c index b6c1bc81c..c0a342040 100644 --- a/xserver/hw/xfree86/modes/xf86cvt.c +++ b/xserver/hw/xfree86/modes/xf86cvt.c @@ -28,10 +28,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include "xf86.h" diff --git a/xserver/hw/xfree86/modes/xf86gtf.c b/xserver/hw/xfree86/modes/xf86gtf.c index 17c2f3255..c6a738422 100644 --- a/xserver/hw/xfree86/modes/xf86gtf.c +++ b/xserver/hw/xfree86/modes/xf86gtf.c @@ -62,10 +62,6 @@ #ifdef HAVE_XORG_CONFIG_H #include -#else -#ifdef HAVE_CONFIG_H -#include -#endif #endif #include "xf86.h" diff --git a/xserver/hw/xfree86/os-support/Makefile.in b/xserver/hw/xfree86/os-support/Makefile.in index 3d6f65a09..e7aa6817c 100644 --- a/xserver/hw/xfree86/os-support/Makefile.in +++ b/xserver/hw/xfree86/os-support/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -372,6 +372,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -390,15 +391,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -406,6 +410,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -477,8 +483,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.am b/xserver/hw/xfree86/os-support/bsd/Makefile.am index 8d5abc1d5..eb208962b 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.am +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.am @@ -26,8 +26,7 @@ endif if ALPHA_VIDEO # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. ARCH_SOURCES = \ - alpha_video.c \ - bsd_ev56.c + alpha_video.c endif if ARM_VIDEO diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.in b/xserver/hw/xfree86/os-support/bsd/Makefile.in index 2e41e7664..a99576633 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.in +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -76,12 +76,11 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libbsd_la_LIBADD = am__libbsd_la_SOURCES_DIST = $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c $(srcdir)/../shared/vidmem.c \ - bsd_VTsw.c bsd_init.c bsd_bell.c alpha_video.c bsd_ev56.c \ - arm64_video.c $(srcdir)/../shared/ioperm_noop.c arm_video.c \ - hppa_video.c i386_video.c luna88k_video.c ppc_video.c \ - sgi_video.c sparc64_video.c bsd_sbus.c \ - $(srcdir)/../shared/agp_noop.c bsd_agp.c \ - $(srcdir)/../shared/pm_noop.c $(srcdir)/bsd_apm.c \ + bsd_VTsw.c bsd_init.c bsd_bell.c alpha_video.c arm64_video.c \ + $(srcdir)/../shared/ioperm_noop.c arm_video.c hppa_video.c \ + i386_video.c luna88k_video.c ppc_video.c sgi_video.c \ + sparc64_video.c bsd_sbus.c $(srcdir)/../shared/agp_noop.c \ + bsd_agp.c $(srcdir)/../shared/pm_noop.c $(srcdir)/bsd_apm.c \ $(srcdir)/bsd_kqueue_apm.c $(srcdir)/../shared/kmod_noop.c \ bsd_kmod.c @ALPHA_VIDEO_FALSE@@ARM64_VIDEO_FALSE@@ARM_VIDEO_FALSE@@HPPA_VIDEO_FALSE@@I386_VIDEO_FALSE@@LUNA88K_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SGI_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@am__objects_1 = sparc64_video.lo \ @@ -100,7 +99,7 @@ am__libbsd_la_SOURCES_DIST = $(srcdir)/../shared/posix_tty.c \ @ALPHA_VIDEO_FALSE@@ARM64_VIDEO_FALSE@@ARM_VIDEO_TRUE@ ioperm_noop.lo @ALPHA_VIDEO_FALSE@@ARM64_VIDEO_TRUE@am__objects_1 = arm64_video.lo \ @ALPHA_VIDEO_FALSE@@ARM64_VIDEO_TRUE@ ioperm_noop.lo -@ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo bsd_ev56.lo +@ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo @AGP_FALSE@am__objects_2 = agp_noop.lo @AGP_TRUE@am__objects_2 = bsd_agp.lo @BSD_APM_FALSE@@BSD_KQUEUE_APM_FALSE@am__objects_3 = pm_noop.lo @@ -343,6 +342,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -361,15 +361,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -377,6 +380,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -448,8 +453,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -527,8 +530,7 @@ noinst_LTLIBRARIES = libbsd.la # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. @ALPHA_VIDEO_TRUE@ARCH_SOURCES = \ -@ALPHA_VIDEO_TRUE@ alpha_video.c \ -@ALPHA_VIDEO_TRUE@ bsd_ev56.c +@ALPHA_VIDEO_TRUE@ alpha_video.c @ARM64_VIDEO_TRUE@ARCH_SOURCES = arm64_video.c \ @ARM64_VIDEO_TRUE@ $(srcdir)/../shared/ioperm_noop.c @@ -642,7 +644,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_apm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_bell.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_kmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_kqueue_apm.Plo@am__quote@ diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c index 60a19d79a..dab0a9a7d 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c @@ -37,14 +37,12 @@ static struct { #endif }; -#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0])) - static pmEvent bsdToXF86(int type) { int i; - for (i = 0; i < numApmEvents; i++) { + for (i = 0; i < ARRAY_SIZE(bsdToXF86Array); i++) { if (type == bsdToXF86Array[i].apmBsd) { return bsdToXF86Array[i].xf86; } diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c b/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c deleted file mode 100644 index 95883491b..000000000 --- a/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c +++ /dev/null @@ -1,75 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "input.h" -#include "scrnintstr.h" -#include "compiler.h" - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "xf86OSpriv.h" - -#include - -/* - * The following functions are used only on EV56 and greater CPUs, - * and the assembler requires going to EV56 mode in order to emit - * these instructions. - */ -__asm(".arch ev56"); - -int readDense8(void *Base, register unsigned long Offset); -int readDense16(void *Base, register unsigned long Offset); -int readDense32(void *Base, register unsigned long Offset); -void - writeDense8(int Value, void *Base, register unsigned long Offset); -void - writeDense16(int Value, void *Base, register unsigned long Offset); -void - writeDense32(int Value, void *Base, register unsigned long Offset); - -int -readDense8(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return (alpha_ldbu((void *) ((unsigned long) Base + (Offset)))); -} - -int -readDense16(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return (alpha_ldwu((void *) ((unsigned long) Base + (Offset)))); -} - -int -readDense32(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); -} - -void -writeDense8(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); -} - -void -writeDense16(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); -} - -void -writeDense32(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; -} diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index be2db06c4..1b33cef7c 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -207,7 +207,7 @@ xf86OpenConsole(void) /* Check that a supported console driver was found */ if (fd < 0) { char cons_drivers[80] = {0, }; - for (i = 0; i < sizeof(supported_drivers) / sizeof(char *); i++) { + for (i = 0; i < ARRAY_SIZE(supported_drivers); i++) { if (i) { strcat(cons_drivers, ", "); } diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index 8e9d09384..6911e360e 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c @@ -70,14 +70,12 @@ static struct { #endif }; -#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0])) - static pmEvent bsdToXF86(int type) { int i; - for (i = 0; i < numApmEvents; i++) { + for (i = 0; i < ARRAY_SIZE(bsdToXF86Array); i++) { if (type == bsdToXF86Array[i].apmBsd) { return bsdToXF86Array[i].xf86; } diff --git a/xserver/hw/xfree86/os-support/bus/Makefile.in b/xserver/hw/xfree86/os-support/bus/Makefile.in index c3ae11787..a312795bf 100644 --- a/xserver/hw/xfree86/os-support/bus/Makefile.in +++ b/xserver/hw/xfree86/os-support/bus/Makefile.in @@ -72,7 +72,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -346,6 +346,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -364,15 +365,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -380,6 +384,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -451,8 +457,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/bus/Pci.h b/xserver/hw/xfree86/os-support/bus/Pci.h index 776bb637c..1921e0282 100644 --- a/xserver/hw/xfree86/os-support/bus/Pci.h +++ b/xserver/hw/xfree86/os-support/bus/Pci.h @@ -111,7 +111,7 @@ /* * Global Definitions */ -#if (defined(__alpha__) || defined(__ia64__)) && defined (linux) +#if (defined(__alpha__) || defined(__ia64__)) && defined (__linux__) #define PCI_DOM_MASK 0x01fful #else #define PCI_DOM_MASK 0x0ffu @@ -135,7 +135,7 @@ #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u) -#if defined(linux) +#if defined(__linux__) #define osPciInit(x) do {} while (0) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || \ diff --git a/xserver/hw/xfree86/os-support/bus/Sbus.c b/xserver/hw/xfree86/os-support/bus/Sbus.c index a5265770c..cb14368f8 100644 --- a/xserver/hw/xfree86/os-support/bus/Sbus.c +++ b/xserver/hw/xfree86/os-support/bus/Sbus.c @@ -157,7 +157,7 @@ promSetNode(sbusPromNodePtr pnode) static void promIsP1275(void) { -#ifdef linux +#ifdef __linux__ FILE *f; char buffer[1024]; diff --git a/xserver/hw/xfree86/os-support/bus/xf86Pci.h b/xserver/hw/xfree86/os-support/bus/xf86Pci.h index 210ab3d89..4dbe08bd7 100644 --- a/xserver/hw/xfree86/os-support/bus/xf86Pci.h +++ b/xserver/hw/xfree86/os-support/bus/xf86Pci.h @@ -234,5 +234,6 @@ /* Public PCI access functions */ extern _X_EXPORT Bool xf86scanpci(void); +extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *dev); #endif /* _XF86PCI_H */ diff --git a/xserver/hw/xfree86/os-support/bus/xf86Sbus.h b/xserver/hw/xfree86/os-support/bus/xf86Sbus.h index a24d92269..e9b880d7f 100644 --- a/xserver/hw/xfree86/os-support/bus/xf86Sbus.h +++ b/xserver/hw/xfree86/os-support/bus/xf86Sbus.h @@ -28,7 +28,7 @@ #ifndef _XF86_SBUS_H #define _XF86_SBUS_H -#if defined(linux) +#if defined(__linux__) #include #include #include diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.in b/xserver/hw/xfree86/os-support/hurd/Makefile.in index 504c9e483..ecc3cc20d 100644 --- a/xserver/hw/xfree86/os-support/hurd/Makefile.in +++ b/xserver/hw/xfree86/os-support/hurd/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -309,6 +309,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -327,15 +328,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -343,6 +347,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -414,8 +420,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.am b/xserver/hw/xfree86/os-support/linux/Makefile.am index d8cb17777..9b4535b53 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.am +++ b/xserver/hw/xfree86/os-support/linux/Makefile.am @@ -1,15 +1,10 @@ noinst_LTLIBRARIES = liblinux.la -if LINUX_ALPHA -noinst_LTLIBRARIES += liblinuxev56.la - -liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 - -liblinuxev56_la_SOURCES = lnx_ev56.c -endif - if LNXACPI -ACPI_SRCS = lnx_acpi.c lnx_apm.c +ACPI_SRCS = lnx_acpi.c +if !LNXAPM +ACPI_SRCS += lnx_apm.c +endif XORG_CFLAGS += -DHAVE_ACPI endif @@ -36,7 +31,3 @@ liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \ AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) - -if LINUX_ALPHA -liblinux_la_LIBADD = liblinuxev56.la -endif diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.in b/xserver/hw/xfree86/os-support/linux/Makefile.in index 014eaab38..623f93f5d 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.in +++ b/xserver/hw/xfree86/os-support/linux/Makefile.in @@ -50,7 +50,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@LINUX_ALPHA_TRUE@am__append_1 = liblinuxev56.la +@LNXACPI_TRUE@@LNXAPM_FALSE@am__append_1 = lnx_apm.c @LNXACPI_TRUE@am__append_2 = -DHAVE_ACPI @LNXAPM_TRUE@am__append_3 = -DHAVE_APM @SYSTEMD_LOGIND_TRUE@am__append_4 = $(DBUS_CFLAGS) @@ -72,39 +72,30 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -@LINUX_ALPHA_TRUE@liblinux_la_DEPENDENCIES = liblinuxev56.la +liblinux_la_LIBADD = am__liblinux_la_SOURCES_DIST = linux.h lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/VTsw_usl.c $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c $(srcdir)/../shared/sigio.c \ lnx_acpi.c lnx_apm.c systemd-logind.c -@LNXACPI_TRUE@am__objects_1 = lnx_acpi.lo lnx_apm.lo -@LNXAPM_TRUE@am__objects_2 = lnx_apm.lo -@SYSTEMD_LOGIND_TRUE@am__objects_3 = systemd-logind.lo +@LNXACPI_TRUE@@LNXAPM_FALSE@am__objects_1 = lnx_apm.lo +@LNXACPI_TRUE@am__objects_2 = lnx_acpi.lo $(am__objects_1) +@LNXAPM_TRUE@am__objects_3 = lnx_apm.lo +@SYSTEMD_LOGIND_TRUE@am__objects_4 = systemd-logind.lo am_liblinux_la_OBJECTS = lnx_init.lo lnx_video.lo lnx_agp.lo \ lnx_kmod.lo lnx_bell.lo lnx_platform.lo VTsw_usl.lo \ - posix_tty.lo vidmem.lo sigio.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) + posix_tty.lo vidmem.lo sigio.lo $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) liblinux_la_OBJECTS = $(am_liblinux_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -liblinuxev56_la_LIBADD = -am__liblinuxev56_la_SOURCES_DIST = lnx_ev56.c -@LINUX_ALPHA_TRUE@am_liblinuxev56_la_OBJECTS = \ -@LINUX_ALPHA_TRUE@ liblinuxev56_la-lnx_ev56.lo -liblinuxev56_la_OBJECTS = $(am_liblinuxev56_la_OBJECTS) -liblinuxev56_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(liblinuxev56_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -@LINUX_ALPHA_TRUE@am_liblinuxev56_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -139,9 +130,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(liblinux_la_SOURCES) $(liblinuxev56_la_SOURCES) -DIST_SOURCES = $(am__liblinux_la_SOURCES_DIST) \ - $(am__liblinuxev56_la_SOURCES_DIST) +SOURCES = $(liblinux_la_SOURCES) +DIST_SOURCES = $(am__liblinux_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -333,6 +323,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -351,15 +342,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -367,6 +361,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -439,8 +435,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -505,10 +499,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = liblinux.la $(am__append_1) -@LINUX_ALPHA_TRUE@liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 -@LINUX_ALPHA_TRUE@liblinuxev56_la_SOURCES = lnx_ev56.c -@LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c lnx_apm.c +noinst_LTLIBRARIES = liblinux.la +@LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c $(am__append_1) @LNXAPM_TRUE@APM_SRCS = lnx_apm.c @SYSTEMD_LOGIND_TRUE@LOGIND_SRCS = systemd-logind.c liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \ @@ -523,7 +515,6 @@ liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \ AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) -@LINUX_ALPHA_TRUE@liblinux_la_LIBADD = liblinuxev56.la all: all-am .SUFFIXES: @@ -571,8 +562,6 @@ clean-noinstLTLIBRARIES: } liblinux.la: $(liblinux_la_OBJECTS) $(liblinux_la_DEPENDENCIES) $(EXTRA_liblinux_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(liblinux_la_OBJECTS) $(liblinux_la_LIBADD) $(LIBS) -liblinuxev56.la: $(liblinuxev56_la_OBJECTS) $(liblinuxev56_la_DEPENDENCIES) $(EXTRA_liblinuxev56_la_DEPENDENCIES) - $(AM_V_CCLD)$(liblinuxev56_la_LINK) $(am_liblinuxev56_la_rpath) $(liblinuxev56_la_OBJECTS) $(liblinuxev56_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -581,7 +570,6 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_usl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_acpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_apm.Plo@am__quote@ @@ -644,13 +632,6 @@ sigio.lo: $(srcdir)/../shared/sigio.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c -liblinuxev56_la-lnx_ev56.lo: lnx_ev56.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblinuxev56_la_CFLAGS) $(CFLAGS) -MT liblinuxev56_la-lnx_ev56.lo -MD -MP -MF $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo -c -o liblinuxev56_la-lnx_ev56.lo `test -f 'lnx_ev56.c' || echo '$(srcdir)/'`lnx_ev56.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo $(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lnx_ev56.c' object='liblinuxev56_la-lnx_ev56.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblinuxev56_la_CFLAGS) $(CFLAGS) -c -o liblinuxev56_la-lnx_ev56.lo `test -f 'lnx_ev56.c' || echo '$(srcdir)/'`lnx_ev56.c - mostlyclean-libtool: -rm -f *.lo diff --git a/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c index 187698399..134809814 100644 --- a/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c +++ b/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c @@ -231,20 +231,9 @@ vm86_GP_fault(xf86Int10InfoPtr pInt) static int do_vm86(xf86Int10InfoPtr pInt) { - int retval, signo; + int retval; - xf86InterceptSignals(&signo); retval = vm86_rep(VM86S); - xf86InterceptSignals(NULL); - - if (signo >= 0) { - xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, - "vm86() syscall generated signal %d.\n", signo); - dump_registers(pInt); - dump_code(pInt); - stack_trace(pInt); - return 0; - } switch (VM86_TYPE(retval)) { case VM86_UNKNOWN: diff --git a/xserver/hw/xfree86/os-support/linux/lnx_agp.c b/xserver/hw/xfree86/os-support/linux/lnx_agp.c index 2a28c6af8..e47bbfa1a 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_agp.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_agp.c @@ -17,7 +17,7 @@ #include "xf86_OSlib.h" #include "xf86OSpriv.h" -#if defined(linux) +#if defined(__linux__) #include #include #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) @@ -91,7 +91,7 @@ GARTInit(int screenNum) } xf86ReleaseGART(-1); -#if defined(linux) +#if defined(__linux__) /* Per Dave Jones, every effort will be made to keep the * agpgart interface backwards compatible, so allow all * future versions. @@ -196,7 +196,7 @@ xf86ReleaseGART(int screenNum) * to give up access to the GART, but not to remove any * allocations. */ -#if !defined(linux) +#if !defined(__linux__) if (screenNum == -1) #endif { diff --git a/xserver/hw/xfree86/os-support/linux/lnx_apm.c b/xserver/hw/xfree86/os-support/linux/lnx_apm.c index 621691997..29c363360 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_apm.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_apm.c @@ -62,8 +62,6 @@ static struct { #endif }; -#define numApmEvents (sizeof(LinuxToXF86) / sizeof(LinuxToXF86[0])) - /* * APM is still under construction. * I'm not sure if the places where I initialize/deinitialize @@ -84,12 +82,12 @@ lnxPMGetEventFromOs(int fd, pmEvent * events, int num) if (n > num) n = num; for (i = 0; i < n; i++) { - for (j = 0; j < numApmEvents; j++) + for (j = 0; j < ARRAY_SIZE(LinuxToXF86); j++) if (LinuxToXF86[j].apmLinux == linuxEvents[i]) { events[i] = LinuxToXF86[j].xf86; break; } - if (j == numApmEvents) + if (j == ARRAY_SIZE(LinuxToXF86)) events[i] = XF86_APM_UNKNOWN; } return n; diff --git a/xserver/hw/xfree86/os-support/linux/lnx_ev56.c b/xserver/hw/xfree86/os-support/linux/lnx_ev56.c deleted file mode 100644 index 4e886b6ce..000000000 --- a/xserver/hw/xfree86/os-support/linux/lnx_ev56.c +++ /dev/null @@ -1,59 +0,0 @@ -/* This file has to be built with -mcpu=ev56 */ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "compiler.h" - -int readDense8(void *Base, register unsigned long Offset); -int readDense16(void *Base, register unsigned long Offset); -int readDense32(void *Base, register unsigned long Offset); -void - writeDense8(int Value, void *Base, register unsigned long Offset); -void - writeDense16(int Value, void *Base, register unsigned long Offset); -void - writeDense32(int Value, void *Base, register unsigned long Offset); - -int -readDense8(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return *(volatile CARD8 *) ((unsigned long) Base + (Offset)); -} - -int -readDense16(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return *(volatile CARD16 *) ((unsigned long) Base + (Offset)); -} - -int -readDense32(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); -} - -void -writeDense8(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; -} - -void -writeDense16(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; -} - -void -writeDense32(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; -} diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c index 9e5ddcd50..039dc4a4d 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_init.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c @@ -46,10 +46,6 @@ #define K_OFF 0x4 #endif -#ifndef KDSKBMUTE -#define KDSKBMUTE 0x4B51 -#endif - static Bool KeepTty = FALSE; static int activeVT = -1; @@ -262,23 +258,18 @@ xf86OpenConsole(void) tcgetattr(xf86Info.consoleFd, &tty_attr); SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode)); - /* disable kernel special keys and buffering, new style */ - SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMUTE, 1)); + /* disable kernel special keys and buffering */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF)); if (ret < 0) { - /* disable kernel special keys and buffering, old style */ - SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF)); + /* fine, just disable special keys */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW)); if (ret < 0) - { - /* fine, just disable special keys */ - SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW)); - if (ret < 0) - FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", - strerror(errno)); + FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", + strerror(errno)); - /* ... and drain events, else the kernel gets angry */ - xf86SetConsoleHandler(drain_console, NULL); - } + /* ... and drain events, else the kernel gets angry */ + xf86SetConsoleHandler(drain_console, NULL); } nTty = tty_attr; @@ -327,7 +318,6 @@ xf86CloseConsole(void) xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n", strerror(errno)); - SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMUTE, 0)); SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode)); tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); @@ -356,6 +346,13 @@ xf86CloseConsole(void) close(xf86Info.consoleFd); /* make the vt-manager happy */ } +#define CHECK_FOR_REQUIRED_ARGUMENT() \ + if (((i + 1) >= argc) || (!argv[i + 1])) { \ + ErrorF("Required argument to %s not specified\n", argv[i]); \ + UseMsg(); \ + FatalError("Required argument to %s not specified\n", argv[i]); \ + } + int xf86ProcessArgument(int argc, char *argv[], int i) { @@ -376,6 +373,19 @@ xf86ProcessArgument(int argc, char *argv[], int i) } return 1; } + + if (!strcmp(argv[i], "-masterfd")) { + CHECK_FOR_REQUIRED_ARGUMENT(); + if (xf86PrivsElevated()) + FatalError("\nCannot specify -masterfd when server is setuid/setgid\n"); + if (sscanf(argv[++i], "%d", &xf86DRMMasterFd) != 1) { + UseMsg(); + xf86DRMMasterFd = -1; + return 0; + } + return 2; + } + return 0; } @@ -385,4 +395,5 @@ xf86UseMsg(void) ErrorF("vtXX use the specified VT number\n"); ErrorF("-keeptty "); ErrorF("don't detach controlling tty (for debugging only)\n"); + ErrorF("-masterfd use the specified fd as the DRM master fd (not if setuid/gid)\n"); } diff --git a/xserver/hw/xfree86/os-support/linux/lnx_platform.c b/xserver/hw/xfree86/os-support/linux/lnx_platform.c index 1d145b362..70374ace8 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_platform.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_platform.c @@ -26,19 +26,16 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) drmSetVersion sv; drmVersionPtr v; char *buf; - int major, minor, fd; + int fd; int err = 0; Bool paused, server_fd = FALSE; - major = attribs->major; - minor = attribs->minor; - - fd = systemd_logind_take_fd(major, minor, path, &paused); + fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused); if (fd != -1) { if (paused) { LogMessage(X_ERROR, "Error systemd-logind returned paused fd for drm node\n"); - systemd_logind_release_fd(major, minor, -1); + systemd_logind_release_fd(attribs->major, attribs->minor, -1); return FALSE; } attribs->fd = fd; @@ -46,7 +43,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) } if (fd == -1) - fd = open(path, O_RDWR, O_CLOEXEC); + fd = open(path, O_RDWR | O_CLOEXEC, 0); if (fd == -1) return FALSE; diff --git a/xserver/hw/xfree86/os-support/linux/lnx_video.c b/xserver/hw/xfree86/os-support/linux/lnx_video.c index c09d71947..04e45092a 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_video.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_video.c @@ -166,30 +166,3 @@ xf86DisableIO(void) ExtendedEnabled = FALSE; } - -#if defined (__alpha__) - -extern int readDense8(void *Base, register unsigned long Offset); -extern int readDense16(void *Base, register unsigned long Offset); -extern int readDense32(void *Base, register unsigned long Offset); -extern void - writeDense8(int Value, void *Base, register unsigned long Offset); -extern void - writeDense16(int Value, void *Base, register unsigned long Offset); -extern void - writeDense32(int Value, void *Base, register unsigned long Offset); - -void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) - = writeDense8; -void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) - = writeDense16; -void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) - = writeDense32; -int (*xf86ReadMmio8) (void *Base, unsigned long Offset) - = readDense8; -int (*xf86ReadMmio16) (void *Base, unsigned long Offset) - = readDense16; -int (*xf86ReadMmio32) (void *Base, unsigned long Offset) - = readDense32; - -#endif /* __alpha__ */ diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in index bb80b923a..0e5ee8f7b 100644 --- a/xserver/hw/xfree86/os-support/misc/Makefile.in +++ b/xserver/hw/xfree86/os-support/misc/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -307,6 +307,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -325,15 +326,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -341,6 +345,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -412,8 +418,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/misc/SlowBcopy.c b/xserver/hw/xfree86/os-support/misc/SlowBcopy.c index 4f4881ce2..9d82c71bf 100644 --- a/xserver/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/xserver/hw/xfree86/os-support/misc/SlowBcopy.c @@ -57,7 +57,7 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) #ifdef __alpha__ -#ifdef linux +#ifdef __linux__ unsigned long _bus_base(void); diff --git a/xserver/hw/xfree86/os-support/shared/posix_tty.c b/xserver/hw/xfree86/os-support/shared/posix_tty.c index 2b287b38f..736e658e1 100644 --- a/xserver/hw/xfree86/os-support/shared/posix_tty.c +++ b/xserver/hw/xfree86/os-support/shared/posix_tty.c @@ -192,7 +192,7 @@ xf86SetSerial(int fd, XF86OptionPtr options) { struct termios t; int val; - const char *s; + char *s; int baud, r; if (fd < 0) @@ -268,8 +268,10 @@ xf86SetSerial(int fd, XF86OptionPtr options) } else { xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s); + free(s); return -1; } + free(s); } if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) { @@ -295,8 +297,10 @@ xf86SetSerial(int fd, XF86OptionPtr options) } else { xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s); + free(s); return -1; } + free(s); } if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) { @@ -489,7 +493,7 @@ static struct states { #endif }; -static int numStates = sizeof(modemStates) / sizeof(modemStates[0]); +static int numStates = ARRAY_SIZE(modemStates); static int xf2osState(int state) diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.in b/xserver/hw/xfree86/os-support/solaris/Makefile.in index 00e3566cf..74ba8bf84 100644 --- a/xserver/hw/xfree86/os-support/solaris/Makefile.in +++ b/xserver/hw/xfree86/os-support/solaris/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -362,6 +362,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -380,15 +381,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -396,6 +400,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -467,8 +473,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/solaris/sun_apm.c b/xserver/hw/xfree86/os-support/solaris/sun_apm.c index 4d4dbc105..dbdc4b677 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_apm.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_apm.c @@ -113,14 +113,12 @@ static struct { #endif }; -#define numApmEvents (sizeof(sunToXF86Array) / sizeof(sunToXF86Array[0])) - static pmEvent sunToXF86(int type) { int i; - for (i = 0; i < numApmEvents; i++) { + for (i = 0; i < ARRAY_SIZE(sunToXF86Array); i++) { if (type == sunToXF86Array[i].apmBsd) { return sunToXF86Array[i].xf86; } diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.in b/xserver/hw/xfree86/os-support/stub/Makefile.in index fbf7416b7..04712aa08 100644 --- a/xserver/hw/xfree86/os-support/stub/Makefile.in +++ b/xserver/hw/xfree86/os-support/stub/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -309,6 +309,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -327,15 +328,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -343,6 +347,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -414,8 +420,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/os-support/xf86_OSlib.h b/xserver/hw/xfree86/os-support/xf86_OSlib.h index 5d78c66e3..159c8064c 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSlib.h +++ b/xserver/hw/xfree86/os-support/xf86_OSlib.h @@ -337,13 +337,7 @@ struct pcvtid { #define MAXHOSTNAMELEN 32 #endif /* !MAXHOSTNAMELEN */ -#if defined(_POSIX_SOURCE) #include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif /* _POSIX_SOURCE */ #ifndef DEV_MEM #define DEV_MEM "/dev/mem" diff --git a/xserver/hw/xfree86/parser/Device.c b/xserver/hw/xfree86/parser/Device.c index 353d48c64..34b7f6557 100644 --- a/xserver/hw/xfree86/parser/Device.c +++ b/xserver/hw/xfree86/parser/Device.c @@ -172,7 +172,7 @@ xf86parseDeviceSection(void) case BIOSBASE: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "BIOSBase"); - ptr->dev_bios_base = xf86_lex_val.num; + /* ignored */ break; case MEMBASE: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) @@ -285,8 +285,6 @@ xf86printDeviceSection(FILE * cf, XF86ConfDevicePtr ptr) } if (ptr->dev_videoram) fprintf(cf, "\tVideoRam %d\n", ptr->dev_videoram); - if (ptr->dev_bios_base) - fprintf(cf, "\tBiosBase 0x%lx\n", ptr->dev_bios_base); if (ptr->dev_mem_base) fprintf(cf, "\tMemBase 0x%lx\n", ptr->dev_mem_base); if (ptr->dev_io_base) diff --git a/xserver/hw/xfree86/parser/Makefile.am b/xserver/hw/xfree86/parser/Makefile.am index 9aa8cfefb..2e4c6afdb 100644 --- a/xserver/hw/xfree86/parser/Makefile.am +++ b/xserver/hw/xfree86/parser/Makefile.am @@ -24,7 +24,6 @@ libxf86config_la_SOURCES = \ $(INTERNAL_SOURCES) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ -DDATADIR=\"$(datadir)\" EXTRA_DIST = \ diff --git a/xserver/hw/xfree86/parser/Makefile.in b/xserver/hw/xfree86/parser/Makefile.in index 8bf545e8c..c65a84db3 100644 --- a/xserver/hw/xfree86/parser/Makefile.in +++ b/xserver/hw/xfree86/parser/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -341,6 +341,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -359,15 +360,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -375,6 +379,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -446,8 +452,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -537,7 +541,6 @@ libxf86config_la_SOURCES = \ $(INTERNAL_SOURCES) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ -DDATADIR=\"$(datadir)\" EXTRA_DIST = \ diff --git a/xserver/hw/xfree86/parser/OutputClass.c b/xserver/hw/xfree86/parser/OutputClass.c index 8064e0cc0..01b348fdd 100644 --- a/xserver/hw/xfree86/parser/OutputClass.c +++ b/xserver/hw/xfree86/parser/OutputClass.c @@ -36,6 +36,8 @@ static const xf86ConfigSymTabRec OutputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {DRIVER, "driver"}, + {MODULEPATH, "modulepath"}, + {OPTION, "option"}, {MATCH_DRIVER, "matchdriver"}, {-1, ""}, }; @@ -52,6 +54,7 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) TestFree(ptr->identifier); TestFree(ptr->comment); TestFree(ptr->driver); + TestFree(ptr->modulepath); xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { xorg_list_del(&group->entry); @@ -60,6 +63,8 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) free(group); } + xf86optionListFree(ptr->option_lst); + prev = ptr; ptr = ptr->list.next; free(prev); @@ -112,6 +117,22 @@ xf86parseOutputClassSection(void) else ptr->driver = xf86_lex_val.str; break; + case MODULEPATH: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "ModulePath"); + if (ptr->modulepath) { + char *path; + XNFasprintf(&path, "%s,%s", ptr->modulepath, xf86_lex_val.str); + free(xf86_lex_val.str); + free(ptr->modulepath); + ptr->modulepath = path; + } else { + ptr->modulepath = xf86_lex_val.str; + } + break; + case OPTION: + ptr->option_lst = xf86parseOption(ptr->option_lst); + break; case MATCH_DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDriver"); diff --git a/xserver/hw/xfree86/parser/scan.c b/xserver/hw/xfree86/parser/scan.c index 3356224ce..1eb35ed73 100644 --- a/xserver/hw/xfree86/parser/scan.c +++ b/xserver/hw/xfree86/parser/scan.c @@ -65,14 +65,7 @@ #include #include #include - -#if defined(_POSIX_SOURCE) #include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif /* _POSIX_SOURCE */ #if !defined(MAXHOSTNAMELEN) #define MAXHOSTNAMELEN 32 @@ -542,27 +535,8 @@ xf86pathIsSafe(const char *path) * %% % */ -#ifndef XCONFIGFILE -#define XCONFIGFILE "xorg.conf" -#endif -#ifndef XCONFIGDIR -#define XCONFIGDIR "xorg.conf.d" -#endif -#ifndef XCONFIGSUFFIX #define XCONFIGSUFFIX ".conf" -#endif -#ifndef PROJECTROOT -#define PROJECTROOT "/usr/X11R6" -#endif -#ifndef SYSCONFDIR -#define SYSCONFDIR PROJECTROOT "/etc" -#endif -#ifndef DATADIR -#define DATADIR PROJECTROOT "/share" -#endif -#ifndef XCONFENV #define XCONFENV "XORGCONFIG" -#endif #define BAIL_OUT do { \ free(result); \ @@ -935,7 +909,7 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot) * information. If a command-line name is specified, then this function * fails if it is not found. * - * The return value is a pointer to the actual name of the direcoty that was + * The return value is a pointer to the actual name of the directory that was * opened. When no directory is found, the return value is NULL. The caller * should free() the returned value. * diff --git a/xserver/hw/xfree86/parser/xf86Parser.h b/xserver/hw/xfree86/parser/xf86Parser.h index 9c4b40370..6762edbe1 100644 --- a/xserver/hw/xfree86/parser/xf86Parser.h +++ b/xserver/hw/xfree86/parser/xf86Parser.h @@ -211,7 +211,6 @@ typedef struct { const char *dev_ramdac; int dev_dacSpeeds[CONF_MAXDACSPEEDS]; int dev_videoram; - unsigned long dev_bios_base; unsigned long dev_mem_base; unsigned long dev_io_base; const char *dev_clockchip; @@ -337,7 +336,9 @@ typedef struct { GenericListRec list; char *identifier; char *driver; + char *modulepath; struct xorg_list match_driver; + XF86OptionPtr option_lst; char *comment; } XF86ConfOutputClassRec, *XF86ConfOutputClassPtr; diff --git a/xserver/hw/xfree86/ramdac/Makefile.am b/xserver/hw/xfree86/ramdac/Makefile.am index a3d77628c..59e0996ad 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.am +++ b/xserver/hw/xfree86/ramdac/Makefile.am @@ -1,7 +1,7 @@ noinst_LTLIBRARIES = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ - xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c + xf86CursorRD.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h diff --git a/xserver/hw/xfree86/ramdac/Makefile.in b/xserver/hw/xfree86/ramdac/Makefile.in index 96222e47b..c54d3efcf 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.in +++ b/xserver/hw/xfree86/ramdac/Makefile.in @@ -69,14 +69,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libramdac_la_LIBADD = am_libramdac_la_OBJECTS = xf86RamDac.lo xf86RamDacCmap.lo \ - xf86Cursor.lo xf86HWCurs.lo IBM.lo BT.lo TI.lo + xf86CursorRD.lo xf86HWCurs.lo IBM.lo BT.lo TI.lo libramdac_la_OBJECTS = $(am_libramdac_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -338,6 +338,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -356,15 +357,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -372,6 +376,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -443,8 +449,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -511,7 +515,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ - xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c + xf86CursorRD.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ @@ -576,7 +580,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BT.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IBM.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TI.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86CursorRD.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86HWCurs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RamDac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RamDacCmap.Plo@am__quote@ diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.h b/xserver/hw/xfree86/ramdac/xf86Cursor.h index 320ec0ce6..11a03b67b 100644 --- a/xserver/hw/xfree86/ramdac/xf86Cursor.h +++ b/xserver/hw/xfree86/ramdac/xf86Cursor.h @@ -16,6 +16,7 @@ typedef struct _xf86CursorInfoRec { Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits); void (*HideCursor) (ScrnInfoPtr pScrn); void (*ShowCursor) (ScrnInfoPtr pScrn); + Bool (*ShowCursorCheck) (ScrnInfoPtr pScrn); unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr); Bool (*UseHWCursor) (ScreenPtr, CursorPtr); @@ -40,6 +41,21 @@ xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits) return TRUE; } +static inline Bool +xf86DriverHasShowCursor(xf86CursorInfoPtr infoPtr) +{ + return infoPtr->ShowCursorCheck || infoPtr->ShowCursor; +} + +static inline Bool +xf86DriverShowCursor(xf86CursorInfoPtr infoPtr) +{ + if(infoPtr->ShowCursorCheck) + return infoPtr->ShowCursorCheck(infoPtr->pScrn); + infoPtr->ShowCursor(infoPtr->pScrn); + return TRUE; +} + static inline Bool xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr) { diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.c b/xserver/hw/xfree86/ramdac/xf86CursorRD.c similarity index 100% rename from xserver/hw/xfree86/ramdac/xf86Cursor.c rename to xserver/hw/xfree86/ramdac/xf86CursorRD.c diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c index 4e2e587fd..366837c01 100644 --- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -93,7 +93,8 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) if (!infoPtr->SetCursorPosition || !xf86DriverHasLoadCursorImage(infoPtr) || !infoPtr->HideCursor || - !infoPtr->ShowCursor || !infoPtr->SetCursorColors) + !xf86DriverHasShowCursor(infoPtr) || + !infoPtr->SetCursorColors) return FALSE; if (infoPtr->RealizeCursor) { @@ -231,8 +232,7 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); - (*infoPtr->ShowCursor) (infoPtr->pScrn); - return TRUE; + return xf86DriverShowCursor(infoPtr); } Bool @@ -294,7 +294,7 @@ xf86SetTransparentCursor(ScreenPtr pScreen) xf86DriverLoadCursorImage (infoPtr, ScreenPriv->transparentData); - (*infoPtr->ShowCursor) (infoPtr->pScrn); + xf86DriverShowCursor(infoPtr); input_unlock(); } diff --git a/xserver/hw/xfree86/sdksyms.sh b/xserver/hw/xfree86/sdksyms.sh index 03d0a5d68..794cdbbf4 100644 --- a/xserver/hw/xfree86/sdksyms.sh +++ b/xserver/hw/xfree86/sdksyms.sh @@ -58,11 +58,15 @@ cat > sdksyms.c << EOF #include "shmint.h" #endif #include "syncsdk.h" -#if XINERAMA +#ifdef XINERAMA # include "panoramiXsrv.h" # include "panoramiX.h" #endif +/* glx/Makefile.am */ +#ifdef GLX +#include "vndserver.h" +#endif /* hw/xfree86/int10/Makefile.am -- module */ /* @@ -97,7 +101,7 @@ cat > sdksyms.c << EOF /* hw/xfree86/dri2/Makefile.am -- module */ -#if DRI2 +#ifdef DRI2 # include "dri2.h" #endif @@ -131,7 +135,7 @@ cat > sdksyms.c << EOF #include "xf86str.h" #include "xf86Xinput.h" #include "xisb.h" -#if XV +#ifdef XV # include "xf86xv.h" # include "xf86xvmc.h" # include "xf86xvpriv.h" @@ -189,7 +193,7 @@ cat > sdksyms.c << EOF /* hw/xfree86/dri/Makefile.am -- module */ -#if XF86DRI +#ifdef XF86DRI # include "dri.h" # include "sarea.h" # include "dristruct.h" @@ -296,7 +300,7 @@ cat > sdksyms.c << EOF EOF -topdir=$1 +topdir=$(readlink -f $1) shift LC_ALL=C export LC_ALL @@ -314,11 +318,24 @@ BEGIN { printf("sdksyms.c:") > "sdksyms.dep"; } /^# [0-9]+ "/ { - # Process text after a include in a relative path or when the - # processed file has a basename matching $top_srcdir. - # Note that indexing starts at 1; 0 means no match, and there - # is a starting ". - sdk = $3 !~ /^"\// || index($3, topdir) == 2; + # Match preprocessor linemarkers which have the form: + # # linenum "filename" flags + # + # Only process text for sdk exports where the linemarker filename has a + # relative path, or an absolute path matching $top_srcdir. + # + + # canonicalize filename + if ($3 in canonicalized) { + c = canonicalized[$3] + } else { + cmd = "readlink -f " $3 + cmd | getline c + close(cmd) + canonicalized[$3] = c + } + # note that index() starts at 1; 0 means no match. + sdk = $3 !~ /^"\// || index(c, topdir) == 1; if (sdk && $3 ~ /\.h"$/) { # remove quotes @@ -356,6 +373,17 @@ BEGIN { n = 1; } } + # hack: pid_t becomes __pid_t on NetBSD, same for uint32_t -> __uint32_t. + # GCC 5 inserts additional lines around this. + if (($1 == "__pid_t" || $1 == "__uint32_t") && NF == 1) { + getline; + n++; + # skip line numbers GCC 5 adds (after typedef return type?) + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + } # type specifier may not be set, as in # extern _X_EXPORT unsigned name(...) @@ -398,7 +426,8 @@ BEGIN { sub(/[^a-zA-Z0-9_].*/, "", symbol); #print; - printf(" (void *) &%-50s /* %s:%s */\n", symbol ",", header, line); + if (symbol != "") + printf(" (void *) &%-50s /* %s:%s */\n", symbol ",", header, line); } } diff --git a/xserver/hw/xfree86/shadowfb/Makefile.am b/xserver/hw/xfree86/shadowfb/Makefile.am index 22f7ada2a..67fb2e4cb 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.am +++ b/xserver/hw/xfree86/shadowfb/Makefile.am @@ -1,6 +1,6 @@ module_LTLIBRARIES = libshadowfb.la libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -libshadowfb_la_SOURCES = sfbmodule.c shadow.c +libshadowfb_la_SOURCES = sfbmodule.c shadowfb.c libshadowfb_la_LIBADD = $(PIXMAN_LIBS) sdk_HEADERS = shadowfb.h diff --git a/xserver/hw/xfree86/shadowfb/Makefile.in b/xserver/hw/xfree86/shadowfb/Makefile.in index 64143cd55..5a51e4597 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.in +++ b/xserver/hw/xfree86/shadowfb/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -104,7 +104,7 @@ am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)" LTLIBRARIES = $(module_LTLIBRARIES) am__DEPENDENCIES_1 = libshadowfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libshadowfb_la_OBJECTS = sfbmodule.lo shadow.lo +am_libshadowfb_la_OBJECTS = sfbmodule.lo shadowfb.lo libshadowfb_la_OBJECTS = $(am_libshadowfb_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -342,6 +342,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -360,15 +361,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -376,6 +380,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -447,8 +453,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -515,7 +519,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ module_LTLIBRARIES = libshadowfb.la libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -libshadowfb_la_SOURCES = sfbmodule.c shadow.c +libshadowfb_la_SOURCES = sfbmodule.c shadowfb.c libshadowfb_la_LIBADD = $(PIXMAN_LIBS) sdk_HEADERS = shadowfb.h AM_CPPFLAGS = $(XORG_INCS) @@ -598,7 +602,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfbmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadowfb.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/hw/xfree86/shadowfb/shadow.c b/xserver/hw/xfree86/shadowfb/shadowfb.c similarity index 100% rename from xserver/hw/xfree86/shadowfb/shadow.c rename to xserver/hw/xfree86/shadowfb/shadowfb.c diff --git a/xserver/hw/xfree86/utils/Makefile.in b/xserver/hw/xfree86/utils/Makefile.in index a499e3ef7..6a4ca4194 100644 --- a/xserver/hw/xfree86/utils/Makefile.in +++ b/xserver/hw/xfree86/utils/Makefile.in @@ -66,7 +66,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -313,6 +313,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -331,15 +332,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -347,6 +351,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -418,8 +424,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/utils/cvt/Makefile.in b/xserver/hw/xfree86/utils/cvt/Makefile.in index 88fbe5ef6..feb22b1d9 100644 --- a/xserver/hw/xfree86/utils/cvt/Makefile.in +++ b/xserver/hw/xfree86/utils/cvt/Makefile.in @@ -91,7 +91,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -335,6 +335,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -353,15 +354,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -369,6 +373,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -440,8 +446,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/utils/gtf/Makefile.in b/xserver/hw/xfree86/utils/gtf/Makefile.in index 83c9c10fd..1dd56a88b 100644 --- a/xserver/hw/xfree86/utils/gtf/Makefile.in +++ b/xserver/hw/xfree86/utils/gtf/Makefile.in @@ -91,7 +91,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -334,6 +334,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -352,15 +353,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -368,6 +372,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -439,8 +445,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/utils/gtf/gtf.c b/xserver/hw/xfree86/utils/gtf/gtf.c index c31bc8f93..818ee0fd7 100644 --- a/xserver/hw/xfree86/utils/gtf/gtf.c +++ b/xserver/hw/xfree86/utils/gtf/gtf.c @@ -238,7 +238,7 @@ print_fb_mode(mode * m) printf(" # PCLK: %.2f MHz, H: %.2f kHz, V: %.2f Hz\n", m->pclk, m->h_freq, m->v_freq); printf(" geometry %d %d %d %d 32\n", m->hr, m->vr, m->hr, m->vr); - printf(" timings %d %d %d %d %d %d %d\n", (int) rint(1000000.0 / m->pclk), /* pixclock in picoseconds */ + printf(" timings %d %d %d %d %d %d %d\n", (int)lrint(1000000.0 / m->pclk), /* pixclock in picoseconds */ m->hfl - m->hse, /* left margin (in pixels) */ m->hss - m->hr, /* right margin (in pixels) */ m->vfl - m->vse, /* upper margin (in pixel lines) */ diff --git a/xserver/hw/xfree86/utils/man/Makefile.in b/xserver/hw/xfree86/utils/man/Makefile.in index 69b7ca20c..5c22f4757 100644 --- a/xserver/hw/xfree86/utils/man/Makefile.in +++ b/xserver/hw/xfree86/utils/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/utils/man/cvt.man b/xserver/hw/xfree86/utils/man/cvt.man index 8d70ead1b..009ab6540 100644 --- a/xserver/hw/xfree86/utils/man/cvt.man +++ b/xserver/hw/xfree86/utils/man/cvt.man @@ -1,4 +1,4 @@ -.TH CVT 1 __vendorversion__ +.TH CVT 1 @vendorversion@ .SH NAME cvt - calculate VESA CVT mode lines .SH SYNOPSIS @@ -13,7 +13,7 @@ cvt - calculate VESA CVT mode lines is a utility for calculating VESA Coordinated Video Timing modes. Given the desired horizontal and vertical resolutions, a modeline adhering to the CVT standard is printed. This modeline can be included in Xorg -.B xorg.conf(__filemansuffix__) +.B xorg.conf(@filemansuffix@) . .SH OPTIONS @@ -31,7 +31,7 @@ Create a mode with reduced blanking. This allows for higher frequency signals, with a lower or equal dotclock. Not for Cathode Ray Tube based displays though. .SH "SEE ALSO" -xorg.conf(__filemansuffix__), gtf(__appmansuffix__) +xorg.conf(@filemansuffix@), gtf(@appmansuffix@) .SH AUTHOR Luc Verhaegen. .PP diff --git a/xserver/hw/xfree86/utils/man/gtf.man b/xserver/hw/xfree86/utils/man/gtf.man index 004d2f059..95bddbbcf 100644 --- a/xserver/hw/xfree86/utils/man/gtf.man +++ b/xserver/hw/xfree86/utils/man/gtf.man @@ -1,4 +1,4 @@ -.TH GTF 1 __vendorversion__ +.TH GTF 1 @vendorversion@ .SH NAME gtf - calculate VESA GTF mode lines .SH SYNOPSIS @@ -15,7 +15,7 @@ is a utility for calculating VESA GTF modes. Given the desired horizontal and vertical resolutions and refresh rate (in Hz), the parameters for a matching VESA GTF mode are printed out. Two output formats are supported: mode lines suitable for the Xorg -.B xorg.conf(__filemansuffix__) +.B xorg.conf(@filemansuffix@) file, and mode parameters suitable for the Linux .B fbset(8) utility. @@ -34,7 +34,7 @@ default format. Print the mode parameters in a format suitable for .BR fbset(8) . .SH "SEE ALSO" -xorg.conf(__filemansuffix__), cvt(__appmansuffix__) +xorg.conf(@filemansuffix@), cvt(@appmansuffix@) .SH AUTHOR Andy Ritger. .PP diff --git a/xserver/hw/xfree86/vbe/Makefile.in b/xserver/hw/xfree86/vbe/Makefile.in index ac0e87a5f..b0cae486a 100644 --- a/xserver/hw/xfree86/vbe/Makefile.in +++ b/xserver/hw/xfree86/vbe/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -340,6 +340,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -358,15 +359,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -374,6 +378,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -445,8 +451,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/vgahw/Makefile.in b/xserver/hw/xfree86/vgahw/Makefile.in index 5a86d5a1c..f8f06813c 100644 --- a/xserver/hw/xfree86/vgahw/Makefile.in +++ b/xserver/hw/xfree86/vgahw/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -341,6 +341,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -359,15 +360,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -375,6 +379,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -446,8 +452,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/x86emu/Makefile.in b/xserver/hw/xfree86/x86emu/Makefile.in index cc7a58233..b36a80ada 100644 --- a/xserver/hw/xfree86/x86emu/Makefile.in +++ b/xserver/hw/xfree86/x86emu/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -309,6 +309,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -327,15 +328,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -343,6 +347,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -414,8 +420,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xfree86/x86emu/debug.c b/xserver/hw/xfree86/x86emu/debug.c index 72a06ffb8..576ace55e 100644 --- a/xserver/hw/xfree86/x86emu/debug.c +++ b/xserver/hw/xfree86/x86emu/debug.c @@ -40,8 +40,8 @@ #include "x86emu/x86emui.h" #include #include -#ifndef NO_SYS_HEADERS #include +#ifndef NO_SYS_HEADERS #include #endif @@ -174,18 +174,14 @@ x86emu_inc_decoded_inst_len(int x) } void -x86emu_decode_printf(const char *x) -{ - sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", x); - M.x86.enc_str_pos += strlen(x); -} - -void -x86emu_decode_printf2(const char *x, int y) +x86emu_decode_printf(const char *x, ...) { + va_list ap; char temp[100]; - snprintf(temp, sizeof(temp), x, y); + va_start(ap, x); + vsnprintf(temp, sizeof(temp), x, ap); + va_end(ap); sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", temp); M.x86.enc_str_pos += strlen(temp); } diff --git a/xserver/hw/xfree86/x86emu/sys.c b/xserver/hw/xfree86/x86emu/sys.c index 5eba35856..ccce540e7 100644 --- a/xserver/hw/xfree86/x86emu/sys.c +++ b/xserver/hw/xfree86/x86emu/sys.c @@ -191,7 +191,7 @@ rdb(u32 addr) u8 val; if (addr > M.mem_size - 1) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -217,7 +217,7 @@ rdw(u32 addr) u16 val = 0; if (addr > M.mem_size - 2) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -249,7 +249,7 @@ rdl(u32 addr) u32 val = 0; if (addr > M.mem_size - 4) { - DB(printk("mem_read: address %#lx out of range!\n", addr); + DB(printk("mem_read: address %#" PRIx32 " out of range!\n", addr); ) HALT_SYS(); } @@ -282,7 +282,7 @@ wrb(u32 addr, u8 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 1 <- %#x\n", addr, val);) if (addr > M.mem_size - 1) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } @@ -303,7 +303,7 @@ wrw(u32 addr, u16 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 2 <- %#x\n", addr, val);) if (addr > M.mem_size - 2) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } @@ -331,7 +331,7 @@ wrl(u32 addr, u32 val) DB(if (DEBUG_MEM_TRACE()) printk("%#08x 4 <- %#x\n", addr, val);) if (addr > M.mem_size - 4) { - DB(printk("mem_write: address %#lx out of range!\n", addr); + DB(printk("mem_write: address %#" PRIx32 " out of range!\n",addr); ) HALT_SYS(); } diff --git a/xserver/hw/xfree86/x86emu/x86emu/debug.h b/xserver/hw/xfree86/x86emu/x86emu/debug.h index 385b804dd..1f04b7b65 100644 --- a/xserver/hw/xfree86/x86emu/x86emu/debug.h +++ b/xserver/hw/xfree86/x86emu/x86emu/debug.h @@ -102,9 +102,9 @@ #ifdef DEBUG #define DECODE_PRINTF(x) if (DEBUG_DECODE()) \ - x86emu_decode_printf(x) + x86emu_decode_printf("%s",x) #define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \ - x86emu_decode_printf2(x,y) + x86emu_decode_printf(x,y) /* * The following allow us to look at the bytes of an instruction. The @@ -189,8 +189,7 @@ extern "C" { /* Use "C" linkage when in C++ mode */ #endif extern void x86emu_inc_decoded_inst_len(int x); - extern void x86emu_decode_printf(const char *x); - extern void x86emu_decode_printf2(const char *x, int y); + extern void x86emu_decode_printf(const char *x, ...) _X_ATTRIBUTE_PRINTF(1,2); extern void x86emu_just_disassemble(void); extern void x86emu_single_step(void); extern void x86emu_end_instr(void); diff --git a/xserver/hw/xfree86/x86emu/x86emu/types.h b/xserver/hw/xfree86/x86emu/x86emu/types.h index 5a6ef01f8..0559bc089 100644 --- a/xserver/hw/xfree86/x86emu/x86emu/types.h +++ b/xserver/hw/xfree86/x86emu/x86emu/types.h @@ -61,6 +61,7 @@ /*---------------------- Macros and type definitions ----------------------*/ #include +#include typedef uint8_t u8; typedef uint16_t u16; diff --git a/xserver/hw/xfree86/xkb/Makefile.in b/xserver/hw/xfree86/xkb/Makefile.in index 2cdb18173..ba03bcb35 100644 --- a/xserver/hw/xfree86/xkb/Makefile.in +++ b/xserver/hw/xfree86/xkb/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -307,6 +307,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -325,15 +326,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -341,6 +345,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -412,8 +418,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xnest/Init.c b/xserver/hw/xnest/Init.c index e8a700e88..b45685216 100644 --- a/xserver/hw/xnest/Init.c +++ b/xserver/hw/xnest/Init.c @@ -47,6 +47,13 @@ is" without express or implied warranty. Bool xnestDoFullGeneration = True; +#ifdef GLXEXT +void +GlxExtensionInit(void) +{ +} +#endif + void InitOutput(ScreenInfo * screen_info, int argc, char *argv[]) { diff --git a/xserver/hw/xnest/Makefile.am b/xserver/hw/xnest/Makefile.am index eb550c0f7..c77da6412 100644 --- a/xserver/hw/xnest/Makefile.am +++ b/xserver/hw/xnest/Makefile.am @@ -45,7 +45,6 @@ SRCS = Args.c \ XNEST_LIBS = \ @XNEST_LIBS@ \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la Xnest_SOURCES = $(SRCS) @@ -57,10 +56,5 @@ Xnest_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) EXTRA_DIST = icon \ screensaver -# -UDPMSExtension for miinitext? can't put into -# OS_DEFINES??? -# EXT_DEFINES??? -# ICONFIGFILES -- SpecialCObjectRule - relink: $(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT) diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in index 23e9c87c2..b120181ed 100644 --- a/xserver/hw/xnest/Makefile.in +++ b/xserver/hw/xnest/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -83,8 +83,7 @@ am__objects_1 = Args.$(OBJEXT) Color.$(OBJEXT) Cursor.$(OBJEXT) \ miinitext.$(OBJEXT) am_Xnest_OBJECTS = $(am__objects_1) Xnest_OBJECTS = $(am_Xnest_OBJECTS) -am__DEPENDENCIES_1 = $(top_builddir)/Xext/libXextdpmsstubs.la \ - $(top_builddir)/Xi/libXistubs.la +am__DEPENDENCIES_1 = $(top_builddir)/Xi/libXistubs.la am__DEPENDENCIES_2 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -358,6 +357,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -376,15 +376,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -392,6 +395,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -420,7 +425,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = \ @XNEST_LIBS@ \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ @@ -467,8 +471,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -1041,11 +1043,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall uninstall-am uninstall-binPROGRAMS -# -UDPMSExtension for miinitext? can't put into -# OS_DEFINES??? -# EXT_DEFINES??? -# ICONFIGFILES -- SpecialCObjectRule - relink: $(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT) diff --git a/xserver/hw/xnest/Screen.c b/xserver/hw/xnest/Screen.c index 214b55015..30c6a4623 100644 --- a/xserver/hw/xnest/Screen.c +++ b/xserver/hw/xnest/Screen.c @@ -248,7 +248,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) pScreen->whitePixel = xnestWhitePixel; pScreen->blackPixel = xnestBlackPixel; /* GCperDepth */ - /* PixmapPerDepth */ + /* defaultStipple */ pScreen->devPrivate = NULL; /* WindowPrivateLen */ /* WindowPrivateSizes */ diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in index 6f92ab520..520a1ea52 100644 --- a/xserver/hw/xnest/man/Makefile.in +++ b/xserver/hw/xnest/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xnest/man/Xnest.man b/xserver/hw/xnest/man/Xnest.man index 024d88e82..e287b8e9c 100644 --- a/xserver/hw/xnest/man/Xnest.man +++ b/xserver/hw/xnest/man/Xnest.man @@ -27,7 +27,7 @@ .\" .\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $ .\" -.TH Xnest __appmansuffix__ __xorgversion__ +.TH Xnest @appmansuffix@ @xorgversion@ .SH NAME Xnest \- a nested X server .SH SYNOPSIS @@ -52,7 +52,7 @@ appears to be a conventional server. .B Xnest supports all standard options of the sample server implementation. For more details, please see -.BR Xserver (__appmansuffix__). +.BR Xserver (@appmansuffix@). The following additional arguments are supported as well. .TP .BI "\-display " string @@ -113,7 +113,7 @@ The class of the default visual of the nested server need not be the same as the class of the default visual of the real server, but it must be supported by the real server. Use -.BR xdpyinfo (__appmansuffix__) +.BR xdpyinfo (@appmansuffix@) to obtain a list of supported visual classes on the real server before starting .BR Xnest . If the user chooses a static class, all the colors in the default color map will @@ -127,7 +127,7 @@ The depth of the default visual of the nested server need not be the same as the depth of the default visual of the real server, but it must be supported by the real server. Use -.BR xdpyinfo (__appmansuffix__) +.BR xdpyinfo (@appmansuffix@) to obtain a list of supported visual depths on the real server before starting .BR Xnest . .TP @@ -149,7 +149,7 @@ This option specifies the geometry parameters for the top-level .B Xnest window. See \(lqGEOMETRY SPECIFICATIONS\(rq in -.BR X (__miscmansuffix__) +.BR X (@miscmansuffix@) for a discusson of this option's syntax. This window corresponds to the root window of the nested server. The width @@ -200,7 +200,7 @@ specification. For example, .B xterm \-display :1.1 will open an -.BR xterm (__appmansuffix__) +.BR xterm (@appmansuffix@) client in the nested server with the display number .B :1 on the second screen. @@ -249,7 +249,7 @@ as the root window instead of creating a window. Starting up .B Xnest is just as simple as starting up -.BR xclock (__appmansuffix__) +.BR xclock (@appmansuffix@) from a terminal emulator. If a user wishes to run .B Xnest @@ -385,7 +385,7 @@ file system which makes the two font paths mutually incompatible. Thus, if there is a font in the local font path of the nested server, there is no guarantee that this font exists in the remote font path of the real server. The -.BR xlsfonts (__appmansuffix__) +.BR xlsfonts (@appmansuffix@) client, if run on the nested server, will list fonts in the local font path and, if run on the real server, will list fonts in the remote font path. Before a font can be successfully opened by the nested server, it has to exist @@ -423,6 +423,6 @@ Probably has some memory leaks. .SH AUTHOR Davor Matic, MIT X Consortium .SH "SEE ALSO" -.BR Xserver (__appmansuffix__), -.BR xdpyinfo (__appmansuffix__), -.BR X (__miscmansuffix__) +.BR Xserver (@appmansuffix@), +.BR xdpyinfo (@appmansuffix@), +.BR X (@miscmansuffix@) diff --git a/xserver/hw/xquartz/GL/Makefile.in b/xserver/hw/xquartz/GL/Makefile.in index b7c0c0ff9..16aa9e89c 100644 --- a/xserver/hw/xquartz/GL/Makefile.in +++ b/xserver/hw/xquartz/GL/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -308,6 +308,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -326,15 +327,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -342,6 +346,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -413,8 +419,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/GL/visualConfigs.c b/xserver/hw/xquartz/GL/visualConfigs.c index ce68663cd..69b18f6a0 100644 --- a/xserver/hw/xquartz/GL/visualConfigs.c +++ b/xserver/hw/xquartz/GL/visualConfigs.c @@ -51,7 +51,6 @@ #include #include #include -#include #include "capabilities.h" #include "visualConfigs.h" diff --git a/xserver/hw/xquartz/Makefile.in b/xserver/hw/xquartz/Makefile.in index ba0a5f7ef..d4c0607ef 100644 --- a/xserver/hw/xquartz/Makefile.in +++ b/xserver/hw/xquartz/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -364,6 +364,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -382,15 +383,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -398,6 +402,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -469,8 +475,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/X11Application.m b/xserver/hw/xquartz/X11Application.m index 768eecf68..821e1c5a1 100644 --- a/xserver/hw/xquartz/X11Application.m +++ b/xserver/hw/xquartz/X11Application.m @@ -275,13 +275,32 @@ message_kit_thread(SEL selector, NSObject *arg) if (_x_active) [self activateX:NO]; } else if ([self modalWindow] == nil) { - /* Must be an X window. Tell appkit it doesn't have focus. */ + /* Must be an X window. Tell appkit windows to resign main/key */ for_appkit = NO; - if ([self isActive]) { - [self deactivate]; - if (!_x_active && quartzProcs->IsX11Window([e windowNumber])) - [self activateX:YES]; + if (!_x_active && quartzProcs->IsX11Window([e windowNumber])) { + if ([self respondsToSelector:@selector(_setKeyWindow:)] && [self respondsToSelector:@selector(_setMainWindow:)]) { + NSWindow *keyWindow = [self keyWindow]; + if (keyWindow) { + [self _setKeyWindow:nil]; + [keyWindow resignKeyWindow]; + } + + NSWindow *mainWindow = [self mainWindow]; + if (mainWindow) { + [self _setMainWindow:nil]; + [mainWindow resignMainWindow]; + } + } else { + /* This has a side effect of causing background apps to steal focus from XQuartz. + * Unfortunately, there is no public and stable API to do what we want, but this + * is a decent fallback in the off chance that the above selectors get dropped + * in the future. + */ + [self deactivate]; + } + + [self activateX:YES]; } } diff --git a/xserver/hw/xquartz/bundle/Makefile.in b/xserver/hw/xquartz/bundle/Makefile.in index dd4fed6ce..fcab532e2 100644 --- a/xserver/hw/xquartz/bundle/Makefile.in +++ b/xserver/hw/xquartz/bundle/Makefile.in @@ -76,7 +76,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -312,6 +312,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -330,15 +331,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -346,6 +350,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -417,8 +423,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/darwin.c b/xserver/hw/xquartz/darwin.c index 36c149cba..c701eb6ac 100644 --- a/xserver/hw/xquartz/darwin.c +++ b/xserver/hw/xquartz/darwin.c @@ -50,7 +50,7 @@ #include #include "exevents.h" #include "extinit.h" - +#include "glx_extinit.h" #include "xserver-properties.h" #include @@ -162,7 +162,6 @@ static PixmapFormatRec formats[] = { { 24, 32, BITMAP_SCANLINE_PAD }, { 32, 32, BITMAP_SCANLINE_PAD } }; -const int NUMFORMATS = sizeof(formats) / sizeof(formats[0]); void DarwinPrintBanner(void) @@ -659,8 +658,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; // List how we want common pixmap formats to be padded - pScreenInfo->numPixmapFormats = NUMFORMATS; - for (i = 0; i < NUMFORMATS; i++) + pScreenInfo->numPixmapFormats = ARRAY_SIZE(formats); + for (i = 0; i < ARRAY_SIZE(formats); i++) pScreenInfo->formats[i] = formats[i]; // Discover screens and do mode specific initialization @@ -671,6 +670,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) AddScreen(DarwinScreenInit, argc, argv); } + xorgGlxCreateVendor(); + DarwinAdjustScreenOrigins(pScreenInfo); } diff --git a/xserver/hw/xquartz/keysym2ucs.c b/xserver/hw/xquartz/keysym2ucs.c index 934b57756..12da19d67 100644 --- a/xserver/hw/xquartz/keysym2ucs.c +++ b/xserver/hw/xquartz/keysym2ucs.c @@ -832,7 +832,7 @@ long keysym2ucs(int keysym) { int min = 0; - int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; + int max = ARRAY_SIZE(keysymtab) - 1; int mid; /* first check for Latin-1 characters (1:1 mapping) */ @@ -875,7 +875,7 @@ ucs2keysym(long ucs) static struct codepair *reverse_keysymtab; int min = 0; - int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; + int max = ARRAY_SIZE(keysymtab) - 1; int mid; if (reverse_keysymtab == NULL) { @@ -883,7 +883,7 @@ ucs2keysym(long ucs) memcpy(reverse_keysymtab, keysymtab, sizeof(keysymtab)); qsort(reverse_keysymtab, - sizeof(keysymtab) / sizeof(struct codepair), + ARRAY_SIZE(keysymtab), sizeof(struct codepair), reverse_compare); } diff --git a/xserver/hw/xquartz/keysym2ucs.h b/xserver/hw/xquartz/keysym2ucs.h index 01af0371d..aedbf43bf 100644 --- a/xserver/hw/xquartz/keysym2ucs.h +++ b/xserver/hw/xquartz/keysym2ucs.h @@ -30,6 +30,8 @@ #ifndef KEYSYM2UCS_H #define KEYSYM2UCS_H 1 +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + extern long keysym2ucs(int keysym); extern int diff --git a/xserver/hw/xquartz/mach-startup/Makefile.am b/xserver/hw/xquartz/mach-startup/Makefile.am index 77962b14d..b2c446af8 100644 --- a/xserver/hw/xquartz/mach-startup/Makefile.am +++ b/xserver/hw/xquartz/mach-startup/Makefile.am @@ -47,6 +47,7 @@ X11_bin_LDFLAGS = \ if GLX X11_bin_DEPENDENCIES += \ $(top_builddir)/hw/xquartz/GL/libCGLCore.la \ + $(top_builddir)/glx/libglxvnd.la \ $(top_builddir)/glx/libglx.la X11_bin_LDFLAGS += \ @@ -75,6 +76,8 @@ nodist_Xquartz_SOURCES = \ Xquartz_LDFLAGS = \ -Wl,-framework,CoreServices +if XQUARTZ + BUILT_SOURCES = \ mach_startupServer.c \ mach_startupUser.c \ @@ -87,6 +90,8 @@ CLEANFILES = \ $(BUILT_SOURCES): $(srcdir)/mach_startup.defs mig -sheader mach_startupServer.h $(srcdir)/mach_startup.defs +endif + EXTRA_DIST = \ launchd_fd.h \ mach_startup.defs \ diff --git a/xserver/hw/xquartz/mach-startup/Makefile.in b/xserver/hw/xquartz/mach-startup/Makefile.in index 661020c29..3f91029ca 100644 --- a/xserver/hw/xquartz/mach-startup/Makefile.in +++ b/xserver/hw/xquartz/mach-startup/Makefile.in @@ -53,6 +53,7 @@ host_triplet = @host@ x11app_PROGRAMS = X11.bin$(EXEEXT) @GLX_TRUE@am__append_1 = \ @GLX_TRUE@ $(top_builddir)/hw/xquartz/GL/libCGLCore.la \ +@GLX_TRUE@ $(top_builddir)/glx/libglxvnd.la \ @GLX_TRUE@ $(top_builddir)/glx/libglx.la @GLX_TRUE@am__append_2 = \ @@ -83,7 +84,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -343,6 +344,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -361,15 +363,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -377,6 +382,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -448,8 +455,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -558,14 +563,14 @@ nodist_Xquartz_SOURCES = \ Xquartz_LDFLAGS = \ -Wl,-framework,CoreServices -BUILT_SOURCES = \ - mach_startupServer.c \ - mach_startupUser.c \ - mach_startupServer.h \ - mach_startup.h +@XQUARTZ_TRUE@BUILT_SOURCES = \ +@XQUARTZ_TRUE@ mach_startupServer.c \ +@XQUARTZ_TRUE@ mach_startupUser.c \ +@XQUARTZ_TRUE@ mach_startupServer.h \ +@XQUARTZ_TRUE@ mach_startup.h -CLEANFILES = \ - $(BUILT_SOURCES) +@XQUARTZ_TRUE@CLEANFILES = \ +@XQUARTZ_TRUE@ $(BUILT_SOURCES) EXTRA_DIST = \ launchd_fd.h \ @@ -986,8 +991,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-x11appPROGRAMS uninstall-am uninstall-binPROGRAMS uninstall-x11appPROGRAMS -$(BUILT_SOURCES): $(srcdir)/mach_startup.defs - mig -sheader mach_startupServer.h $(srcdir)/mach_startup.defs +@XQUARTZ_TRUE@$(BUILT_SOURCES): $(srcdir)/mach_startup.defs +@XQUARTZ_TRUE@ mig -sheader mach_startupServer.h $(srcdir)/mach_startup.defs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/hw/xquartz/man/Makefile.in b/xserver/hw/xquartz/man/Makefile.in index f5ed0fd7c..a458e3c1b 100644 --- a/xserver/hw/xquartz/man/Makefile.in +++ b/xserver/hw/xquartz/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/man/Xquartz.man b/xserver/hw/xquartz/man/Xquartz.man index 0ea6e6eb8..df7ab25aa 100644 --- a/xserver/hw/xquartz/man/Xquartz.man +++ b/xserver/hw/xquartz/man/Xquartz.man @@ -1,4 +1,4 @@ -.TH XQUARTZ 1 __vendorversion__ +.TH XQUARTZ 1 @vendorversion@ .SH NAME Xquartz \- X window system server for Mac OSX .SH SYNOPSIS @@ -16,75 +16,75 @@ OS X handles the desktop background. .SH CUSTOMIZATION \fIXquartz\fP can be customized using the defaults(1) command. The available options are: .TP 8 -.B defaults write __bundle_id_prefix__.X11 enable_fake_buttons -boolean true +.B defaults write @bundle_id_prefix@.X11 enable_fake_buttons -boolean true Emulates a 3 button mouse using modifier keys. By default, the Command modifier is used to emulate button 2 and Option is used for button 3. Thus, clicking the first mouse button while holding down Command will act like clicking button 2. Holding down Option will simulate button 3. .TP 8 -.B defaults write __bundle_id_prefix__.X11 fake_button2 \fImodifiers\fP +.B defaults write @bundle_id_prefix@.X11 fake_button2 \fImodifiers\fP Change the modifier keys used to emulate the second mouse button. By default, Command is used to emulate the second button. Any combination of the following modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn .TP 8 -.B defaults write __bundle_id_prefix__.X11 fake_button3 \fImodifiers\fP +.B defaults write @bundle_id_prefix@.X11 fake_button3 \fImodifiers\fP Change the modifier keys used to emulate the second mouse button. By default, Command is used to emulate the second button. Any combination of the following modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn .TP 8 -.B defaults write __bundle_id_prefix__.X11 fullscreen_hotkeys -boolean true +.B defaults write @bundle_id_prefix@.X11 fullscreen_hotkeys -boolean true Enable OSX hotkeys while in fullscreen .TP 8 -.B defaults write __bundle_id_prefix__.X11 fullscreen_menu -boolean true +.B defaults write @bundle_id_prefix@.X11 fullscreen_menu -boolean true Show the OSX menu while in fullscreen .TP 8 -.B defaults write __bundle_id_prefix__.X11 no_quit_alert -boolean true +.B defaults write @bundle_id_prefix@.X11 no_quit_alert -boolean true Disables the alert dialog displayed when attempting to quit X11. .TP 8 -.B defaults write __bundle_id_prefix__.X11 no_auth -boolean true +.B defaults write @bundle_id_prefix@.X11 no_auth -boolean true Stops the X server requiring that clients authenticate themselves when -connecting. See Xsecurity(__miscmansuffix__). +connecting. See Xsecurity(@miscmansuffix@). .TP 8 -.B defaults write __bundle_id_prefix__.X11 nolisten_tcp -boolean false +.B defaults write @bundle_id_prefix@.X11 nolisten_tcp -boolean false This will tell the server to listen and accept TCP connections. Doing this without enabling -xauth is a possible security concern. See Xsecurity(__miscmansuffix__). +xauth is a possible security concern. See Xsecurity(@miscmansuffix@). .TP 8 -.B defaults write __bundle_id_prefix__.X11 enable_system_beep -boolean false +.B defaults write @bundle_id_prefix@.X11 enable_system_beep -boolean false Don't use the standard system beep effect for X11 alerts. .TP 8 -.B defaults write __bundle_id_prefix__.X11 enable_key_equivalents -boolean false +.B defaults write @bundle_id_prefix@.X11 enable_key_equivalents -boolean false Disable menu keyboard equivalents while X11 windows are focused. .TP 8 -.B defaults write __bundle_id_prefix__.X11 depth \fIdepth\fP +.B defaults write @bundle_id_prefix@.X11 depth \fIdepth\fP Specifies the color bit depth to use. Currently only 15, and 24 color bits per pixel are supported. If not specified, or a value of -1 is specified, defaults to the depth of the main display. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_keymap -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_keymap -boolean true Keep the X11 keymap up to date with the OSX system keymap. .TP 8 -.B defaults write __bundle_id_prefix__.X11 option_sends_alt -boolean true +.B defaults write @bundle_id_prefix@.X11 option_sends_alt -boolean true The Option key will send Alt_L and Alt_R instead of Mode_switch. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_pasteboard -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_pasteboard -boolean true Enable syncing between the OSX pasteboard and clipboard/primary selection buffers in X11. This option needs to be true for any of the other pasteboard sync options to have an effect. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_pasteboard_to_clipboard -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_pasteboard_to_clipboard -boolean true Update the X11 CLIPBOARD when the OSX NSPasteboard is updated. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_pasteboard_to_primary -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_pasteboard_to_primary -boolean true Update the the X11 PRIMARY buffer when the OSX NSPasteboard is updated. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_clipboard_to_pasteboard -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_clipboard_to_pasteboard -boolean true Update the the OSX NSPasteboard when the X11 CLIPBOARD is updated. Note that enabling this option causes the clipboard synchronization to act as a clipboard manager in X11. This makes it impossible to use xclipboard, klipper, or any other such clipboard managers. If you want to use any of these programs, you must disable this option. .TP 8 -.B defaults write __bundle_id_prefix__.X11 sync_primary_on_select -boolean true +.B defaults write @bundle_id_prefix@.X11 sync_primary_on_select -boolean true This option defaults to false and is provided only "for experts." It updates the NSPasteboard whenever a new X11 selection is made (rather than requiring you to hit cmd-c to copy the selection to the NSPasteboard). Since the X11 protocol does not require applications to send notification when they change selection, this might not work in all cases (if you run into this problem, try selecting text in another application first, then selecting the text you want). .TP 8 -.B defaults write __bundle_id_prefix__.X11 enable_test_extensions -boolean true +.B defaults write @bundle_id_prefix@.X11 enable_test_extensions -boolean true This option defaults to false and is only accessible through the command line. Enable this option to turn on the DEC-XTRAP, RECORD, and XTEST extensions in the server. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 scroll_in_device_direction -boolean true +.B defaults write @laucnd_id_prefix@.X11 scroll_in_device_direction -boolean true This option defaults to false. Enable this option to ensure that X11 scroll events are always in the direction of the device. This overrides the related option in the Mouse/Trackpad section of System Preferences. .SH OPTIONS .PP @@ -106,19 +106,19 @@ Same as fake_button3 above. .B "\-depth \fIdepth\fP" Same as depth above. .SH LOGGING -XQuartz stores a server log at ~/Library/Logs/X11.__bundle_id_prefix__.log which +XQuartz stores a server log at ~/Library/Logs/X11.@bundle_id_prefix@.log which is analogous to /var/log/Xorg.#.log on systems that use the XFree86 DDX such as Linux, BSD, and Solaris. .PP In addition to this server log, XQuartz sends messages to syslogd(8) using -asl(3). These logs are sent to the __bundle_id_prefix__ facility, and you can +asl(3). These logs are sent to the @bundle_id_prefix@ facility, and you can watch these logs using the following syslog(1) command: .TP 8 -.B $ syslog -w -k Facility eq __bundle_id_prefix__ +.B $ syslog -w -k Facility eq @bundle_id_prefix@ .PP or you can include extra information such as the file, line, and function where the message originated: .TP 8 -.B $ syslog -w -F '$(Time) $(Sender) <$(Level)> $(File):$(Line) $(Function) :: $(Message)' -k Facility eq __bundle_id_prefix__ +.B $ syslog -w -F '$(Time) $(Sender) <$(Level)> $(File):$(Line) $(Function) :: $(Message)' -k Facility eq @bundle_id_prefix@ .PP By default, XQaurtz sets an ASL mask which prevents it from logging messages below the ASL_LEVEL_WARNING level (meaning almost all logging is done strictly @@ -134,7 +134,7 @@ you will need to adjust XQuartz's asl mask as above but using -i or -n instead of -d. .SH "SEE ALSO" .PP -X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), syslog(1), syslogd(8) +X(@miscmansuffix@), Xserver(1), xdm(1), xinit(1), syslog(1), syslogd(8) .PP http://xquartz.macosforge.org .PP diff --git a/xserver/hw/xquartz/pbproxy/Makefile.in b/xserver/hw/xquartz/pbproxy/Makefile.in index 9561699af..1a64545ee 100644 --- a/xserver/hw/xquartz/pbproxy/Makefile.in +++ b/xserver/hw/xquartz/pbproxy/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -338,6 +338,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -356,15 +357,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -372,6 +376,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -443,8 +449,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/quartz.c b/xserver/hw/xquartz/quartz.c index c8ea3bf8b..980aa4a36 100644 --- a/xserver/hw/xquartz/quartz.c +++ b/xserver/hw/xquartz/quartz.c @@ -149,25 +149,6 @@ QuartzSetupScreen(int index, return TRUE; } -static const ExtensionModule quartzExtensions[] = { - /* PseudoramiX needs to be done before RandR, so - * it is in miinitext.c until it can be reordered. - * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension }, - */ -#ifdef GLXEXT - {GlxExtensionInit, "GLX", &noGlxExtension}, -#endif -}; - -/* - * QuartzExtensionInit - * Initialises XQuartz-specific extensions. - */ -static void QuartzExtensionInit(void) -{ - LoadExtensionList(quartzExtensions, ARRAY_SIZE(quartzExtensions), TRUE); -} - /* * QuartzInitOutput * Quartz display initialization. @@ -208,8 +189,6 @@ QuartzInitOutput(int argc, // Do display mode specific initialization quartzProcs->DisplayInit(); - - QuartzExtensionInit(); } /* diff --git a/xserver/hw/xquartz/quartzKeyboard.c b/xserver/hw/xquartz/quartzKeyboard.c index 2fed59306..755fe0990 100644 --- a/xserver/hw/xquartz/quartzKeyboard.c +++ b/xserver/hw/xquartz/quartzKeyboard.c @@ -790,7 +790,7 @@ make_dead_key(KeySym in) { int i; - for (i = 0; i < sizeof(dead_keys) / sizeof(dead_keys[0]); i++) + for (i = 0; i < ARRAY_SIZE(dead_keys); i++) if (dead_keys[i].normal == in) return dead_keys[i].dead; return in; @@ -975,7 +975,7 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) #if HACK_MISSING /* Fix up some things that are normally missing.. */ - for (i = 0; i < sizeof(known_keys) / sizeof(known_keys[0]); i++) { + for (i = 0; i < ARRAY_SIZE(known_keys); i++) { k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY; if (k[0] == NoSymbol && k[1] == NoSymbol @@ -987,8 +987,7 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) #if HACK_KEYPAD /* And some more things. We find the right symbols for the numeric keypad, but not the KP_ keysyms. So try to convert known keycodes. */ - for (i = 0; i < sizeof(known_numeric_keys) / sizeof(known_numeric_keys[0]); - i++) { + for (i = 0; i < ARRAY_SIZE(known_numeric_keys); i++) { k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY; if (k[0] == known_numeric_keys[i].normal) @@ -997,8 +996,7 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) #endif #if HACK_BLACKLIST - for (i = 0; i < sizeof(keycode_blacklist) / sizeof(keycode_blacklist[0]); - i++) { + for (i = 0; i < ARRAY_SIZE(keycode_blacklist); i++) { k = info->keyMap + keycode_blacklist[i] * GLYPHS_PER_KEY; k[0] = k[1] = k[2] = k[3] = NoSymbol; } diff --git a/xserver/hw/xquartz/xpr/Makefile.in b/xserver/hw/xquartz/xpr/Makefile.in index 86a9423c7..65cf505d2 100644 --- a/xserver/hw/xquartz/xpr/Makefile.in +++ b/xserver/hw/xquartz/xpr/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -309,6 +309,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -327,15 +328,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -343,6 +347,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -414,8 +420,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xquartz/xpr/x-hash.c b/xserver/hw/xquartz/xpr/x-hash.c index 26e079ff0..087656d9b 100644 --- a/xserver/hw/xquartz/xpr/x-hash.c +++ b/xserver/hw/xquartz/xpr/x-hash.c @@ -37,6 +37,8 @@ #include #include +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + struct x_hash_table_struct { unsigned int bucket_index; unsigned int total_keys; @@ -65,8 +67,6 @@ static const unsigned int bucket_sizes[] = { 1610612741 }; -#define N_BUCKET_SIZES (sizeof(bucket_sizes) / sizeof(bucket_sizes[0])) - static inline unsigned int hash_table_total_buckets(x_hash_table *h) { @@ -110,7 +110,7 @@ hash_table_split(x_hash_table *h) size_t b; int i; - if (h->bucket_index == N_BUCKET_SIZES - 1) + if (h->bucket_index == ARRAY_SIZE(bucket_sizes) - 1) return; old_size = hash_table_total_buckets(h); diff --git a/xserver/hw/xwayland/Makefile.am b/xserver/hw/xwayland/Makefile.am index a3c9fce48..bc1cb8506 100644 --- a/xserver/hw/xwayland/Makefile.am +++ b/xserver/hw/xwayland/Makefile.am @@ -18,13 +18,13 @@ Xwayland_SOURCES = \ xwayland-cvt.c \ xwayland-vidmode.c \ xwayland.h \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c Xwayland_LDADD = \ $(glamor_lib) \ $(XWAYLAND_LIBS) \ + $(top_builddir)/glx/libglxvnd.la \ $(XWAYLAND_SYS_LIBS) \ $(top_builddir)/Xext/libXvidmode.la \ $(XSERVER_SYS_LIBS) @@ -34,12 +34,19 @@ Xwayland_built_sources = if GLAMOR_EGL Xwayland_SOURCES += \ - xwayland-glamor.c + xwayland-glamor.c \ + xwayland-glamor-gbm.c \ + xwayland-present.c if XV Xwayland_SOURCES += \ xwayland-glamor-xv.c endif +if XWAYLAND_EGLSTREAM +Xwayland_SOURCES += \ + xwayland-glamor-eglstream.c +endif + glamor_built_sources = \ drm-client-protocol.h \ drm-protocol.c @@ -56,31 +63,75 @@ Xwayland_built_sources += \ relative-pointer-unstable-v1-client-protocol.h \ relative-pointer-unstable-v1-protocol.c \ pointer-constraints-unstable-v1-client-protocol.h \ - pointer-constraints-unstable-v1-protocol.c + pointer-constraints-unstable-v1-protocol.c \ + tablet-unstable-v2-client-protocol.h \ + tablet-unstable-v2-protocol.c \ + xwayland-keyboard-grab-unstable-v1-protocol.c \ + xwayland-keyboard-grab-unstable-v1-client-protocol.h \ + xdg-output-unstable-v1-protocol.c \ + xdg-output-unstable-v1-client-protocol.h \ + linux-dmabuf-unstable-v1-client-protocol.h \ + linux-dmabuf-unstable-v1-protocol.c + +if XWAYLAND_EGLSTREAM +Xwayland_built_sources += \ + wayland-eglstream-client-protocol.h \ + wayland-eglstream-protocol.c \ + wayland-eglstream-controller-client-protocol.h \ + wayland-eglstream-controller-protocol.c +endif nodist_Xwayland_SOURCES = $(Xwayland_built_sources) CLEANFILES = $(Xwayland_built_sources) EXTRA_DIST = drm.xml - $(Xwayland_SOURCES): $(Xwayland_built_sources) relink: $(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT) relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ -%-protocol.c : %.xml +tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +xwayland-keyboard-grab-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +xwayland-keyboard-grab-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ +xdg-output-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +xdg-output-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +wayland-eglstream-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ +wayland-eglstream-controller-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +wayland-eglstream-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +wayland-eglstream-controller-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + +%-protocol.c : %.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ %-client-protocol.h : %.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ diff --git a/xserver/hw/xwayland/Makefile.in b/xserver/hw/xwayland/Makefile.in index 7b9a37e89..5a110e736 100644 --- a/xserver/hw/xwayland/Makefile.in +++ b/xserver/hw/xwayland/Makefile.in @@ -52,17 +52,30 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = Xwayland$(EXEEXT) @GLAMOR_EGL_TRUE@am__append_1 = \ -@GLAMOR_EGL_TRUE@ xwayland-glamor.c +@GLAMOR_EGL_TRUE@ xwayland-glamor.c \ +@GLAMOR_EGL_TRUE@ xwayland-glamor-gbm.c \ +@GLAMOR_EGL_TRUE@ xwayland-present.c @GLAMOR_EGL_TRUE@@XV_TRUE@am__append_2 = \ @GLAMOR_EGL_TRUE@@XV_TRUE@ xwayland-glamor-xv.c -@GLAMOR_EGL_TRUE@am__append_3 = $(glamor_built_sources) -@GLAMOR_EGL_TRUE@am__append_4 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL +@GLAMOR_EGL_TRUE@@XWAYLAND_EGLSTREAM_TRUE@am__append_3 = \ +@GLAMOR_EGL_TRUE@@XWAYLAND_EGLSTREAM_TRUE@ xwayland-glamor-eglstream.c + +@GLAMOR_EGL_TRUE@am__append_4 = $(glamor_built_sources) +@GLAMOR_EGL_TRUE@am__append_5 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL @GLAMOR_EGL_FALSE@Xwayland_DEPENDENCIES = $(glamor_lib) \ -@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) \ +@GLAMOR_EGL_FALSE@ $(top_builddir)/glx/libglxvnd.la \ +@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) \ @GLAMOR_EGL_FALSE@ $(top_builddir)/Xext/libXvidmode.la \ @GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +@XWAYLAND_EGLSTREAM_TRUE@am__append_6 = \ +@XWAYLAND_EGLSTREAM_TRUE@ wayland-eglstream-client-protocol.h \ +@XWAYLAND_EGLSTREAM_TRUE@ wayland-eglstream-protocol.c \ +@XWAYLAND_EGLSTREAM_TRUE@ wayland-eglstream-controller-client-protocol.h \ +@XWAYLAND_EGLSTREAM_TRUE@ wayland-eglstream-controller-protocol.c + subdir = hw/xwayland DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -81,7 +94,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -90,26 +103,36 @@ PROGRAMS = $(bin_PROGRAMS) am__Xwayland_SOURCES_DIST = xwayland.c xwayland-input.c \ xwayland-cursor.c xwayland-shm.c xwayland-output.c \ xwayland-cvt.c xwayland-vidmode.c xwayland.h \ - $(top_srcdir)/Xext/dpmsstubs.c $(top_srcdir)/Xi/stubs.c \ - $(top_srcdir)/mi/miinitext.c xwayland-glamor.c \ - xwayland-glamor-xv.c -@GLAMOR_EGL_TRUE@am__objects_1 = Xwayland-xwayland-glamor.$(OBJEXT) + $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \ + xwayland-glamor.c xwayland-glamor-gbm.c xwayland-present.c \ + xwayland-glamor-xv.c xwayland-glamor-eglstream.c +@GLAMOR_EGL_TRUE@am__objects_1 = Xwayland-xwayland-glamor.$(OBJEXT) \ +@GLAMOR_EGL_TRUE@ Xwayland-xwayland-glamor-gbm.$(OBJEXT) \ +@GLAMOR_EGL_TRUE@ Xwayland-xwayland-present.$(OBJEXT) @GLAMOR_EGL_TRUE@@XV_TRUE@am__objects_2 = Xwayland-xwayland-glamor-xv.$(OBJEXT) +@GLAMOR_EGL_TRUE@@XWAYLAND_EGLSTREAM_TRUE@am__objects_3 = Xwayland-xwayland-glamor-eglstream.$(OBJEXT) am_Xwayland_OBJECTS = Xwayland-xwayland.$(OBJEXT) \ Xwayland-xwayland-input.$(OBJEXT) \ Xwayland-xwayland-cursor.$(OBJEXT) \ Xwayland-xwayland-shm.$(OBJEXT) \ Xwayland-xwayland-output.$(OBJEXT) \ Xwayland-xwayland-cvt.$(OBJEXT) \ - Xwayland-xwayland-vidmode.$(OBJEXT) \ - Xwayland-dpmsstubs.$(OBJEXT) Xwayland-stubs.$(OBJEXT) \ - Xwayland-miinitext.$(OBJEXT) $(am__objects_1) $(am__objects_2) -@GLAMOR_EGL_TRUE@am__objects_3 = Xwayland-drm-protocol.$(OBJEXT) -@GLAMOR_EGL_TRUE@am__objects_4 = $(am__objects_3) -am__objects_5 = $(am__objects_4) \ + Xwayland-xwayland-vidmode.$(OBJEXT) Xwayland-stubs.$(OBJEXT) \ + Xwayland-miinitext.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) +@GLAMOR_EGL_TRUE@am__objects_4 = Xwayland-drm-protocol.$(OBJEXT) +@GLAMOR_EGL_TRUE@am__objects_5 = $(am__objects_4) +@XWAYLAND_EGLSTREAM_TRUE@am__objects_6 = Xwayland-wayland-eglstream-protocol.$(OBJEXT) \ +@XWAYLAND_EGLSTREAM_TRUE@ Xwayland-wayland-eglstream-controller-protocol.$(OBJEXT) +am__objects_7 = $(am__objects_5) \ Xwayland-relative-pointer-unstable-v1-protocol.$(OBJEXT) \ - Xwayland-pointer-constraints-unstable-v1-protocol.$(OBJEXT) -nodist_Xwayland_OBJECTS = $(am__objects_5) + Xwayland-pointer-constraints-unstable-v1-protocol.$(OBJEXT) \ + Xwayland-tablet-unstable-v2-protocol.$(OBJEXT) \ + Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.$(OBJEXT) \ + Xwayland-xdg-output-unstable-v1-protocol.$(OBJEXT) \ + Xwayland-linux-dmabuf-unstable-v1-protocol.$(OBJEXT) \ + $(am__objects_6) +nodist_Xwayland_OBJECTS = $(am__objects_7) Xwayland_OBJECTS = $(am_Xwayland_OBJECTS) $(nodist_Xwayland_OBJECTS) am__DEPENDENCIES_1 = @GLAMOR_EGL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @@ -348,6 +371,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -366,15 +390,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -382,6 +409,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -453,8 +482,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -530,18 +557,27 @@ Xwayland_CFLAGS = \ Xwayland_SOURCES = xwayland.c xwayland-input.c xwayland-cursor.c \ xwayland-shm.c xwayland-output.c xwayland-cvt.c \ - xwayland-vidmode.c xwayland.h $(top_srcdir)/Xext/dpmsstubs.c \ - $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \ - $(am__append_1) $(am__append_2) -Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) $(XWAYLAND_SYS_LIBS) \ + xwayland-vidmode.c xwayland.h $(top_srcdir)/Xi/stubs.c \ + $(top_srcdir)/mi/miinitext.c $(am__append_1) $(am__append_2) \ + $(am__append_3) +Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) \ + $(top_builddir)/glx/libglxvnd.la $(XWAYLAND_SYS_LIBS) \ $(top_builddir)/Xext/libXvidmode.la $(XSERVER_SYS_LIBS) \ - $(am__append_4) + $(am__append_5) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Xwayland_built_sources = $(am__append_3) \ +Xwayland_built_sources = $(am__append_4) \ relative-pointer-unstable-v1-client-protocol.h \ relative-pointer-unstable-v1-protocol.c \ pointer-constraints-unstable-v1-client-protocol.h \ - pointer-constraints-unstable-v1-protocol.c + pointer-constraints-unstable-v1-protocol.c \ + tablet-unstable-v2-client-protocol.h \ + tablet-unstable-v2-protocol.c \ + xwayland-keyboard-grab-unstable-v1-protocol.c \ + xwayland-keyboard-grab-unstable-v1-client-protocol.h \ + xdg-output-unstable-v1-protocol.c \ + xdg-output-unstable-v1-client-protocol.h \ + linux-dmabuf-unstable-v1-client-protocol.h \ + linux-dmabuf-unstable-v1-protocol.c $(am__append_6) @GLAMOR_EGL_TRUE@glamor_built_sources = \ @GLAMOR_EGL_TRUE@ drm-client-protocol.h \ @GLAMOR_EGL_TRUE@ drm-protocol.c @@ -641,18 +677,26 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-dpmsstubs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-drm-protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-miinitext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-stubs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-wayland-eglstream-protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-cvt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor-gbm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor-xv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-input.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-output.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-present.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-shm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-vidmode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland.Po@am__quote@ @@ -776,20 +820,6 @@ Xwayland-xwayland-vidmode.obj: xwayland-vidmode.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-vidmode.obj `if test -f 'xwayland-vidmode.c'; then $(CYGPATH_W) 'xwayland-vidmode.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-vidmode.c'; fi` -Xwayland-dpmsstubs.o: $(top_srcdir)/Xext/dpmsstubs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-dpmsstubs.o -MD -MP -MF $(DEPDIR)/Xwayland-dpmsstubs.Tpo -c -o Xwayland-dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-dpmsstubs.Tpo $(DEPDIR)/Xwayland-dpmsstubs.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/Xext/dpmsstubs.c' object='Xwayland-dpmsstubs.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c - -Xwayland-dpmsstubs.obj: $(top_srcdir)/Xext/dpmsstubs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-dpmsstubs.obj -MD -MP -MF $(DEPDIR)/Xwayland-dpmsstubs.Tpo -c -o Xwayland-dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-dpmsstubs.Tpo $(DEPDIR)/Xwayland-dpmsstubs.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/Xext/dpmsstubs.c' object='Xwayland-dpmsstubs.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi` - Xwayland-stubs.o: $(top_srcdir)/Xi/stubs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-stubs.o -MD -MP -MF $(DEPDIR)/Xwayland-stubs.Tpo -c -o Xwayland-stubs.o `test -f '$(top_srcdir)/Xi/stubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xi/stubs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-stubs.Tpo $(DEPDIR)/Xwayland-stubs.Po @@ -832,6 +862,34 @@ Xwayland-xwayland-glamor.obj: xwayland-glamor.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor.obj `if test -f 'xwayland-glamor.c'; then $(CYGPATH_W) 'xwayland-glamor.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor.c'; fi` +Xwayland-xwayland-glamor-gbm.o: xwayland-glamor-gbm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-gbm.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Tpo -c -o Xwayland-xwayland-glamor-gbm.o `test -f 'xwayland-glamor-gbm.c' || echo '$(srcdir)/'`xwayland-glamor-gbm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-gbm.c' object='Xwayland-xwayland-glamor-gbm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor-gbm.o `test -f 'xwayland-glamor-gbm.c' || echo '$(srcdir)/'`xwayland-glamor-gbm.c + +Xwayland-xwayland-glamor-gbm.obj: xwayland-glamor-gbm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-gbm.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Tpo -c -o Xwayland-xwayland-glamor-gbm.obj `if test -f 'xwayland-glamor-gbm.c'; then $(CYGPATH_W) 'xwayland-glamor-gbm.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-gbm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-gbm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-gbm.c' object='Xwayland-xwayland-glamor-gbm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor-gbm.obj `if test -f 'xwayland-glamor-gbm.c'; then $(CYGPATH_W) 'xwayland-glamor-gbm.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-gbm.c'; fi` + +Xwayland-xwayland-present.o: xwayland-present.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-present.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-present.Tpo -c -o Xwayland-xwayland-present.o `test -f 'xwayland-present.c' || echo '$(srcdir)/'`xwayland-present.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-present.Tpo $(DEPDIR)/Xwayland-xwayland-present.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-present.c' object='Xwayland-xwayland-present.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-present.o `test -f 'xwayland-present.c' || echo '$(srcdir)/'`xwayland-present.c + +Xwayland-xwayland-present.obj: xwayland-present.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-present.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-present.Tpo -c -o Xwayland-xwayland-present.obj `if test -f 'xwayland-present.c'; then $(CYGPATH_W) 'xwayland-present.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-present.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-present.Tpo $(DEPDIR)/Xwayland-xwayland-present.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-present.c' object='Xwayland-xwayland-present.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-present.obj `if test -f 'xwayland-present.c'; then $(CYGPATH_W) 'xwayland-present.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-present.c'; fi` + Xwayland-xwayland-glamor-xv.o: xwayland-glamor-xv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-xv.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo -c -o Xwayland-xwayland-glamor-xv.o `test -f 'xwayland-glamor-xv.c' || echo '$(srcdir)/'`xwayland-glamor-xv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-xv.Po @@ -846,6 +904,20 @@ Xwayland-xwayland-glamor-xv.obj: xwayland-glamor-xv.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor-xv.obj `if test -f 'xwayland-glamor-xv.c'; then $(CYGPATH_W) 'xwayland-glamor-xv.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-xv.c'; fi` +Xwayland-xwayland-glamor-eglstream.o: xwayland-glamor-eglstream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-eglstream.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Tpo -c -o Xwayland-xwayland-glamor-eglstream.o `test -f 'xwayland-glamor-eglstream.c' || echo '$(srcdir)/'`xwayland-glamor-eglstream.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-eglstream.c' object='Xwayland-xwayland-glamor-eglstream.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor-eglstream.o `test -f 'xwayland-glamor-eglstream.c' || echo '$(srcdir)/'`xwayland-glamor-eglstream.c + +Xwayland-xwayland-glamor-eglstream.obj: xwayland-glamor-eglstream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-eglstream.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Tpo -c -o Xwayland-xwayland-glamor-eglstream.obj `if test -f 'xwayland-glamor-eglstream.c'; then $(CYGPATH_W) 'xwayland-glamor-eglstream.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-eglstream.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-eglstream.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-eglstream.c' object='Xwayland-xwayland-glamor-eglstream.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-glamor-eglstream.obj `if test -f 'xwayland-glamor-eglstream.c'; then $(CYGPATH_W) 'xwayland-glamor-eglstream.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-eglstream.c'; fi` + Xwayland-drm-protocol.o: drm-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-drm-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-drm-protocol.Tpo -c -o Xwayland-drm-protocol.o `test -f 'drm-protocol.c' || echo '$(srcdir)/'`drm-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-drm-protocol.Tpo $(DEPDIR)/Xwayland-drm-protocol.Po @@ -888,6 +960,90 @@ Xwayland-pointer-constraints-unstable-v1-protocol.obj: pointer-constraints-unsta @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-pointer-constraints-unstable-v1-protocol.obj `if test -f 'pointer-constraints-unstable-v1-protocol.c'; then $(CYGPATH_W) 'pointer-constraints-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/pointer-constraints-unstable-v1-protocol.c'; fi` +Xwayland-tablet-unstable-v2-protocol.o: tablet-unstable-v2-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-tablet-unstable-v2-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Tpo -c -o Xwayland-tablet-unstable-v2-protocol.o `test -f 'tablet-unstable-v2-protocol.c' || echo '$(srcdir)/'`tablet-unstable-v2-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Tpo $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tablet-unstable-v2-protocol.c' object='Xwayland-tablet-unstable-v2-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-tablet-unstable-v2-protocol.o `test -f 'tablet-unstable-v2-protocol.c' || echo '$(srcdir)/'`tablet-unstable-v2-protocol.c + +Xwayland-tablet-unstable-v2-protocol.obj: tablet-unstable-v2-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-tablet-unstable-v2-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Tpo -c -o Xwayland-tablet-unstable-v2-protocol.obj `if test -f 'tablet-unstable-v2-protocol.c'; then $(CYGPATH_W) 'tablet-unstable-v2-protocol.c'; else $(CYGPATH_W) '$(srcdir)/tablet-unstable-v2-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Tpo $(DEPDIR)/Xwayland-tablet-unstable-v2-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tablet-unstable-v2-protocol.c' object='Xwayland-tablet-unstable-v2-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-tablet-unstable-v2-protocol.obj `if test -f 'tablet-unstable-v2-protocol.c'; then $(CYGPATH_W) 'tablet-unstable-v2-protocol.c'; else $(CYGPATH_W) '$(srcdir)/tablet-unstable-v2-protocol.c'; fi` + +Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.o: xwayland-keyboard-grab-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Tpo -c -o Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.o `test -f 'xwayland-keyboard-grab-unstable-v1-protocol.c' || echo '$(srcdir)/'`xwayland-keyboard-grab-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-keyboard-grab-unstable-v1-protocol.c' object='Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.o `test -f 'xwayland-keyboard-grab-unstable-v1-protocol.c' || echo '$(srcdir)/'`xwayland-keyboard-grab-unstable-v1-protocol.c + +Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.obj: xwayland-keyboard-grab-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Tpo -c -o Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.obj `if test -f 'xwayland-keyboard-grab-unstable-v1-protocol.c'; then $(CYGPATH_W) 'xwayland-keyboard-grab-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-keyboard-grab-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-keyboard-grab-unstable-v1-protocol.c' object='Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xwayland-keyboard-grab-unstable-v1-protocol.obj `if test -f 'xwayland-keyboard-grab-unstable-v1-protocol.c'; then $(CYGPATH_W) 'xwayland-keyboard-grab-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-keyboard-grab-unstable-v1-protocol.c'; fi` + +Xwayland-xdg-output-unstable-v1-protocol.o: xdg-output-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xdg-output-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Tpo -c -o Xwayland-xdg-output-unstable-v1-protocol.o `test -f 'xdg-output-unstable-v1-protocol.c' || echo '$(srcdir)/'`xdg-output-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xdg-output-unstable-v1-protocol.c' object='Xwayland-xdg-output-unstable-v1-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xdg-output-unstable-v1-protocol.o `test -f 'xdg-output-unstable-v1-protocol.c' || echo '$(srcdir)/'`xdg-output-unstable-v1-protocol.c + +Xwayland-xdg-output-unstable-v1-protocol.obj: xdg-output-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xdg-output-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Tpo -c -o Xwayland-xdg-output-unstable-v1-protocol.obj `if test -f 'xdg-output-unstable-v1-protocol.c'; then $(CYGPATH_W) 'xdg-output-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/xdg-output-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-xdg-output-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xdg-output-unstable-v1-protocol.c' object='Xwayland-xdg-output-unstable-v1-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-xdg-output-unstable-v1-protocol.obj `if test -f 'xdg-output-unstable-v1-protocol.c'; then $(CYGPATH_W) 'xdg-output-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/xdg-output-unstable-v1-protocol.c'; fi` + +Xwayland-linux-dmabuf-unstable-v1-protocol.o: linux-dmabuf-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-linux-dmabuf-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Tpo -c -o Xwayland-linux-dmabuf-unstable-v1-protocol.o `test -f 'linux-dmabuf-unstable-v1-protocol.c' || echo '$(srcdir)/'`linux-dmabuf-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux-dmabuf-unstable-v1-protocol.c' object='Xwayland-linux-dmabuf-unstable-v1-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-linux-dmabuf-unstable-v1-protocol.o `test -f 'linux-dmabuf-unstable-v1-protocol.c' || echo '$(srcdir)/'`linux-dmabuf-unstable-v1-protocol.c + +Xwayland-linux-dmabuf-unstable-v1-protocol.obj: linux-dmabuf-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-linux-dmabuf-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Tpo -c -o Xwayland-linux-dmabuf-unstable-v1-protocol.obj `if test -f 'linux-dmabuf-unstable-v1-protocol.c'; then $(CYGPATH_W) 'linux-dmabuf-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/linux-dmabuf-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-linux-dmabuf-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux-dmabuf-unstable-v1-protocol.c' object='Xwayland-linux-dmabuf-unstable-v1-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-linux-dmabuf-unstable-v1-protocol.obj `if test -f 'linux-dmabuf-unstable-v1-protocol.c'; then $(CYGPATH_W) 'linux-dmabuf-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/linux-dmabuf-unstable-v1-protocol.c'; fi` + +Xwayland-wayland-eglstream-protocol.o: wayland-eglstream-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-wayland-eglstream-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Tpo -c -o Xwayland-wayland-eglstream-protocol.o `test -f 'wayland-eglstream-protocol.c' || echo '$(srcdir)/'`wayland-eglstream-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Tpo $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wayland-eglstream-protocol.c' object='Xwayland-wayland-eglstream-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-wayland-eglstream-protocol.o `test -f 'wayland-eglstream-protocol.c' || echo '$(srcdir)/'`wayland-eglstream-protocol.c + +Xwayland-wayland-eglstream-protocol.obj: wayland-eglstream-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-wayland-eglstream-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Tpo -c -o Xwayland-wayland-eglstream-protocol.obj `if test -f 'wayland-eglstream-protocol.c'; then $(CYGPATH_W) 'wayland-eglstream-protocol.c'; else $(CYGPATH_W) '$(srcdir)/wayland-eglstream-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Tpo $(DEPDIR)/Xwayland-wayland-eglstream-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wayland-eglstream-protocol.c' object='Xwayland-wayland-eglstream-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-wayland-eglstream-protocol.obj `if test -f 'wayland-eglstream-protocol.c'; then $(CYGPATH_W) 'wayland-eglstream-protocol.c'; else $(CYGPATH_W) '$(srcdir)/wayland-eglstream-protocol.c'; fi` + +Xwayland-wayland-eglstream-controller-protocol.o: wayland-eglstream-controller-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-wayland-eglstream-controller-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Tpo -c -o Xwayland-wayland-eglstream-controller-protocol.o `test -f 'wayland-eglstream-controller-protocol.c' || echo '$(srcdir)/'`wayland-eglstream-controller-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Tpo $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wayland-eglstream-controller-protocol.c' object='Xwayland-wayland-eglstream-controller-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-wayland-eglstream-controller-protocol.o `test -f 'wayland-eglstream-controller-protocol.c' || echo '$(srcdir)/'`wayland-eglstream-controller-protocol.c + +Xwayland-wayland-eglstream-controller-protocol.obj: wayland-eglstream-controller-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-wayland-eglstream-controller-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Tpo -c -o Xwayland-wayland-eglstream-controller-protocol.obj `if test -f 'wayland-eglstream-controller-protocol.c'; then $(CYGPATH_W) 'wayland-eglstream-controller-protocol.c'; else $(CYGPATH_W) '$(srcdir)/wayland-eglstream-controller-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Tpo $(DEPDIR)/Xwayland-wayland-eglstream-controller-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wayland-eglstream-controller-protocol.c' object='Xwayland-wayland-eglstream-controller-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-wayland-eglstream-controller-protocol.obj `if test -f 'wayland-eglstream-controller-protocol.c'; then $(CYGPATH_W) 'wayland-eglstream-controller-protocol.c'; else $(CYGPATH_W) '$(srcdir)/wayland-eglstream-controller-protocol.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1121,17 +1277,46 @@ relink: $(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT) relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ -%-protocol.c : %.xml +tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +xwayland-keyboard-grab-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +xwayland-keyboard-grab-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ +xdg-output-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +xdg-output-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ +linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +wayland-eglstream-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ +wayland-eglstream-controller-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +wayland-eglstream-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +wayland-eglstream-controller-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + +%-protocol.c : %.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ %-client-protocol.h : %.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ diff --git a/xserver/hw/xwayland/xwayland-cursor.c b/xserver/hw/xwayland/xwayland-cursor.c index 7b6a698fd..cf8395f1d 100644 --- a/xserver/hw/xwayland/xwayland-cursor.c +++ b/xserver/hw/xwayland/xwayland-cursor.c @@ -96,11 +96,11 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) } static void -clear_cursor_frame_callback(struct xwl_seat *xwl_seat) +clear_cursor_frame_callback(struct xwl_cursor *xwl_cursor) { - if (xwl_seat->cursor_frame_cb) { - wl_callback_destroy (xwl_seat->cursor_frame_cb); - xwl_seat->cursor_frame_cb = NULL; + if (xwl_cursor->frame_cb) { + wl_callback_destroy (xwl_cursor->frame_cb); + xwl_cursor->frame_cb = NULL; } } @@ -109,12 +109,12 @@ frame_callback(void *data, struct wl_callback *callback, uint32_t time) { - struct xwl_seat *xwl_seat = data; + struct xwl_cursor *xwl_cursor = data; - clear_cursor_frame_callback(xwl_seat); - if (xwl_seat->cursor_needs_update) { - xwl_seat->cursor_needs_update = FALSE; - xwl_seat_set_cursor(xwl_seat); + clear_cursor_frame_callback(xwl_cursor); + if (xwl_cursor->needs_update) { + xwl_cursor->needs_update = FALSE; + xwl_cursor->update_proc(xwl_cursor); } } @@ -125,6 +125,7 @@ static const struct wl_callback_listener frame_listener = { void xwl_seat_set_cursor(struct xwl_seat *xwl_seat) { + struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; PixmapPtr pixmap; CursorPtr cursor; int stride; @@ -135,13 +136,13 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) if (!xwl_seat->x_cursor) { wl_pointer_set_cursor(xwl_seat->wl_pointer, xwl_seat->pointer_enter_serial, NULL, 0, 0); - clear_cursor_frame_callback(xwl_seat); - xwl_seat->cursor_needs_update = FALSE; + clear_cursor_frame_callback(xwl_cursor); + xwl_cursor->needs_update = FALSE; return; } - if (xwl_seat->cursor_frame_cb) { - xwl_seat->cursor_needs_update = TRUE; + if (xwl_cursor->frame_cb) { + xwl_cursor->needs_update = TRUE; return; } @@ -159,19 +160,69 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) wl_pointer_set_cursor(xwl_seat->wl_pointer, xwl_seat->pointer_enter_serial, - xwl_seat->cursor, + xwl_cursor->surface, xwl_seat->x_cursor->bits->xhot, xwl_seat->x_cursor->bits->yhot); - wl_surface_attach(xwl_seat->cursor, + wl_surface_attach(xwl_cursor->surface, xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); - wl_surface_damage(xwl_seat->cursor, 0, 0, + wl_surface_damage(xwl_cursor->surface, 0, 0, xwl_seat->x_cursor->bits->width, xwl_seat->x_cursor->bits->height); - xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor); - wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat); + xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); + wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); - wl_surface_commit(xwl_seat->cursor); + wl_surface_commit(xwl_cursor->surface); +} + +void +xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) +{ + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; + PixmapPtr pixmap; + CursorPtr cursor; + int stride; + + if (!xwl_seat->x_cursor) { + zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, + xwl_tablet_tool->proximity_in_serial, + NULL, 0, 0); + return; + } + + if (xwl_cursor->frame_cb) { + xwl_cursor->needs_update = TRUE; + return; + } + + cursor = xwl_seat->x_cursor; + pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); + if (!pixmap) + return; + + stride = cursor->bits->width * 4; + if (cursor->bits->argb) + memcpy(pixmap->devPrivate.ptr, + cursor->bits->argb, cursor->bits->height * stride); + else + expand_source_and_mask(cursor, pixmap->devPrivate.ptr); + + zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, + xwl_tablet_tool->proximity_in_serial, + xwl_cursor->surface, + xwl_seat->x_cursor->bits->xhot, + xwl_seat->x_cursor->bits->yhot); + wl_surface_attach(xwl_cursor->surface, + xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); + wl_surface_damage(xwl_cursor->surface, 0, 0, + xwl_seat->x_cursor->bits->width, + xwl_seat->x_cursor->bits->height); + + xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); + wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); + + wl_surface_commit(xwl_cursor->surface); } static void @@ -179,6 +230,7 @@ xwl_set_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor, int x, int y) { struct xwl_seat *xwl_seat; + struct xwl_tablet_tool *xwl_tablet_tool; Bool cursor_visibility_changed; xwl_seat = device->public.devicePrivate; @@ -193,6 +245,11 @@ xwl_set_cursor(DeviceIntPtr device, xwl_seat_cursor_visibility_changed(xwl_seat); xwl_seat_set_cursor(xwl_seat); + + xorg_list_for_each_entry(xwl_tablet_tool, &xwl_seat->tablet_tools, link) { + if (xwl_tablet_tool->proximity_in_serial != 0) + xwl_tablet_tool_set_cursor(xwl_tablet_tool); + } } static void diff --git a/xserver/hw/xwayland/xwayland-glamor-eglstream.c b/xserver/hw/xwayland/xwayland-glamor-eglstream.c new file mode 100644 index 000000000..c62c0d2ac --- /dev/null +++ b/xserver/hw/xwayland/xwayland-glamor-eglstream.c @@ -0,0 +1,932 @@ +/* + * Copyright © 2017 Red Hat Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including + * the next paragraph) 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 AUTHORS OR COPYRIGHT + * HOLDERS 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. + * + * Authors: + * Lyude Paul + * + */ + +#include "xwayland.h" + +#include "wayland-eglstream-client-protocol.h" +#include "wayland-eglstream-controller-client-protocol.h" + +#define MESA_EGL_NO_X11_HEADERS +#include +#include +#include +#include + +#include + +#include + +struct xwl_eglstream_pending_stream { + PixmapPtr pixmap; + WindowPtr window; + + struct xwl_pixmap *xwl_pixmap; + struct wl_callback *cb; + + Bool is_valid; + + struct xorg_list link; +}; + +struct xwl_eglstream_private { + EGLDeviceEXT egl_device; + struct wl_eglstream_display *display; + struct wl_eglstream_controller *controller; + uint32_t display_caps; + + EGLConfig config; + + SetWindowPixmapProcPtr SetWindowPixmap; + + struct xorg_list pending_streams; + + Bool have_egl_damage; + + GLint blit_prog; + GLuint blit_vao; + GLuint blit_vbo; + GLuint blit_is_rgba_pos; +}; + +struct xwl_pixmap { + struct wl_buffer *buffer; + struct xwl_screen *xwl_screen; + + /* The stream and associated resources have their own lifetime seperate + * from the pixmap's */ + int refcount; + + EGLStreamKHR stream; + EGLSurface surface; +}; + +static DevPrivateKeyRec xwl_eglstream_private_key; +static DevPrivateKeyRec xwl_eglstream_window_private_key; + +static inline struct xwl_eglstream_private * +xwl_eglstream_get(struct xwl_screen *xwl_screen) +{ + return dixLookupPrivate(&xwl_screen->screen->devPrivates, + &xwl_eglstream_private_key); +} + +static inline struct xwl_eglstream_pending_stream * +xwl_eglstream_window_get_pending(WindowPtr window) +{ + return dixLookupPrivate(&window->devPrivates, + &xwl_eglstream_window_private_key); +} + +static inline void +xwl_eglstream_window_set_pending(WindowPtr window, + struct xwl_eglstream_pending_stream *stream) +{ + dixSetPrivate(&window->devPrivates, + &xwl_eglstream_window_private_key, stream); +} + +static GLint +xwl_eglstream_compile_glsl_prog(GLenum type, const char *source) +{ + GLint ok; + GLint prog; + + prog = glCreateShader(type); + glShaderSource(prog, 1, (const GLchar **) &source, NULL); + glCompileShader(prog); + glGetShaderiv(prog, GL_COMPILE_STATUS, &ok); + if (!ok) { + GLchar *info; + GLint size; + + glGetShaderiv(prog, GL_INFO_LOG_LENGTH, &size); + info = malloc(size); + if (info) { + glGetShaderInfoLog(prog, size, NULL, info); + ErrorF("Failed to compile %s: %s\n", + type == GL_FRAGMENT_SHADER ? "FS" : "VS", info); + ErrorF("Program source:\n%s", source); + free(info); + } + else + ErrorF("Failed to get shader compilation info.\n"); + FatalError("GLSL compile failure\n"); + } + + return prog; +} + +static GLuint +xwl_eglstream_build_glsl_prog(GLuint vs, GLuint fs) +{ + GLint ok; + GLuint prog; + + prog = glCreateProgram(); + glAttachShader(prog, vs); + glAttachShader(prog, fs); + + glLinkProgram(prog); + glGetProgramiv(prog, GL_LINK_STATUS, &ok); + if (!ok) { + GLchar *info; + GLint size; + + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &size); + info = malloc(size); + + glGetProgramInfoLog(prog, size, NULL, info); + ErrorF("Failed to link: %s\n", info); + FatalError("GLSL link failure\n"); + } + + return prog; +} + +static void +xwl_eglstream_cleanup(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + + if (xwl_eglstream->display) + wl_eglstream_display_destroy(xwl_eglstream->display); + if (xwl_eglstream->controller) + wl_eglstream_controller_destroy(xwl_eglstream->controller); + if (xwl_eglstream->blit_prog) { + glDeleteProgram(xwl_eglstream->blit_prog); + glDeleteBuffers(1, &xwl_eglstream->blit_vbo); + } + + free(xwl_eglstream); +} + +static Bool +xwl_glamor_egl_supports_device_probing(void) +{ + return epoxy_has_egl_extension(NULL, "EGL_EXT_device_base"); +} + +static void ** +xwl_glamor_egl_get_devices(int *num_devices) +{ + EGLDeviceEXT *devices, *tmp; + Bool ret; + int drm_dev_count = 0; + int i; + + if (!xwl_glamor_egl_supports_device_probing()) + return NULL; + + /* Get the number of devices */ + ret = eglQueryDevicesEXT(0, NULL, num_devices); + if (!ret || *num_devices < 1) + return NULL; + + devices = calloc(*num_devices, sizeof(EGLDeviceEXT)); + if (!devices) + return NULL; + + ret = eglQueryDevicesEXT(*num_devices, devices, num_devices); + if (!ret) + goto error; + + /* We're only ever going to care about devices that support + * EGL_EXT_device_drm, so filter out the ones that don't + */ + for (i = 0; i < *num_devices; i++) { + const char *extension_str = + eglQueryDeviceStringEXT(devices[i], EGL_EXTENSIONS); + + if (!epoxy_extension_in_string(extension_str, "EGL_EXT_device_drm")) + continue; + + devices[drm_dev_count++] = devices[i]; + } + if (!drm_dev_count) + goto error; + + *num_devices = drm_dev_count; + tmp = realloc(devices, sizeof(EGLDeviceEXT) * drm_dev_count); + if (!tmp) + goto error; + + devices = tmp; + + return devices; + +error: + free(devices); + + return NULL; +} + +static Bool +xwl_glamor_egl_device_has_egl_extensions(void *device, + const char **ext_list, size_t size) +{ + EGLDisplay egl_display; + int i; + Bool has_exts = TRUE; + + egl_display = glamor_egl_get_display(EGL_PLATFORM_DEVICE_EXT, device); + if (!egl_display || !eglInitialize(egl_display, NULL, NULL)) + return FALSE; + + for (i = 0; i < size; i++) { + if (!epoxy_has_egl_extension(egl_display, ext_list[i])) { + has_exts = FALSE; + break; + } + } + + eglTerminate(egl_display); + return has_exts; +} + +static void +xwl_eglstream_unref_pixmap_stream(struct xwl_pixmap *xwl_pixmap) +{ + struct xwl_screen *xwl_screen = xwl_pixmap->xwl_screen; + + if (--xwl_pixmap->refcount >= 1) + return; + + /* If we're using this stream in the current egl context, unbind it so the + * driver doesn't keep it around until the next eglMakeCurrent() + * don't have to keep it around until something else changes the surface + */ + xwl_glamor_egl_make_current(xwl_screen); + if (eglGetCurrentSurface(EGL_READ) == xwl_pixmap->surface || + eglGetCurrentSurface(EGL_DRAW) == xwl_pixmap->surface) { + eglMakeCurrent(xwl_screen->egl_display, + EGL_NO_SURFACE, EGL_NO_SURFACE, + xwl_screen->egl_context); + } + + if (xwl_pixmap->surface) + eglDestroySurface(xwl_screen->egl_display, xwl_pixmap->surface); + + eglDestroyStreamKHR(xwl_screen->egl_display, xwl_pixmap->stream); + + wl_buffer_destroy(xwl_pixmap->buffer); + free(xwl_pixmap); +} + +static Bool +xwl_glamor_eglstream_destroy_pixmap(PixmapPtr pixmap) +{ + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + + if (xwl_pixmap && pixmap->refcnt == 1) + xwl_eglstream_unref_pixmap_stream(xwl_pixmap); + + return glamor_destroy_pixmap(pixmap); +} + +static struct wl_buffer * +xwl_glamor_eglstream_get_wl_buffer_for_pixmap(PixmapPtr pixmap, + Bool *created) +{ + /* XXX created? */ + return xwl_pixmap_get(pixmap)->buffer; +} + +static void +xwl_eglstream_set_window_pixmap(WindowPtr window, PixmapPtr pixmap) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + struct xwl_eglstream_pending_stream *pending; + + pending = xwl_eglstream_window_get_pending(window); + if (pending) { + /* The pixmap for this window has changed before the compositor + * finished attaching the consumer for the window's pixmap's original + * eglstream. A producer can no longer be attached, so the stream's + * useless + */ + pending->is_valid = FALSE; + + /* The compositor may still be using the stream, so we can't destroy + * it yet. We'll only have a guarantee that the stream is safe to + * destroy once we receive the pending wl_display_sync() for this + * stream + */ + pending->xwl_pixmap->refcount++; + } + + xwl_screen->screen->SetWindowPixmap = xwl_eglstream->SetWindowPixmap; + (*xwl_screen->screen->SetWindowPixmap)(window, pixmap); + xwl_eglstream->SetWindowPixmap = xwl_screen->screen->SetWindowPixmap; + xwl_screen->screen->SetWindowPixmap = xwl_eglstream_set_window_pixmap; +} + +/* Because we run asynchronously with our wayland compositor, it's possible + * that an X client event could cause us to begin creating a stream for a + * pixmap/window combo before the stream for the pixmap this window + * previously used has been fully initialized. An example: + * + * - Start processing X client events. + * - X window receives resize event, causing us to create a new pixmap and + * begin creating the corresponding eglstream. This pixmap is known as + * pixmap A. + * - X window receives another resize event, and again changes it's current + * pixmap causing us to create another corresponding eglstream for the same + * window. This pixmap is known as pixmap B. + * - Start handling events from the wayland compositor. + * + * Since both pixmap A and B will have scheduled wl_display_sync events to + * indicate when their respective streams are connected, we will receive each + * callback in the original order the pixmaps were created. This means the + * following would happen: + * + * - Receive pixmap A's stream callback, attach it's stream to the surface of + * the window that just orphaned it. + * - Receive pixmap B's stream callback, fall over and fail because the + * window's surface now incorrectly has pixmap A's stream attached to it. + * + * We work around this problem by keeping a queue of pending streams, and + * only allowing one queue entry to exist for each window. In the scenario + * listed above, this should happen: + * + * - Begin processing X events... + * - A window is resized, causing us to add an eglstream (known as eglstream + * A) waiting for it's consumer to finish attachment to be added to the + * queue. + * - Resize on same window happens. We invalidate the previously pending + * stream and add another one to the pending queue (known as eglstream B). + * - Begin processing Wayland events... + * - Receive invalidated callback from compositor for eglstream A, destroy + * stream. + * - Receive callback from compositor for eglstream B, create producer. + * - Success! + */ +static void +xwl_eglstream_consumer_ready_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_screen *xwl_screen = data; + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + struct xwl_pixmap *xwl_pixmap; + struct xwl_eglstream_pending_stream *pending; + Bool found = FALSE; + + wl_callback_destroy(callback); + + xorg_list_for_each_entry(pending, &xwl_eglstream->pending_streams, link) { + if (pending->cb == callback) { + found = TRUE; + break; + } + } + assert(found); + + if (!pending->is_valid) { + xwl_eglstream_unref_pixmap_stream(pending->xwl_pixmap); + goto out; + } + + xwl_glamor_egl_make_current(xwl_screen); + + xwl_pixmap = pending->xwl_pixmap; + xwl_pixmap->surface = eglCreateStreamProducerSurfaceKHR( + xwl_screen->egl_display, xwl_eglstream->config, + xwl_pixmap->stream, (int[]) { + EGL_WIDTH, pending->pixmap->drawable.width, + EGL_HEIGHT, pending->pixmap->drawable.height, + EGL_NONE + }); + + DebugF("eglstream: win %d completes eglstream for pixmap %p, congrats!\n", + pending->window->drawable.id, pending->pixmap); + + xwl_eglstream_window_set_pending(pending->window, NULL); +out: + xorg_list_del(&pending->link); + free(pending); +} + +static const struct wl_callback_listener consumer_ready_listener = { + xwl_eglstream_consumer_ready_callback +}; + +static void +xwl_eglstream_queue_pending_stream(struct xwl_screen *xwl_screen, + WindowPtr window, PixmapPtr pixmap) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + struct xwl_eglstream_pending_stream *pending_stream; + +#ifdef DEBUG + if (!xwl_eglstream_window_get_pending(window)) + DebugF("eglstream: win %d begins new eglstream for pixmap %p\n", + window->drawable.id, pixmap); + else + DebugF("eglstream: win %d interrupts and replaces pending eglstream for pixmap %p\n", + window->drawable.id, pixmap); +#endif + + pending_stream = malloc(sizeof(*pending_stream)); + pending_stream->window = window; + pending_stream->pixmap = pixmap; + pending_stream->xwl_pixmap = xwl_pixmap_get(pixmap); + pending_stream->is_valid = TRUE; + xorg_list_init(&pending_stream->link); + xorg_list_add(&pending_stream->link, &xwl_eglstream->pending_streams); + xwl_eglstream_window_set_pending(window, pending_stream); + + pending_stream->cb = wl_display_sync(xwl_screen->display); + wl_callback_add_listener(pending_stream->cb, &consumer_ready_listener, + xwl_screen); +} + +static void +xwl_eglstream_buffer_release_callback(void *data, struct wl_buffer *wl_buffer) +{ + xwl_eglstream_unref_pixmap_stream(data); +} + +static const struct wl_buffer_listener xwl_eglstream_buffer_release_listener = { + xwl_eglstream_buffer_release_callback +}; + +static void +xwl_eglstream_create_pending_stream(struct xwl_screen *xwl_screen, + WindowPtr window, PixmapPtr pixmap) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + struct xwl_pixmap *xwl_pixmap; + struct xwl_window *xwl_window = xwl_window_from_window(window); + struct wl_array stream_attribs; + int stream_fd = -1; + + xwl_pixmap = calloc(sizeof(*xwl_pixmap), 1); + if (!xwl_pixmap) + FatalError("Not enough memory to create pixmap\n"); + xwl_pixmap_set_private(pixmap, xwl_pixmap); + + xwl_glamor_egl_make_current(xwl_screen); + + xwl_pixmap->xwl_screen = xwl_screen; + xwl_pixmap->refcount = 1; + xwl_pixmap->stream = eglCreateStreamKHR(xwl_screen->egl_display, NULL); + stream_fd = eglGetStreamFileDescriptorKHR(xwl_screen->egl_display, + xwl_pixmap->stream); + + wl_array_init(&stream_attribs); + xwl_pixmap->buffer = + wl_eglstream_display_create_stream(xwl_eglstream->display, + pixmap->drawable.width, + pixmap->drawable.height, + stream_fd, + WL_EGLSTREAM_HANDLE_TYPE_FD, + &stream_attribs); + + wl_buffer_add_listener(xwl_pixmap->buffer, + &xwl_eglstream_buffer_release_listener, + xwl_pixmap); + + wl_eglstream_controller_attach_eglstream_consumer( + xwl_eglstream->controller, xwl_window->surface, xwl_pixmap->buffer); + + xwl_eglstream_queue_pending_stream(xwl_screen, window, pixmap); + + close(stream_fd); +} + +static Bool +xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window) +{ + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; + struct xwl_eglstream_pending_stream *pending = + xwl_eglstream_window_get_pending(xwl_window->window); + PixmapPtr pixmap = + (*xwl_screen->screen->GetWindowPixmap)(xwl_window->window); + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + + if (xwl_pixmap) { + if (pending) { + /* Wait for the compositor to finish connecting the consumer for + * this eglstream */ + if (pending->is_valid) + return FALSE; + + /* The pixmap for this window was changed before the compositor + * finished connecting the eglstream for the window's previous + * pixmap. Begin creating a new eglstream. */ + } else { + return TRUE; + } + } + + /* Glamor pixmap has no backing stream yet; begin making one and disallow + * commits until then + */ + xwl_eglstream_create_pending_stream(xwl_screen, xwl_window->window, + pixmap); + + return FALSE; +} + +static void +xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window, + PixmapPtr pixmap, RegionPtr region) +{ + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + BoxPtr box = RegionExtents(region); + EGLint egl_damage[] = { + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1 + }; + GLint saved_vao; + + /* Unbind the framebuffer BEFORE binding the EGLSurface, otherwise we + * won't actually draw to it + */ + xwl_glamor_egl_make_current(xwl_screen); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + if (eglGetCurrentSurface(EGL_READ) != xwl_pixmap->surface || + eglGetCurrentSurface(EGL_DRAW) != xwl_pixmap->surface) + eglMakeCurrent(xwl_screen->egl_display, + xwl_pixmap->surface, xwl_pixmap->surface, + xwl_screen->egl_context); + + /* Save current GL state */ + glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &saved_vao); + + /* Setup our GL state */ + glUseProgram(xwl_eglstream->blit_prog); + glViewport(0, 0, pixmap->drawable.width, pixmap->drawable.height); + glActiveTexture(GL_TEXTURE0); + glBindVertexArray(xwl_eglstream->blit_vao); + glBindTexture(GL_TEXTURE_2D, glamor_get_pixmap_texture(pixmap)); + + glUniform1i(xwl_eglstream->blit_is_rgba_pos, + pixmap->drawable.depth >= 32); + + /* Blit rendered image into EGLStream surface */ + glDrawBuffer(GL_BACK); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + + if (xwl_eglstream->have_egl_damage) + eglSwapBuffersWithDamageKHR(xwl_screen->egl_display, + xwl_pixmap->surface, egl_damage, 1); + else + eglSwapBuffers(xwl_screen->egl_display, xwl_pixmap->surface); + + /* Restore previous state */ + glBindVertexArray(saved_vao); + glBindTexture(GL_TEXTURE_2D, 0); + + /* After this we will hand off the eglstream's wl_buffer to the + * compositor, which will own it until it sends a release() event. */ + xwl_pixmap->refcount++; +} + +static void +xwl_eglstream_display_handle_caps(void *data, + struct wl_eglstream_display *disp, + int32_t caps) +{ + xwl_eglstream_get(data)->display_caps = caps; +} + +static void +xwl_eglstream_display_handle_swapinterval_override(void *data, + struct wl_eglstream_display *disp, + int32_t swapinterval, + struct wl_buffer *stream) +{ +} + +const struct wl_eglstream_display_listener eglstream_display_listener = { + .caps = xwl_eglstream_display_handle_caps, + .swapinterval_override = xwl_eglstream_display_handle_swapinterval_override, +}; + +static Bool +xwl_glamor_eglstream_init_wl_registry(struct xwl_screen *xwl_screen, + struct wl_registry *wl_registry, + uint32_t id, const char *name, + uint32_t version) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + + if (strcmp(name, "wl_eglstream_display") == 0) { + xwl_eglstream->display = wl_registry_bind( + wl_registry, id, &wl_eglstream_display_interface, version); + + wl_eglstream_display_add_listener(xwl_eglstream->display, + &eglstream_display_listener, + xwl_screen); + return TRUE; + } else if (strcmp(name, "wl_eglstream_controller") == 0) { + xwl_eglstream->controller = wl_registry_bind( + wl_registry, id, &wl_eglstream_controller_interface, version); + return TRUE; + } + + /* no match */ + return FALSE; +} + +static Bool +xwl_glamor_eglstream_has_wl_interfaces(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + + if (xwl_eglstream->display == NULL) { + ErrorF("glamor: 'wl_eglstream_display' not supported\n"); + return FALSE; + } + + if (xwl_eglstream->controller == NULL) { + ErrorF("glamor: 'wl_eglstream_controller' not supported\n"); + return FALSE; + } + + return TRUE; +} + +static inline void +xwl_eglstream_init_shaders(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + GLint fs, vs, attrib; + GLuint vbo; + + const char *blit_vs_src = + "attribute vec2 texcoord;\n" + "attribute vec2 position;\n" + "varying vec2 t;\n" + "void main() {\n" + " t = texcoord;\n" + " gl_Position = vec4(position, 0, 1);\n" + "}"; + + const char *blit_fs_src = + "varying vec2 t;\n" + "uniform sampler2D s;\n" + "uniform bool is_rgba;\n" + "void main() {\n" + " if (is_rgba)\n" + " gl_FragColor = texture2D(s, t);\n" + " else\n" + " gl_FragColor = vec4(texture2D(s, t).rgb, 1.0);\n" + "}"; + + static const float position[] = { + /* position */ + -1, -1, + 1, -1, + 1, 1, + -1, 1, + /* texcoord */ + 0, 1, + 1, 1, + 1, 0, + 0, 0, + }; + + vs = xwl_eglstream_compile_glsl_prog(GL_VERTEX_SHADER, blit_vs_src); + fs = xwl_eglstream_compile_glsl_prog(GL_FRAGMENT_SHADER, blit_fs_src); + + xwl_eglstream->blit_prog = xwl_eglstream_build_glsl_prog(vs, fs); + glDeleteShader(vs); + glDeleteShader(fs); + + /* Create the blitter's vao */ + glGenVertexArrays(1, &xwl_eglstream->blit_vao); + glBindVertexArray(xwl_eglstream->blit_vao); + + /* Set the data for both position and texcoord in the vbo */ + glGenBuffers(1, &vbo); + glBindBuffer(GL_ARRAY_BUFFER, vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(position), position, GL_STATIC_DRAW); + xwl_eglstream->blit_vbo = vbo; + + /* Define each shader attribute's data location in our vbo */ + attrib = glGetAttribLocation(xwl_eglstream->blit_prog, "position"); + glVertexAttribPointer(attrib, 2, GL_FLOAT, TRUE, 0, NULL); + glEnableVertexAttribArray(attrib); + + attrib = glGetAttribLocation(xwl_eglstream->blit_prog, "texcoord"); + glVertexAttribPointer(attrib, 2, GL_FLOAT, TRUE, 0, + (void*)(sizeof(float) * 8)); + glEnableVertexAttribArray(attrib); + + /* Save the location of uniforms we'll set later */ + xwl_eglstream->blit_is_rgba_pos = + glGetUniformLocation(xwl_eglstream->blit_prog, "is_rgba"); +} + +static Bool +xwl_glamor_eglstream_init_egl(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + EGLConfig config; + const EGLint attrib_list[] = { + EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, + EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, + EGL_CONTEXT_MAJOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MAJOR, + EGL_CONTEXT_MINOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MINOR, + EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG, + EGL_NONE + }; + const EGLint config_attribs[] = { + EGL_SURFACE_TYPE, EGL_STREAM_BIT_KHR, + EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_NONE, + }; + int n; + + xwl_screen->egl_display = glamor_egl_get_display( + EGL_PLATFORM_DEVICE_EXT, xwl_eglstream->egl_device); + if (!xwl_screen->egl_display) + goto error; + + if (!eglInitialize(xwl_screen->egl_display, NULL, NULL)) { + xwl_screen->egl_display = NULL; + goto error; + } + + if (!epoxy_has_egl_extension(xwl_screen->egl_display, + "EGL_IMG_context_priority")) { + ErrorF("EGL_IMG_context_priority not available\n"); + goto error; + } + + eglChooseConfig(xwl_screen->egl_display, config_attribs, &config, 1, &n); + if (!n) { + ErrorF("No acceptable EGL configs found\n"); + goto error; + } + + xwl_eglstream->config = config; +#if 0 + xwl_screen->formats = + XWL_FORMAT_RGB565 | XWL_FORMAT_XRGB8888 | XWL_FORMAT_ARGB8888; +#endif + + eglBindAPI(EGL_OPENGL_API); + xwl_screen->egl_context = eglCreateContext( + xwl_screen->egl_display, config, EGL_NO_CONTEXT, attrib_list); + if (xwl_screen->egl_context == EGL_NO_CONTEXT) { + ErrorF("Failed to create main EGL context: 0x%x\n", eglGetError()); + goto error; + } + + if (!eglMakeCurrent(xwl_screen->egl_display, + EGL_NO_SURFACE, EGL_NO_SURFACE, + xwl_screen->egl_context)) { + ErrorF("Failed to make EGL context current\n"); + goto error; + } + + xwl_eglstream->have_egl_damage = + epoxy_has_egl_extension(xwl_screen->egl_display, + "EGL_KHR_swap_buffers_with_damage"); + if (!xwl_eglstream->have_egl_damage) + ErrorF("Driver lacks EGL_KHR_swap_buffers_with_damage, performance " + "will be affected\n"); + + xwl_eglstream_init_shaders(xwl_screen); + + return TRUE; +error: + xwl_eglstream_cleanup(xwl_screen); + return FALSE; +} + +static Bool +xwl_glamor_eglstream_init_screen(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream = + xwl_eglstream_get(xwl_screen); + ScreenPtr screen = xwl_screen->screen; + + /* We can just let glamor handle CreatePixmap */ + screen->DestroyPixmap = xwl_glamor_eglstream_destroy_pixmap; + + xwl_eglstream->SetWindowPixmap = screen->SetWindowPixmap; + screen->SetWindowPixmap = xwl_eglstream_set_window_pixmap; + + if (!dixRegisterPrivateKey(&xwl_eglstream_window_private_key, + PRIVATE_WINDOW, 0)) + return FALSE; + + return TRUE; +} + +static EGLDeviceEXT +xwl_eglstream_get_device(struct xwl_screen *xwl_screen) +{ + void **devices = NULL; + const char *exts[] = { + "EGL_KHR_stream", + "EGL_KHR_stream_producer_eglsurface", + }; + int num_devices, i; + EGLDeviceEXT device = EGL_NO_DEVICE_EXT; + + /* No device specified by the user, so find one ourselves */ + devices = xwl_glamor_egl_get_devices(&num_devices); + if (!devices) + goto out; + + for (i = 0; i < num_devices; i++) { + if (xwl_glamor_egl_device_has_egl_extensions(devices[i], exts, + ARRAY_SIZE(exts))) { + device = devices[i]; + break; + } + } + + free(devices); +out: + if (!device) + ErrorF("glamor: No eglstream capable devices found\n"); + return device; +} + +void +xwl_glamor_init_eglstream(struct xwl_screen *xwl_screen) +{ + struct xwl_eglstream_private *xwl_eglstream; + EGLDeviceEXT egl_device; + + xwl_screen->eglstream_backend.is_available = FALSE; + egl_device = xwl_eglstream_get_device(xwl_screen); + if (egl_device == EGL_NO_DEVICE_EXT) + return; + + if (!dixRegisterPrivateKey(&xwl_eglstream_private_key, PRIVATE_SCREEN, 0)) + return; + + xwl_eglstream = calloc(sizeof(*xwl_eglstream), 1); + if (!xwl_eglstream) { + ErrorF("Failed to allocate memory required to init EGLStream support\n"); + return; + } + + dixSetPrivate(&xwl_screen->screen->devPrivates, + &xwl_eglstream_private_key, xwl_eglstream); + + xwl_eglstream->egl_device = egl_device; + xorg_list_init(&xwl_eglstream->pending_streams); + + xwl_screen->eglstream_backend.init_egl = xwl_glamor_eglstream_init_egl; + xwl_screen->eglstream_backend.init_wl_registry = xwl_glamor_eglstream_init_wl_registry; + xwl_screen->eglstream_backend.has_wl_interfaces = xwl_glamor_eglstream_has_wl_interfaces; + xwl_screen->eglstream_backend.init_screen = xwl_glamor_eglstream_init_screen; + xwl_screen->eglstream_backend.get_wl_buffer_for_pixmap = xwl_glamor_eglstream_get_wl_buffer_for_pixmap; + xwl_screen->eglstream_backend.post_damage = xwl_glamor_eglstream_post_damage; + xwl_screen->eglstream_backend.allow_commits = xwl_glamor_eglstream_allow_commits; + xwl_screen->eglstream_backend.is_available = TRUE; +} diff --git a/xserver/hw/xwayland/xwayland-glamor-gbm.c b/xserver/hw/xwayland/xwayland-glamor-gbm.c new file mode 100644 index 000000000..a211e0915 --- /dev/null +++ b/xserver/hw/xwayland/xwayland-glamor-gbm.c @@ -0,0 +1,1035 @@ +/* + * Copyright © 2011-2014 Intel Corporation + * Copyright © 2017 Red Hat Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including + * the next paragraph) 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 AUTHORS OR COPYRIGHT + * HOLDERS 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. + * + * Authors: + * Lyude Paul + * + */ + +#include "xwayland.h" + +#include +#include +#include +#include + +#define MESA_EGL_NO_X11_HEADERS +#include +#include + +#include +#include +#include +#include "drm-client-protocol.h" + +struct xwl_gbm_private { + char *device_name; + struct gbm_device *gbm; + struct wl_drm *drm; + struct zwp_linux_dmabuf_v1 *dmabuf; + int drm_fd; + int fd_render_node; + Bool drm_authenticated; + uint32_t capabilities; + int dmabuf_capable; +}; + +struct xwl_pixmap { + struct wl_buffer *buffer; + EGLImage image; + unsigned int texture; + struct gbm_bo *bo; +}; + +static DevPrivateKeyRec xwl_gbm_private_key; +static DevPrivateKeyRec xwl_auth_state_private_key; + +static inline struct xwl_gbm_private * +xwl_gbm_get(struct xwl_screen *xwl_screen) +{ + return dixLookupPrivate(&xwl_screen->screen->devPrivates, + &xwl_gbm_private_key); +} + +static uint32_t +gbm_format_for_depth(int depth) +{ + switch (depth) { + case 16: + return GBM_FORMAT_RGB565; + case 24: + return GBM_FORMAT_XRGB8888; + case 30: + return GBM_FORMAT_ARGB2101010; + default: + ErrorF("unexpected depth: %d\n", depth); + case 32: + return GBM_FORMAT_ARGB8888; + } +} + +static uint32_t +wl_drm_format_for_depth(int depth) +{ + switch (depth) { + case 15: + return WL_DRM_FORMAT_XRGB1555; + case 16: + return WL_DRM_FORMAT_RGB565; + case 24: + return WL_DRM_FORMAT_XRGB8888; + case 30: + return WL_DRM_FORMAT_ARGB2101010; + default: + ErrorF("unexpected depth: %d\n", depth); + case 32: + return WL_DRM_FORMAT_ARGB8888; + } +} + +static char +is_fd_render_node(int fd) +{ + struct stat render; + + if (fstat(fd, &render)) + return 0; + if (!S_ISCHR(render.st_mode)) + return 0; + if (render.st_rdev & 0x80) + return 1; + + return 0; +} + +static char +is_device_path_render_node (const char *device_path) +{ + char is_render_node; + int fd; + + fd = open(device_path, O_RDWR | O_CLOEXEC); + if (fd < 0) + return 0; + + is_render_node = is_fd_render_node(fd); + close(fd); + + return is_render_node; +} + +static PixmapPtr +xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, + int depth) +{ + PixmapPtr pixmap; + struct xwl_pixmap *xwl_pixmap; + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + + xwl_pixmap = malloc(sizeof *xwl_pixmap); + if (xwl_pixmap == NULL) + return NULL; + + pixmap = glamor_create_pixmap(screen, + gbm_bo_get_width(bo), + gbm_bo_get_height(bo), + depth, + GLAMOR_CREATE_PIXMAP_NO_TEXTURE); + if (!pixmap) { + free(xwl_pixmap); + return NULL; + } + + xwl_glamor_egl_make_current(xwl_screen); + xwl_pixmap->bo = bo; + xwl_pixmap->buffer = NULL; + xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display, + xwl_screen->egl_context, + EGL_NATIVE_PIXMAP_KHR, + xwl_pixmap->bo, NULL); + + glGenTextures(1, &xwl_pixmap->texture); + glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); + glBindTexture(GL_TEXTURE_2D, 0); + + xwl_pixmap_set_private(pixmap, xwl_pixmap); + + glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture); + glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); + + return pixmap; +} + +static PixmapPtr +xwl_glamor_gbm_create_pixmap(ScreenPtr screen, + int width, int height, int depth, + unsigned int hint) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + struct gbm_bo *bo; + + if (width > 0 && height > 0 && depth >= 15 && + (hint == 0 || + hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP || + hint == CREATE_PIXMAP_USAGE_SHARED)) { + uint32_t format = gbm_format_for_depth(depth); + +#ifdef GBM_BO_WITH_MODIFIERS + if (xwl_gbm->dmabuf_capable) { + uint32_t num_modifiers; + uint64_t *modifiers = NULL; + + glamor_get_modifiers(screen, format, &num_modifiers, &modifiers); + bo = gbm_bo_create_with_modifiers(xwl_gbm->gbm, width, height, + format, modifiers, num_modifiers); + free(modifiers); + } + else +#endif + { + bo = gbm_bo_create(xwl_gbm->gbm, width, height, format, + GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); + } + + if (bo) + return xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); + } + + return glamor_create_pixmap(screen, width, height, depth, hint); +} + +static Bool +xwl_glamor_gbm_destroy_pixmap(PixmapPtr pixmap) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + + if (xwl_pixmap && pixmap->refcnt == 1) { + if (xwl_pixmap->buffer) + wl_buffer_destroy(xwl_pixmap->buffer); + + eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); + if (xwl_pixmap->bo) + gbm_bo_destroy(xwl_pixmap->bo); + free(xwl_pixmap); + } + + return glamor_destroy_pixmap(pixmap); +} + +static struct wl_buffer * +xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap, + Bool *created) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + unsigned short width = pixmap->drawable.width; + unsigned short height = pixmap->drawable.height; + int prime_fd; + int num_planes; + uint32_t strides[4]; + uint32_t offsets[4]; + uint64_t modifier; + int i; + + if (xwl_pixmap == NULL) + return NULL; + + if (xwl_pixmap->buffer) { + /* Buffer already exists. Return it and inform caller if interested. */ + if (created) + *created = FALSE; + return xwl_pixmap->buffer; + } + + /* Buffer does not exist yet. Create now and inform caller if interested. */ + if (created) + *created = TRUE; + + if (!xwl_pixmap->bo) + return NULL; + + prime_fd = gbm_bo_get_fd(xwl_pixmap->bo); + if (prime_fd == -1) + return NULL; + +#ifdef GBM_BO_WITH_MODIFIERS + num_planes = gbm_bo_get_plane_count(xwl_pixmap->bo); + modifier = gbm_bo_get_modifier(xwl_pixmap->bo); + for (i = 0; i < num_planes; i++) { + strides[i] = gbm_bo_get_stride_for_plane(xwl_pixmap->bo, i); + offsets[i] = gbm_bo_get_offset(xwl_pixmap->bo, i); + } +#else + num_planes = 1; + modifier = DRM_FORMAT_MOD_INVALID; + strides[0] = gbm_bo_get_stride(xwl_pixmap->bo); + offsets[0] = 0; +#endif + + if (xwl_gbm->dmabuf && modifier != DRM_FORMAT_MOD_INVALID) { + struct zwp_linux_buffer_params_v1 *params; + + params = zwp_linux_dmabuf_v1_create_params(xwl_gbm->dmabuf); + for (i = 0; i < num_planes; i++) { + zwp_linux_buffer_params_v1_add(params, prime_fd, i, + offsets[i], strides[i], + modifier >> 32, modifier & 0xffffffff); + } + + xwl_pixmap->buffer = + zwp_linux_buffer_params_v1_create_immed(params, width, height, + wl_drm_format_for_depth(pixmap->drawable.depth), + 0); + zwp_linux_buffer_params_v1_destroy(params); + } else if (num_planes == 1) { + xwl_pixmap->buffer = + wl_drm_create_prime_buffer(xwl_gbm->drm, prime_fd, width, height, + wl_drm_format_for_depth(pixmap->drawable.depth), + 0, gbm_bo_get_stride(xwl_pixmap->bo), + 0, 0, + 0, 0); + } + + close(prime_fd); + return xwl_pixmap->buffer; +} + +static void +xwl_glamor_gbm_cleanup(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + if (xwl_gbm->device_name) + free(xwl_gbm->device_name); + if (xwl_gbm->drm_fd) + close(xwl_gbm->drm_fd); + if (xwl_gbm->drm) + wl_drm_destroy(xwl_gbm->drm); + if (xwl_gbm->gbm) + gbm_device_destroy(xwl_gbm->gbm); + + free(xwl_gbm); +} + +struct xwl_auth_state { + int fd; + ClientPtr client; + struct wl_callback *callback; +}; + +static void +free_xwl_auth_state(ClientPtr pClient, struct xwl_auth_state *state) +{ + dixSetPrivate(&pClient->devPrivates, &xwl_auth_state_private_key, NULL); + if (state) { + wl_callback_destroy(state->callback); + free(state); + } +} + +static void +xwl_auth_state_client_callback(CallbackListPtr *pcbl, void *unused, void *data) +{ + NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; + ClientPtr pClient = clientinfo->client; + struct xwl_auth_state *state; + + switch (pClient->clientState) { + case ClientStateGone: + case ClientStateRetained: + state = dixLookupPrivate(&pClient->devPrivates, + &xwl_auth_state_private_key); + free_xwl_auth_state(pClient, state); + break; + default: + break; + } +} + +static void +sync_callback(void *data, struct wl_callback *callback, uint32_t serial) +{ + struct xwl_auth_state *state = data; + ClientPtr client = state->client; + + /* if the client is gone, the callback is cancelled so it's safe to + * assume the client is still in ClientStateRunning at this point... + */ + dri3_send_open_reply(client, state->fd); + AttendClient(client); + free_xwl_auth_state(client, state); +} + +static const struct wl_callback_listener sync_listener = { + sync_callback +}; + +static int +xwl_dri3_open_client(ClientPtr client, + ScreenPtr screen, + RRProviderPtr provider, + int *pfd) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + struct xwl_auth_state *state; + drm_magic_t magic; + int fd; + + fd = open(xwl_gbm->device_name, O_RDWR | O_CLOEXEC); + if (fd < 0) + return BadAlloc; + if (xwl_gbm->fd_render_node) { + *pfd = fd; + return Success; + } + + state = malloc(sizeof *state); + if (state == NULL) { + close(fd); + return BadAlloc; + } + + state->client = client; + state->fd = fd; + + if (drmGetMagic(state->fd, &magic) < 0) { + close(state->fd); + free(state); + return BadMatch; + } + + wl_drm_authenticate(xwl_gbm->drm, magic); + state->callback = wl_display_sync(xwl_screen->display); + wl_callback_add_listener(state->callback, &sync_listener, state); + dixSetPrivate(&client->devPrivates, &xwl_auth_state_private_key, state); + + IgnoreClient(client); + + return Success; +} + +_X_EXPORT PixmapPtr +glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds, + CARD16 width, CARD16 height, + const CARD32 *strides, const CARD32 *offsets, + CARD8 depth, CARD8 bpp, uint64_t modifier) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + struct gbm_bo *bo = NULL; + PixmapPtr pixmap; + int i; + + if (width == 0 || height == 0 || num_fds == 0 || + depth < 15 || bpp != BitsPerPixel(depth) || + strides[0] < width * bpp / 8) + goto error; + + if (xwl_gbm->dmabuf_capable && modifier != DRM_FORMAT_MOD_INVALID) { +#ifdef GBM_BO_WITH_MODIFIERS + struct gbm_import_fd_modifier_data data; + + data.width = width; + data.height = height; + data.num_fds = num_fds; + data.format = gbm_format_for_depth(depth); + data.modifier = modifier; + for (i = 0; i < num_fds; i++) { + data.fds[i] = fds[i]; + data.strides[i] = strides[i]; + data.offsets[i] = offsets[i]; + } + bo = gbm_bo_import(xwl_gbm->gbm, GBM_BO_IMPORT_FD_MODIFIER, &data, 0); +#endif + } else if (num_fds == 1) { + struct gbm_import_fd_data data; + + data.fd = fds[0]; + data.width = width; + data.height = height; + data.stride = strides[0]; + data.format = gbm_format_for_depth(depth); + bo = gbm_bo_import(xwl_gbm->gbm, GBM_BO_IMPORT_FD, &data, + GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); + } else { + goto error; + } + + if (bo == NULL) + goto error; + + pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth); + if (pixmap == NULL) { + gbm_bo_destroy(bo); + goto error; + } + + return pixmap; + +error: + return NULL; +} + +_X_EXPORT int +glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) +{ + struct xwl_pixmap *xwl_pixmap; +#ifdef GBM_BO_WITH_MODIFIERS + uint32_t num_fds; + int i; +#endif + + xwl_pixmap = xwl_pixmap_get(pixmap); + + if (xwl_pixmap == NULL) + return 0; + + if (!xwl_pixmap->bo) + return 0; + +#ifdef GBM_BO_WITH_MODIFIERS + num_fds = gbm_bo_get_plane_count(xwl_pixmap->bo); + *modifier = gbm_bo_get_modifier(xwl_pixmap->bo); + + for (i = 0; i < num_fds; i++) { + fds[i] = gbm_bo_get_fd(xwl_pixmap->bo); + strides[i] = gbm_bo_get_stride_for_plane(xwl_pixmap->bo, i); + offsets[i] = gbm_bo_get_offset(xwl_pixmap->bo, i); + } + + return num_fds; +#else + *modifier = DRM_FORMAT_MOD_INVALID; + fds[0] = gbm_bo_get_fd(xwl_pixmap->bo); + strides[0] = gbm_bo_get_stride(xwl_pixmap->bo); + offsets[0] = 0; + return 1; +#endif +} + +/* Not actually used, just defined here so there's something for + * _glamor_egl_fds_from_pixmap() to link against + */ +_X_EXPORT int +glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ + return -1; +} + +_X_EXPORT Bool +glamor_get_formats(ScreenPtr screen, + CARD32 *num_formats, CARD32 **formats) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + int i; + + /* Explicitly zero the count as the caller may ignore the return value */ + *num_formats = 0; + + if (!xwl_gbm->dmabuf_capable || !xwl_gbm->dmabuf) + return FALSE; + + if (xwl_screen->num_formats == 0) + return TRUE; + + *formats = calloc(xwl_screen->num_formats, sizeof(CARD32)); + if (*formats == NULL) + return FALSE; + + for (i = 0; i < xwl_screen->num_formats; i++) + (*formats)[i] = xwl_screen->formats[i].format; + *num_formats = xwl_screen->num_formats; + + return TRUE; +} + +_X_EXPORT Bool +glamor_get_modifiers(ScreenPtr screen, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + struct xwl_format *xwl_format = NULL; + int i; + + /* Explicitly zero the count as the caller may ignore the return value */ + *num_modifiers = 0; + + if (!xwl_gbm->dmabuf_capable || !xwl_gbm->dmabuf) + return FALSE; + + if (xwl_screen->num_formats == 0) + return TRUE; + + for (i = 0; i < xwl_screen->num_formats; i++) { + if (xwl_screen->formats[i].format == format) { + xwl_format = &xwl_screen->formats[i]; + break; + } + } + + if (!xwl_format) + return FALSE; + + *modifiers = calloc(xwl_format->num_modifiers, sizeof(uint64_t)); + if (*modifiers == NULL) + return FALSE; + + for (i = 0; i < xwl_format->num_modifiers; i++) + (*modifiers)[i] = xwl_format->modifiers[i]; + *num_modifiers = xwl_format->num_modifiers; + + return TRUE; +} + +static const dri3_screen_info_rec xwl_dri3_info = { + .version = 2, + .open = NULL, + .pixmap_from_fds = glamor_pixmap_from_fds, + .fds_from_pixmap = glamor_fds_from_pixmap, + .open_client = xwl_dri3_open_client, + .get_formats = glamor_get_formats, + .get_modifiers = glamor_get_modifiers, + .get_drawable_modifiers = glamor_get_drawable_modifiers, +}; + +static const char * +get_render_node_path_for_device(const drmDevicePtr drm_device, + const char *device_path) +{ + char *render_node_path = NULL; + char device_found = 0; + int i; + + for (i = 0; i < DRM_NODE_MAX; i++) { + if ((drm_device->available_nodes & (1 << i)) == 0) + continue; + + if (!strcmp (device_path, drm_device->nodes[i])) + device_found = 1; + + if (is_device_path_render_node(drm_device->nodes[i])) + render_node_path = drm_device->nodes[i]; + + if (device_found && render_node_path) + return render_node_path; + } + + return NULL; +} + +static char * +get_render_node_path(const char *device_path) +{ + drmDevicePtr *devices = NULL; + char *render_node_path = NULL; + int i, n_devices, max_devices; + + max_devices = drmGetDevices2(0, NULL, 0); + if (max_devices <= 0) + goto out; + + devices = calloc(max_devices, sizeof(drmDevicePtr)); + if (!devices) + goto out; + + n_devices = drmGetDevices2(0, devices, max_devices); + if (n_devices < 0) + goto out; + + for (i = 0; i < n_devices; i++) { + const char *node_path = get_render_node_path_for_device(devices[i], + device_path); + if (node_path) { + render_node_path = strdup(node_path); + break; + } + } + +out: + free(devices); + return render_node_path; +} + +static void +xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) +{ + struct xwl_screen *xwl_screen = data; + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + drm_magic_t magic; + char *render_node_path = NULL; + + if (!is_device_path_render_node(device)) + render_node_path = get_render_node_path(device); + + if (render_node_path) + xwl_gbm->device_name = render_node_path; + else + xwl_gbm->device_name = strdup(device); + + if (!xwl_gbm->device_name) { + xwl_glamor_gbm_cleanup(xwl_screen); + return; + } + + xwl_gbm->drm_fd = open(xwl_gbm->device_name, O_RDWR | O_CLOEXEC); + if (xwl_gbm->drm_fd == -1) { + ErrorF("wayland-egl: could not open %s (%s)\n", + xwl_gbm->device_name, strerror(errno)); + xwl_glamor_gbm_cleanup(xwl_screen); + return; + } + + if (is_fd_render_node(xwl_gbm->drm_fd)) { + xwl_gbm->fd_render_node = 1; + xwl_screen->expecting_event--; + } else { + drmGetMagic(xwl_gbm->drm_fd, &magic); + wl_drm_authenticate(xwl_gbm->drm, magic); + } +} + +static void +xwl_drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) +{ +} + +static void +xwl_drm_handle_authenticated(void *data, struct wl_drm *drm) +{ + struct xwl_screen *xwl_screen = data; + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + xwl_gbm->drm_authenticated = TRUE; + xwl_screen->expecting_event--; +} + +static void +xwl_drm_handle_capabilities(void *data, struct wl_drm *drm, uint32_t value) +{ + xwl_gbm_get(data)->capabilities = value; +} + +static const struct wl_drm_listener xwl_drm_listener = { + xwl_drm_handle_device, + xwl_drm_handle_format, + xwl_drm_handle_authenticated, + xwl_drm_handle_capabilities +}; + +static void +xwl_dmabuf_handle_format(void *data, struct zwp_linux_dmabuf_v1 *dmabuf, + uint32_t format) +{ +} + +static void +xwl_dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf, + uint32_t format, uint32_t modifier_hi, + uint32_t modifier_lo) +{ + struct xwl_screen *xwl_screen = data; + struct xwl_format *xwl_format = NULL; + int i; + + for (i = 0; i < xwl_screen->num_formats; i++) { + if (xwl_screen->formats[i].format == format) { + xwl_format = &xwl_screen->formats[i]; + break; + } + } + + if (xwl_format == NULL) { + xwl_screen->num_formats++; + xwl_screen->formats = realloc(xwl_screen->formats, + xwl_screen->num_formats * sizeof(*xwl_format)); + if (!xwl_screen->formats) + return; + xwl_format = &xwl_screen->formats[xwl_screen->num_formats - 1]; + xwl_format->format = format; + xwl_format->num_modifiers = 0; + xwl_format->modifiers = NULL; + } + + xwl_format->num_modifiers++; + xwl_format->modifiers = realloc(xwl_format->modifiers, + xwl_format->num_modifiers * sizeof(uint64_t)); + if (!xwl_format->modifiers) + return; + xwl_format->modifiers[xwl_format->num_modifiers - 1] = (uint64_t) modifier_lo; + xwl_format->modifiers[xwl_format->num_modifiers - 1] |= (uint64_t) modifier_hi << 32; +} + +static const struct zwp_linux_dmabuf_v1_listener xwl_dmabuf_listener = { + .format = xwl_dmabuf_handle_format, + .modifier = xwl_dmabuf_handle_modifier +}; + +Bool +xwl_screen_set_drm_interface(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + if (version < 2) + return FALSE; + + xwl_gbm->drm = + wl_registry_bind(xwl_screen->registry, id, &wl_drm_interface, 2); + wl_drm_add_listener(xwl_gbm->drm, &xwl_drm_listener, xwl_screen); + xwl_screen->expecting_event++; + + return TRUE; +} + +Bool +xwl_screen_set_dmabuf_interface(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + if (version < 3) + return FALSE; + + xwl_gbm->dmabuf = + wl_registry_bind(xwl_screen->registry, id, &zwp_linux_dmabuf_v1_interface, 3); + zwp_linux_dmabuf_v1_add_listener(xwl_gbm->dmabuf, &xwl_dmabuf_listener, xwl_screen); + + return TRUE; +} + +static Bool +xwl_glamor_gbm_init_wl_registry(struct xwl_screen *xwl_screen, + struct wl_registry *wl_registry, + uint32_t id, const char *name, + uint32_t version) +{ + if (strcmp(name, "wl_drm") == 0) { + xwl_screen_set_drm_interface(xwl_screen, id, version); + return TRUE; + } else if (strcmp(name, "zwp_linux_dmabuf_v1") == 0) { + xwl_screen_set_dmabuf_interface(xwl_screen, id, version); + return TRUE; + } + + /* no match */ + return FALSE; +} + +static Bool +xwl_glamor_gbm_has_egl_extension(void) +{ + return (epoxy_has_egl_extension(NULL, "EGL_MESA_platform_gbm") || + epoxy_has_egl_extension(NULL, "EGL_KHR_platform_gbm")); +} + +static Bool +xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + if (xwl_gbm->drm == NULL) { + ErrorF("glamor: 'wl_drm' not supported\n"); + return FALSE; + } + + return TRUE; +} + +static Bool +xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + EGLint major, minor; + Bool egl_initialized = FALSE; + static const EGLint config_attribs_core[] = { + EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, + EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, + EGL_CONTEXT_MAJOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MAJOR, + EGL_CONTEXT_MINOR_VERSION_KHR, + GLAMOR_GL_CORE_VER_MINOR, + EGL_NONE + }; + const GLubyte *renderer; + + if (!xwl_gbm->fd_render_node && !xwl_gbm->drm_authenticated) { + ErrorF("Failed to get wl_drm, disabling Glamor and DRI3\n"); + return FALSE; + } + + xwl_gbm->gbm = gbm_create_device(xwl_gbm->drm_fd); + if (!xwl_gbm->gbm) { + ErrorF("couldn't create gbm device\n"); + goto error; + } + + xwl_screen->egl_display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, + xwl_gbm->gbm); + if (xwl_screen->egl_display == EGL_NO_DISPLAY) { + ErrorF("glamor_egl_get_display() failed\n"); + goto error; + } + + egl_initialized = eglInitialize(xwl_screen->egl_display, &major, &minor); + if (!egl_initialized) { + ErrorF("eglInitialize() failed\n"); + goto error; + } + + eglBindAPI(EGL_OPENGL_API); + + xwl_screen->egl_context = eglCreateContext( + xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, config_attribs_core); + if (xwl_screen->egl_context == EGL_NO_CONTEXT) { + xwl_screen->egl_context = eglCreateContext( + xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, NULL); + } + + if (xwl_screen->egl_context == EGL_NO_CONTEXT) { + ErrorF("Failed to create EGL context\n"); + goto error; + } + + if (!eglMakeCurrent(xwl_screen->egl_display, + EGL_NO_SURFACE, EGL_NO_SURFACE, + xwl_screen->egl_context)) { + ErrorF("Failed to make EGL context current\n"); + goto error; + } + + renderer = glGetString(GL_RENDERER); + if (!renderer) { + ErrorF("glGetString() returned NULL, your GL is broken\n"); + goto error; + } + if (strstr((const char *)renderer, "llvmpipe")) { + ErrorF("Refusing to try glamor on llvmpipe\n"); + goto error; + } + + if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { + ErrorF("GL_OES_EGL_image not available\n"); + goto error; + } + + if (epoxy_has_egl_extension(xwl_screen->egl_display, + "EXT_image_dma_buf_import") && + epoxy_has_egl_extension(xwl_screen->egl_display, + "EXT_image_dma_buf_import_modifiers")) + xwl_gbm->dmabuf_capable = TRUE; + + return TRUE; +error: + if (xwl_screen->egl_context != EGL_NO_CONTEXT) { + eglDestroyContext(xwl_screen->egl_display, xwl_screen->egl_context); + xwl_screen->egl_context = EGL_NO_CONTEXT; + } + + if (xwl_screen->egl_display != EGL_NO_DISPLAY) { + eglTerminate(xwl_screen->egl_display); + xwl_screen->egl_display = EGL_NO_DISPLAY; + } + + xwl_glamor_gbm_cleanup(xwl_screen); + return FALSE; +} + +static Bool +xwl_glamor_gbm_init_screen(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + if (!dri3_screen_init(xwl_screen->screen, &xwl_dri3_info)) { + ErrorF("Failed to initialize dri3\n"); + goto error; + } + + if (xwl_gbm->fd_render_node) + goto skip_drm_auth; + + if (!dixRegisterPrivateKey(&xwl_auth_state_private_key, PRIVATE_CLIENT, + 0)) { + ErrorF("Failed to register private key\n"); + goto error; + } + + if (!AddCallback(&ClientStateCallback, xwl_auth_state_client_callback, + NULL)) { + ErrorF("Failed to add client state callback\n"); + goto error; + } + +skip_drm_auth: + xwl_screen->screen->CreatePixmap = xwl_glamor_gbm_create_pixmap; + xwl_screen->screen->DestroyPixmap = xwl_glamor_gbm_destroy_pixmap; + + return TRUE; +error: + xwl_glamor_gbm_cleanup(xwl_screen); + return FALSE; +} + +void +xwl_glamor_init_gbm(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm; + + xwl_screen->gbm_backend.is_available = FALSE; + + if (!xwl_glamor_gbm_has_egl_extension()) + return; + + if (!dixRegisterPrivateKey(&xwl_gbm_private_key, PRIVATE_SCREEN, 0)) + return; + + xwl_gbm = calloc(sizeof(*xwl_gbm), 1); + if (!xwl_gbm) { + ErrorF("glamor: Not enough memory to setup GBM, disabling\n"); + return; + } + + dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key, + xwl_gbm); + + xwl_screen->gbm_backend.init_wl_registry = xwl_glamor_gbm_init_wl_registry; + xwl_screen->gbm_backend.has_wl_interfaces = xwl_glamor_gbm_has_wl_interfaces; + xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl; + xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen; + xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap; + xwl_screen->gbm_backend.is_available = TRUE; +} diff --git a/xserver/hw/xwayland/xwayland-glamor-xv.c b/xserver/hw/xwayland/xwayland-glamor-xv.c index 65f93c693..8e0f8da94 100644 --- a/xserver/hw/xwayland/xwayland-glamor-xv.c +++ b/xserver/hw/xwayland/xwayland-glamor-xv.c @@ -213,7 +213,7 @@ xwl_glamor_xv_add_formats(XvAdaptorPtr pa) void *moreSpace; totFormat *= 2; - moreSpace = XNFreallocarray(pFormat, totFormat, + moreSpace = xnfreallocarray(pFormat, totFormat, sizeof(XvFormatRec)); pFormat = moreSpace; pf = pFormat + numFormat; diff --git a/xserver/hw/xwayland/xwayland-glamor.c b/xserver/hw/xwayland/xwayland-glamor.c index 63f230369..7ea6def61 100644 --- a/xserver/hw/xwayland/xwayland-glamor.c +++ b/xserver/hw/xwayland/xwayland-glamor.c @@ -25,30 +25,14 @@ #include "xwayland.h" -#include -#include -#include - #define MESA_EGL_NO_X11_HEADERS -#include #include #include #include -#include -#include "drm-client-protocol.h" - -static DevPrivateKeyRec xwl_auth_state_private_key; - -struct xwl_pixmap { - struct wl_buffer *buffer; - struct gbm_bo *bo; - void *image; - unsigned int texture; -}; static void -xwl_glamor_egl_make_current(struct glamor_context *glamor_ctx) +glamor_egl_make_current(struct glamor_context *glamor_ctx) { eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); @@ -58,36 +42,14 @@ xwl_glamor_egl_make_current(struct glamor_context *glamor_ctx) FatalError("Failed to make EGL context current\n"); } -static uint32_t -drm_format_for_depth(int depth) +void +xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen) { - switch (depth) { - case 15: - return WL_DRM_FORMAT_XRGB1555; - case 16: - return WL_DRM_FORMAT_RGB565; - case 24: - return WL_DRM_FORMAT_XRGB8888; - default: - ErrorF("unexpected depth: %d\n", depth); - case 32: - return WL_DRM_FORMAT_ARGB8888; - } -} + if (lastGLContext == xwl_screen->glamor_ctx) + return; -static uint32_t -gbm_format_for_depth(int depth) -{ - switch (depth) { - case 16: - return GBM_FORMAT_RGB565; - case 24: - return GBM_FORMAT_XRGB8888; - default: - ErrorF("unexpected depth: %d\n", depth); - case 32: - return GBM_FORMAT_ARGB8888; - } + lastGLContext = xwl_screen->glamor_ctx; + xwl_screen->glamor_ctx->make_current(xwl_screen->glamor_ctx); } void @@ -95,129 +57,74 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { struct xwl_screen *xwl_screen = xwl_screen_get(screen); + glamor_enable_dri3(screen); glamor_ctx->ctx = xwl_screen->egl_context; glamor_ctx->display = xwl_screen->egl_display; - glamor_ctx->make_current = xwl_glamor_egl_make_current; + glamor_ctx->make_current = glamor_egl_make_current; xwl_screen->glamor_ctx = glamor_ctx; } -static PixmapPtr -xwl_glamor_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, int depth) +void +xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen, + struct wl_registry *registry, + uint32_t id, const char *interface, + uint32_t version) { - PixmapPtr pixmap; - struct xwl_pixmap *xwl_pixmap; - struct xwl_screen *xwl_screen = xwl_screen_get(screen); + if (xwl_screen->gbm_backend.is_available && + xwl_screen->gbm_backend.init_wl_registry(xwl_screen, + registry, + id, + interface, + version)); /* no-op */ + else if (xwl_screen->eglstream_backend.is_available && + xwl_screen->eglstream_backend.init_wl_registry(xwl_screen, + registry, + id, + interface, + version)); /* no-op */ +} - xwl_pixmap = malloc(sizeof *xwl_pixmap); - if (xwl_pixmap == NULL) - return NULL; - - pixmap = glamor_create_pixmap(screen, - gbm_bo_get_width(bo), - gbm_bo_get_height(bo), - depth, - GLAMOR_CREATE_PIXMAP_NO_TEXTURE); - if (pixmap == NULL) { - free(xwl_pixmap); - return NULL; - } - - if (lastGLContext != xwl_screen->glamor_ctx) { - lastGLContext = xwl_screen->glamor_ctx; - xwl_glamor_egl_make_current(xwl_screen->glamor_ctx); - } - - xwl_pixmap->bo = bo; - xwl_pixmap->buffer = NULL; - xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display, - xwl_screen->egl_context, - EGL_NATIVE_PIXMAP_KHR, - xwl_pixmap->bo, NULL); - - glGenTextures(1, &xwl_pixmap->texture); - glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); - glBindTexture(GL_TEXTURE_2D, 0); - - xwl_pixmap_set_private(pixmap, xwl_pixmap); - - glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture); - glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); - - return pixmap; +Bool +xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen, + struct xwl_egl_backend *xwl_egl_backend) +{ + return xwl_egl_backend->has_wl_interfaces(xwl_screen); } struct wl_buffer * -xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap) +xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap, + Bool *created) { struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); - struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); - int prime_fd; - if (xwl_pixmap->buffer) - return xwl_pixmap->buffer; + if (xwl_screen->egl_backend->get_wl_buffer_for_pixmap) + return xwl_screen->egl_backend->get_wl_buffer_for_pixmap(pixmap, + created); - prime_fd = gbm_bo_get_fd(xwl_pixmap->bo); - if (prime_fd == -1) - return NULL; - - xwl_pixmap->buffer = - wl_drm_create_prime_buffer(xwl_screen->drm, prime_fd, - pixmap->drawable.width, - pixmap->drawable.height, - drm_format_for_depth(pixmap->drawable.depth), - 0, gbm_bo_get_stride(xwl_pixmap->bo), - 0, 0, - 0, 0); - - close(prime_fd); - - return xwl_pixmap->buffer; + return NULL; } -static PixmapPtr -xwl_glamor_create_pixmap(ScreenPtr screen, - int width, int height, int depth, unsigned int hint) +void +xwl_glamor_post_damage(struct xwl_window *xwl_window, + PixmapPtr pixmap, RegionPtr region) { - struct xwl_screen *xwl_screen = xwl_screen_get(screen); - struct gbm_bo *bo; + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; - if (width > 0 && height > 0 && depth >= 15 && - (hint == 0 || - hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP || - hint == CREATE_PIXMAP_USAGE_SHARED)) { - bo = gbm_bo_create(xwl_screen->gbm, width, height, - gbm_format_for_depth(depth), - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); - - if (bo) - return xwl_glamor_create_pixmap_for_bo(screen, bo, depth); - } - - return glamor_create_pixmap(screen, width, height, depth, hint); + if (xwl_screen->egl_backend->post_damage) + xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region); } -static Bool -xwl_glamor_destroy_pixmap(PixmapPtr pixmap) +Bool +xwl_glamor_allow_commits(struct xwl_window *xwl_window) { - struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); - struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; - if (xwl_pixmap && pixmap->refcnt == 1) { - if (xwl_pixmap->buffer) - wl_buffer_destroy(xwl_pixmap->buffer); - - eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); - gbm_bo_destroy(xwl_pixmap->bo); - free(xwl_pixmap); - } - - return glamor_destroy_pixmap(pixmap); + if (xwl_screen->egl_backend->allow_commits) + return xwl_screen->egl_backend->allow_commits(xwl_window); + else + return TRUE; } static Bool @@ -239,12 +146,9 @@ xwl_glamor_create_screen_resources(ScreenPtr screen) fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0); } else { - screen->devPrivate = - xwl_glamor_create_pixmap(screen, screen->width, screen->height, - screen->rootDepth, - CREATE_PIXMAP_USAGE_BACKING_PIXMAP); - if (screen->devPrivate) - glamor_set_screen_pixmap(screen->devPrivate, NULL); + screen->devPrivate = screen->CreatePixmap( + screen, screen->width, screen->height, screen->rootDepth, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP); } SetRootClip(screen, xwl_screen->root_clip_mode); @@ -252,340 +156,90 @@ xwl_glamor_create_screen_resources(ScreenPtr screen) return screen->devPrivate != NULL; } -static char -is_fd_render_node(int fd) -{ - struct stat render; - - if (fstat(fd, &render)) - return 0; - if (!S_ISCHR(render.st_mode)) - return 0; - if (render.st_rdev & 0x80) - return 1; - - return 0; -} - -static void -xwl_drm_init_egl(struct xwl_screen *xwl_screen) -{ - EGLint major, minor; - const char *version; - static const EGLint config_attribs_core[] = { - EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, - EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, - EGL_CONTEXT_MAJOR_VERSION_KHR, - GLAMOR_GL_CORE_VER_MAJOR, - EGL_CONTEXT_MINOR_VERSION_KHR, - GLAMOR_GL_CORE_VER_MINOR, - EGL_NONE - }; - - if (xwl_screen->egl_display) - return; - - xwl_screen->expecting_event--; - - xwl_screen->gbm = gbm_create_device(xwl_screen->drm_fd); - if (xwl_screen->gbm == NULL) { - ErrorF("couldn't get display device\n"); - return; - } - - xwl_screen->egl_display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, - xwl_screen->gbm); - if (xwl_screen->egl_display == EGL_NO_DISPLAY) { - ErrorF("glamor_egl_get_display() failed\n"); - return; - } - - if (!eglInitialize(xwl_screen->egl_display, &major, &minor)) { - ErrorF("eglInitialize() failed\n"); - return; - } - - eglBindAPI(EGL_OPENGL_API); - - version = eglQueryString(xwl_screen->egl_display, EGL_VERSION); - ErrorF("glamor: EGL version %s:\n", version); - - xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display, - NULL, EGL_NO_CONTEXT, config_attribs_core); - if (!xwl_screen->egl_context) - xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display, - NULL, EGL_NO_CONTEXT, NULL); - - if (xwl_screen->egl_context == EGL_NO_CONTEXT) { - ErrorF("Failed to create EGL context\n"); - return; - } - - if (!eglMakeCurrent(xwl_screen->egl_display, - EGL_NO_SURFACE, EGL_NO_SURFACE, - xwl_screen->egl_context)) { - ErrorF("Failed to make EGL context current\n"); - return; - } - - if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { - ErrorF("GL_OES_EGL_image not available\n"); - return; - } - - return; -} - -static void -xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) -{ - struct xwl_screen *xwl_screen = data; - drm_magic_t magic; - - xwl_screen->device_name = strdup(device); - if (!xwl_screen->device_name) - return; - - xwl_screen->drm_fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); - if (xwl_screen->drm_fd == -1) { - ErrorF("wayland-egl: could not open %s (%s)\n", - xwl_screen->device_name, strerror(errno)); - return; - } - - if (is_fd_render_node(xwl_screen->drm_fd)) { - xwl_screen->fd_render_node = 1; - xwl_drm_init_egl(xwl_screen); - } else { - drmGetMagic(xwl_screen->drm_fd, &magic); - wl_drm_authenticate(xwl_screen->drm, magic); - } -} - -static void -xwl_drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) -{ - struct xwl_screen *xwl_screen = data; - - switch (format) { - case WL_DRM_FORMAT_ARGB8888: - xwl_screen->formats |= XWL_FORMAT_ARGB8888; - break; - case WL_DRM_FORMAT_XRGB8888: - xwl_screen->formats |= XWL_FORMAT_XRGB8888; - break; - case WL_DRM_FORMAT_RGB565: - xwl_screen->formats |= XWL_FORMAT_RGB565; - break; - } -} - -static void -xwl_drm_handle_authenticated(void *data, struct wl_drm *drm) -{ - struct xwl_screen *xwl_screen = data; - - if (!xwl_screen->egl_display) - xwl_drm_init_egl(xwl_screen); -} - -static void -xwl_drm_handle_capabilities(void *data, struct wl_drm *drm, uint32_t value) -{ - struct xwl_screen *xwl_screen = data; - - xwl_screen->capabilities = value; -} - -static const struct wl_drm_listener xwl_drm_listener = { - xwl_drm_handle_device, - xwl_drm_handle_format, - xwl_drm_handle_authenticated, - xwl_drm_handle_capabilities -}; - -Bool -xwl_screen_init_glamor(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version) -{ - if (version < 2) - return FALSE; - - xwl_screen->drm = - wl_registry_bind(xwl_screen->registry, id, &wl_drm_interface, 2); - wl_drm_add_listener(xwl_screen->drm, &xwl_drm_listener, xwl_screen); - xwl_screen->expecting_event++; - - return TRUE; -} - int -glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, - PixmapPtr pixmap, - unsigned int tex, - Bool want_name, CARD16 *stride, CARD32 *size) +glamor_egl_fd_name_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) { return 0; } -struct xwl_auth_state { - int fd; - ClientPtr client; - struct wl_callback *callback; -}; - -static void -free_xwl_auth_state(ClientPtr pClient, struct xwl_auth_state *state) +void +xwl_glamor_init_backends(struct xwl_screen *xwl_screen, Bool use_eglstream) { - dixSetPrivate(&pClient->devPrivates, &xwl_auth_state_private_key, NULL); - if (state) { - wl_callback_destroy(state->callback); - free(state); - } +#ifdef GLAMOR_HAS_GBM + xwl_glamor_init_gbm(xwl_screen); + if (!xwl_screen->gbm_backend.is_available && !use_eglstream) + ErrorF("xwayland glamor: GBM backend (default) is not available\n"); +#endif +#ifdef XWL_HAS_EGLSTREAM + xwl_glamor_init_eglstream(xwl_screen); + if (!xwl_screen->eglstream_backend.is_available && use_eglstream) + ErrorF("xwayland glamor: EGLStream backend requested but not available\n"); +#endif } -static void -xwl_auth_state_client_callback(CallbackListPtr *pcbl, void *unused, void *data) +static Bool +xwl_glamor_select_gbm_backend(struct xwl_screen *xwl_screen) { - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - struct xwl_auth_state *state; - - switch (pClient->clientState) { - case ClientStateGone: - case ClientStateRetained: - state = dixLookupPrivate(&pClient->devPrivates, &xwl_auth_state_private_key); - free_xwl_auth_state(pClient, state); - break; - default: - break; +#ifdef GLAMOR_HAS_GBM + if (xwl_screen->gbm_backend.is_available && + xwl_glamor_has_wl_interfaces(xwl_screen, &xwl_screen->gbm_backend)) { + xwl_screen->egl_backend = &xwl_screen->gbm_backend; + return TRUE; } + else + ErrorF("Missing Wayland requirements for glamor GBM backend\n"); +#endif + + return FALSE; } -static void -sync_callback(void *data, struct wl_callback *callback, uint32_t serial) +static Bool +xwl_glamor_select_eglstream_backend(struct xwl_screen *xwl_screen) { - struct xwl_auth_state *state = data; - ClientPtr client = state->client; +#ifdef XWL_HAS_EGLSTREAM + if (xwl_screen->eglstream_backend.is_available && + xwl_glamor_has_wl_interfaces(xwl_screen, &xwl_screen->eglstream_backend)) { + ErrorF("glamor: Using nvidia's EGLStream interface, direct rendering impossible.\n"); + ErrorF("glamor: Performance may be affected. Ask your vendor to support GBM!\n"); + xwl_screen->egl_backend = &xwl_screen->eglstream_backend; + return TRUE; + } + else + ErrorF("Missing Wayland requirements for glamor EGLStream backend\n"); +#endif - /* if the client is gone, the callback is cancelled so it's safe to - * assume the client is still in ClientStateRunning at this point... - */ - dri3_send_open_reply(client, state->fd); - AttendClient(client); - free_xwl_auth_state(client, state); + return FALSE; } -static const struct wl_callback_listener sync_listener = { - sync_callback -}; - -static int -xwl_dri3_open_client(ClientPtr client, - ScreenPtr screen, - RRProviderPtr provider, - int *pfd) +void +xwl_glamor_select_backend(struct xwl_screen *xwl_screen, Bool use_eglstream) { - struct xwl_screen *xwl_screen = xwl_screen_get(screen); - struct xwl_auth_state *state; - drm_magic_t magic; - int fd; - - fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); - if (fd < 0) - return BadAlloc; - if (xwl_screen->fd_render_node) { - *pfd = fd; - return Success; + if (use_eglstream) { + if (!xwl_glamor_select_eglstream_backend(xwl_screen)) + xwl_glamor_select_gbm_backend(xwl_screen); } - - state = malloc(sizeof *state); - if (state == NULL) { - close(fd); - return BadAlloc; + else { + if (!xwl_glamor_select_gbm_backend(xwl_screen)) + xwl_glamor_select_eglstream_backend(xwl_screen); } - - state->client = client; - state->fd = fd; - - if (drmGetMagic(state->fd, &magic) < 0) { - close(state->fd); - free(state); - return BadMatch; - } - - wl_drm_authenticate(xwl_screen->drm, magic); - state->callback = wl_display_sync(xwl_screen->display); - wl_callback_add_listener(state->callback, &sync_listener, state); - dixSetPrivate(&client->devPrivates, &xwl_auth_state_private_key, state); - - IgnoreClient(client); - - return Success; } -static PixmapPtr -xwl_dri3_pixmap_from_fd(ScreenPtr screen, int fd, - CARD16 width, CARD16 height, CARD16 stride, - CARD8 depth, CARD8 bpp) -{ - struct xwl_screen *xwl_screen = xwl_screen_get(screen); - struct gbm_import_fd_data data; - struct gbm_bo *bo; - PixmapPtr pixmap; - - if (width == 0 || height == 0 || - depth < 15 || bpp != BitsPerPixel(depth) || stride < width * bpp / 8) - return NULL; - - data.fd = fd; - data.width = width; - data.height = height; - data.stride = stride; - data.format = gbm_format_for_depth(depth); - bo = gbm_bo_import(xwl_screen->gbm, GBM_BO_IMPORT_FD, &data, - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); - if (bo == NULL) - return NULL; - - pixmap = xwl_glamor_create_pixmap_for_bo(screen, bo, depth); - if (pixmap == NULL) { - gbm_bo_destroy(bo); - return NULL; - } - - return pixmap; -} - -static int -xwl_dri3_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, - CARD16 *stride, CARD32 *size) -{ - struct xwl_pixmap *xwl_pixmap; - - xwl_pixmap = xwl_pixmap_get(pixmap); - - *stride = gbm_bo_get_stride(xwl_pixmap->bo); - *size = pixmap->drawable.width * *stride; - - return gbm_bo_get_fd(xwl_pixmap->bo); -} - -static dri3_screen_info_rec xwl_dri3_info = { - .version = 1, - .open = NULL, - .pixmap_from_fd = xwl_dri3_pixmap_from_fd, - .fd_from_pixmap = xwl_dri3_fd_from_pixmap, - .open_client = xwl_dri3_open_client, -}; - Bool xwl_glamor_init(struct xwl_screen *xwl_screen) { ScreenPtr screen = xwl_screen->screen; + const char *no_glamor_env; - if (xwl_screen->egl_context == EGL_NO_CONTEXT) { - ErrorF("Disabling glamor and dri3, EGL setup failed\n"); + no_glamor_env = getenv("XWAYLAND_NO_GLAMOR"); + if (no_glamor_env && *no_glamor_env != '0') { + ErrorF("Disabling glamor and dri3 support, XWAYLAND_NO_GLAMOR is set\n"); + return FALSE; + } + + if (!xwl_screen->egl_backend->init_egl(xwl_screen)) { + ErrorF("EGL setup failed, disabling glamor\n"); return FALSE; } @@ -594,25 +248,13 @@ xwl_glamor_init(struct xwl_screen *xwl_screen) return FALSE; } - if (!dri3_screen_init(xwl_screen->screen, &xwl_dri3_info)) { - ErrorF("Failed to initialize dri3\n"); - return FALSE; - } - - if (!dixRegisterPrivateKey(&xwl_auth_state_private_key, PRIVATE_CLIENT, 0)) { - ErrorF("Failed to register private key\n"); - return FALSE; - } - - if (!AddCallback(&ClientStateCallback, xwl_auth_state_client_callback, NULL)) { - ErrorF("Failed to add client state callback\n"); + if (!xwl_screen->egl_backend->init_screen(xwl_screen)) { + ErrorF("EGL backend init_screen() failed, disabling glamor\n"); return FALSE; } xwl_screen->CreateScreenResources = screen->CreateScreenResources; screen->CreateScreenResources = xwl_glamor_create_screen_resources; - screen->CreatePixmap = xwl_glamor_create_pixmap; - screen->DestroyPixmap = xwl_glamor_destroy_pixmap; #ifdef XV if (!xwl_glamor_xv_init(screen)) diff --git a/xserver/hw/xwayland/xwayland-input.c b/xserver/hw/xwayland/xwayland-input.c index d96e6f2a4..fbbcb39cc 100644 --- a/xserver/hw/xwayland/xwayland-input.c +++ b/xserver/hw/xwayland/xwayland-input.c @@ -34,12 +34,14 @@ #include #include #include +#include +#include "tablet-unstable-v2-client-protocol.h" -/* Copied from mipointer.c */ -#define MIPOINTER(dev) \ - (IsFloating(dev) ? \ - (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ - (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) +struct axis_discrete_pending { + struct xorg_list l; + uint32_t axis; + int32_t discrete; +}; struct sync_pending { struct xorg_list l; @@ -61,6 +63,12 @@ xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emul static void xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); +static void +init_tablet_manager_seat(struct xwl_screen *xwl_screen, + struct xwl_seat *xwl_seat); +static void +release_tablet_manager_seat(struct xwl_seat *xwl_seat); + static void xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl) { @@ -287,6 +295,75 @@ xwl_touch_proc(DeviceIntPtr device, int what) #undef NTOUCHPOINTS } +static int +xwl_tablet_proc(DeviceIntPtr device, int what) +{ +#define NBUTTONS 9 +#define NAXES 6 + Atom btn_labels[NBUTTONS] = { 0 }; + Atom axes_labels[NAXES] = { 0 }; + BYTE map[NBUTTONS + 1] = { 0 }; + int i; + + switch (what) { + case DEVICE_INIT: + device->public.on = FALSE; + + for (i = 1; i <= NBUTTONS; i++) + map[i] = i; + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE); + axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X); + axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y); + axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL); + + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, + GetMotionHistorySize(), Absolute)) + return BadValue; + + /* Valuators - match the xf86-input-wacom ranges */ + InitValuatorAxisStruct(device, 0, axes_labels[0], + 0, 262143, 10000, 0, 10000, Absolute); + InitValuatorAxisStruct(device, 1, axes_labels[1], + 0, 262143, 10000, 0, 10000, Absolute); + /* pressure */ + InitValuatorAxisStruct(device, 2, axes_labels[2], + 0, 65535, 1, 0, 1, Absolute); + /* tilt x */ + InitValuatorAxisStruct(device, 3, axes_labels[3], + -64, 63, 57, 0, 57, Absolute); + /* tilt y */ + InitValuatorAxisStruct(device, 4, axes_labels[4], + -64, 63, 57, 0, 57, Absolute); + /* abs wheel (airbrush) or rotation (artpen) */ + InitValuatorAxisStruct(device, 5, axes_labels[5], + -900, 899, 1, 0, 1, Absolute); + + if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) + return BadValue; + + if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) + return BadValue; + + return Success; + + case DEVICE_ON: + device->public.on = TRUE; + return Success; + + case DEVICE_OFF: + case DEVICE_CLOSE: + device->public.on = FALSE; + return Success; + } + + return BadMatch; +#undef NAXES +#undef NBUTTONS +} + static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, @@ -347,9 +424,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, * of our surfaces might not have been shown. In that case we'll * have a cursor surface frame callback pending which we need to * clear so that we can continue submitting new cursor frames. */ - if (xwl_seat->cursor_frame_cb) { - wl_callback_destroy(xwl_seat->cursor_frame_cb); - xwl_seat->cursor_frame_cb = NULL; + if (xwl_seat->cursor.frame_cb) { + wl_callback_destroy(xwl_seat->cursor.frame_cb); + xwl_seat->cursor.frame_cb = NULL; xwl_seat_set_cursor(xwl_seat); } @@ -494,6 +571,8 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, int index; const int divisor = 10; ValuatorMask mask; + struct axis_discrete_pending *pending = NULL; + struct axis_discrete_pending *iter; switch (axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: @@ -506,8 +585,22 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, return; } + xorg_list_for_each_entry(iter, &xwl_seat->axis_discrete_pending, l) { + if (iter->axis == axis) { + pending = iter; + break; + } + } + valuator_mask_zero(&mask); - valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); + + if (pending) { + valuator_mask_set(&mask, index, pending->discrete); + xorg_list_del(&pending->l); + free(pending); + } else { + valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); + } QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); } @@ -537,6 +630,16 @@ static void pointer_handle_axis_discrete(void *data, struct wl_pointer *wl_pointer, uint32_t axis, int32_t discrete) { + struct xwl_seat *xwl_seat = data; + + struct axis_discrete_pending *pending = malloc(sizeof *pending); + if (!pending) + return; + + pending->axis = axis; + pending->discrete = discrete; + + xorg_list_add(&pending->l, &xwl_seat->axis_discrete_pending); } static const struct wl_pointer_listener pointer_listener = { @@ -864,9 +967,9 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, if (surface == NULL) return; - xwl_touch = calloc(sizeof *xwl_touch, 1); + xwl_touch = calloc(1, sizeof *xwl_touch); if (xwl_touch == NULL) { - ErrorF("touch_handle_down ENOMEM"); + ErrorF("%s: ENOMEM\n", __func__); return; } @@ -945,6 +1048,84 @@ static const struct wl_touch_listener touch_listener = { touch_handle_cancel }; +static struct xwl_seat * +find_matching_seat(DeviceIntPtr device) +{ + DeviceIntPtr dev; + + for (dev = inputInfo.devices; dev; dev = dev->next) + if (dev->deviceProc == xwl_keyboard_proc && + device == GetMaster(dev, MASTER_KEYBOARD)) + return (struct xwl_seat *) dev->public.devicePrivate; + + return NULL; +} + +static void +release_grab(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->keyboard_grab) + zwp_xwayland_keyboard_grab_v1_destroy(xwl_seat->keyboard_grab); + xwl_seat->keyboard_grab = NULL; +} + +static void +set_grab(struct xwl_seat *xwl_seat, struct xwl_window *xwl_window) +{ + struct xwl_screen *xwl_screen; + + if (!xwl_window) + return; + + /* We already have a grab */ + if (xwl_seat->keyboard_grab) + release_grab (xwl_seat); + + xwl_screen = xwl_seat->xwl_screen; + xwl_seat->keyboard_grab = + zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(xwl_screen->wp_grab, + xwl_window->surface, + xwl_seat->seat); +} + +static void +xwl_keyboard_activate_grab(DeviceIntPtr device, GrabPtr grab, TimeStamp time, Bool passive) +{ + struct xwl_seat *xwl_seat = device->public.devicePrivate; + + /* We are not interested in passive grabs */ + if (!passive) { + /* If the device is the MASTER_KEYBOARD, we don't have an xwl_seat */ + if (xwl_seat == NULL) + xwl_seat = find_matching_seat(device); + if (xwl_seat) + set_grab(xwl_seat, xwl_window_from_window(grab->window)); + } + + ActivateKeyboardGrab(device, grab, time, passive); +} + +static void +xwl_keyboard_deactivate_grab(DeviceIntPtr device) +{ + struct xwl_seat *xwl_seat = device->public.devicePrivate; + + /* If the device is the MASTER_KEYBOARD, we don't have an xwl_seat */ + if (xwl_seat == NULL) + xwl_seat = find_matching_seat(device); + if (xwl_seat) + release_grab (xwl_seat); + + DeactivateKeyboardGrab(device); +} + +static void +setup_keyboard_grab_handler (DeviceIntPtr device) +{ + device->deviceGrab.ActivateGrab = xwl_keyboard_activate_grab; + device->deviceGrab.DeactivateGrab = xwl_keyboard_deactivate_grab; +} + static DeviceIntPtr add_device(struct xwl_seat *xwl_seat, const char *driver, DeviceProc device_proc) @@ -1033,6 +1214,8 @@ release_relative_pointer(struct xwl_seat *xwl_seat) static void init_keyboard(struct xwl_seat *xwl_seat) { + DeviceIntPtr master; + xwl_seat->wl_keyboard = wl_seat_get_keyboard(xwl_seat->seat); wl_keyboard_add_listener(xwl_seat->wl_keyboard, &keyboard_listener, xwl_seat); @@ -1044,11 +1227,19 @@ init_keyboard(struct xwl_seat *xwl_seat) } EnableDevice(xwl_seat->keyboard, TRUE); xwl_seat->keyboard->key->xkbInfo->checkRepeat = keyboard_check_repeat; + + if (xwl_seat->xwl_screen->wp_grab) { + /* We have Xwayland grab protocol supported by the compositor */ + master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); + if (master) + setup_keyboard_grab_handler(master); + } } static void release_keyboard(struct xwl_seat *xwl_seat) { + release_grab(xwl_seat); wl_keyboard_release(xwl_seat->wl_keyboard); xwl_seat->wl_keyboard = NULL; @@ -1125,14 +1316,39 @@ static const struct wl_seat_listener seat_listener = { seat_handle_name }; +static void +xwl_cursor_init(struct xwl_cursor *xwl_cursor, struct xwl_screen *xwl_screen, + void (* update_proc)(struct xwl_cursor *)) +{ + xwl_cursor->surface = wl_compositor_create_surface(xwl_screen->compositor); + xwl_cursor->update_proc = update_proc; + xwl_cursor->frame_cb = NULL; + xwl_cursor->needs_update = FALSE; +} + +static void +xwl_cursor_release(struct xwl_cursor *xwl_cursor) +{ + wl_surface_destroy(xwl_cursor->surface); + if (xwl_cursor->frame_cb) + wl_callback_destroy(xwl_cursor->frame_cb); +} + +static void +xwl_seat_update_cursor(struct xwl_cursor *xwl_cursor) +{ + struct xwl_seat *xwl_seat = wl_container_of(xwl_cursor, xwl_seat, cursor); + xwl_seat_set_cursor(xwl_seat); +} + static void create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) { struct xwl_seat *xwl_seat; - xwl_seat = calloc(sizeof *xwl_seat, 1); + xwl_seat = calloc(1, sizeof *xwl_seat); if (xwl_seat == NULL) { - ErrorF("create_input ENOMEM\n"); + ErrorF("%s: ENOMEM\n", __func__); return; } @@ -1144,11 +1360,16 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version &wl_seat_interface, min(version, 5)); xwl_seat->id = id; - xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); + xwl_cursor_init(&xwl_seat->cursor, xwl_seat->xwl_screen, + xwl_seat_update_cursor); wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); + + init_tablet_manager_seat(xwl_screen, xwl_seat); + wl_array_init(&xwl_seat->keys); xorg_list_init(&xwl_seat->touches); + xorg_list_init(&xwl_seat->axis_discrete_pending); xorg_list_init(&xwl_seat->sync_pending); } @@ -1157,6 +1378,7 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) { struct xwl_touch *xwl_touch, *next_xwl_touch; struct sync_pending *p, *npd; + struct axis_discrete_pending *ad, *ad_next; xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, &xwl_seat->touches, link_touch) { @@ -1169,14 +1391,1034 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) free (p); } + xorg_list_for_each_entry_safe(ad, ad_next, &xwl_seat->axis_discrete_pending, l) { + xorg_list_del(&ad->l); + free(ad); + } + + release_tablet_manager_seat(xwl_seat); + + release_grab(xwl_seat); wl_seat_destroy(xwl_seat->seat); - wl_surface_destroy(xwl_seat->cursor); - if (xwl_seat->cursor_frame_cb) - wl_callback_destroy(xwl_seat->cursor_frame_cb); + xwl_cursor_release(&xwl_seat->cursor); wl_array_release(&xwl_seat->keys); free(xwl_seat); } +static void +tablet_handle_name(void *data, struct zwp_tablet_v2 *tablet, const char *name) +{ +} + +static void +tablet_handle_id(void *data, struct zwp_tablet_v2 *tablet, uint32_t vid, + uint32_t pid) +{ +} + +static void +tablet_handle_path(void *data, struct zwp_tablet_v2 *tablet, const char *path) +{ +} + +static void +tablet_handle_done(void *data, struct zwp_tablet_v2 *tablet) +{ + struct xwl_tablet *xwl_tablet = data; + struct xwl_seat *xwl_seat = xwl_tablet->seat; + + if (xwl_seat->stylus == NULL) { + xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", xwl_tablet_proc); + ActivateDevice(xwl_seat->stylus, TRUE); + } + EnableDevice(xwl_seat->stylus, TRUE); + + if (xwl_seat->eraser == NULL) { + xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", xwl_tablet_proc); + ActivateDevice(xwl_seat->eraser, TRUE); + } + EnableDevice(xwl_seat->eraser, TRUE); + + if (xwl_seat->puck == NULL) { + xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", xwl_tablet_proc); + ActivateDevice(xwl_seat->puck, TRUE); + } + EnableDevice(xwl_seat->puck, TRUE); +} + +static void +tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) +{ + struct xwl_tablet *xwl_tablet = data; + struct xwl_seat *xwl_seat = xwl_tablet->seat; + + xorg_list_del(&xwl_tablet->link); + + /* The tablet is merely disabled, not removed. The next tablet + will re-use the same X devices */ + if (xorg_list_is_empty(&xwl_seat->tablets)) { + if (xwl_seat->stylus) + DisableDevice(xwl_seat->stylus, TRUE); + if (xwl_seat->eraser) + DisableDevice(xwl_seat->eraser, TRUE); + if (xwl_seat->puck) + DisableDevice(xwl_seat->puck, TRUE); + /* pads are removed separately */ + } + + zwp_tablet_v2_destroy(tablet); + free(xwl_tablet); +} + +static const struct zwp_tablet_v2_listener tablet_listener = { + tablet_handle_name, + tablet_handle_id, + tablet_handle_path, + tablet_handle_done, + tablet_handle_removed +}; + +static void +tablet_tool_receive_type(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t type) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + switch (type) { + case ZWP_TABLET_TOOL_V2_TYPE_ERASER: + xwl_tablet_tool->xdevice = xwl_seat->eraser; + break; + case ZWP_TABLET_TOOL_V2_TYPE_MOUSE: + case ZWP_TABLET_TOOL_V2_TYPE_LENS: + xwl_tablet_tool->xdevice = xwl_seat->puck; + break; + default: + xwl_tablet_tool->xdevice = xwl_seat->stylus; + break; + } +} + +static void +tablet_tool_receive_hardware_serial(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t hi, uint32_t low) +{ +} + +static void +tablet_tool_receive_hardware_id_wacom(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t hi, uint32_t low) +{ +} + +static void +tablet_tool_receive_capability(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t capability) +{ +} + +static void +tablet_tool_receive_done(void *data, struct zwp_tablet_tool_v2 *tool) +{ +} + +static void +tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + + xorg_list_del(&xwl_tablet_tool->link); + xwl_cursor_release(&xwl_tablet_tool->cursor); + zwp_tablet_tool_v2_destroy(tool); + free(xwl_tablet_tool); +} + +static void +tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t serial, struct zwp_tablet_v2 *tablet, + struct wl_surface *wl_surface) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + /* There's a race here where if we create and then immediately + * destroy a surface, we might end up in a state where the Wayland + * compositor sends us an event for a surface that doesn't exist. + * + * Don't process enter events in this case. + * + * see pointer_handle_enter() + */ + if (wl_surface == NULL) + return; + + xwl_tablet_tool->proximity_in_serial = serial; + xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface); + + xwl_tablet_tool_set_cursor(xwl_tablet_tool); +} + +static void +tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + xwl_tablet_tool->proximity_in_serial = 0; + xwl_seat->tablet_focus_window = NULL; + + xwl_tablet_tool->pressure = 0; + xwl_tablet_tool->tilt_x = 0; + xwl_tablet_tool->tilt_y = 0; + xwl_tablet_tool->rotation = 0; + xwl_tablet_tool->slider = 0; +} + +static void +tablet_tool_down(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + ValuatorMask mask; + + xwl_seat->xwl_screen->serial = serial; + + valuator_mask_zero(&mask); + QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonPress, 1, 0, &mask); +} + +static void +tablet_tool_up(void *data, struct zwp_tablet_tool_v2 *tool) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + ValuatorMask mask; + + valuator_mask_zero(&mask); + QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonRelease, 1, 0, &mask); +} + +static void +tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, + wl_fixed_t x, wl_fixed_t y) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + int32_t dx, dy; + double sx = wl_fixed_to_double(x); + double sy = wl_fixed_to_double(y); + + if (!xwl_seat->tablet_focus_window) + return; + + dx = xwl_seat->tablet_focus_window->window->drawable.x; + dy = xwl_seat->tablet_focus_window->window->drawable.y; + + xwl_tablet_tool->x = (double) dx + sx; + xwl_tablet_tool->y = (double) dy + sy; +} + +static void +tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t pressure) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + if (!xwl_seat->tablet_focus_window) + return; + + /* normalized to 65535 already */ + xwl_tablet_tool->pressure = pressure; +} + +static void +tablet_tool_distance(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t distance_raw) +{ +} + +static void +tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, + wl_fixed_t tilt_x, wl_fixed_t tilt_y) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); + xwl_tablet_tool->tilt_y = wl_fixed_to_double(tilt_y); +} + +static void +tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, + wl_fixed_t angle) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + double rotation = wl_fixed_to_double(angle); + + if (!xwl_seat->tablet_focus_window) + return; + + /* change origin (buttons facing right [libinput +90 degrees]) and + * scaling (5 points per degree) to match wacom driver behavior + */ + rotation = remainderf(rotation + 90.0f, 360.0f); + rotation *= 5.0f; + xwl_tablet_tool->rotation = rotation; +} + +static void +tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, + int32_t position_raw) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + float position = position_raw / 65535.0; + + if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; +} + +static void +tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, + wl_fixed_t degrees, int32_t clicks) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + + if (!xwl_seat->tablet_focus_window) + return; + + xwl_tablet_tool->wheel_clicks = clicks; +} + +static void +tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, + uint32_t serial, uint32_t button, uint32_t state) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; + uint32_t *mask = &xwl_tablet_tool->buttons_now; + int xbtn = 0; + + /* BTN_0 .. BTN_9 */ + if (button >= 0x100 && button <= 0x109) { + xbtn = button - 0x100 + 1; + } + /* BTN_A .. BTN_Z */ + else if (button >= 0x130 && button <= 0x135) { + xbtn = button - 0x130 + 10; + } + /* BTN_BASE .. BTN_BASE6 */ + else if (button >= 0x126 && button <= 0x12b) { + xbtn = button - 0x126 + 16; + } + else { + switch (button) { + case 0x110: /* BTN_LEFT */ + case 0x14a: /* BTN_TOUCH */ + xbtn = 1; + break; + + case 0x112: /* BTN_MIDDLE */ + case 0x14b: /* BTN_STYLUS */ + xbtn = 2; + break; + + case 0x111: /* BTN_RIGHT */ + case 0x14c: /* BTN_STYLUS2 */ + xbtn = 3; + break; + + case 0x113: /* BTN_SIDE */ + case 0x116: /* BTN_BACK */ + case 0x149: /* BTN_STYLUS3 */ + xbtn = 8; + break; + + case 0x114: /* BTN_EXTRA */ + case 0x115: /* BTN_FORWARD */ + xbtn = 9; + break; + } + } + + if (!xbtn) { + ErrorF("unknown tablet button number %d\n", button); + return; + } + + BUG_RETURN(xbtn >= 8 * sizeof(*mask)); + + if (state) + SetBit(mask, xbtn - 1); + else + ClearBit(mask, xbtn - 1); + + xwl_seat->xwl_screen->serial = serial; +} + +static void +tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) +{ + struct xwl_tablet_tool *xwl_tablet_tool = data; + ValuatorMask mask; + uint32_t released, pressed, diff; + int button; + + valuator_mask_zero(&mask); + valuator_mask_set_double(&mask, 0, xwl_tablet_tool->x); + valuator_mask_set_double(&mask, 1, xwl_tablet_tool->y); + valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure); + valuator_mask_set_double(&mask, 3, xwl_tablet_tool->tilt_x); + valuator_mask_set_double(&mask, 4, xwl_tablet_tool->tilt_y); + valuator_mask_set_double(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); + + QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, + POINTER_ABSOLUTE | POINTER_DESKTOP, &mask); + + valuator_mask_zero(&mask); + + diff = xwl_tablet_tool->buttons_prev ^ xwl_tablet_tool->buttons_now; + released = diff & ~xwl_tablet_tool->buttons_now; + pressed = diff & xwl_tablet_tool->buttons_now; + + button = 1; + while (released) { + if (released & 0x1) + QueuePointerEvents(xwl_tablet_tool->xdevice, + ButtonRelease, button, 0, &mask); + button++; + released >>= 1; + } + + button = 1; + while (pressed) { + if (pressed & 0x1) + QueuePointerEvents(xwl_tablet_tool->xdevice, + ButtonPress, button, 0, &mask); + button++; + pressed >>= 1; + } + + xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; + + while (xwl_tablet_tool->wheel_clicks) { + if (xwl_tablet_tool->wheel_clicks < 0) { + button = 4; + xwl_tablet_tool->wheel_clicks++; + } + else { + button = 5; + xwl_tablet_tool->wheel_clicks--; + } + + QueuePointerEvents(xwl_tablet_tool->xdevice, + ButtonPress, button, 0, &mask); + QueuePointerEvents(xwl_tablet_tool->xdevice, + ButtonRelease, button, 0, &mask); + + } +} + +static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { + tablet_tool_receive_type, + tablet_tool_receive_hardware_serial, + tablet_tool_receive_hardware_id_wacom, + tablet_tool_receive_capability, + tablet_tool_receive_done, + tablet_tool_receive_removed, + tablet_tool_proximity_in, + tablet_tool_proximity_out, + tablet_tool_down, + tablet_tool_up, + tablet_tool_motion, + tablet_tool_pressure, + tablet_tool_distance, + tablet_tool_tilt, + tablet_tool_rotation, + tablet_tool_slider, + tablet_tool_wheel, + tablet_tool_button_state, + tablet_tool_frame +}; + +static void +tablet_pad_ring_destroy(struct xwl_tablet_pad_ring *ring) +{ + zwp_tablet_pad_ring_v2_destroy(ring->ring); + xorg_list_del(&ring->link); + free(ring); +} + +static void +tablet_pad_ring_source(void *data, + struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, + uint32_t source) +{ +} + +static void +tablet_pad_ring_angle(void *data, + struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, + wl_fixed_t degrees) +{ + struct xwl_tablet_pad_ring *ring = data; + struct xwl_tablet_pad *pad = ring->group->pad; + double deg = wl_fixed_to_double(degrees); + ValuatorMask mask; + + valuator_mask_zero(&mask); + valuator_mask_set(&mask, 5 + ring->index, deg/360.0 * 71); + QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); +} + +static void +tablet_pad_ring_stop(void *data, + struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) +{ +} + +static void +tablet_pad_ring_frame(void *data, + struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, + uint32_t time) +{ +} + +static const struct zwp_tablet_pad_ring_v2_listener tablet_pad_ring_listener = { + tablet_pad_ring_source, + tablet_pad_ring_angle, + tablet_pad_ring_stop, + tablet_pad_ring_frame, +}; + + +static void +tablet_pad_strip_destroy(struct xwl_tablet_pad_strip *strip) +{ + zwp_tablet_pad_strip_v2_destroy(strip->strip); + xorg_list_del(&strip->link); + free(strip); +} + +static void +tablet_pad_strip_source(void *data, + struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, + uint32_t source) +{ +} + +static void +tablet_pad_strip_position(void *data, + struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, + uint32_t position) +{ + struct xwl_tablet_pad_strip *strip = data; + struct xwl_tablet_pad *pad = strip->group->pad; + ValuatorMask mask; + + valuator_mask_zero(&mask); + valuator_mask_set(&mask, 3 + strip->index, position/65535.0 * 2048); + QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); +} + +static void +tablet_pad_strip_stop(void *data, + struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) +{ +} + +static void +tablet_pad_strip_frame(void *data, + struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, + uint32_t time) +{ +} + +static const struct zwp_tablet_pad_strip_v2_listener tablet_pad_strip_listener = { + tablet_pad_strip_source, + tablet_pad_strip_position, + tablet_pad_strip_stop, + tablet_pad_strip_frame, +}; + +static void +tablet_pad_group_destroy(struct xwl_tablet_pad_group *group) +{ + struct xwl_tablet_pad_ring *r, *tr; + struct xwl_tablet_pad_strip *s, *ts; + + xorg_list_for_each_entry_safe(r, tr, + &group->pad_group_ring_list, + link) + tablet_pad_ring_destroy(r); + + xorg_list_for_each_entry_safe(s, ts, + &group->pad_group_strip_list, + link) + tablet_pad_strip_destroy(s); + + zwp_tablet_pad_group_v2_destroy(group->group); + xorg_list_del(&group->link); + free(group); +} + +static void +tablet_pad_group_buttons(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, + struct wl_array *buttons) +{ + +} + +static void +tablet_pad_group_ring(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, + struct zwp_tablet_pad_ring_v2 *wp_ring) +{ + static unsigned int ring_index = 0; + struct xwl_tablet_pad_group *group = data; + struct xwl_tablet_pad_ring *ring; + + ring = calloc(1, sizeof *ring); + if (ring == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + ring->index = ring_index++; + ring->group = group; + ring->ring = wp_ring; + + xorg_list_add(&ring->link, &group->pad_group_ring_list); + + zwp_tablet_pad_ring_v2_add_listener(wp_ring, &tablet_pad_ring_listener, + ring); +} + +static void +tablet_pad_group_strip(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, + struct zwp_tablet_pad_strip_v2 *wp_strip) +{ + static unsigned int strip_index = 0; + struct xwl_tablet_pad_group *group = data; + struct xwl_tablet_pad_strip *strip; + + strip = calloc(1, sizeof *strip); + if (strip == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + strip->index = strip_index++; + strip->group = group; + strip->strip = wp_strip; + + xorg_list_add(&strip->link, &group->pad_group_strip_list); + + zwp_tablet_pad_strip_v2_add_listener(wp_strip, &tablet_pad_strip_listener, + strip); +} + +static void +tablet_pad_group_modes(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, + uint32_t modes) +{ + +} + +static void +tablet_pad_group_done(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) +{ + +} + +static void +tablet_pad_group_mode_switch(void *data, + struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, + uint32_t time, + uint32_t serial, + uint32_t mode) +{ + +} + +static struct zwp_tablet_pad_group_v2_listener tablet_pad_group_listener = { + tablet_pad_group_buttons, + tablet_pad_group_ring, + tablet_pad_group_strip, + tablet_pad_group_modes, + tablet_pad_group_done, + tablet_pad_group_mode_switch, +}; + +static int +xwl_tablet_pad_proc(DeviceIntPtr device, int what) +{ + struct xwl_tablet_pad *pad = device->public.devicePrivate; + /* Axis layout mirrors that of xf86-input-wacom to have better + compatibility with existing clients */ +#define NAXES 7 + Atom axes_labels[NAXES] = { 0 }; + BYTE map[MAX_BUTTONS + 1]; + int i = 0; + Atom btn_labels[MAX_BUTTONS] = { 0 }; /* btn labels are meaningless */ + int nbuttons; + + switch (what) { + case DEVICE_INIT: + device->public.on = FALSE; + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + /* The others have no good mapping */ + + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, + GetMotionHistorySize(), Absolute)) + return BadValue; + + for (i = 1; i <= MAX_BUTTONS; i++) + map[i] = i; + + /* We need at least 7 buttons to allow scrolling */ + nbuttons = min(max(pad->nbuttons + 4, 7), MAX_BUTTONS); + + if (!InitButtonClassDeviceStruct(device, nbuttons, + btn_labels, map)) + return BadValue; + + /* Valuators */ + InitValuatorAxisStruct(device, 0, axes_labels[0], + 0, 100, 1, 0, 1, Absolute); + InitValuatorAxisStruct(device, 1, axes_labels[1], + 0, 100, 1, 0, 1, Absolute); + /* Pressure - unused, for backwards compat only */ + InitValuatorAxisStruct(device, 2, axes_labels[2], + 0, 2048, 1, 0, 1, Absolute); + /* strip x */ + InitValuatorAxisStruct(device, 3, axes_labels[3], + 0, 2048, 1, 0, 1, Absolute); + /* strip y */ + InitValuatorAxisStruct(device, 4, axes_labels[4], + 0, 2048, 1, 0, 1, Absolute); + /* ring */ + InitValuatorAxisStruct(device, 5, axes_labels[5], + 0, 71, 1, 0, 1, Absolute); + /* ring2 */ + InitValuatorAxisStruct(device, 6, axes_labels[6], + 0, 71, 1, 0, 1, Absolute); + + if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) + return BadValue; + + return Success; + + case DEVICE_ON: + device->public.on = TRUE; + return Success; + + case DEVICE_OFF: + case DEVICE_CLOSE: + device->public.on = FALSE; + return Success; + } + + return BadMatch; +#undef NAXES +} + +static void +tablet_pad_group(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + struct zwp_tablet_pad_group_v2 *pad_group) +{ + struct xwl_tablet_pad *pad = data; + struct xwl_tablet_pad_group *group; + + group = calloc(1, sizeof *group); + if (pad == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + group->pad = pad; + group->group = pad_group; + xorg_list_init(&group->pad_group_ring_list); + xorg_list_init(&group->pad_group_strip_list); + + xorg_list_add(&group->link, &pad->pad_group_list); + + zwp_tablet_pad_group_v2_add_listener(pad_group, + &tablet_pad_group_listener, + group); +} + +static void +tablet_pad_path(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + const char *path) +{ + +} + +static void +tablet_pad_buttons(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + uint32_t buttons) +{ + struct xwl_tablet_pad *pad = data; + + pad->nbuttons = buttons; +} + +static void +tablet_pad_done(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) +{ + struct xwl_tablet_pad *pad = data; + + pad->xdevice = add_device(pad->seat, "xwayland-pad", + xwl_tablet_pad_proc); + pad->xdevice->public.devicePrivate = pad; + ActivateDevice(pad->xdevice, TRUE); + EnableDevice(pad->xdevice, TRUE); +} + +static void +tablet_pad_button(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + uint32_t time, + uint32_t button, + uint32_t state) +{ + struct xwl_tablet_pad *pad = data; + ValuatorMask mask; + + button++; /* wayland index vs X's 1-offset */ + /* skip scroll wheel buttons 4-7 */ + button = button > 3 ? button + 4 : button; + + valuator_mask_zero(&mask); + QueuePointerEvents(pad->xdevice, + state ? ButtonPress : ButtonRelease, button, 0, &mask); +} + +static void +tablet_pad_enter(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + uint32_t serial, + struct zwp_tablet_v2 *tablet, + struct wl_surface *surface) +{ + /* pairs the pad with the tablet but also to set the focus. We + * don't care about the pairing and always use X's focus */ +} + +static void +tablet_pad_leave(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, + uint32_t serial, + struct wl_surface *surface) +{ + /* pairs the pad with the tablet but also to set the focus. We + * don't care about the pairing and always use X's focus */ +} + +static void +tablet_pad_removed(void *data, + struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) +{ + struct xwl_tablet_pad *pad = data; + struct xwl_tablet_pad_group *g, *tg; + + xorg_list_for_each_entry_safe(g, tg, &pad->pad_group_list, link) + tablet_pad_group_destroy(g); + + RemoveDevice(pad->xdevice, TRUE); + xorg_list_del(&pad->link); + zwp_tablet_pad_v2_destroy(pad->pad); + free(pad); +} + +static const struct zwp_tablet_pad_v2_listener tablet_pad_listener = { + tablet_pad_group, + tablet_pad_path, + tablet_pad_buttons, + tablet_pad_done, + tablet_pad_button, + tablet_pad_enter, + tablet_pad_leave, + tablet_pad_removed, +}; + +static void +tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, + struct zwp_tablet_v2 *tablet) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_tablet *xwl_tablet; + + xwl_tablet = calloc(sizeof *xwl_tablet, 1); + if (xwl_tablet == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + xwl_tablet->tablet = tablet; + xwl_tablet->seat = xwl_seat; + + xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); + + zwp_tablet_v2_add_listener(tablet, &tablet_listener, xwl_tablet); +} + +static void +xwl_tablet_tool_update_cursor(struct xwl_cursor *xwl_cursor) +{ + struct xwl_tablet_tool *xwl_tablet_tool = wl_container_of(xwl_cursor, + xwl_tablet_tool, + cursor); + xwl_tablet_tool_set_cursor(xwl_tablet_tool); +} + +static void +tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, + struct zwp_tablet_tool_v2 *tool) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + struct xwl_tablet_tool *xwl_tablet_tool; + + xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); + if (xwl_tablet_tool == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + xwl_tablet_tool->tool = tool; + xwl_tablet_tool->seat = xwl_seat; + xwl_cursor_init(&xwl_tablet_tool->cursor, xwl_screen, + xwl_tablet_tool_update_cursor); + + xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); + + zwp_tablet_tool_v2_add_listener(tool, &tablet_tool_listener, xwl_tablet_tool); +} + +static void +tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat, + struct zwp_tablet_pad_v2 *pad) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_tablet_pad *xwl_tablet_pad; + + xwl_tablet_pad = calloc(sizeof *xwl_tablet_pad, 1); + if (xwl_tablet_pad == NULL) { + ErrorF("%s ENOMEM\n", __func__); + return; + } + + xwl_tablet_pad->pad = pad; + xwl_tablet_pad->seat = xwl_seat; + xorg_list_init(&xwl_tablet_pad->pad_group_list); + + xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); + + zwp_tablet_pad_v2_add_listener(pad, &tablet_pad_listener, + xwl_tablet_pad); +} + +static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { + tablet_seat_handle_add_tablet, + tablet_seat_handle_add_tool, + tablet_seat_handle_add_pad +}; + +static void +init_tablet_manager_seat(struct xwl_screen *xwl_screen, + struct xwl_seat *xwl_seat) +{ + xorg_list_init(&xwl_seat->tablets); + xorg_list_init(&xwl_seat->tablet_tools); + xorg_list_init(&xwl_seat->tablet_pads); + + if (!xwl_screen->tablet_manager) + return; + + xwl_seat->tablet_seat = + zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, + xwl_seat->seat); + + zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); +} + +static void +release_tablet_manager_seat(struct xwl_seat *xwl_seat) +{ + struct xwl_tablet *xwl_tablet, *next_xwl_tablet; + struct xwl_tablet_tool *xwl_tablet_tool, *next_xwl_tablet_tool; + struct xwl_tablet_pad *xwl_tablet_pad, *next_xwl_tablet_pad; + + xorg_list_for_each_entry_safe(xwl_tablet_pad, next_xwl_tablet_pad, + &xwl_seat->tablet_pads, link) { + xorg_list_del(&xwl_tablet_pad->link); + zwp_tablet_pad_v2_destroy(xwl_tablet_pad->pad); + free(xwl_tablet_pad); + } + + xorg_list_for_each_entry_safe(xwl_tablet_tool, next_xwl_tablet_tool, + &xwl_seat->tablet_tools, link) { + xorg_list_del(&xwl_tablet_tool->link); + zwp_tablet_tool_v2_destroy(xwl_tablet_tool->tool); + free(xwl_tablet_tool); + } + + xorg_list_for_each_entry_safe(xwl_tablet, next_xwl_tablet, + &xwl_seat->tablets, link) { + xorg_list_del(&xwl_tablet->link); + zwp_tablet_v2_destroy(xwl_tablet->tablet); + free(xwl_tablet); + } + + if (xwl_seat->tablet_seat) { + zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); + xwl_seat->tablet_seat = NULL; + } +} + +static void +init_tablet_manager(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) +{ + struct xwl_seat *xwl_seat; + + xwl_screen->tablet_manager = wl_registry_bind(xwl_screen->registry, + id, + &zwp_tablet_manager_v2_interface, + min(version,1)); + + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + init_tablet_manager_seat(xwl_screen, xwl_seat); + } +} + +void +xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen) +{ + if (xwl_screen->tablet_manager) { + zwp_tablet_manager_v2_destroy(xwl_screen->tablet_manager); + xwl_screen->tablet_manager = NULL; + } +} + static void init_relative_pointer_manager(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) @@ -1197,6 +2439,27 @@ init_pointer_constraints(struct xwl_screen *xwl_screen, 1); } +static void +init_keyboard_grab(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + struct xwl_seat *xwl_seat; + DeviceIntPtr master; + + xwl_screen->wp_grab = + wl_registry_bind(xwl_screen->registry, id, + &zwp_xwayland_keyboard_grab_manager_v1_interface, + 1); + + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + if (xwl_seat->keyboard) { + master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); + if (master) + setup_keyboard_grab_handler(master); + } + } +} + static void input_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) @@ -1210,6 +2473,10 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id, init_relative_pointer_manager(xwl_screen, id, version); } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { init_pointer_constraints(xwl_screen, id, version); + } else if (strcmp(interface, "zwp_tablet_manager_v2") == 0) { + init_tablet_manager(xwl_screen, id, version); + } else if (strcmp(interface, "zwp_xwayland_keyboard_grab_manager_v1") == 0) { + init_keyboard_grab(xwl_screen, id, version); } } @@ -1457,9 +2724,9 @@ xwl_pointer_warp_emulator_create(struct xwl_seat *xwl_seat) { struct xwl_pointer_warp_emulator *warp_emulator; - warp_emulator = calloc(sizeof *warp_emulator, 1); + warp_emulator = calloc(1, sizeof *warp_emulator); if (!warp_emulator) { - ErrorF("%s: ENOMEM", __func__); + ErrorF("%s: ENOMEM\n", __func__); return NULL; } diff --git a/xserver/hw/xwayland/xwayland-output.c b/xserver/hw/xwayland/xwayland-output.c index 5a0f739f3..cc68f0340 100644 --- a/xserver/hw/xwayland/xwayland-output.c +++ b/xserver/hw/xwayland/xwayland-output.c @@ -38,6 +38,8 @@ RR_Reflect_X | \ RR_Reflect_Y) +static void xwl_output_get_xdg_output(struct xwl_output *xwl_output); + static Rotation wl_transform_to_xrandr(enum wl_output_transform transform) { @@ -93,9 +95,12 @@ output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, physical_width, physical_height); RROutputSetSubpixelOrder(xwl_output->randr_output, wl_subpixel_to_xrandr(subpixel)); - xwl_output->x = x; - xwl_output->y = y; + /* Apply the change from wl_output only if xdg-output is not supported */ + if (!xwl_output->xdg_output) { + xwl_output->x = x; + xwl_output->y = y; + } xwl_output->rotation = wl_transform_to_xrandr(transform); } @@ -108,18 +113,22 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, if (!(flags & WL_OUTPUT_MODE_CURRENT)) return; - xwl_output->width = width; - xwl_output->height = height; + /* Apply the change from wl_output only if xdg-output is not supported */ + if (!xwl_output->xdg_output) { + xwl_output->width = width; + xwl_output->height = height; + } xwl_output->refresh = refresh; } static inline void output_get_new_size(struct xwl_output *xwl_output, + Bool need_rotate, int *height, int *width) { int output_width, output_height; - if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { + if (!need_rotate || (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180))) { output_width = xwl_output->width; output_height = xwl_output->height; } else { @@ -137,8 +146,9 @@ output_get_new_size(struct xwl_output *xwl_output, /* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs * associated with it. * - * It will either calculate the mean mmpd of all the outputs, or default to - * 96 DPI if no reasonable value could be calculated. + * It either calculates the mean mmpd of all the outputs or, if no reasonable + * value could be calculated, defaults to the mmpd of a screen with a DPI value + * of DEFAULT_DPI. */ static double approximate_mmpd(struct xwl_screen *xwl_screen) @@ -199,14 +209,32 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) } static void -output_handle_done(void *data, struct wl_output *wl_output) +apply_output_change(struct xwl_output *xwl_output) { - struct xwl_output *it, *xwl_output = data; struct xwl_screen *xwl_screen = xwl_output->xwl_screen; + struct xwl_output *it; + int mode_width, mode_height; int width = 0, height = 0, has_this_output = 0; RRModePtr randr_mode; + Bool need_rotate; - randr_mode = xwayland_cvt(xwl_output->width, xwl_output->height, + /* Clear out the "done" received flags */ + xwl_output->wl_output_done = FALSE; + xwl_output->xdg_output_done = FALSE; + + /* xdg-output sends output size in compositor space. so already rotated */ + need_rotate = (xwl_output->xdg_output == NULL); + + /* We need to rotate back the logical size for the mode */ + if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { + mode_width = xwl_output->width; + mode_height = xwl_output->height; + } else { + mode_width = xwl_output->height; + mode_height = xwl_output->width; + } + + randr_mode = xwayland_cvt(mode_width, mode_height, xwl_output->refresh / 1000.0, 0, 0); RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); RRCrtcNotify(xwl_output->randr_crtc, randr_mode, @@ -221,14 +249,14 @@ output_handle_done(void *data, struct wl_output *wl_output) if (it == xwl_output) has_this_output = 1; - output_get_new_size(it, &height, &width); + output_get_new_size(it, need_rotate, &height, &width); } if (!has_this_output) { xorg_list_append(&xwl_output->link, &xwl_screen->output_list); /* we did not check this output for new screen size, do it now */ - output_get_new_size(xwl_output, &height, &width); + output_get_new_size(xwl_output, need_rotate, &height, &width); --xwl_screen->expecting_event; } @@ -236,6 +264,19 @@ output_handle_done(void *data, struct wl_output *wl_output) update_screen_size(xwl_output, width, height); } +static void +output_handle_done(void *data, struct wl_output *wl_output) +{ + struct xwl_output *xwl_output = data; + + xwl_output->wl_output_done = TRUE; + /* Apply the changes from wl_output only if both "done" events are received, + * or if xdg-output is not supported. + */ + if (xwl_output->xdg_output_done || !xwl_output->xdg_output) + apply_output_change(xwl_output); +} + static void output_handle_scale(void *data, struct wl_output *wl_output, int32_t factor) { @@ -248,6 +289,42 @@ static const struct wl_output_listener output_listener = { output_handle_scale }; +static void +xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *xdg_output, + int32_t x, int32_t y) +{ + struct xwl_output *xwl_output = data; + + xwl_output->x = x; + xwl_output->y = y; +} + +static void +xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, + int32_t width, int32_t height) +{ + struct xwl_output *xwl_output = data; + + xwl_output->width = width; + xwl_output->height = height; +} + +static void +xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) +{ + struct xwl_output *xwl_output = data; + + xwl_output->xdg_output_done = TRUE; + if (xwl_output->wl_output_done) + apply_output_change(xwl_output); +} + +static const struct zxdg_output_v1_listener xdg_output_listener = { + xdg_output_handle_logical_position, + xdg_output_handle_logical_size, + xdg_output_handle_done, +}; + struct xwl_output * xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) { @@ -255,9 +332,9 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) static int serial; char name[256]; - xwl_output = calloc(sizeof *xwl_output, 1); + xwl_output = calloc(1, sizeof *xwl_output); if (xwl_output == NULL) { - ErrorF("create_output ENOMEM\n"); + ErrorF("%s ENOMEM\n", __func__); return NULL; } @@ -292,6 +369,15 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1); RROutputSetConnection(xwl_output->randr_output, RR_Connected); + /* We want the output to be in the list as soon as created so we can + * use it when binding to the xdg-output protocol... + */ + xorg_list_append(&xwl_output->link, &xwl_screen->output_list); + --xwl_screen->expecting_event; + + if (xwl_screen->xdg_output_manager) + xwl_output_get_xdg_output(xwl_output); + return xwl_output; err: @@ -316,15 +402,17 @@ xwl_output_remove(struct xwl_output *xwl_output) struct xwl_output *it; struct xwl_screen *xwl_screen = xwl_output->xwl_screen; int width = 0, height = 0; + Bool need_rotate = (xwl_output->xdg_output == NULL); - RRCrtcDestroy(xwl_output->randr_crtc); - RROutputDestroy(xwl_output->randr_output); xorg_list_del(&xwl_output->link); xorg_list_for_each_entry(it, &xwl_screen->output_list, link) - output_get_new_size(it, &height, &width); + output_get_new_size(it, need_rotate, &height, &width); update_screen_size(xwl_output, width, height); + RRCrtcDestroy(xwl_output->randr_crtc); + RROutputDestroy(xwl_output->randr_output); + xwl_output_destroy(xwl_output); } @@ -359,3 +447,28 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen) return TRUE; } + +static void +xwl_output_get_xdg_output(struct xwl_output *xwl_output) +{ + struct xwl_screen *xwl_screen = xwl_output->xwl_screen; + + xwl_output->xdg_output = + zxdg_output_manager_v1_get_xdg_output (xwl_screen->xdg_output_manager, + xwl_output->output); + + zxdg_output_v1_add_listener(xwl_output->xdg_output, + &xdg_output_listener, + xwl_output); +} + +void +xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen) +{ + struct xwl_output *it; + + assert(xwl_screen->xdg_output_manager); + + xorg_list_for_each_entry(it, &xwl_screen->output_list, link) + xwl_output_get_xdg_output(it); +} diff --git a/xserver/hw/xwayland/xwayland-present.c b/xserver/hw/xwayland/xwayland-present.c new file mode 100644 index 000000000..2937d9c97 --- /dev/null +++ b/xserver/hw/xwayland/xwayland-present.c @@ -0,0 +1,578 @@ +/* + * Copyright © 2018 Roman Gilg + * + * 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, and that the name of the + * copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#include "xwayland.h" + +#include + +/* + * When not flipping let Present copy with 60fps. + * When flipping wait on frame_callback, otherwise + * the surface is not visible, in this case update + * with long interval. + */ +#define TIMER_LEN_COPY 17 // ~60fps +#define TIMER_LEN_FLIP 1000 // 1fps + +static DevPrivateKeyRec xwl_present_window_private_key; + +static struct xwl_present_window * +xwl_present_window_priv(WindowPtr window) +{ + return dixGetPrivate(&window->devPrivates, + &xwl_present_window_private_key); +} + +static struct xwl_present_window * +xwl_present_window_get_priv(WindowPtr window) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + + if (xwl_present_window == NULL) { + xwl_present_window = calloc (1, sizeof (struct xwl_present_window)); + if (!xwl_present_window) + return NULL; + + xwl_present_window->window = window; + xwl_present_window->msc = 1; + xwl_present_window->ust = GetTimeInMicros(); + + xorg_list_init(&xwl_present_window->event_list); + xorg_list_init(&xwl_present_window->release_queue); + + dixSetPrivate(&window->devPrivates, + &xwl_present_window_private_key, + xwl_present_window); + } + + return xwl_present_window; +} + +static void +xwl_present_free_timer(struct xwl_present_window *xwl_present_window) +{ + TimerFree(xwl_present_window->frame_timer); + xwl_present_window->frame_timer = NULL; +} + +static CARD32 +xwl_present_timer_callback(OsTimerPtr timer, + CARD32 time, + void *arg); + +static inline Bool +xwl_present_has_events(struct xwl_present_window *xwl_present_window) +{ + return !!xwl_present_window->sync_flip || + !xorg_list_is_empty(&xwl_present_window->event_list); +} + +static void +xwl_present_reset_timer(struct xwl_present_window *xwl_present_window) +{ + if (xwl_present_has_events(xwl_present_window)) { + CARD32 timeout; + + if (xwl_present_window->frame_callback) + timeout = TIMER_LEN_FLIP; + else + timeout = TIMER_LEN_COPY; + + xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_timer, + 0, timeout, + &xwl_present_timer_callback, + xwl_present_window); + } else { + xwl_present_free_timer(xwl_present_window); + } +} + +void +xwl_present_cleanup(WindowPtr window) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + struct xwl_present_event *event, *tmp; + + if (!xwl_present_window) + return; + + if (xwl_present_window->frame_callback) { + wl_callback_destroy(xwl_present_window->frame_callback); + xwl_present_window->frame_callback = NULL; + } + + if (xwl_present_window->sync_callback) { + wl_callback_destroy(xwl_present_window->sync_callback); + xwl_present_window->sync_callback = NULL; + } + + /* Clear remaining events */ + xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) { + xorg_list_del(&event->list); + free(event); + } + + /* Clear remaining buffer releases and inform Present about free ressources */ + event = xwl_present_window->sync_flip; + xwl_present_window->sync_flip = NULL; + if (event) { + if (event->buffer_released) { + free(event); + } else { + event->pending = FALSE; + event->abort = TRUE; + } + } + xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->release_queue, list) { + xorg_list_del(&event->list); + event->abort = TRUE; + } + + /* Clear timer */ + xwl_present_free_timer(xwl_present_window); + + /* Remove from privates so we don't try to access it later */ + dixSetPrivate(&window->devPrivates, + &xwl_present_window_private_key, + NULL); + + free(xwl_present_window); +} + +static void +xwl_present_free_event(struct xwl_present_event *event) +{ + xorg_list_del(&event->list); + free(event); +} + +static void +xwl_present_buffer_release(void *data, struct wl_buffer *buffer) +{ + struct xwl_present_event *event = data; + if (!event) + return; + + wl_buffer_set_user_data(buffer, NULL); + event->buffer_released = TRUE; + + if (event->abort) { + if (!event->pending) + xwl_present_free_event(event); + return; + } + + if (!event->pending) { + present_wnmd_event_notify(event->xwl_present_window->window, + event->event_id, + event->xwl_present_window->ust, + event->xwl_present_window->msc); + xwl_present_free_event(event); + } +} + +static const struct wl_buffer_listener xwl_present_release_listener = { + xwl_present_buffer_release +}; + +static void +xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) +{ + uint64_t msc = ++xwl_present_window->msc; + struct xwl_present_event *event, *tmp; + + xwl_present_window->ust = GetTimeInMicros(); + + event = xwl_present_window->sync_flip; + xwl_present_window->sync_flip = NULL; + if (event) { + event->pending = FALSE; + + present_wnmd_event_notify(xwl_present_window->window, event->event_id, + xwl_present_window->ust, msc); + + if (event->buffer_released) { + /* If the buffer was already released, clean up now */ + present_wnmd_event_notify(xwl_present_window->window, event->event_id, + xwl_present_window->ust, msc); + free(event); + } else { + xorg_list_add(&event->list, &xwl_present_window->release_queue); + } + } + + xorg_list_for_each_entry_safe(event, tmp, + &xwl_present_window->event_list, + list) { + if (event->target_msc <= msc) { + present_wnmd_event_notify(xwl_present_window->window, + event->event_id, + xwl_present_window->ust, + msc); + xwl_present_free_event(event); + } + } +} + +CARD32 +xwl_present_timer_callback(OsTimerPtr timer, + CARD32 time, + void *arg) +{ + struct xwl_present_window *xwl_present_window = arg; + + xwl_present_window->frame_timer_firing = TRUE; + + xwl_present_msc_bump(xwl_present_window); + xwl_present_reset_timer(xwl_present_window); + + return 0; +} + +static void +xwl_present_frame_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_present_window *xwl_present_window = data; + + wl_callback_destroy(xwl_present_window->frame_callback); + xwl_present_window->frame_callback = NULL; + + if (xwl_present_window->frame_timer_firing) { + /* If the timer is firing, this frame callback is too late */ + return; + } + + xwl_present_msc_bump(xwl_present_window); + + /* we do not need the timer anymore for this frame, + * reset it for potentially the next one + */ + xwl_present_reset_timer(xwl_present_window); +} + +static const struct wl_callback_listener xwl_present_frame_listener = { + xwl_present_frame_callback +}; + +static void +xwl_present_sync_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_present_event *event = data; + struct xwl_present_window *xwl_present_window = event->xwl_present_window; + + wl_callback_destroy(xwl_present_window->sync_callback); + xwl_present_window->sync_callback = NULL; + + event->pending = FALSE; + + if (event->abort) { + /* Event might have been aborted */ + if (event->buffer_released) + /* Buffer was already released, cleanup now */ + xwl_present_free_event(event); + return; + } + + present_wnmd_event_notify(xwl_present_window->window, + event->event_id, + xwl_present_window->ust, + xwl_present_window->msc); + + if (event->buffer_released) { + /* If the buffer was already released, send the event now again */ + present_wnmd_event_notify(xwl_present_window->window, + event->event_id, + xwl_present_window->ust, + xwl_present_window->msc); + xwl_present_free_event(event); + } +} + +static const struct wl_callback_listener xwl_present_sync_listener = { + xwl_present_sync_callback +}; + +static RRCrtcPtr +xwl_present_get_crtc(WindowPtr present_window) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); + rrScrPrivPtr rr_private; + + if (xwl_present_window == NULL) + return NULL; + + rr_private = rrGetScrPriv(present_window->drawable.pScreen); + + if (rr_private->numCrtcs == 0) + return NULL; + + return rr_private->crtcs[0]; +} + +static int +xwl_present_get_ust_msc(WindowPtr present_window, uint64_t *ust, uint64_t *msc) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); + if (!xwl_present_window) + return BadAlloc; + + *ust = xwl_present_window->ust; + *msc = xwl_present_window->msc; + + return Success; +} + +/* + * Queue an event to report back to the Present extension when the specified + * MSC has past + */ +static int +xwl_present_queue_vblank(WindowPtr present_window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); + struct xwl_present_event *event; + + event = malloc(sizeof *event); + if (!event) + return BadAlloc; + + event->event_id = event_id; + event->xwl_present_window = xwl_present_window; + event->target_msc = msc; + + xorg_list_append(&event->list, &xwl_present_window->event_list); + + if (!xwl_present_window->frame_timer) + xwl_present_reset_timer(xwl_present_window); + + return Success; +} + +/* + * Remove a pending vblank event so that it is not reported + * to the extension + */ +static void +xwl_present_abort_vblank(WindowPtr present_window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(present_window); + struct xwl_present_event *event, *tmp; + + if (!xwl_present_window) + return; + + xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) { + if (event->event_id == event_id) { + xorg_list_del(&event->list); + free(event); + return; + } + } + + xorg_list_for_each_entry(event, &xwl_present_window->release_queue, list) { + if (event->event_id == event_id) { + event->abort = TRUE; + return; + } + } +} + +static void +xwl_present_flush(WindowPtr window) +{ + /* Only called when a Pixmap is copied instead of flipped, + * but in this case we wait on the next block_handler. + */ +} + +static Bool +xwl_present_check_flip2(RRCrtcPtr crtc, + WindowPtr present_window, + PixmapPtr pixmap, + Bool sync_flip, + PresentFlipReason *reason) +{ + struct xwl_window *xwl_window = xwl_window_from_window(present_window); + + if (!xwl_window) + return FALSE; + + /* + * We currently only allow flips of windows, that have the same + * dimensions as their xwl_window parent window. For the case of + * different sizes subsurfaces are presumably the way forward. + */ + if (!RegionEqual(&xwl_window->window->winSize, &present_window->winSize)) + return FALSE; + + return TRUE; +} + +static Bool +xwl_present_flip(WindowPtr present_window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr damage) +{ + struct xwl_window *xwl_window = xwl_window_from_window(present_window); + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(present_window); + BoxPtr damage_box; + Bool buffer_created; + struct wl_buffer *buffer; + struct xwl_present_event *event; + + if (!xwl_window) + return FALSE; + + damage_box = RegionExtents(damage); + + event = malloc(sizeof *event); + if (!event) + return FALSE; + + buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, &buffer_created); + + event->event_id = event_id; + event->xwl_present_window = xwl_present_window; + event->buffer = buffer; + event->target_msc = target_msc; + event->pending = TRUE; + event->abort = FALSE; + event->buffer_released = FALSE; + + if (sync_flip) { + xorg_list_init(&event->list); + xwl_present_window->sync_flip = event; + } else { + xorg_list_add(&event->list, &xwl_present_window->release_queue); + } + + if (buffer_created) + wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL); + wl_buffer_set_user_data(buffer, event); + + /* We can flip directly to the main surface (full screen window without clips) */ + wl_surface_attach(xwl_window->surface, buffer, 0, 0); + + if (!xwl_present_window->frame_callback) { + xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface); + wl_callback_add_listener(xwl_present_window->frame_callback, + &xwl_present_frame_listener, + xwl_present_window); + } + + /* Realign timer */ + xwl_present_window->frame_timer_firing = FALSE; + xwl_present_reset_timer(xwl_present_window); + + wl_surface_damage(xwl_window->surface, 0, 0, + damage_box->x2 - damage_box->x1, + damage_box->y2 - damage_box->y1); + + wl_surface_commit(xwl_window->surface); + + if (!sync_flip) { + xwl_present_window->sync_callback = + wl_display_sync(xwl_window->xwl_screen->display); + wl_callback_add_listener(xwl_present_window->sync_callback, + &xwl_present_sync_listener, + event); + } + + wl_display_flush(xwl_window->xwl_screen->display); + xwl_window->present_flipped = TRUE; + return TRUE; +} + +static void +xwl_present_flips_stop(WindowPtr window) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + + /* Change back to the fast refresh rate */ + xwl_present_reset_timer(xwl_present_window); +} + +void +xwl_present_unrealize_window(WindowPtr window) +{ + struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); + + if (!xwl_present_window || !xwl_present_window->frame_callback) + return; + + /* The pending frame callback may never be called, so drop it and shorten + * the frame timer interval. + */ + wl_callback_destroy(xwl_present_window->frame_callback); + xwl_present_window->frame_callback = NULL; + xwl_present_reset_timer(xwl_present_window); +} + +static present_wnmd_info_rec xwl_present_info = { + .version = PRESENT_SCREEN_INFO_VERSION, + .get_crtc = xwl_present_get_crtc, + + .get_ust_msc = xwl_present_get_ust_msc, + .queue_vblank = xwl_present_queue_vblank, + .abort_vblank = xwl_present_abort_vblank, + + .flush = xwl_present_flush, + + .capabilities = PresentCapabilityAsync, + .check_flip2 = xwl_present_check_flip2, + .flip = xwl_present_flip, + .flips_stop = xwl_present_flips_stop +}; + +Bool +xwl_present_init(ScreenPtr screen) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + + /* + * doesn't work with the EGLStream backend. + */ + if (xwl_screen->egl_backend == &xwl_screen->eglstream_backend) + return FALSE; + + if (!dixRegisterPrivateKey(&xwl_present_window_private_key, PRIVATE_WINDOW, 0)) + return FALSE; + + return present_wnmd_screen_init(screen, &xwl_present_info); +} diff --git a/xserver/hw/xwayland/xwayland-shm.c b/xserver/hw/xwayland/xwayland-shm.c index 452d1f509..29732eaca 100644 --- a/xserver/hw/xwayland/xwayland-shm.c +++ b/xserver/hw/xwayland/xwayland-shm.c @@ -24,7 +24,7 @@ * SOFTWARE. */ -#ifdef HAVE_CONFIG_H +#ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/xserver/hw/xwayland/xwayland.c b/xserver/hw/xwayland/xwayland.c index d0bdf36a4..7e6e0ab25 100644 --- a/xserver/hw/xwayland/xwayland.c +++ b/xserver/hw/xwayland/xwayland.c @@ -27,13 +27,16 @@ #include +#include #include #include #include #include +#include #include #include #include +#include #ifdef XF86VIDMODE #include @@ -71,12 +74,29 @@ ddxBeforeReset(void) } #endif + _X_NORETURN +static void _X_ATTRIBUTE_PRINTF(1, 2) +xwl_give_up(const char *f, ...) +{ + va_list args; + + va_start(args, f); + VErrorFSigSafe(f, args); + va_end(args); + + CloseWellKnownConnections(); + OsCleanup(TRUE); + fflush(stderr); + exit(1); +} + void ddxUseMsg(void) { ErrorF("-rootless run rootless, requires wm support\n"); ErrorF("-wm fd create X client for wm on given fd\n"); ErrorF("-listen fd add give fd as a listen socket\n"); + ErrorF("-eglstream use eglstream backend for nvidia GPUs\n"); } int @@ -95,6 +115,9 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(argv[i], "-shm") == 0) { return 1; } + else if (strcmp(argv[i], "-eglstream") == 0) { + return 1; + } return 0; } @@ -115,6 +138,94 @@ xwl_screen_get(ScreenPtr screen) return dixLookupPrivate(&screen->devPrivates, &xwl_screen_private_key); } +static void +xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, + const char *debug_msg) +{ + xwl_window->allow_commits = allow; + DebugF("xwayland: win %d allow_commits = %d (%s)\n", + xwl_window->window->drawable.id, allow, debug_msg); +} + +static void +xwl_window_set_allow_commits_from_property(struct xwl_window *xwl_window, + PropertyPtr prop) +{ + static Bool warned = FALSE; + CARD32 *propdata; + + if (prop->propertyName != xwl_window->xwl_screen->allow_commits_prop) + FatalError("Xwayland internal error: prop mismatch in %s.\n", __func__); + + if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { + /* Not properly set, so fall back to safe and glitchy */ + xwl_window_set_allow_commits(xwl_window, TRUE, "WM fault"); + + if (!warned) { + LogMessage(X_WARNING, "Window manager is misusing property %s.\n", + NameForAtom(prop->propertyName)); + warned = TRUE; + } + return; + } + + propdata = prop->data; + xwl_window_set_allow_commits(xwl_window, !!propdata[0], "from property"); +} + +static void +xwl_window_property_allow_commits(struct xwl_window *xwl_window, + PropertyStateRec *propstate) +{ + Bool old_allow_commits = xwl_window->allow_commits; + + switch (propstate->state) { + case PropertyNewValue: + xwl_window_set_allow_commits_from_property(xwl_window, propstate->prop); + break; + + case PropertyDelete: + xwl_window_set_allow_commits(xwl_window, TRUE, "property deleted"); + break; + + default: + break; + } + + /* If allow_commits turned from off to on, discard any frame + * callback we might be waiting for so that a new buffer is posted + * immediately through block_handler() if there is damage to post. + */ + if (!old_allow_commits && xwl_window->allow_commits) { + if (xwl_window->frame_callback) { + wl_callback_destroy(xwl_window->frame_callback); + xwl_window->frame_callback = NULL; + } + } +} + +static void +xwl_property_callback(CallbackListPtr *pcbl, void *closure, + void *calldata) +{ + ScreenPtr screen = closure; + PropertyStateRec *rec = calldata; + struct xwl_screen *xwl_screen; + struct xwl_window *xwl_window; + + if (rec->win->drawable.pScreen != screen) + return; + + xwl_window = xwl_window_get(rec->win); + if (!xwl_window) + return; + + xwl_screen = xwl_screen_get(screen); + + if (rec->prop->propertyName == xwl_screen->allow_commits_prop) + xwl_window_property_allow_commits(xwl_window, rec); +} + static Bool xwl_close_screen(ScreenPtr screen) { @@ -122,6 +233,8 @@ xwl_close_screen(ScreenPtr screen) struct xwl_output *xwl_output, *next_xwl_output; struct xwl_seat *xwl_seat, *next_xwl_seat; + DeleteCallback(&PropertyStateCallback, xwl_property_callback, screen); + xorg_list_for_each_entry_safe(xwl_output, next_xwl_output, &xwl_screen->output_list, link) xwl_output_destroy(xwl_output); @@ -130,6 +243,8 @@ xwl_close_screen(ScreenPtr screen) &xwl_screen->seat_list, link) xwl_seat_destroy(xwl_seat); + xwl_screen_release_tablet_manager(xwl_screen); + RemoveNotifyFd(xwl_screen->wayland_fd); wl_display_disconnect(xwl_screen->display); @@ -140,7 +255,7 @@ xwl_close_screen(ScreenPtr screen) return screen->CloseScreen(screen); } -static struct xwl_window * +struct xwl_window * xwl_window_from_window(WindowPtr window) { struct xwl_window *xwl_window; @@ -183,6 +298,9 @@ xwl_cursor_warped_to(DeviceIntPtr device, if (!xwl_seat) xwl_seat = xwl_screen_get_default_seat(xwl_screen); + if (!window) + window = XYToWindow(sprite, x, y); + xwl_window = xwl_window_from_window(window); if (!xwl_window && xwl_seat->focus_window) { focus = xwl_seat->focus_window->window; @@ -252,6 +370,18 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) struct xwl_window *xwl_window = data; struct xwl_screen *xwl_screen = xwl_window->xwl_screen; +#ifdef GLAMOR_HAS_GBM + if (xwl_window->present_flipped) { + /* This damage is from a Present flip, which already committed a new + * buffer for the surface, so we don't need to do anything in response + */ + RegionEmpty(DamageRegion(pDamage)); + xorg_list_del(&xwl_window->link_damage); + xwl_window->present_flipped = FALSE; + return; + } +#endif + xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list); } @@ -297,6 +427,21 @@ xwl_pixmap_get(PixmapPtr pixmap) return dixLookupPrivate(&pixmap->devPrivates, &xwl_pixmap_private_key); } +static void +xwl_window_init_allow_commits(struct xwl_window *xwl_window) +{ + PropertyPtr prop = NULL; + int ret; + + ret = dixLookupProperty(&prop, xwl_window->window, + xwl_window->xwl_screen->allow_commits_prop, + serverClient, DixReadAccess); + if (ret == Success && prop) + xwl_window_set_allow_commits_from_property(xwl_window, prop); + else + xwl_window_set_allow_commits(xwl_window, TRUE, "no property"); +} + static void send_surface_id_event(struct xwl_window *xwl_window) { @@ -357,7 +502,7 @@ xwl_realize_window(WindowPtr window) return ret; } - xwl_window = calloc(sizeof *xwl_window, 1); + xwl_window = calloc(1, sizeof *xwl_window); if (xwl_window == NULL) return FALSE; @@ -408,12 +553,16 @@ xwl_realize_window(WindowPtr window) goto err_surf; } + compRedirectWindow(serverClient, window, CompositeRedirectManual); + DamageRegister(&window->drawable, xwl_window->damage); DamageSetReportAfterOp(xwl_window->damage, TRUE); dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window); xorg_list_init(&xwl_window->link_damage); + xwl_window_init_allow_commits(xwl_window); + return ret; err_surf: @@ -439,6 +588,8 @@ xwl_unrealize_window(WindowPtr window) xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) xwl_seat->focus_window = NULL; + if (xwl_seat->tablet_focus_window && xwl_seat->tablet_focus_window->window == window) + xwl_seat->tablet_focus_window = NULL; if (xwl_seat->last_xwindow == window) xwl_seat->last_xwindow = NullWindow; if (xwl_seat->cursor_confinement_window && @@ -451,11 +602,18 @@ xwl_unrealize_window(WindowPtr window) xwl_seat_clear_touch(xwl_seat, window); } + compUnredirectWindow(serverClient, window, CompositeRedirectManual); + screen->UnrealizeWindow = xwl_screen->UnrealizeWindow; ret = (*screen->UnrealizeWindow) (window); xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; screen->UnrealizeWindow = xwl_unrealize_window; +#ifdef GLAMOR_HAS_GBM + if (xwl_screen->present) + xwl_present_unrealize_window(window); +#endif + xwl_window = xwl_window_get(window); if (!xwl_window) return ret; @@ -494,14 +652,89 @@ static const struct wl_callback_listener frame_listener = { frame_callback }; -static void -xwl_screen_post_damage(struct xwl_screen *xwl_screen) +static Bool +xwl_destroy_window(WindowPtr window) { - struct xwl_window *xwl_window, *next_xwl_window; + ScreenPtr screen = window->drawable.pScreen; + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + Bool ret; + +#ifdef GLAMOR_HAS_GBM + if (xwl_screen->present) + xwl_present_cleanup(window); +#endif + + screen->DestroyWindow = xwl_screen->DestroyWindow; + + if (screen->DestroyWindow) + ret = screen->DestroyWindow (window); + else + ret = TRUE; + + xwl_screen->DestroyWindow = screen->DestroyWindow; + screen->DestroyWindow = xwl_destroy_window; + + return ret; +} + +static void +xwl_window_post_damage(struct xwl_window *xwl_window) +{ + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; RegionPtr region; BoxPtr box; struct wl_buffer *buffer; PixmapPtr pixmap; + int i; + + assert(!xwl_window->frame_callback); + + region = DamageRegion(xwl_window->damage); + pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); + +#ifdef XWL_HAS_GLAMOR + if (xwl_screen->glamor) + buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, + NULL); + else +#endif + buffer = xwl_shm_pixmap_get_wl_buffer(pixmap); + +#ifdef XWL_HAS_GLAMOR + if (xwl_screen->glamor) + xwl_glamor_post_damage(xwl_window, pixmap, region); +#endif + + wl_surface_attach(xwl_window->surface, buffer, 0, 0); + + /* Arbitrary limit to try to avoid flooding the Wayland + * connection. If we flood it too much anyway, this could + * abort in libwayland-client. + */ + if (RegionNumRects(region) > 256) { + box = RegionExtents(region); + wl_surface_damage(xwl_window->surface, box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + } else { + box = RegionRects(region); + for (i = 0; i < RegionNumRects(region); i++, box++) + wl_surface_damage(xwl_window->surface, box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + } + + xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); + wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); + + wl_surface_commit(xwl_window->surface); + DamageEmpty(xwl_window->damage); + + xorg_list_del(&xwl_window->link_damage); +} + +static void +xwl_screen_post_damage(struct xwl_screen *xwl_screen) +{ + struct xwl_window *xwl_window, *next_xwl_window; xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, &xwl_screen->damage_window_list, link_damage) { @@ -510,29 +743,15 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) if (xwl_window->frame_callback) continue; - region = DamageRegion(xwl_window->damage); - pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); + if (!xwl_window->allow_commits) + continue; -#if GLAMOR_HAS_GBM - if (xwl_screen->glamor) - buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap); +#ifdef XWL_HAS_GLAMOR + if (xwl_screen->glamor && !xwl_glamor_allow_commits(xwl_window)) + continue; #endif - if (!xwl_screen->glamor) - buffer = xwl_shm_pixmap_get_wl_buffer(pixmap); - wl_surface_attach(xwl_window->surface, buffer, 0, 0); - - box = RegionExtents(region); - wl_surface_damage(xwl_window->surface, box->x1, box->y1, - box->x2 - box->x1, box->y2 - box->y1); - - xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); - wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); - - wl_surface_commit(xwl_window->surface); - DamageEmpty(xwl_window->damage); - - xorg_list_del(&xwl_window->link_damage); + xwl_window_post_damage(xwl_window); } } @@ -557,10 +776,15 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, if (xwl_output_create(xwl_screen, id)) xwl_screen->expecting_event++; } -#ifdef GLAMOR_HAS_GBM - else if (xwl_screen->glamor && - strcmp(interface, "wl_drm") == 0 && version >= 2) { - xwl_screen_init_glamor(xwl_screen, id, version); + else if (strcmp(interface, "zxdg_output_manager_v1") == 0) { + xwl_screen->xdg_output_manager = + wl_registry_bind(registry, id, &zxdg_output_manager_v1_interface, 1); + xwl_screen_init_xdg_output(xwl_screen); + } +#ifdef XWL_HAS_GLAMOR + else if (xwl_screen->glamor) { + xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, + version); } #endif } @@ -595,13 +819,13 @@ xwl_read_events (struct xwl_screen *xwl_screen) ret = wl_display_read_events(xwl_screen->display); if (ret == -1) - FatalError("failed to read Wayland events: %s\n", strerror(errno)); + xwl_give_up("failed to read Wayland events: %s\n", strerror(errno)); xwl_screen->prepare_read = 0; ret = wl_display_dispatch_pending(xwl_screen->display); if (ret == -1) - FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); + xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); } static int @@ -628,7 +852,7 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) wl_display_prepare_read(xwl_screen->display) == -1) { ret = wl_display_dispatch_pending(xwl_screen->display); if (ret == -1) - FatalError("failed to dispatch Wayland events: %s\n", + xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); } @@ -637,13 +861,13 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) pollout: ready = xwl_display_pollout(xwl_screen, 5); if (ready == -1 && errno != EINTR) - FatalError("error polling on XWayland fd: %s\n", strerror(errno)); + xwl_give_up("error polling on XWayland fd: %s\n", strerror(errno)); if (ready > 0) ret = wl_display_flush(xwl_screen->display); if (ret == -1 && errno != EAGAIN) - FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); + xwl_give_up("failed to write to XWayland fd: %s\n", strerror(errno)); xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); } @@ -721,11 +945,13 @@ wm_selection_callback(CallbackListPtr *p, void *data, void *arg) static Bool xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) { + static const char allow_commits[] = "_XWAYLAND_ALLOW_COMMITS"; struct xwl_screen *xwl_screen; Pixel red_mask, blue_mask, green_mask; int ret, bpc, green_bpc, i; + Bool use_eglstreams = FALSE; - xwl_screen = calloc(sizeof *xwl_screen, 1); + xwl_screen = calloc(1, sizeof *xwl_screen); if (xwl_screen == NULL) return FALSE; xwl_screen->wm_fd = -1; @@ -740,7 +966,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); xwl_screen->screen = pScreen; -#ifdef GLAMOR_HAS_GBM +#ifdef XWL_HAS_GLAMOR xwl_screen->glamor = 1; #endif @@ -756,7 +982,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) else if (strcmp(argv[i], "-listen") == 0) { if (xwl_screen->listen_fd_count == ARRAY_SIZE(xwl_screen->listen_fds)) - FatalError("Too many -listen arguments given, max is %ld\n", + FatalError("Too many -listen arguments given, max is %zu\n", ARRAY_SIZE(xwl_screen->listen_fds)); xwl_screen->listen_fds[xwl_screen->listen_fd_count++] = @@ -766,8 +992,20 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) else if (strcmp(argv[i], "-shm") == 0) { xwl_screen->glamor = 0; } + else if (strcmp(argv[i], "-eglstream") == 0) { +#ifdef XWL_HAS_EGLSTREAM + use_eglstreams = TRUE; +#else + ErrorF("xwayland glamor: this build does not have EGLStream support\n"); +#endif + } } +#ifdef XWL_HAS_GLAMOR + if (xwl_screen->glamor) + xwl_glamor_init_backends(xwl_screen, use_eglstreams); +#endif + /* In rootless mode, we don't have any screen storage, and the only * rendering should be to redirected mode. */ if (xwl_screen->rootless) @@ -850,11 +1088,18 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) if (!xwl_screen_init_cursor(xwl_screen)) return FALSE; -#ifdef GLAMOR_HAS_GBM - if (xwl_screen->glamor && !xwl_glamor_init(xwl_screen)) { - ErrorF("Failed to initialize glamor, falling back to sw\n"); - xwl_screen->glamor = 0; +#ifdef XWL_HAS_GLAMOR + if (xwl_screen->glamor) { + xwl_glamor_select_backend(xwl_screen, use_eglstreams); + + if (xwl_screen->egl_backend == NULL || !xwl_glamor_init(xwl_screen)) { + ErrorF("Failed to initialize glamor, falling back to sw\n"); + xwl_screen->glamor = 0; + } } + + if (xwl_screen->glamor && xwl_screen->rootless) + xwl_screen->present = xwl_present_init(pScreen); #endif if (!xwl_screen->glamor) { @@ -870,12 +1115,27 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->UnrealizeWindow = pScreen->UnrealizeWindow; pScreen->UnrealizeWindow = xwl_unrealize_window; + xwl_screen->DestroyWindow = pScreen->DestroyWindow; + pScreen->DestroyWindow = xwl_destroy_window; + xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; pScreen->CursorWarpedTo = xwl_cursor_warped_to; pScreen->CursorConfinedTo = xwl_cursor_confined_to; + xwl_screen->allow_commits_prop = MakeAtom(allow_commits, + strlen(allow_commits), + TRUE); + if (xwl_screen->allow_commits_prop == BAD_RESOURCE) + return FALSE; + + AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen); + + wl_display_roundtrip(xwl_screen->display); + while (xwl_screen->expecting_event) + wl_display_roundtrip(xwl_screen->display); + return ret; } @@ -890,9 +1150,6 @@ xwl_log_handler(const char *format, va_list args) } static const ExtensionModule xwayland_extensions[] = { -#ifdef GLXEXT - { GlxExtensionInit, "GLX", &noGlxExtension }, -#endif #ifdef XF86VIDMODE { xwlVidModeExtensionInit, XF86VIDMODENAME, &noXFree86VidModeExtension }, #endif @@ -930,5 +1187,7 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) FatalError("Couldn't add screen\n"); } + xorgGlxCreateVendor(); + LocalAccessScopeUser(); } diff --git a/xserver/hw/xwayland/xwayland.h b/xserver/hw/xwayland/xwayland.h index 5e5624be0..463622669 100644 --- a/xserver/hw/xwayland/xwayland.h +++ b/xserver/hw/xwayland/xwayland.h @@ -26,7 +26,7 @@ #ifndef XWAYLAND_H #define XWAYLAND_H -#include +#include #include #include @@ -44,6 +44,73 @@ #include "relative-pointer-unstable-v1-client-protocol.h" #include "pointer-constraints-unstable-v1-client-protocol.h" +#include "tablet-unstable-v2-client-protocol.h" +#include "xwayland-keyboard-grab-unstable-v1-client-protocol.h" +#include "xdg-output-unstable-v1-client-protocol.h" +#include "linux-dmabuf-unstable-v1-client-protocol.h" + +struct xwl_format { + uint32_t format; + int num_modifiers; + uint64_t *modifiers; +}; + +struct xwl_pixmap; +struct xwl_window; +struct xwl_screen; + +struct xwl_egl_backend { + /* Set by the backend if available */ + Bool is_available; + + /* Called once for each interface in the global registry. Backends + * should use this to bind to any wayland interfaces they need. + */ + Bool (*init_wl_registry)(struct xwl_screen *xwl_screen, + struct wl_registry *wl_registry, + uint32_t id, const char *name, + uint32_t version); + + /* Check that the required Wayland interfaces are available. + */ + Bool (*has_wl_interfaces)(struct xwl_screen *xwl_screen); + + /* Called before glamor has been initialized. Backends should setup a + * valid, glamor compatible EGL context in this hook. + */ + Bool (*init_egl)(struct xwl_screen *xwl_screen); + + /* Called after glamor has been initialized, and after all of the + * common Xwayland DDX hooks have been connected. Backends should use + * this to setup any required wraps around X server callbacks like + * CreatePixmap. + */ + Bool (*init_screen)(struct xwl_screen *xwl_screen); + + /* Called by Xwayland to retrieve a pointer to a valid wl_buffer for + * the given window/pixmap combo so that damage to the pixmap may be + * displayed on-screen. Backends should use this to create a new + * wl_buffer for a currently buffer-less pixmap, or simply return the + * pixmap they've prepared beforehand. + */ + struct wl_buffer *(*get_wl_buffer_for_pixmap)(PixmapPtr pixmap, + Bool *created); + + /* Called by Xwayland to perform any pre-wl_surface damage routines + * that are required by the backend. If your backend is poorly + * designed and lacks the ability to render directly to a surface, + * you should implement blitting from the glamor pixmap to the wayland + * pixmap here. Otherwise, this callback is optional. + */ + void (*post_damage)(struct xwl_window *xwl_window, + PixmapPtr pixmap, RegionPtr region); + + /* Called by Xwayland to confirm with the egl backend that the given + * pixmap is completely setup and ready for display on-screen. This + * callback is optional. + */ + Bool (*allow_commits)(struct xwl_window *xwl_window); +}; struct xwl_screen { int width; @@ -58,13 +125,13 @@ struct xwl_screen { int listen_fd_count; int rootless; int glamor; + int present; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; + DestroyWindowProcPtr DestroyWindow; XYToWindowProcPtr XYToWindow; struct xorg_list output_list; @@ -76,11 +143,13 @@ struct xwl_screen { struct wl_registry *registry; struct wl_registry *input_registry; struct wl_compositor *compositor; + struct zwp_tablet_manager_v2 *tablet_manager; struct wl_shm *shm; struct wl_shell *shell; struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; struct zwp_pointer_constraints_v1 *pointer_constraints; - + struct zwp_xwayland_keyboard_grab_manager_v1 *wp_grab; + struct zxdg_output_manager_v1 *xdg_output_manager; uint32_t serial; #define XWL_FORMAT_ARGB8888 (1 << 0) @@ -90,15 +159,18 @@ struct xwl_screen { int prepare_read; int wait_flush; - char *device_name; - int drm_fd; - int fd_render_node; - struct wl_drm *drm; - uint32_t formats; - uint32_t capabilities; + uint32_t num_formats; + struct xwl_format *formats; void *egl_display, *egl_context; - struct gbm_device *gbm; + + struct xwl_egl_backend gbm_backend; + struct xwl_egl_backend eglstream_backend; + /* pointer to the current backend for creating pixmaps on wayland */ + struct xwl_egl_backend *egl_backend; + struct glamor_context *glamor_ctx; + + Atom allow_commits_prop; }; struct xwl_window { @@ -109,8 +181,47 @@ struct xwl_window { DamagePtr damage; struct xorg_list link_damage; struct wl_callback *frame_callback; + Bool allow_commits; +#ifdef GLAMOR_HAS_GBM + Bool present_flipped; +#endif }; +#ifdef GLAMOR_HAS_GBM +struct xwl_present_window { + struct xwl_screen *xwl_screen; + struct xwl_present_event *sync_flip; + WindowPtr window; + struct xorg_list link; + + uint64_t msc; + uint64_t ust; + + OsTimerPtr frame_timer; + Bool frame_timer_firing; + + struct wl_callback *frame_callback; + struct wl_callback *sync_callback; + + struct xorg_list event_list; + struct xorg_list release_queue; +}; + +struct xwl_present_event { + uint64_t event_id; + uint64_t target_msc; + + Bool abort; + Bool pending; + Bool buffer_released; + + struct xwl_present_window *xwl_present_window; + struct wl_buffer *buffer; + + struct xorg_list list; +}; +#endif + #define MODIFIER_META 0x01 struct xwl_touch { @@ -126,26 +237,36 @@ struct xwl_pointer_warp_emulator { struct zwp_locked_pointer_v1 *locked_pointer; }; +struct xwl_cursor { + void (* update_proc) (struct xwl_cursor *); + struct wl_surface *surface; + struct wl_callback *frame_cb; + Bool needs_update; +}; + struct xwl_seat { DeviceIntPtr pointer; DeviceIntPtr relative_pointer; DeviceIntPtr keyboard; DeviceIntPtr touch; + DeviceIntPtr stylus; + DeviceIntPtr eraser; + DeviceIntPtr puck; struct xwl_screen *xwl_screen; struct wl_seat *seat; struct wl_pointer *wl_pointer; struct zwp_relative_pointer_v1 *wp_relative_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; + struct zwp_tablet_seat_v2 *tablet_seat; struct wl_array keys; struct xwl_window *focus_window; + struct xwl_window *tablet_focus_window; uint32_t id; uint32_t pointer_enter_serial; struct xorg_list link; CursorPtr x_cursor; - struct wl_surface *cursor; - struct wl_callback *cursor_frame_cb; - Bool cursor_needs_update; + struct xwl_cursor cursor; WindowPtr last_xwindow; struct xorg_list touches; @@ -154,6 +275,7 @@ struct xwl_seat { char *keymap; struct wl_surface *keyboard_focus; + struct xorg_list axis_discrete_pending; struct xorg_list sync_pending; struct xwl_pointer_warp_emulator *pointer_warp_emulator; @@ -172,27 +294,97 @@ struct xwl_seat { double dx_unaccel; double dy_unaccel; } pending_pointer_event; + + struct xorg_list tablets; + struct xorg_list tablet_tools; + struct xorg_list tablet_pads; + struct zwp_xwayland_keyboard_grab_v1 *keyboard_grab; +}; + +struct xwl_tablet { + struct xorg_list link; + struct zwp_tablet_v2 *tablet; + struct xwl_seat *seat; +}; + +struct xwl_tablet_tool { + struct xorg_list link; + struct zwp_tablet_tool_v2 *tool; + struct xwl_seat *seat; + + DeviceIntPtr xdevice; + uint32_t proximity_in_serial; + double x; + double y; + uint32_t pressure; + double tilt_x; + double tilt_y; + double rotation; + double slider; + + uint32_t buttons_now, + buttons_prev; + + int32_t wheel_clicks; + + struct xwl_cursor cursor; +}; + +struct xwl_tablet_pad_ring { + unsigned int index; + struct xorg_list link; + struct xwl_tablet_pad_group *group; + struct zwp_tablet_pad_ring_v2 *ring; +}; + +struct xwl_tablet_pad_strip { + unsigned int index; + struct xorg_list link; + struct xwl_tablet_pad_group *group; + struct zwp_tablet_pad_strip_v2 *strip; +}; + +struct xwl_tablet_pad_group { + struct xorg_list link; + struct xwl_tablet_pad *pad; + struct zwp_tablet_pad_group_v2 *group; + + struct xorg_list pad_group_ring_list; + struct xorg_list pad_group_strip_list; +}; + +struct xwl_tablet_pad { + struct xorg_list link; + struct zwp_tablet_pad_v2 *pad; + struct xwl_seat *seat; + + DeviceIntPtr xdevice; + + unsigned int nbuttons; + struct xorg_list pad_group_list; }; struct xwl_output { struct xorg_list link; struct wl_output *output; + struct zxdg_output_v1 *xdg_output; uint32_t server_output_id; struct xwl_screen *xwl_screen; RROutputPtr randr_output; RRCrtcPtr randr_crtc; int32_t x, y, width, height, refresh; Rotation rotation; + Bool wl_output_done; + Bool xdg_output_done; }; -struct xwl_pixmap; - void xwl_sync_events (struct xwl_screen *xwl_screen); Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); +void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); void xwl_seat_destroy(struct xwl_seat *xwl_seat); @@ -227,6 +419,7 @@ RRModePtr xwayland_cvt(int HDisplay, int VDisplay, void xwl_pixmap_set_private(PixmapPtr pixmap, struct xwl_pixmap *xwl_pixmap); struct xwl_pixmap *xwl_pixmap_get(PixmapPtr pixmap); +struct xwl_window *xwl_window_from_window(WindowPtr window); Bool xwl_shm_create_screen_resources(ScreenPtr screen); PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height, @@ -234,20 +427,65 @@ PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height, Bool xwl_shm_destroy_pixmap(PixmapPtr pixmap); struct wl_buffer *xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap); - +#ifdef XWL_HAS_GLAMOR +void xwl_glamor_init_backends(struct xwl_screen *xwl_screen, + Bool use_eglstream); +void xwl_glamor_select_backend(struct xwl_screen *xwl_screen, + Bool use_eglstream); Bool xwl_glamor_init(struct xwl_screen *xwl_screen); -Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version); -struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap); +Bool xwl_screen_set_drm_interface(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version); +Bool xwl_screen_set_dmabuf_interface(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version); +struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap, + Bool *created); +void xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen, + struct wl_registry *registry, + uint32_t id, const char *interface, + uint32_t version); +Bool xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen, + struct xwl_egl_backend *xwl_egl_backend); +void xwl_glamor_post_damage(struct xwl_window *xwl_window, + PixmapPtr pixmap, RegionPtr region); +Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window); +void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); + +#ifdef GLAMOR_HAS_GBM +Bool xwl_present_init(ScreenPtr screen); +void xwl_present_cleanup(WindowPtr window); +void xwl_present_unrealize_window(WindowPtr window); +#endif /* GLAMOR_HAS_GBM */ #ifdef XV /* glamor Xv Adaptor */ Bool xwl_glamor_xv_init(ScreenPtr pScreen); -#endif +#endif /* XV */ + +#endif /* XWL_HAS_GLAMOR */ + +void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen); + +void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); #ifdef XF86VIDMODE void xwlVidModeExtensionInit(void); #endif +#ifdef GLAMOR_HAS_GBM +void xwl_glamor_init_gbm(struct xwl_screen *xwl_screen); +#else +static inline void xwl_glamor_init_gbm(struct xwl_screen *xwl_screen) +{ +} +#endif + +#ifdef XWL_HAS_EGLSTREAM +void xwl_glamor_init_eglstream(struct xwl_screen *xwl_screen); +#else +static inline void xwl_glamor_init_eglstream(struct xwl_screen *xwl_screen) +{ +} +#endif + #endif diff --git a/xserver/hw/xwin/InitInput.c b/xserver/hw/xwin/InitInput.c index ae837e8c5..f121d055e 100644 --- a/xserver/hw/xwin/InitInput.c +++ b/xserver/hw/xwin/InitInput.c @@ -37,9 +37,7 @@ * Local function prototypes */ -#ifdef XWIN_CLIPBOARD int winProcEstablishConnection(ClientPtr /* client */ ); -#endif /* * Local global declarations @@ -109,7 +107,6 @@ InitInput(int argc, char *argv[]) winDebug("InitInput\n"); #endif -#ifdef XWIN_CLIPBOARD /* * Wrap some functions at every generation of the server. */ @@ -117,7 +114,6 @@ InitInput(int argc, char *argv[]) winProcEstablishConnectionOrig = InitialVector[2]; InitialVector[2] = winProcEstablishConnection; } -#endif if (AllocDevicePair(serverClient, "Windows", &g_pwinPointer, &g_pwinKeyboard, diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c index edd526647..9560c5684 100644 --- a/xserver/hw/xwin/InitOutput.c +++ b/xserver/hw/xwin/InitOutput.c @@ -35,9 +35,7 @@ from The Open Group. #include "winmsg.h" #include "winconfig.h" #include "winprefs.h" -#ifdef XWIN_CLIPBOARD #include "X11/Xlocale.h" -#endif #ifdef DPMSExtension #include "dpmsproc.h" #endif @@ -113,11 +111,8 @@ static PixmapFormatRec g_PixmapFormats[] = { {32, 32, BITMAP_SCANLINE_PAD} }; -const int NUMFORMATS = sizeof(g_PixmapFormats) / sizeof(g_PixmapFormats[0]); - static const ExtensionModule xwinExtensions[] = { #ifdef GLXEXT - { GlxExtensionInit, "GLX", &noGlxExtension }, #ifdef XWIN_WINDOWS_DRI { WindowsDRIExtensionInit, "Windows-DRI", &noDriExtension }, #endif @@ -152,9 +147,7 @@ ddxBeforeReset(void) { winDebug("ddxBeforeReset - Hello\n"); -#ifdef XWIN_CLIPBOARD winClipboardShutdown(); -#endif } #endif @@ -194,13 +187,11 @@ ddxGiveUp(enum ExitCode error) winDeleteNotifyIcon(winGetScreenPriv(g_ScreenInfo[i].pScreen)); } -#ifdef XWIN_MULTIWINDOW /* Unload libraries for taskbar grouping */ winPropertyStoreDestroy(); /* Notify the worker threads we're exiting */ winDeinitMultiWindowWM(); -#endif #ifdef HAS_DEVWINDOWS /* Close our handle to our message queue */ @@ -718,10 +709,8 @@ winUseMsg(void) ErrorF(EXECUTABLE_NAME " Device Dependent Usage:\n"); ErrorF("\n"); -#ifdef XWIN_CLIPBOARD ErrorF("-[no]clipboard\n" "\tEnable [disable] the clipboard integration. Default is enabled.\n"); -#endif ErrorF("-clipupdates num_boxes\n" "\tUse a clipping region to constrain shadow update blits to\n" @@ -793,9 +782,7 @@ winUseMsg(void) "\tUse the entire virtual screen if multiple\n" "\tmonitors are present.\n"); -#ifdef XWIN_MULTIWINDOW ErrorF("-multiwindow\n" "\tRun the server in multi-window mode.\n"); -#endif #ifdef XWIN_MULTIWINDOWEXTWM ErrorF("-mwextwm\n" @@ -806,14 +793,12 @@ winUseMsg(void) "\tDo not draw a window border, title bar, etc. Windowed\n" "\tmode only.\n"); -#ifdef XWIN_CLIPBOARD ErrorF("-nounicodeclipboard\n" "\tDo not use Unicode clipboard even if on a NT-based platform.\n"); ErrorF("-[no]primary\n" "\tWhen clipboard integration is enabled, map the X11 PRIMARY selection\n" "\tto the Windows clipboard. Default is enabled.\n"); -#endif ErrorF("-refresh rate_in_Hz\n" "\tSpecify an optional refresh rate to use in fullscreen mode\n" @@ -944,10 +929,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - pScreenInfo->numPixmapFormats = NUMFORMATS; + pScreenInfo->numPixmapFormats = ARRAY_SIZE(g_PixmapFormats); /* Describe how we want common pixmap formats padded */ - for (i = 0; i < NUMFORMATS; i++) { + for (i = 0; i < ARRAY_SIZE(g_PixmapFormats); i++) { pScreenInfo->formats[i] = g_PixmapFormats[i]; } @@ -956,10 +941,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Detect supported engines */ winDetectSupportedEngines(); -#ifdef XWIN_MULTIWINDOW /* Load libraries for taskbar grouping */ winPropertyStoreInit(); -#endif /* Store the instance handle */ g_hInstance = GetModuleHandle(NULL); @@ -1029,7 +1012,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) } } -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) + xorgGlxCreateVendor(); /* Generate a cookie used by internal clients for authorization */ if (g_fXdmcpEnabled || g_fAuthEnabled) @@ -1043,7 +1026,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) */ setlocale(LC_ALL, ""); } -#endif #if CYGDEBUG || YES winDebug("InitOutput - Returning.\n"); diff --git a/xserver/hw/xwin/Makefile.am b/xserver/hw/xwin/Makefile.am index 0846230b0..5f67a6eca 100644 --- a/xserver/hw/xwin/Makefile.am +++ b/xserver/hw/xwin/Makefile.am @@ -1,12 +1,9 @@ bin_PROGRAMS = XWin -if XWIN_CLIPBOARD SRCS_CLIPBOARD = \ winclipboardinit.c \ winclipboardwrappers.c -DEFS_CLIPBOARD = -DXWIN_CLIPBOARD CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la -endif if XWIN_GLX_WINDOWS GLX_DIR = @@ -23,7 +20,6 @@ XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/glx/libXwinGLX.la XWIN_GLX_SYS_LIBS = -lopengl32 endif -if XWIN_MULTIWINDOW SRCS_MULTIWINDOW = \ winmultiwindowshape.c \ winmultiwindowwindow.c \ @@ -31,9 +27,7 @@ SRCS_MULTIWINDOW = \ winmultiwindowwndproc.c \ propertystore.h \ winSetAppUserModelID.c -DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 -endif if XWIN_MULTIWINDOWEXTWM SRCS_MULTIWINDOWEXTWM = \ @@ -43,19 +37,11 @@ SRCS_MULTIWINDOWEXTWM = \ winwindowswm.c DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la +MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless endif -if XWIN_RANDR SRCS_RANDR = \ winrandr.c -DEFS_RANDR = -DXWIN_RANDR -endif - -if XWIN_XV -SRCS_XV = \ - winvideo.c -DEFS_XV = -DXWIN_XV -endif SRCS = InitInput.c \ InitOutput.c \ @@ -116,29 +102,18 @@ SRCS = InitInput.c \ $(SRCS_CLIPBOARD) \ $(SRCS_MULTIWINDOW) \ $(SRCS_MULTIWINDOWEXTWM) \ - $(SRCS_NATIVEGDI) \ - $(SRCS_PRIMARYFB) \ - $(SRCS_RANDR) \ - $(SRCS_XV) + $(SRCS_RANDR) - DEFS = $(DEFS_CLIPBOARD) \ +DEFS = \ $(DEFS_GLX_WINDOWS) \ - $(DEFS_MULTIWINDOW) \ - $(DEFS_MULTIWINDOWEXTWM) \ - $(DEFS_NATIVEGDI) \ - $(DEFS_PRIMARYFB) \ - $(DEFS_RANDR) \ - $(DEFS_XV) + $(DEFS_MULTIWINDOWEXTWM) XWin_SOURCES = $(SRCS) -AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless - XWIN_SYS_LIBS += -ldxguid XWIN_LIBS += \ $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la XWin_DEPENDENCIES = \ @@ -179,6 +154,7 @@ AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ $(XWINMODULES_CFLAGS) \ -I$(top_srcdir) \ + $(MULTIWINDOWEXTWM_CFLAGS) \ -Wno-bad-function-cast xwinconfigdir = $(sysconfdir)/X11 diff --git a/xserver/hw/xwin/Makefile.in b/xserver/hw/xwin/Makefile.in index 7ab9bf613..b82abe003 100644 --- a/xserver/hw/xwin/Makefile.in +++ b/xserver/hw/xwin/Makefile.in @@ -74,7 +74,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -98,22 +98,19 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ winmultiwindowwindow.c winmultiwindowwm.c \ winmultiwindowwndproc.c propertystore.h winSetAppUserModelID.c \ winwin32rootless.c winwin32rootlesswindow.c \ - winwin32rootlesswndproc.c winwindowswm.c winrandr.c winvideo.c -@XWIN_CLIPBOARD_TRUE@am__objects_1 = winclipboardinit.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.$(OBJEXT) -@XWIN_MULTIWINDOW_TRUE@am__objects_2 = winmultiwindowshape.$(OBJEXT) \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.$(OBJEXT) \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwm.$(OBJEXT) \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.$(OBJEXT) \ -@XWIN_MULTIWINDOW_TRUE@ winSetAppUserModelID.$(OBJEXT) + winwin32rootlesswndproc.c winwindowswm.c winrandr.c +am__objects_1 = winclipboardinit.$(OBJEXT) \ + winclipboardwrappers.$(OBJEXT) +am__objects_2 = winmultiwindowshape.$(OBJEXT) \ + winmultiwindowwindow.$(OBJEXT) winmultiwindowwm.$(OBJEXT) \ + winmultiwindowwndproc.$(OBJEXT) winSetAppUserModelID.$(OBJEXT) @XWIN_MULTIWINDOWEXTWM_TRUE@am__objects_3 = \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootless.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswndproc.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwindowswm.$(OBJEXT) -@XWIN_RANDR_TRUE@am__objects_4 = winrandr.$(OBJEXT) -@XWIN_XV_TRUE@am__objects_5 = winvideo.$(OBJEXT) -am__objects_6 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ +am__objects_4 = winrandr.$(OBJEXT) +am__objects_5 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ winallpriv.$(OBJEXT) winauth.$(OBJEXT) winblock.$(OBJEXT) \ wincmap.$(OBJEXT) winconfig.$(OBJEXT) wincreatewnd.$(OBJEXT) \ wincursor.$(OBJEXT) windialogs.$(OBJEXT) winengine.$(OBJEXT) \ @@ -128,12 +125,10 @@ am__objects_6 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ wintrayicon.$(OBJEXT) winvalargs.$(OBJEXT) winwakeup.$(OBJEXT) \ winwindow.$(OBJEXT) winwndproc.$(OBJEXT) windisplay.$(OBJEXT) \ XWin.$(OBJEXT) miinitext.$(OBJEXT) $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) -am_XWin_OBJECTS = $(am__objects_6) + $(am__objects_2) $(am__objects_3) $(am__objects_4) +am_XWin_OBJECTS = $(am__objects_5) XWin_OBJECTS = $(am_XWin_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la am__DEPENDENCIES_2 = AM_V_lt = $(am__v_lt_@AM_V@) @@ -313,14 +308,9 @@ DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ -DEFS = $(DEFS_CLIPBOARD) \ +DEFS = \ $(DEFS_GLX_WINDOWS) \ - $(DEFS_MULTIWINDOW) \ - $(DEFS_MULTIWINDOWEXTWM) \ - $(DEFS_NATIVEGDI) \ - $(DEFS_PRIMARYFB) \ - $(DEFS_RANDR) \ - $(DEFS_XV) + $(DEFS_MULTIWINDOWEXTWM) DEPDIR = @DEPDIR@ DGA_CFLAGS = @DGA_CFLAGS@ @@ -462,6 +452,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -480,15 +471,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -496,6 +490,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -563,14 +559,11 @@ XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ XWINMODULES_LIBS = @XWINMODULES_LIBS@ XWIN_LIBS = @XWIN_LIBS@ $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ -ldxguid YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -635,28 +628,26 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@XWIN_CLIPBOARD_TRUE@SRCS_CLIPBOARD = \ -@XWIN_CLIPBOARD_TRUE@ winclipboardinit.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.c +SRCS_CLIPBOARD = \ + winclipboardinit.c \ + winclipboardwrappers.c -@XWIN_CLIPBOARD_TRUE@DEFS_CLIPBOARD = -DXWIN_CLIPBOARD -@XWIN_CLIPBOARD_TRUE@CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la +CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la @XWIN_GLX_WINDOWS_TRUE@GLX_DIR = $(am__append_1) glx @XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = $(am__append_2) \ @XWIN_GLX_WINDOWS_TRUE@ -DXWIN_GLX_WINDOWS @XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LIBS = $(am__append_3) \ @XWIN_GLX_WINDOWS_TRUE@ $(top_builddir)/hw/xwin/glx/libXwinGLX.la @XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_SYS_LIBS = -lopengl32 -@XWIN_MULTIWINDOW_TRUE@SRCS_MULTIWINDOW = \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowshape.c \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.c \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwm.c \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.c \ -@XWIN_MULTIWINDOW_TRUE@ propertystore.h \ -@XWIN_MULTIWINDOW_TRUE@ winSetAppUserModelID.c +SRCS_MULTIWINDOW = \ + winmultiwindowshape.c \ + winmultiwindowwindow.c \ + winmultiwindowwm.c \ + winmultiwindowwndproc.c \ + propertystore.h \ + winSetAppUserModelID.c -@XWIN_MULTIWINDOW_TRUE@DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -@XWIN_MULTIWINDOW_TRUE@MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 +MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 @XWIN_MULTIWINDOWEXTWM_TRUE@SRCS_MULTIWINDOWEXTWM = \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootless.c \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.c \ @@ -665,14 +656,10 @@ top_srcdir = @top_srcdir@ @XWIN_MULTIWINDOWEXTWM_TRUE@DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM @XWIN_MULTIWINDOWEXTWM_TRUE@MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la -@XWIN_RANDR_TRUE@SRCS_RANDR = \ -@XWIN_RANDR_TRUE@ winrandr.c +@XWIN_MULTIWINDOWEXTWM_TRUE@MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless +SRCS_RANDR = \ + winrandr.c -@XWIN_RANDR_TRUE@DEFS_RANDR = -DXWIN_RANDR -@XWIN_XV_TRUE@SRCS_XV = \ -@XWIN_XV_TRUE@ winvideo.c - -@XWIN_XV_TRUE@DEFS_XV = -DXWIN_XV SRCS = InitInput.c \ InitOutput.c \ winallpriv.c \ @@ -732,13 +719,9 @@ SRCS = InitInput.c \ $(SRCS_CLIPBOARD) \ $(SRCS_MULTIWINDOW) \ $(SRCS_MULTIWINDOWEXTWM) \ - $(SRCS_NATIVEGDI) \ - $(SRCS_PRIMARYFB) \ - $(SRCS_RANDR) \ - $(SRCS_XV) + $(SRCS_RANDR) XWin_SOURCES = $(SRCS) -AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWin_DEPENDENCIES = \ $(MULTIWINDOWEXTWM_LIBS) \ $(XWIN_GLX_LIBS) \ @@ -765,6 +748,7 @@ AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ $(XWINMODULES_CFLAGS) \ -I$(top_srcdir) \ + $(MULTIWINDOWEXTWM_CFLAGS) \ -Wno-bad-function-cast xwinconfigdir = $(sysconfdir)/X11 @@ -911,7 +895,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wintaskbar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wintrayicon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winvalargs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winvideo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winwakeup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winwin32rootless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winwin32rootlesswindow.Po@am__quote@ diff --git a/xserver/hw/xwin/dri/Makefile.in b/xserver/hw/xwin/dri/Makefile.in index 22408630a..7d09c18ae 100644 --- a/xserver/hw/xwin/dri/Makefile.in +++ b/xserver/hw/xwin/dri/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -307,6 +307,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -325,15 +326,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -341,6 +345,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -412,8 +418,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xwin/glx/Makefile.am b/xserver/hw/xwin/glx/Makefile.am index 599ec37cc..119fee404 100644 --- a/xserver/hw/xwin/glx/Makefile.am +++ b/xserver/hw/xwin/glx/Makefile.am @@ -20,10 +20,6 @@ endif libnativeGLthunk_la_SOURCES = \ glthunk.c -if XWIN_MULTIWINDOW -DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -endif - if XWIN_MULTIWINDOWEXTWM DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM endif @@ -32,7 +28,9 @@ if XWIN_GLX_WINDOWS DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS endif -DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS) +DEFS = \ + $(DEFS_MULTIWINDOWEXTWM) \ + $(DEFS_GLX_WINDOWS) AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless @@ -53,20 +51,21 @@ else GENGLWRAPPERSOPTS="-nodebug" endif -generated_wgl_wrappers.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py +generated_wgl_wrappers.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/wgl.xml -prefix wgl -wrapper -preresolve $(GENGLWRAPPERSOPTS) -outfile $@ -generated_gl_shim.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py +generated_gl_shim.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -shim $(GENGLWRAPPERSOPTS) -outfile $@ -generated_gl_thunks.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py +generated_gl_thunks.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunk $(GENGLWRAPPERSOPTS) -outfile $@ generated_gl_thunks.def: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunkdefs $(GENGLWRAPPERSOPTS) -outfile $@ -endif -BUILT_SOURCES = generated_gl_shim.c generated_gl_thunks.c generated_gl_thunks.def generated_wgl_wrappers.c +BUILT_SOURCES = generated_gl_shim.ic generated_gl_thunks.ic generated_gl_thunks.def generated_wgl_wrappers.ic CLEANFILES = $(BUILT_SOURCES) +endif + EXTRA_DIST = gen_gl_wrappers.py diff --git a/xserver/hw/xwin/glx/Makefile.in b/xserver/hw/xwin/glx/Makefile.in index 8dfc6b033..3225fd315 100644 --- a/xserver/hw/xwin/glx/Makefile.in +++ b/xserver/hw/xwin/glx/Makefile.in @@ -72,7 +72,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -211,7 +211,10 @@ DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ -DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS) +DEFS = \ + $(DEFS_MULTIWINDOWEXTWM) \ + $(DEFS_GLX_WINDOWS) + DEPDIR = @DEPDIR@ DGA_CFLAGS = @DGA_CFLAGS@ DGA_LIBS = @DGA_LIBS@ @@ -352,6 +355,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -370,15 +374,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -386,6 +393,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -457,8 +466,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -531,7 +538,6 @@ libXwinGLX_la_SOURCES = winpriv.c winpriv.h glwindows.h glshim.c \ libnativeGLthunk_la_SOURCES = \ glthunk.c -@XWIN_MULTIWINDOW_TRUE@DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW @XWIN_MULTIWINDOWEXTWM_TRUE@DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM @XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless @@ -545,8 +551,8 @@ libnativeGLthunk_la_LDFLAGS = -shared -no-undefined -avoid-version -lopengl32 -e EXTRA_libnativeGLthunk_la_DEPENDENCIES = generated_gl_thunks.def @DEBUG_FALSE@@XWIN_GLX_WINDOWS_TRUE@GENGLWRAPPERSOPTS = "-nodebug" @DEBUG_TRUE@@XWIN_GLX_WINDOWS_TRUE@GENGLWRAPPERSOPTS = "" -BUILT_SOURCES = generated_gl_shim.c generated_gl_thunks.c generated_gl_thunks.def generated_wgl_wrappers.c -CLEANFILES = $(BUILT_SOURCES) +@XWIN_GLX_WINDOWS_TRUE@BUILT_SOURCES = generated_gl_shim.ic generated_gl_thunks.ic generated_gl_thunks.def generated_wgl_wrappers.ic +@XWIN_GLX_WINDOWS_TRUE@CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = gen_gl_wrappers.py all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -905,13 +911,13 @@ uninstall-am: uninstall-libLTLIBRARIES tags uninstall uninstall-am uninstall-libLTLIBRARIES -@XWIN_GLX_WINDOWS_TRUE@generated_wgl_wrappers.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py +@XWIN_GLX_WINDOWS_TRUE@generated_wgl_wrappers.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py @XWIN_GLX_WINDOWS_TRUE@ $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/wgl.xml -prefix wgl -wrapper -preresolve $(GENGLWRAPPERSOPTS) -outfile $@ -@XWIN_GLX_WINDOWS_TRUE@generated_gl_shim.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py +@XWIN_GLX_WINDOWS_TRUE@generated_gl_shim.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py @XWIN_GLX_WINDOWS_TRUE@ $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -shim $(GENGLWRAPPERSOPTS) -outfile $@ -@XWIN_GLX_WINDOWS_TRUE@generated_gl_thunks.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py +@XWIN_GLX_WINDOWS_TRUE@generated_gl_thunks.ic: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py @XWIN_GLX_WINDOWS_TRUE@ $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunk $(GENGLWRAPPERSOPTS) -outfile $@ @XWIN_GLX_WINDOWS_TRUE@generated_gl_thunks.def: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py diff --git a/xserver/hw/xwin/glx/glshim.c b/xserver/hw/xwin/glx/glshim.c index df5a932ff..a27040257 100644 --- a/xserver/hw/xwin/glx/glshim.c +++ b/xserver/hw/xwin/glx/glshim.c @@ -106,7 +106,7 @@ int glWinSelectImplementation(int native) #define RESOLVED_PROC proc /* Include generated shims for direct linkage to GL functions which are in the ABI */ -#include "generated_gl_shim.c" +#include "generated_gl_shim.ic" /* Special wrapper for glAddSwapHintRectWIN for copySubBuffers diff --git a/xserver/hw/xwin/glx/glthunk.c b/xserver/hw/xwin/glx/glthunk.c index d49fe487c..3d2702ddb 100644 --- a/xserver/hw/xwin/glx/glthunk.c +++ b/xserver/hw/xwin/glx/glthunk.c @@ -84,4 +84,4 @@ glWinResolveHelper(PROC * cache, const char *symbol) found using wglGetProcAddress(), but also stdcall so still need wrappers... */ -#include "generated_gl_thunks.c" +#include "generated_gl_thunks.ic" diff --git a/xserver/hw/xwin/glx/indirect.c b/xserver/hw/xwin/glx/indirect.c index 239327ed4..1aaa87d8f 100644 --- a/xserver/hw/xwin/glx/indirect.c +++ b/xserver/hw/xwin/glx/indirect.c @@ -88,8 +88,6 @@ #include #include -#define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) - /* Not yet in w32api */ #ifndef PFD_SUPPORT_DIRECTDRAW #define PFD_SUPPORT_DIRECTDRAW 0x00002000 @@ -1403,7 +1401,7 @@ glxWinContextMakeCurrent(__GLXcontext * base) * feature so just error out if it can't work. */ if (!scr->has_WGL_ARB_make_current_read) - return False; + return FALSE; /* If there is a separate read drawable, create a separate read DC, and @@ -1522,11 +1520,6 @@ glxWinCreateContext(__GLXscreen * screen, __GLXWinContext *context; __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext; - static __GLXtextureFromPixmap glxWinTextureFromPixmap = { - glxWinBindTexImage, - glxWinReleaseTexImage - }; - context = calloc(1, sizeof(__GLXWinContext)); if (!context) @@ -1537,7 +1530,8 @@ glxWinCreateContext(__GLXscreen * screen, context->base.makeCurrent = glxWinContextMakeCurrent; context->base.loseCurrent = glxWinContextLoseCurrent; context->base.copy = glxWinContextCopy; - context->base.textureFromPixmap = &glxWinTextureFromPixmap; + context->base.bindTexImage = glxWinBindTexImage; + context->base.releaseTexImage = glxWinReleaseTexImage; context->base.config = modes; context->base.pGlxScreen = screen; @@ -1643,7 +1637,7 @@ fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret, return 0; } -#define SET_ATTR_VALUE(attr, value) { attribList[i++] = attr; attribList[i++] = value; assert(i < NUM_ELEMENTS(attribList)); } +#define SET_ATTR_VALUE(attr, value) { attribList[i++] = attr; attribList[i++] = value; assert(i < ARRAY_SIZE(attribList)); } static int fbConfigToPixelFormatIndex(HDC hdc, __GLXconfig * mode, @@ -1750,7 +1744,7 @@ fbConfigToPixelFormatIndex(HDC hdc, __GLXconfig * mode, static void glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) { - GLXWinConfig *c, *result, *prev = NULL; + GLXWinConfig *first = NULL, *prev = NULL; int numConfigs = 0; int i = 0; int n = 0; @@ -1767,22 +1761,16 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) LogMessage(X_INFO, "%d pixel formats reported by DescribePixelFormat\n", numConfigs); - /* alloc */ - result = malloc(sizeof(GLXWinConfig) * numConfigs); - - if (NULL == result) { - return; - } - - memset(result, 0, sizeof(GLXWinConfig) * numConfigs); n = 0; /* fill in configs */ for (i = 0; i < numConfigs; i++) { int rc; + GLXWinConfig temp; + GLXWinConfig *c = &temp; + GLXWinConfig *work; + memset(c, 0, sizeof(GLXWinConfig)); - c = &(result[i]); - c->base.next = NULL; c->pixelFormatIndex = i + 1; rc = DescribePixelFormat(hdc, i + 1, sizeof(PIXELFORMATDESCRIPTOR), @@ -1945,18 +1933,29 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) n++; + // allocate and save + work = malloc(sizeof(GLXWinConfig)); + if (NULL == work) { + ErrorF("Failed to allocate GLXWinConfig\n"); + break; + } + *work = temp; + + // note the first config + if (!first) + first = work; + // update previous config to point to this config if (prev) - prev->base.next = &(c->base); - - prev = c; + prev->base.next = &(work->base); + prev = work; } GLWIN_DEBUG_MSG ("found %d pixelFormats suitable for conversion to fbConfigs", n); screen->base.numFBConfigs = n; - screen->base.fbconfigs = &(result->base); + screen->base.fbconfigs = first ? &(first->base) : NULL; } // helper function to access an attribute value from an attribute value array by attribute @@ -1986,7 +1985,7 @@ getAttrValue(const int attrs[], int values[], unsigned int num, int attr, static void glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) { - GLXWinConfig *c, *result, *prev = NULL; + GLXWinConfig *first = NULL, *prev = NULL; int i = 0; int n = 0; @@ -2012,17 +2011,9 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) "%d pixel formats reported by wglGetPixelFormatAttribivARB\n", numConfigs); - /* alloc */ - result = malloc(sizeof(GLXWinConfig) * numConfigs); - - if (NULL == result) { - return; - } - - memset(result, 0, sizeof(GLXWinConfig) * numConfigs); n = 0; -#define ADD_ATTR(a) { attrs[num_attrs++] = a; assert(num_attrs < NUM_ELEMENTS(attrs)); } +#define ADD_ATTR(a) { attrs[num_attrs++] = a; assert(num_attrs < ARRAY_SIZE(attrs)); } ADD_ATTR(WGL_DRAW_TO_WINDOW_ARB); ADD_ATTR(WGL_DRAW_TO_BITMAP_ARB); @@ -2080,9 +2071,11 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) /* fill in configs */ for (i = 0; i < numConfigs; i++) { int values[num_attrs]; + GLXWinConfig temp; + GLXWinConfig *c = &temp; + GLXWinConfig *work; + memset(c, 0, sizeof(GLXWinConfig)); - c = &(result[i]); - c->base.next = NULL; c->pixelFormatIndex = i + 1; if (!wglGetPixelFormatAttribivARBWrapper @@ -2335,13 +2328,24 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) n++; + // allocate and save + work = malloc(sizeof(GLXWinConfig)); + if (NULL == work) { + ErrorF("Failed to allocate GLXWinConfig\n"); + break; + } + *work = temp; + + // note the first config + if (!first) + first = work; + // update previous config to point to this config if (prev) - prev->base.next = &(c->base); - - prev = c; + prev->base.next = &(work->base); + prev = work; } screen->base.numFBConfigs = n; - screen->base.fbconfigs = &(result->base); + screen->base.fbconfigs = first ? &(first->base) : NULL; } diff --git a/xserver/hw/xwin/glx/indirect.h b/xserver/hw/xwin/glx/indirect.h index 8a66121ac..bcdef153a 100644 --- a/xserver/hw/xwin/glx/indirect.h +++ b/xserver/hw/xwin/glx/indirect.h @@ -64,9 +64,6 @@ struct __GLXWinDrawable { struct __GLXWinScreen { __GLXscreen base; - /* Supported GLX extensions */ - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - Bool has_WGL_ARB_multisample; Bool has_WGL_ARB_pixel_format; Bool has_WGL_ARB_pbuffer; diff --git a/xserver/hw/xwin/glx/wgl_ext_api.c b/xserver/hw/xwin/glx/wgl_ext_api.c index 78b6e2a02..61cfe8003 100644 --- a/xserver/hw/xwin/glx/wgl_ext_api.c +++ b/xserver/hw/xwin/glx/wgl_ext_api.c @@ -69,4 +69,4 @@ * systems... */ -#include "generated_wgl_wrappers.c" +#include "generated_wgl_wrappers.ic" diff --git a/xserver/hw/xwin/glx/winpriv.c b/xserver/hw/xwin/glx/winpriv.c index c98ad9099..8ed93aba3 100644 --- a/xserver/hw/xwin/glx/winpriv.c +++ b/xserver/hw/xwin/glx/winpriv.c @@ -39,7 +39,6 @@ winGetWindowInfo(WindowPtr pWin) hwnd = pWinScreen->hwndScreen; pScreenInfo = pWinScreen->pScreenInfo; -#ifdef XWIN_MULTIWINDOW /* check for multiwindow mode */ if (pScreenInfo->fMultiWindow) { winWindowPriv(pWin); @@ -64,7 +63,6 @@ winGetWindowInfo(WindowPtr pWin) return hwnd; } -#endif #ifdef XWIN_MULTIWINDOWEXTWM /* check for multiwindow external wm mode */ if (pScreenInfo->fMWExtWM) { @@ -107,10 +105,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen) winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); winScreenInfoPtr pScreenInfo = pWinScreen->pScreenInfo; -#ifdef XWIN_MULTIWINDOW if (pScreenInfo->fMultiWindow) return TRUE; -#endif #ifdef XWIN_MULTIWINDOWEXTWM if (pScreenInfo->fMWExtWM) diff --git a/xserver/hw/xwin/man/Makefile.in b/xserver/hw/xwin/man/Makefile.in index aa16d267d..05c564b66 100644 --- a/xserver/hw/xwin/man/Makefile.in +++ b/xserver/hw/xwin/man/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -263,22 +263,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -322,6 +336,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -340,15 +355,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -356,6 +374,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -427,8 +447,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xwin/man/XWin.man b/xserver/hw/xwin/man/XWin.man index 2222293e0..2081ea1b9 100644 --- a/xserver/hw/xwin/man/XWin.man +++ b/xserver/hw/xwin/man/XWin.man @@ -1,4 +1,4 @@ -.TH XWIN 1 __vendorversion__ +.TH XWIN 1 @vendorversion@ .SH NAME XWin \- X Server for the Cygwin environment on Microsoft Windows @@ -293,7 +293,7 @@ and debugging purposes. .TP 8 .B "\-logfile \fIfilename\fP" Change the server log file from the default of \fI -__logdir__/XWin.n.log\fP, +@logdir@/XWin.n.log\fP, where \fIn\fP is the display number of the XWin server, to \fIfilename\fP. .TP 8 .B "\-logverbose \fIlevel\fP" @@ -319,10 +319,10 @@ These options configure the xkeyboard extension to load a particular keyboard map as the X server starts. The behavior is similar to the \fIsetxkbmap\fP(1) program. -See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of +See the \fIxkeyboard-config\fP(@miscmansuffix@) manual page for a list of keyboard configurations. -The keyboard layout data is located at \fI__datadir__/X11/xkb/\fP. Additional information +The keyboard layout data is located at \fI@datadir@/X11/xkb/\fP. Additional information can be found in the README files there and in the \fIsetxkbmap\fP(1) manual page. For example, in order to load a German layout for a pc105 keyboard, use the options: @@ -352,13 +352,13 @@ visual to operate in TrueColor modes. As it runs \fIXWin\fP writes messages indicating the most relevant events to the console from which it was called and to a log file that by default is located at \fI -__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes. +@logdir@/XWin.0.log\fP. This file is mainly for debugging purposes. .SH PREFERENCES FILE On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if the previous file does not exist, \fI -__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting +@sysconfdir@/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting preferences for the following: .br * To include items into the menu associated with the \fIXWin\fP icon @@ -382,8 +382,8 @@ Need some examples .SH "SEE ALSO" -X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), -setxkbmap(1), xkeyboard-config(__miscmansuffix__). +X(@miscmansuffix@), Xserver(1), xdm(1), xinit(1), XWinrc(@filemansuffix@), +setxkbmap(1), xkeyboard-config(@miscmansuffix@). .SH BUGS diff --git a/xserver/hw/xwin/man/XWinrc.man b/xserver/hw/xwin/man/XWinrc.man index 71d8dad23..0cc2d9d44 100644 --- a/xserver/hw/xwin/man/XWinrc.man +++ b/xserver/hw/xwin/man/XWinrc.man @@ -1,4 +1,4 @@ -.TH XWIN __filemansuffix__ __vendorversion__ +.TH XWIN @filemansuffix@ @vendorversion@ .SH NAME @@ -10,7 +10,7 @@ The X Server for the X Window System on the Cygwin/X environment running on Microsoft Windows, \fIXWin\fP can be optionally configured with the \fIXWinrc\fP file. A system-wide configuration file should be placed in \fI -__sysconfdir__/X11/system.XWinrc\fP, a per-user file +@sysconfdir@/X11/system.XWinrc\fP, a per-user file should be put at \fI$HOME/.XWinrc\fP. The \fIsystem.XWinrc\fP file is read only if no \fI$HOME/.XWinrc\fP exist. .PP diff --git a/xserver/hw/xwin/win.h b/xserver/hw/xwin/win.h index 103c4b9a9..dda2cb548 100644 --- a/xserver/hw/xwin/win.h +++ b/xserver/hw/xwin/win.h @@ -127,11 +127,9 @@ #include #include -#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) #define HANDLE void * #include #undef HANDLE -#endif #ifdef HAVE_MMAP #include @@ -165,7 +163,9 @@ #include "miline.h" #include "shadow.h" #include "fb.h" +#ifdef XWIN_MULTIWINDOWEXTWM #include "rootless.h" +#endif #include "mipict.h" #include "picturestr.h" @@ -394,12 +394,8 @@ typedef struct { Bool fMWExtWM; #endif Bool fRootless; -#ifdef XWIN_MULTIWINDOW Bool fMultiWindow; -#endif -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) Bool fMultiMonitorOverride; -#endif Bool fMultipleMonitors; Bool fLessPointer; winResizeMode iResizeMode; @@ -474,23 +470,17 @@ typedef struct _winPrivScreenRec { Bool fRestacking; #endif -#ifdef XWIN_MULTIWINDOW /* Privates used by multi-window */ pthread_t ptWMProc; pthread_t ptXMsgProc; void *pWMInfo; -#endif -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) /* Privates used by both multi-window and rootless */ Bool fRootWindowShown; -#endif -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Privates used for any module running in a seperate thread */ pthread_mutex_t pmServerStarted; Bool fServerStarted; -#endif /* Engine specific functions */ winAllocateFBProcPtr pwinAllocateFB; @@ -707,11 +697,9 @@ Bool * winauth.c */ -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) Bool winGenerateAuthorization(void); void winSetAuthorization(void); -#endif /* * winblock.c @@ -721,7 +709,6 @@ void winBlockHandler(ScreenPtr pScreen, void *pTimeout); -#ifdef XWIN_CLIPBOARD /* * winclipboardinit.c */ @@ -731,7 +718,6 @@ Bool void winClipboardShutdown(void); -#endif /* * wincmap.c @@ -930,7 +916,6 @@ Bool void winSetShapeRootless(WindowPtr pWindow, int kind); -#ifdef XWIN_MULTIWINDOW /* * winmultiwindowshape.c */ @@ -943,9 +928,7 @@ void void winUpdateRgnMultiWindow(WindowPtr pWindow); -#endif -#ifdef XWIN_MULTIWINDOW /* * winmultiwindowwindow.c */ @@ -996,16 +979,13 @@ XID int winAdjustXWindow(WindowPtr pWin, HWND hwnd); -#endif -#ifdef XWIN_MULTIWINDOW /* * winmultiwindowwndproc.c */ LRESULT CALLBACK winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); -#endif /* * wintrayicon.c diff --git a/xserver/hw/xwin/winauth.c b/xserver/hw/xwin/winauth.c index e86343952..14278390f 100644 --- a/xserver/hw/xwin/winauth.c +++ b/xserver/hw/xwin/winauth.c @@ -68,42 +68,6 @@ static xcb_auth_info_t auth_info; */ #ifndef XCSECURITY -void -GenerateRandomData(int len, char *buf) -{ - int fd; - - fd = open("/dev/urandom", O_RDONLY); - read(fd, buf, len); - close(fd); -} - -static char cookie[16]; /* 128 bits */ - -XID -MitGenerateCookie(unsigned data_length, - const char *data, - XID id, unsigned *data_length_return, char **data_return) -{ - int i = 0; - int status; - - while (data_length--) { - cookie[i++] += *data++; - if (i >= sizeof(cookie)) - i = 0; - } - GenerateRandomData(sizeof(cookie), cookie); - status = MitAddCookie(sizeof(cookie), cookie, id); - if (!status) { - id = -1; - } - else { - *data_return = cookie; - *data_length_return = sizeof(cookie); - } - return id; -} static XID diff --git a/xserver/hw/xwin/winblock.c b/xserver/hw/xwin/winblock.c index 110740d55..c8eb0c9a1 100644 --- a/xserver/hw/xwin/winblock.c +++ b/xserver/hw/xwin/winblock.c @@ -38,9 +38,7 @@ void winBlockHandler(ScreenPtr pScreen, void *pTimeout) { -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) winScreenPriv(pScreen); -#endif #ifndef HAS_DEVWINDOWS struct timeval **tvp = pTimeout; @@ -64,7 +62,6 @@ winBlockHandler(ScreenPtr pScreen, void *pTimeout) } #endif -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Signal threaded modules to begin */ if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) { int iReturn; @@ -84,7 +81,6 @@ winBlockHandler(ScreenPtr pScreen, void *pTimeout) winDebug("winBlockHandler - pthread_mutex_unlock () returned\n"); } } -#endif /* At least one X client has asked to suspend the screensaver, so diff --git a/xserver/hw/xwin/winclipboard/Makefile.in b/xserver/hw/xwin/winclipboard/Makefile.in index fa5a808e6..f00872a55 100644 --- a/xserver/hw/xwin/winclipboard/Makefile.in +++ b/xserver/hw/xwin/winclipboard/Makefile.in @@ -71,7 +71,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -313,22 +313,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -372,6 +386,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -390,15 +405,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -406,6 +424,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -477,8 +497,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/hw/xwin/winclipboard/wndproc.c b/xserver/hw/xwin/winclipboard/wndproc.c index d289f7755..c8d0064bd 100644 --- a/xserver/hw/xwin/winclipboard/wndproc.c +++ b/xserver/hw/xwin/winclipboard/wndproc.c @@ -529,7 +529,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int i,j; for (i = 0 ; data.targetList[i] != 0; i++) { - for (j = 0; j < sizeof(target_priority_table)/sizeof(struct target_priority); j ++) + for (j = 0; j < ARRAY_SIZE(target_priority_table); j ++) { if ((data.targetList[i] == target_priority_table[j].target) && (target_priority_table[j].priority < best_priority)) diff --git a/xserver/hw/xwin/winclipboard/xevents.c b/xserver/hw/xwin/winclipboard/xevents.c index aee6c86a2..d4ea97fc3 100644 --- a/xserver/hw/xwin/winclipboard/xevents.c +++ b/xserver/hw/xwin/winclipboard/xevents.c @@ -267,8 +267,7 @@ winClipboardFlushXEvents(HWND hwnd, 32, PropModeReplace, (unsigned char *) atomTargetArr, - (sizeof(atomTargetArr) - / sizeof(atomTargetArr[0]))); + ARRAY_SIZE(atomTargetArr)); if (iReturn == BadAlloc || iReturn == BadAtom || iReturn == BadMatch diff --git a/xserver/hw/xwin/winclipboard/xwinclip.man b/xserver/hw/xwin/winclipboard/xwinclip.man index a53dc3029..73dfc8a94 100644 --- a/xserver/hw/xwin/winclipboard/xwinclip.man +++ b/xserver/hw/xwin/winclipboard/xwinclip.man @@ -1,4 +1,4 @@ -.TH xwinclip 1 __xorgversion__ +.TH xwinclip 1 @xorgversion@ .SH NAME xwinclip - An X11 and Windows clipboard integration tool diff --git a/xserver/hw/xwin/wincreatewnd.c b/xserver/hw/xwin/wincreatewnd.c index e6e587f9f..daa6daac9 100644 --- a/xserver/hw/xwin/wincreatewnd.c +++ b/xserver/hw/xwin/wincreatewnd.c @@ -156,9 +156,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) && !pScreenInfo->fMWExtWM #endif && !pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW && !pScreenInfo->fMultiWindow -#endif ) { /* Try to handle startup via run.exe. run.exe instructs Windows to * hide all created windows. Detect this case and make sure the @@ -220,9 +218,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) || pScreenInfo->fMWExtWM #endif || pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#endif ) && (pScreenInfo->iResizeMode == resizeWithScrollbars)) { /* We cannot have scrollbars if we do not have a window border */ @@ -243,9 +239,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) && !pScreenInfo->fMWExtWM #endif && !pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW && !pScreenInfo->fMultiWindow -#endif ) { #if CYGDEBUG winDebug @@ -293,9 +287,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) #ifdef XWIN_MULTIWINDOWEXTWM && !pScreenInfo->fMWExtWM #endif -#ifdef XWIN_MULTIWINDOW && !pScreenInfo->fMultiWindow -#endif ) { /* Trim window width to fit work area */ if (iWidth > (rcWorkArea.right - rcWorkArea.left)) @@ -430,13 +422,9 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) #ifdef XWIN_MULTIWINDOWEXTWM || pScreenInfo->fMWExtWM #endif -#ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#endif ) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) pScreenPriv->fRootWindowShown = FALSE; -#endif ShowWindow(*phwnd, SW_HIDE); } else @@ -452,9 +440,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) && !pScreenInfo->fMWExtWM #endif && !pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW && !pScreenInfo->fMultiWindow -#endif ) { if (!BringWindowToTop(*phwnd)) { ErrorF("winCreateBoundingWindowWindowed - BringWindowToTop () " diff --git a/xserver/hw/xwin/wincursor.c b/xserver/hw/xwin/wincursor.c index bddd6b7ed..2afcf9fb5 100644 --- a/xserver/hw/xwin/wincursor.c +++ b/xserver/hw/xwin/wincursor.c @@ -95,9 +95,7 @@ winPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) */ if ((pScreenPriv->hwndScreen == GetForegroundWindow()) || pScreenPriv->pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW || pScreenPriv->pScreenInfo->fMultiWindow -#endif ) { /* Get the client area coordinates */ GetClientRect(pScreenPriv->hwndScreen, &rcClient); diff --git a/xserver/hw/xwin/windialogs.c b/xserver/hw/xwin/windialogs.c index c83b49bab..26b2ebd2c 100644 --- a/xserver/hw/xwin/windialogs.c +++ b/xserver/hw/xwin/windialogs.c @@ -201,18 +201,14 @@ winInitDialog(HWND hwndDlg) 0, 0, SWP_NOSIZE | SWP_FRAMECHANGED); } -#ifdef XWIN_MULTIWINDOW if (g_hIconX) hIcon = g_hIconX; else -#endif hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_XWIN)); -#ifdef XWIN_MULTIWINDOW if (g_hSmallIconX) hIconSmall = g_hSmallIconX; else -#endif hIconSmall = LoadImage(g_hInstance, MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), @@ -236,15 +232,11 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv) for (i = 1; i < currentMaxClients; i++) if (clients[i] != NullClient) liveClients++; -#if defined(XWIN_MULTIWINDOW) /* Count down server internal clients */ if (pScreenPriv->pScreenInfo->fMultiWindow) liveClients -= 2; /* multiwindow window manager & XMsgProc */ -#endif -#if defined(XWIN_CLIPBOARD) if (g_fClipboardStarted) liveClients--; /* clipboard manager */ -#endif /* A user reported that this sometimes drops below zero. just eye-candy. */ if (liveClients < 0) diff --git a/xserver/hw/xwin/winengine.c b/xserver/hw/xwin/winengine.c index d816851e2..2336442c0 100644 --- a/xserver/hw/xwin/winengine.c +++ b/xserver/hw/xwin/winengine.c @@ -150,9 +150,7 @@ winSetEngine(ScreenPtr pScreen) #ifdef XWIN_MULTIWINDOWEXTWM || pScreenInfo->fMWExtWM #endif -#ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#endif ) { winErrorFVerb(2, "winSetEngine - Multi Window or Rootless => ShadowGDI\n"); diff --git a/xserver/hw/xwin/winerror.c b/xserver/hw/xwin/winerror.c index b49f9e59d..784772f5f 100644 --- a/xserver/hw/xwin/winerror.c +++ b/xserver/hw/xwin/winerror.c @@ -39,22 +39,18 @@ void OsVendorVErrorF(const char *pszFormat, va_list va_args) { -#if defined(XWIN_CLIPBOARD) || defined (XWIN_MULTIWINDOW) /* make sure the clipboard and multiwindow threads do not interfere the * main thread */ static pthread_mutex_t s_pmPrinting = PTHREAD_MUTEX_INITIALIZER; /* Lock the printing mutex */ pthread_mutex_lock(&s_pmPrinting); -#endif /* Print the error message to a log file, could be stderr */ LogVWrite(0, pszFormat, va_args); -#if defined(XWIN_CLIPBOARD) || defined (XWIN_MULTIWINDOW) /* Unlock the printing mutex */ pthread_mutex_unlock(&s_pmPrinting); -#endif } #endif diff --git a/xserver/hw/xwin/winglobals.c b/xserver/hw/xwin/winglobals.c index 66019b4b1..d1a0d4587 100644 --- a/xserver/hw/xwin/winglobals.c +++ b/xserver/hw/xwin/winglobals.c @@ -80,7 +80,6 @@ Bool g_fNativeGl = TRUE; Bool g_fHostInTitle = TRUE; pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; -#ifdef XWIN_CLIPBOARD /* * Wrapped DIX functions */ @@ -93,7 +92,6 @@ winDispatchProcPtr winProcEstablishConnectionOrig = NULL; Bool g_fUnicodeClipboard = TRUE; Bool g_fClipboard = TRUE; Bool g_fClipboardStarted = FALSE; -#endif /* * Re-initialize global variables that are invalidated diff --git a/xserver/hw/xwin/winglobals.h b/xserver/hw/xwin/winglobals.h index d143fb819..250085fbc 100644 --- a/xserver/hw/xwin/winglobals.h +++ b/xserver/hw/xwin/winglobals.h @@ -62,8 +62,6 @@ extern HWND g_hDlgAbout; extern Bool g_fSoftwareCursor; extern Bool g_fCursor; -#ifdef XWIN_CLIPBOARD - /* Typedef for DIX wrapper functions */ typedef int (*winDispatchProcPtr) (ClientPtr); @@ -71,20 +69,15 @@ typedef int (*winDispatchProcPtr) (ClientPtr); * Wrapped DIX functions */ extern winDispatchProcPtr winProcEstablishConnectionOrig; -#endif extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; extern Bool g_fClipboardStarted; /* The global X default icons */ -#if defined(XWIN_MULTIWINDOW) extern HICON g_hIconX; extern HICON g_hSmallIconX; -#endif -#ifdef XWIN_MULTIWINDOW extern DWORD g_dwCurrentThreadID; -#endif extern Bool g_fKeyboardHookLL; extern Bool g_fButton[3]; diff --git a/xserver/hw/xwin/winkeyhook.c b/xserver/hw/xwin/winkeyhook.c index 66d68f63d..bb99c3e25 100644 --- a/xserver/hw/xwin/winkeyhook.c +++ b/xserver/hw/xwin/winkeyhook.c @@ -61,7 +61,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam) PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) lParam; HWND hwnd = GetActiveWindow(); -#ifdef XWIN_MULTIWINDOW WindowPtr pWin = NULL; winPrivWinPtr pWinPriv = NULL; winPrivScreenPtr pScreenPriv = NULL; @@ -79,7 +78,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam) if (pScreenInfo->fMultiWindow) fPassAltTab = FALSE; } -#endif /* Pass keystrokes on to our main message loop */ if (iCode == HC_ACTION) { diff --git a/xserver/hw/xwin/winmultiwindowicons.c b/xserver/hw/xwin/winmultiwindowicons.c index 050795123..c43c29887 100644 --- a/xserver/hw/xwin/winmultiwindowicons.c +++ b/xserver/hw/xwin/winmultiwindowicons.c @@ -581,7 +581,6 @@ winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize) * Change the Windows window icon */ -#ifdef XWIN_MULTIWINDOW void winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew) { @@ -671,4 +670,3 @@ winDestroyIcon(HICON hIcon) hIcon != g_hSmallIconX && !winIconIsOverride(hIcon)) DestroyIcon(hIcon); } -#endif diff --git a/xserver/hw/xwin/winmultiwindowwm.c b/xserver/hw/xwin/winmultiwindowwm.c index df7e6d3d5..32bc722e2 100644 --- a/xserver/hw/xwin/winmultiwindowwm.c +++ b/xserver/hw/xwin/winmultiwindowwm.c @@ -184,6 +184,7 @@ static Bool g_shutdown = FALSE; * Translate msg id to text, for debug purposes */ +#if CYGMULTIWINDOW_DEBUG static const char * MessageName(winWMMessagePtr msg) { @@ -233,6 +234,7 @@ MessageName(winWMMessagePtr msg) break; } } +#endif /* @@ -1515,7 +1517,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) }; xcb_ewmh_set_supported(&pWMInfo->ewmh, pProcArg->dwScreen, - sizeof(supported)/sizeof(xcb_atom_t), supported); + ARRAY_SIZE(supported), supported); } else { ErrorF("winInitMultiWindowWM - xcb_ewmh_init_atoms() failed\n"); diff --git a/xserver/hw/xwin/winprefs.c b/xserver/hw/xwin/winprefs.c index 65115ec5b..0ac5b4fea 100644 --- a/xserver/hw/xwin/winprefs.c +++ b/xserver/hw/xwin/winprefs.c @@ -138,7 +138,6 @@ MakeMenu(char *name, HMENU editMenu, int editItem) return hmenu; } -#ifdef XWIN_MULTIWINDOW /* * Callback routine that is executed once per window class. * Removes or creates custom window settings depending on LPARAM @@ -197,7 +196,6 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam) return TRUE; } -#endif /* * Removes any custom icons in classes, custom menus, etc. @@ -210,7 +208,6 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv) { int i; -#ifdef XWIN_MULTIWINDOW winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; /* First, iterate over all windows, deleting their icons and custom menus. @@ -221,7 +218,6 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv) */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); -#endif /* Now, free/clear all info from our prefs structure */ for (i = 0; i < pref.menuItems; i++) @@ -264,14 +260,12 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv) g_hIconX = NULL; g_hSmallIconX = NULL; -#ifdef XWIN_MULTIWINDOW if (pScreenInfo->fMultiWindow) { winInitGlobalIcons(); /* Rebuild the icons and menus */ EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); } -#endif /* Whew, done */ } @@ -385,14 +379,12 @@ HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv) SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); -#if XWIN_MULTIWINDOW { winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; if (pScreenInfo->fMultiWindow) /* Reflect the changed Z order */ winReorderWindowsMultiWindow(); } -#endif return TRUE; case CMD_RELOAD: @@ -409,7 +401,6 @@ HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv) return FALSE; } -#ifdef XWIN_MULTIWINDOW /* * Add the default or a custom menu depending on the class match */ @@ -459,7 +450,6 @@ SetupSysMenu(HWND hwnd) MakeMenu(pref.defaultSysMenuName, sys, -1); } } -#endif /* * Possibly add a menu to the toolbar icon diff --git a/xserver/hw/xwin/winprocarg.c b/xserver/hw/xwin/winprocarg.c index 35ea8f23a..803e78f93 100644 --- a/xserver/hw/xwin/winprocarg.c +++ b/xserver/hw/xwin/winprocarg.c @@ -41,9 +41,7 @@ from The Open Group. #include "winmsg.h" #include "winmonitors.h" -#ifdef XWIN_CLIPBOARD #include "winclipboard/winclipboard.h" -#endif /* * Function prototypes @@ -132,12 +130,8 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fMWExtWM = FALSE; #endif defaultScreenInfo.fRootless = FALSE; -#ifdef XWIN_MULTIWINDOW defaultScreenInfo.fMultiWindow = FALSE; -#endif -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) defaultScreenInfo.fMultiMonitorOverride = FALSE; -#endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; defaultScreenInfo.iResizeMode = resizeDefault; @@ -526,10 +520,8 @@ ddxProcessArgument(int argc, char *argv[], int i) * Look for the '-fullscreen' argument */ if (IS_OPTION("-fullscreen")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!screenInfoPtr->fMultiMonitorOverride) screenInfoPtr->fMultipleMonitors = FALSE; -#endif screenInfoPtr->fFullScreen = TRUE; /* Indicate that we have processed this argument */ @@ -550,10 +542,8 @@ ddxProcessArgument(int argc, char *argv[], int i) * Look for the '-nodecoration' argument */ if (IS_OPTION("-nodecoration")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!screenInfoPtr->fMultiMonitorOverride) screenInfoPtr->fMultipleMonitors = FALSE; -#endif screenInfoPtr->fDecoration = FALSE; /* Indicate that we have processed this argument */ @@ -587,40 +577,32 @@ ddxProcessArgument(int argc, char *argv[], int i) * Look for the '-rootless' argument */ if (IS_OPTION("-rootless")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!screenInfoPtr->fMultiMonitorOverride) screenInfoPtr->fMultipleMonitors = FALSE; -#endif screenInfoPtr->fRootless = TRUE; /* Indicate that we have processed this argument */ return 1; } -#ifdef XWIN_MULTIWINDOW /* * Look for the '-multiwindow' argument */ if (IS_OPTION("-multiwindow")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!screenInfoPtr->fMultiMonitorOverride) screenInfoPtr->fMultipleMonitors = TRUE; -#endif screenInfoPtr->fMultiWindow = TRUE; /* Indicate that we have processed this argument */ return 1; } -#endif /* * Look for the '-multiplemonitors' argument */ if (IS_OPTION("-multiplemonitors") || IS_OPTION("-multimonitors")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) screenInfoPtr->fMultiMonitorOverride = TRUE; -#endif screenInfoPtr->fMultipleMonitors = TRUE; /* Indicate that we have processed this argument */ @@ -632,9 +614,7 @@ ddxProcessArgument(int argc, char *argv[], int i) */ if (IS_OPTION("-nomultiplemonitors") || IS_OPTION("-nomultimonitors")) { -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) screenInfoPtr->fMultiMonitorOverride = TRUE; -#endif screenInfoPtr->fMultipleMonitors = FALSE; /* Indicate that we have processed this argument */ @@ -690,7 +670,6 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } -#ifdef XWIN_CLIPBOARD /* * Look for the '-clipboard' argument */ @@ -731,7 +710,6 @@ ddxProcessArgument(int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } -#endif /* * Look for the '-ignoreinput' argument @@ -1022,7 +1000,6 @@ ddxProcessArgument(int argc, char *argv[], int i) return 2; } -#ifdef XWIN_CLIPBOARD /* * Look for the '-nounicodeclipboard' argument */ @@ -1031,7 +1008,6 @@ ddxProcessArgument(int argc, char *argv[], int i) /* Indicate that we have processed the argument */ return 1; } -#endif if (IS_OPTION("-xkbrules")) { CHECK_ARGS(1); diff --git a/xserver/hw/xwin/winrandr.c b/xserver/hw/xwin/winrandr.c index 1560199c1..3e084221e 100644 --- a/xserver/hw/xwin/winrandr.c +++ b/xserver/hw/xwin/winrandr.c @@ -174,9 +174,7 @@ winRandRScreenSetSize(ScreenPtr pScreen, || pScreenInfo->fMWExtWM #endif || pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#endif ) { ErrorF ("winRandRScreenSetSize - resize not supported in rootless modes\n"); diff --git a/xserver/hw/xwin/winscrinit.c b/xserver/hw/xwin/winscrinit.c index 6cbf08da4..a44e21fbd 100644 --- a/xserver/hw/xwin/winscrinit.c +++ b/xserver/hw/xwin/winscrinit.c @@ -264,9 +264,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; VisualPtr pVisual = NULL; -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) int iReturn; -#endif /* Create framebuffer */ if (!(*pScreenPriv->pwinInitScreen) (pScreen)) { @@ -455,7 +453,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) #undef WRAP } -#ifdef XWIN_MULTIWINDOW /* Handle multi window mode */ else if (pScreenInfo->fMultiWindow) { /* Define the WRAP macro temporarily for local use */ @@ -498,13 +495,11 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) /* Undefine the WRAP macro, as it is not needed elsewhere */ #undef WRAP } -#endif /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */ pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = pScreenPriv->pwinCloseScreen; -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Create a mutex for modules in separate threads to wait for */ iReturn = pthread_mutex_init(&pScreenPriv->pmServerStarted, NULL); if (iReturn != 0) { @@ -523,18 +518,12 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) /* Set the ServerStarted flag to false */ pScreenPriv->fServerStarted = FALSE; -#endif #ifdef XWIN_MULTIWINDOWEXTWM pScreenPriv->fRestacking = FALSE; #endif -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) - if (FALSE -#ifdef XWIN_MULTIWINDOW - || pScreenInfo->fMultiWindow -#endif - ) { + if (pScreenInfo->fMultiWindow) { #if CYGDEBUG || YES winDebug("winFinishScreenInitFB - Calling winInitWM.\n"); #endif @@ -550,7 +539,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) return FALSE; } } -#endif /* Tell the server that we are enabled */ pScreenPriv->fEnabled = TRUE; diff --git a/xserver/hw/xwin/winshadddnl.c b/xserver/hw/xwin/winshadddnl.c index 0ec5246fc..4e1fbd15c 100644 --- a/xserver/hw/xwin/winshadddnl.c +++ b/xserver/hw/xwin/winshadddnl.c @@ -520,7 +520,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); HRESULT ddrval = DD_OK; RECT rcDest, rcSrc; POINT ptOrigin; @@ -658,7 +658,7 @@ winCloseScreenShadowDDNL(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; + Bool fReturn = TRUE; #if CYGDEBUG winDebug("winCloseScreenShadowDDNL - Freeing screen resources\n"); @@ -697,10 +697,8 @@ winCloseScreenShadowDDNL(ScreenPtr pScreen) pScreenPriv->hwndScreen = NULL; } -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Destroy the thread startup mutex */ pthread_mutex_destroy(&pScreenPriv->pmServerStarted); -#endif /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; diff --git a/xserver/hw/xwin/winshadgdi.c b/xserver/hw/xwin/winshadgdi.c index 22836c518..6d7ebce07 100644 --- a/xserver/hw/xwin/winshadgdi.c +++ b/xserver/hw/xwin/winshadgdi.c @@ -37,11 +37,9 @@ * Local function prototypes */ -#ifdef XWIN_MULTIWINDOW static wBOOL CALLBACK winRedrawAllProcShadowGDI(HWND hwnd, LPARAM lParam); static wBOOL CALLBACK winRedrawDamagedWindowShadowGDI(HWND hwnd, LPARAM lParam); -#endif static Bool winAllocateFBShadowGDI(ScreenPtr pScreen); @@ -263,7 +261,6 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen) return fReturn; } -#ifdef XWIN_MULTIWINDOW /* * Redraw all ---? */ @@ -309,7 +306,6 @@ winRedrawDamagedWindowShadowGDI(HWND hwnd, LPARAM lParam) } return TRUE; } -#endif /* * Allocate a DIB for the shadow framebuffer GDI server @@ -403,11 +399,9 @@ winAllocateFBShadowGDI(ScreenPtr pScreen) (int) pScreenInfo->dwStride); #endif -#ifdef XWIN_MULTIWINDOW /* Redraw all windows */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif return fReturn; } @@ -434,7 +428,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); int x, y, w, h; @@ -525,13 +519,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) SelectClipRgn(pScreenPriv->hdcScreen, NULL); } -#ifdef XWIN_MULTIWINDOW /* Redraw all multiwindow windows */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, winRedrawDamagedWindowShadowGDI, (LPARAM) pBoxExtents); -#endif } static Bool @@ -576,7 +568,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; + Bool fReturn = TRUE; #if CYGDEBUG winDebug("winCloseScreenShadowGDI - Freeing screen resources\n"); @@ -618,10 +610,8 @@ winCloseScreenShadowGDI(ScreenPtr pScreen) pScreenPriv->hwndScreen = NULL; } -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Destroy the thread startup mutex */ pthread_mutex_destroy(&pScreenPriv->pmServerStarted); -#endif /* Invalidate our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; @@ -778,12 +768,10 @@ winBltExposedRegionsShadowGDI(ScreenPtr pScreen) /* EndPaint frees the DC */ EndPaint(pScreenPriv->hwndScreen, &ps); -#ifdef XWIN_MULTIWINDOW /* Redraw all windows */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, (LPARAM) pScreenPriv->hwndScreen); -#endif return TRUE; } @@ -847,11 +835,9 @@ winRedrawScreenShadowGDI(ScreenPtr pScreen) pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenPriv->hdcShadow, 0, 0, SRCCOPY); -#ifdef XWIN_MULTIWINDOW /* Redraw all windows */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif return TRUE; } @@ -946,11 +932,9 @@ winInstallColormapShadowGDI(ColormapPtr pColormap) /* Save a pointer to the newly installed colormap */ pScreenPriv->pcmapInstalled = pColormap; -#ifdef XWIN_MULTIWINDOW /* Redraw all windows */ if (pScreenInfo->fMultiWindow) EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif return TRUE; } diff --git a/xserver/hw/xwin/wintrayicon.c b/xserver/hw/xwin/wintrayicon.c index 6acc0d712..a22ca24f2 100644 --- a/xserver/hw/xwin/wintrayicon.c +++ b/xserver/hw/xwin/wintrayicon.c @@ -36,9 +36,7 @@ #include "win.h" #include #include "winprefs.h" -#ifdef XWIN_CLIPBOARD #include "winclipboard/winclipboard.h" -#endif /* * Initialize the tray icon @@ -111,9 +109,7 @@ LRESULT winHandleIconMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, winPrivScreenPtr pScreenPriv) { -#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_MULTIWINDOW) winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; -#endif switch (lParam) { case WM_LBUTTONUP: @@ -148,7 +144,6 @@ winHandleIconMessage(HWND hwnd, UINT message, /* Get actual tray icon menu */ hmenuTray = GetSubMenu(hmenuPopup, 0); -#ifdef XWIN_MULTIWINDOW /* Check for MultiWindow mode */ if (pScreenInfo->fMultiWindow) { MENUITEMINFO mii = { 0 }; @@ -168,13 +163,11 @@ winHandleIconMessage(HWND hwnd, UINT message, SetMenuItemInfo(hmenuTray, ID_APP_HIDE_ROOT, FALSE, &mii); } else -#endif { /* Remove Hide Root Window button */ RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND); } -#ifdef XWIN_CLIPBOARD if (g_fClipboard) { /* Set menu state to indicate if 'Monitor Primary' is enabled or not */ MENUITEMINFO mii = { 0 }; @@ -187,7 +180,6 @@ winHandleIconMessage(HWND hwnd, UINT message, /* Remove 'Monitor Primary' menu item */ RemoveMenu(hmenuTray, ID_APP_MONITOR_PRIMARY, MF_BYCOMMAND); } -#endif SetupRootMenu(hmenuTray); diff --git a/xserver/hw/xwin/winvalargs.c b/xserver/hw/xwin/winvalargs.c index f93872419..50587d4b3 100644 --- a/xserver/hw/xwin/winvalargs.c +++ b/xserver/hw/xwin/winvalargs.c @@ -86,10 +86,8 @@ winValidateArgs(void) int iCount = 0; /* Count conflicting options */ -#ifdef XWIN_MULTIWINDOW if (g_ScreenInfo[i].fMultiWindow) ++iCount; -#endif #ifdef XWIN_MULTIWINDOWEXTWM if (g_ScreenInfo[i].fMWExtWM) ++iCount; @@ -112,10 +110,9 @@ winValidateArgs(void) /* Check for -multiwindow or -mwextwm and Xdmcp */ /* allow xdmcp if screen 0 is normal. */ if (g_fXdmcpEnabled && !fHasNormalScreen0 && (FALSE -#ifdef XWIN_MULTIWINDOW || g_ScreenInfo[i]. fMultiWindow -#endif + #ifdef XWIN_MULTIWINDOWEXTWM || g_ScreenInfo[i]. fMWExtWM @@ -129,9 +126,7 @@ winValidateArgs(void) /* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */ if (g_ScreenInfo[i].fFullScreen && (FALSE -#ifdef XWIN_MULTIWINDOW || g_ScreenInfo[i].fMultiWindow -#endif #ifdef XWIN_MULTIWINDOWEXTWM || g_ScreenInfo[i].fMWExtWM #endif @@ -144,9 +139,7 @@ winValidateArgs(void) /* Check for -multiwindow, -mwextwm, or -rootless and -nodecoration */ if (!g_ScreenInfo[i].fDecoration && (FALSE -#ifdef XWIN_MULTIWINDOW || g_ScreenInfo[i].fMultiWindow -#endif #ifdef XWIN_MULTIWINDOWEXTWM || g_ScreenInfo[i].fMWExtWM #endif diff --git a/xserver/hw/xwin/winwindow.h b/xserver/hw/xwin/winwindow.h index 65e4bea0c..959ce152a 100644 --- a/xserver/hw/xwin/winwindow.h +++ b/xserver/hw/xwin/winwindow.h @@ -84,7 +84,6 @@ typedef struct { #endif } winPrivWinRec, *winPrivWinPtr; -#ifdef XWIN_MULTIWINDOW typedef struct _winWMMessageRec { DWORD dwID; DWORD msg; @@ -162,5 +161,4 @@ void void winShowWindowOnTaskbar(HWND hWnd, Bool show); -#endif /* XWIN_MULTIWINDOW */ #endif diff --git a/xserver/hw/xwin/winwndproc.c b/xserver/hw/xwin/winwndproc.c index 7236a9520..02186b13e 100644 --- a/xserver/hw/xwin/winwndproc.c +++ b/xserver/hw/xwin/winwndproc.c @@ -42,9 +42,7 @@ #include "winmsg.h" #include "winmonitors.h" #include "inputstr.h" -#ifdef XWIN_CLIPBOARD #include "winclipboard/winclipboard.h" -#endif /* * Global variables @@ -231,13 +229,11 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) || s_pScreenInfo-> fRootless -#ifdef XWIN_MULTIWINDOW || s_pScreenInfo-> fMultiWindow -#endif )) { - DWORD dwWidth, dwHeight; + DWORD dwWidth = 0, dwHeight = 0; if (s_pScreenInfo->fMultipleMonitors) { /* resize to new virtual desktop size */ @@ -273,8 +269,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) */ /* Set screen size to match new size, if it is different to current */ - if ((s_pScreenInfo->dwWidth != dwWidth) || - (s_pScreenInfo->dwHeight != dwHeight)) { + if (((dwWidth != 0) && (dwHeight != 0)) && + ((s_pScreenInfo->dwWidth != dwWidth) || + (s_pScreenInfo->dwHeight != dwHeight))) { winDoRandRScreenSetSize(s_pScreen, dwWidth, dwHeight, @@ -322,9 +319,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) || s_pScreenInfo->fMWExtWM #endif || s_pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW || s_pScreenInfo->fMultiWindow -#endif || s_pScreenInfo->fFullScreen) break; @@ -625,9 +620,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) || s_pScreenInfo->fMWExtWM #endif || s_pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW || s_pScreenInfo->fMultiWindow -#endif ) break; @@ -1167,10 +1160,8 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ShowCursor(TRUE); } -#ifdef XWIN_CLIPBOARD /* Make sure the clipboard chain is ok. */ winFixClipboardChain(); -#endif /* Call engine specific screen activation/deactivation function */ (*s_pScreenPriv->pwinActivateApp) (s_pScreen); @@ -1192,7 +1183,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winDisplayExitDialog(s_pScreenPriv); return 0; -#ifdef XWIN_MULTIWINDOW case ID_APP_HIDE_ROOT: if (s_pScreenPriv->fRootWindowShown) ShowWindow(s_pScreenPriv->hwndScreen, SW_HIDE); @@ -1200,13 +1190,10 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ShowWindow(s_pScreenPriv->hwndScreen, SW_SHOW); s_pScreenPriv->fRootWindowShown = !s_pScreenPriv->fRootWindowShown; return 0; -#endif -#ifdef XWIN_CLIPBOARD case ID_APP_MONITOR_PRIMARY: fPrimarySelection = !fPrimarySelection; return 0; -#endif case ID_APP_ABOUT: /* Display the About box */ @@ -1222,10 +1209,8 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_GIVEUP: /* Tell X that we are giving up */ -#ifdef XWIN_MULTIWINDOW if (s_pScreenInfo->fMultiWindow) winDeinitMultiWindowWM(); -#endif GiveUp(0); return 0; diff --git a/xserver/include/Makefile.am b/xserver/include/Makefile.am index cbc4a7c58..9c22ce113 100644 --- a/xserver/include/Makefile.am +++ b/xserver/include/Makefile.am @@ -27,6 +27,7 @@ sdk_HEADERS = \ gcstruct.h \ globals.h \ glx_extinit.h \ + glxvndabi.h \ input.h \ inputstr.h \ list.h \ @@ -78,4 +79,8 @@ EXTRA_DIST = \ swapreq.h \ systemd-logind.h \ vidmodestr.h \ + xorg-config.h.meson.in \ + xorg-server.h.meson.in \ + xwayland-config.h.meson.in \ + xwin-config.h.meson.in \ xsha1.h diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in index c1ef5f054..dcc8e32a8 100644 --- a/xserver/include/Makefile.in +++ b/xserver/include/Makefile.in @@ -53,9 +53,9 @@ host_triplet = @host@ subdir = include DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/dix-config.h.in \ - $(srcdir)/do-not-use-config.h.in $(srcdir)/kdrive-config.h.in \ - $(srcdir)/version-config.h.in $(srcdir)/xkb-config.h.in \ - $(srcdir)/xorg-config.h.in $(srcdir)/xorg-server.h.in \ + $(srcdir)/do-not-use-config.h.in $(srcdir)/version-config.h.in \ + $(srcdir)/xkb-config.h.in $(srcdir)/xorg-config.h.in \ + $(srcdir)/xorg-server.h.in $(srcdir)/xwayland-config.h.in \ $(srcdir)/xwin-config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ @@ -67,7 +67,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = do-not-use-config.h xorg-server.h dix-config.h \ - xorg-config.h xkb-config.h xwin-config.h kdrive-config.h \ + xorg-config.h xkb-config.h xwin-config.h xwayland-config.h \ version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -123,13 +123,14 @@ am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \ cursor.h cursorstr.h dix.h dixaccess.h dixevents.h dixfont.h \ dixfontstr.h dixgrabs.h dixstruct.h events.h exevents.h \ extension.h extinit.h extnsionst.h gc.h gcstruct.h globals.h \ - glx_extinit.h input.h inputstr.h list.h misc.h miscstruct.h \ - opaque.h nonsdk_extinit.h optionstr.h os.h pixmap.h \ - pixmapstr.h privates.h property.h propertyst.h ptrveloc.h \ - region.h regionstr.h registry.h resource.h rgb.h screenint.h \ - scrnintstr.h selection.h servermd.h site.h validate.h \ - displaymode.h window.h windowstr.h xkbfile.h xkbsrv.h xkbstr.h \ - xkbrules.h xserver_poll.h xserver-properties.h + glx_extinit.h glxvndabi.h input.h inputstr.h list.h misc.h \ + miscstruct.h opaque.h nonsdk_extinit.h optionstr.h os.h \ + pixmap.h pixmapstr.h privates.h property.h propertyst.h \ + ptrveloc.h region.h regionstr.h registry.h resource.h rgb.h \ + screenint.h scrnintstr.h selection.h servermd.h site.h \ + validate.h displaymode.h window.h windowstr.h xkbfile.h \ + xkbsrv.h xkbstr.h xkbrules.h xserver_poll.h \ + xserver-properties.h HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS) ETAGS = etags CTAGS = ctags @@ -317,6 +318,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -335,15 +337,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -351,6 +356,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -422,8 +429,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -516,6 +521,7 @@ top_srcdir = @top_srcdir@ @XORG_TRUE@ gcstruct.h \ @XORG_TRUE@ globals.h \ @XORG_TRUE@ glx_extinit.h \ +@XORG_TRUE@ glxvndabi.h \ @XORG_TRUE@ input.h \ @XORG_TRUE@ inputstr.h \ @XORG_TRUE@ list.h \ @@ -564,9 +570,13 @@ EXTRA_DIST = \ swapreq.h \ systemd-logind.h \ vidmodestr.h \ + xorg-config.h.meson.in \ + xorg-server.h.meson.in \ + xwayland-config.h.meson.in \ + xwin-config.h.meson.in \ xsha1.h -all: do-not-use-config.h xorg-server.h dix-config.h xorg-config.h xkb-config.h xwin-config.h kdrive-config.h version-config.h +all: do-not-use-config.h xorg-server.h dix-config.h xorg-config.h xkb-config.h xwin-config.h xwayland-config.h version-config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: @@ -653,13 +663,13 @@ stamp-h6: $(srcdir)/xwin-config.h.in $(top_builddir)/config.status @rm -f stamp-h6 cd $(top_builddir) && $(SHELL) ./config.status include/xwin-config.h -kdrive-config.h: stamp-h7 +xwayland-config.h: stamp-h7 @if test ! -f $@; then rm -f stamp-h7; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h7; else :; fi -stamp-h7: $(srcdir)/kdrive-config.h.in $(top_builddir)/config.status +stamp-h7: $(srcdir)/xwayland-config.h.in $(top_builddir)/config.status @rm -f stamp-h7 - cd $(top_builddir) && $(SHELL) ./config.status include/kdrive-config.h + cd $(top_builddir) && $(SHELL) ./config.status include/xwayland-config.h version-config.h: stamp-h8 @if test ! -f $@; then rm -f stamp-h8; else :; fi @@ -670,7 +680,7 @@ stamp-h8: $(srcdir)/version-config.h.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status include/version-config.h distclean-hdr: - -rm -f do-not-use-config.h stamp-h1 xorg-server.h stamp-h2 dix-config.h stamp-h3 xorg-config.h stamp-h4 xkb-config.h stamp-h5 xwin-config.h stamp-h6 kdrive-config.h stamp-h7 version-config.h stamp-h8 + -rm -f do-not-use-config.h stamp-h1 xorg-server.h stamp-h2 dix-config.h stamp-h3 xorg-config.h stamp-h4 xkb-config.h stamp-h5 xwin-config.h stamp-h6 xwayland-config.h stamp-h7 version-config.h stamp-h8 mostlyclean-libtool: -rm -f *.lo @@ -730,11 +740,11 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in kdrive-config.h.in version-config.h.in $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in xwayland-config.h.in version-config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in kdrive-config.h.in version-config.h.in $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in xwayland-config.h.in version-config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ @@ -752,9 +762,9 @@ TAGS: $(HEADERS) $(SOURCES) do-not-use-config.h.in xorg-server.h.in dix-config. fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in kdrive-config.h.in version-config.h.in $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in xwayland-config.h.in version-config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in kdrive-config.h.in version-config.h.in $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) do-not-use-config.h.in xorg-server.h.in dix-config.h.in xorg-config.h.in xkb-config.h.in xwin-config.h.in xwayland-config.h.in version-config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ @@ -820,7 +830,7 @@ check-am: all-am check: check-am all-am: Makefile $(HEADERS) do-not-use-config.h xorg-server.h \ dix-config.h xorg-config.h xkb-config.h xwin-config.h \ - kdrive-config.h version-config.h + xwayland-config.h version-config.h installdirs: for dir in "$(DESTDIR)$(sdkdir)" "$(DESTDIR)$(sdkdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index ad0ce6748..3d5b2ce55 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -63,15 +63,9 @@ /* Has libunwind support */ #undef HAVE_LIBUNWIND -/* Define to 1 if you have the header file. */ -#undef HAVE_BYTESWAP_H - /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT -/* Define to 1 if you have the header file. */ -#undef HAVE_DBM_H - /* Define to 1 if you have the declaration of `program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME @@ -89,9 +83,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `ffs' function. */ -#undef HAVE_FFS - /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE @@ -143,6 +134,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FB_H +/* Define to 1 if you have the `mkostemp' function. */ +#undef HAVE_MKOSTEMP + /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP @@ -152,18 +146,12 @@ /* Define to 1 if you have the function pthread_setname_np(pthread_t, const char*) */ #undef HAVE_PTHREAD_SETNAME_NP_WITH_TID -/* Define to 1 if you have the header file. */ -#undef HAVE_NDBM_H - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `reallocarray' function. */ #undef HAVE_REALLOCARRAY -/* Define to 1 if you have the header file. */ -#undef HAVE_RPCSVC_DBM_H - /* Define to 1 if you have the `arc4random_buf' function. */ #undef HAVE_ARC4RANDOM_BUF @@ -247,9 +235,6 @@ /* Define to 1 if you have the `timingsafe_memcmp' function. */ #undef HAVE_TIMINGSAFE_MEMCMP -/* Define to 1 if you have the header file. */ -#undef HAVE_TSLIB_H - /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -322,18 +307,9 @@ /* Support TCP socket connections */ #undef TCPCONN -/* Support tslib touchscreen abstraction library */ -#undef TSLIB - /* Support UNIX socket connections */ #undef UNIXCONN -/* Define to use byteswap macros from */ -#undef USE_SYS_ENDIAN_H - -/* unaligned word accesses behave as expected */ -#undef WORKING_UNALIGNED_INT - /* Build X string registry */ #undef XREGISTRY @@ -367,15 +343,9 @@ /* Support Xinerama extension */ #undef XINERAMA -/* Vendor release */ -#undef XORG_RELEASE - /* Current Xorg version */ #undef XORG_VERSION_CURRENT -/* Xorg release date */ -#undef XORG_DATE - /* Build Xv Extension */ #undef XvExtension @@ -469,15 +439,6 @@ /* Define to 1 if the DTrace Xserver provider probes should be built in */ #undef XSERVER_DTRACE -/* Define to 16-bit byteswap macro */ -#undef bswap_16 - -/* Define to 32-bit byteswap macro */ -#undef bswap_32 - -/* Define to 64-bit byteswap macro */ -#undef bswap_64 - /* Define to 1 if typeof works with your compiler. */ #undef HAVE_TYPEOF @@ -527,6 +488,12 @@ /* Build glamor/gbm has linear support */ #undef GLAMOR_HAS_GBM_LINEAR +/* GBM has modifiers support */ +#undef GBM_BO_WITH_MODIFIERS + +/* Glamor can use eglQueryDmaBuf* functions */ +#undef GLAMOR_HAS_EGL_QUERY_DMABUF + /* byte order */ #undef X_BYTE_ORDER diff --git a/xserver/include/dix.h b/xserver/include/dix.h index 240018b8d..b6e2bcfde 100644 --- a/xserver/include/dix.h +++ b/xserver/include/dix.h @@ -240,6 +240,8 @@ extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blo extern _X_EXPORT void InitBlockAndWakeupHandlers(void); +extern _X_EXPORT void ClearWorkQueue(void); + extern _X_EXPORT void ProcessWorkQueue(void); extern _X_EXPORT void ProcessWorkQueueZombies(void); @@ -557,11 +559,6 @@ extern _X_EXPORT void ScreenRestructured(ScreenPtr pScreen); #endif -#ifndef HAVE_FFS -extern _X_EXPORT int -ffs(int i); -#endif - /* * ServerGrabCallback stuff */ diff --git a/xserver/include/dixstruct.h b/xserver/include/dixstruct.h index 21a6b8a8d..fb0ac14b8 100644 --- a/xserver/include/dixstruct.h +++ b/xserver/include/dixstruct.h @@ -100,10 +100,9 @@ typedef struct _Client { CARD32 req_len; /* length of current request */ unsigned int replyBytesRemaining; PrivateRec *devPrivates; - unsigned short xkbClientFlags; unsigned short mapNotifyMask; unsigned short newKeyboardNotifyMask; - unsigned short vMajor, vMinor; + unsigned char xkbClientFlags; KeyCode minKC, maxKC; int smart_start_tick; @@ -111,19 +110,15 @@ typedef struct _Client { DeviceIntPtr clientPtr; ClientIdPtr clientIds; -#if XTRANS_SEND_FDS int req_fds; -#endif } ClientRec; -#if XTRANS_SEND_FDS static inline void SetReqFds(ClientPtr client, int req_fds) { if (client->req_fds != 0 && req_fds != client->req_fds) LogMessage(X_ERROR, "Mismatching number of request fds %d != %d\n", req_fds, client->req_fds); client->req_fds = req_fds; } -#endif /* * Scheduling interface @@ -132,7 +127,7 @@ extern long SmartScheduleTime; extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER extern Bool SmartScheduleSignalEnable; #else #define SmartScheduleSignalEnable FALSE diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index 259d0b426..884e80533 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -111,9 +111,15 @@ /* Fallback input driver */ #undef FALLBACK_INPUT_DRIVER +/* Have gbm_bo_create_with_modifiers */ +#undef GBM_BO_WITH_MODIFIERS + /* Build glamor */ #undef GLAMOR +/* Have GLAMOR_HAS_EGL_QUERY_DMABUF */ +#undef GLAMOR_HAS_EGL_QUERY_DMABUF + /* Build glamor with GBM-based EGL support */ #undef GLAMOR_HAS_GBM @@ -150,18 +156,12 @@ /* Has backtrace support */ #undef HAVE_BACKTRACE -/* Define to 1 if you have the header file. */ -#undef HAVE_BYTESWAP_H - /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME -/* Define to 1 if you have the header file. */ -#undef HAVE_DBM_H - /* Have D-Bus support */ #undef HAVE_DBUS @@ -185,9 +185,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `ffs' function. */ -#undef HAVE_FFS - /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H @@ -260,12 +257,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `mkostemp' function. */ +#undef HAVE_MKOSTEMP + /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP -/* Define to 1 if you have the header file. */ -#undef HAVE_NDBM_H - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H @@ -290,9 +287,6 @@ /* Define to 1 if you have the `reallocarray' function. */ #undef HAVE_REALLOCARRAY -/* Define to 1 if you have the header file. */ -#undef HAVE_RPCSVC_DBM_H - /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID @@ -440,24 +434,6 @@ /* Support IPv6 for TCP connections */ #undef IPv6 -/* Build kdrive ddx */ -#undef KDRIVEDDXACTIONS - -/* Build fbdev-based kdrive server */ -#undef KDRIVEFBDEV - -/* Build Kdrive X server */ -#undef KDRIVESERVER - -/* Enable KDrive evdev driver */ -#undef KDRIVE_EVDEV - -/* Enable KDrive kbd driver */ -#undef KDRIVE_KBD - -/* Enable KDrive mouse driver */ -#undef KDRIVE_MOUSE - /* Listen on local socket */ #undef LISTEN_LOCAL @@ -607,9 +583,6 @@ /* Support TCP socket connections */ #undef TCPCONN -/* Have tslib support */ -#undef TSLIB - /* Support UNIX socket connections */ #undef UNIXCONN @@ -647,9 +620,6 @@ #endif -/* Define to use byteswap macros from */ -#undef USE_SYS_ENDIAN_H - /* Vendor man version */ #undef VENDOR_MAN_VERSION @@ -692,6 +662,12 @@ /* Support XCMisc extension */ #undef XCMISC +/* Name of configuration directory */ +#undef XCONFIGDIR + +/* Name of configuration file */ +#undef XCONFIGFILE + /* Build Security extension */ #undef XCSECURITY @@ -755,9 +731,6 @@ /* Building Xorg server */ #undef XORGSERVER -/* Vendor release */ -#undef XORG_DATE - /* Vendor man version */ #undef XORG_MAN_VERSION @@ -806,6 +779,12 @@ /* Short vendor name */ #undef XVENDORNAMESHORT +/* Build xwayland with eglstream support */ +#undef XWL_HAS_EGLSTREAM + +/* Build xwayland with glamor support */ +#undef XWL_HAS_GLAMOR + /* byte order */ #undef X_BYTE_ORDER @@ -855,24 +834,9 @@ /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ -/* Name of configuration directory */ -#undef __XCONFIGDIR__ - -/* Name of configuration file */ -#undef __XCONFIGFILE__ - /* Name of X server */ #undef __XSERVERNAME__ -/* Define to 16-bit byteswap macro */ -#undef bswap_16 - -/* Define to 32-bit byteswap macro */ -#undef bswap_32 - -/* Define to 64-bit byteswap macro */ -#undef bswap_64 - /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff --git a/xserver/include/events.h b/xserver/include/events.h index c0ef45d5f..0cbd8c84a 100644 --- a/xserver/include/events.h +++ b/xserver/include/events.h @@ -29,7 +29,7 @@ typedef struct _DeviceChangedEvent DeviceChangedEvent; typedef struct _TouchOwnershipEvent TouchOwnershipEvent; typedef struct _BarrierEvent BarrierEvent; -#if XFreeXDGA +#ifdef XFreeXDGA typedef struct _DGAEvent DGAEvent; #endif typedef struct _RawDeviceEvent RawDeviceEvent; diff --git a/xserver/include/eventstr.h b/xserver/include/eventstr.h index 74469613a..bf3b95fe4 100644 --- a/xserver/include/eventstr.h +++ b/xserver/include/eventstr.h @@ -200,7 +200,7 @@ struct _DeviceChangedEvent { } keys; }; -#if XFreeXDGA +#ifdef XFreeXDGA /** * DGAEvent, used by DGA to intercept and emulate input events. */ @@ -287,7 +287,7 @@ union _InternalEvent { DeviceChangedEvent changed_event; TouchOwnershipEvent touch_ownership_event; BarrierEvent barrier_event; -#if XFreeXDGA +#ifdef XFreeXDGA DGAEvent dga_event; #endif RawDeviceEvent raw_event; diff --git a/xserver/include/extinit.h b/xserver/include/extinit.h index 4ad4fcac0..46081ad30 100644 --- a/xserver/include/extinit.h +++ b/xserver/include/extinit.h @@ -69,7 +69,6 @@ extern void DbeExtensionInit(void); #endif #if defined(DPMSExtension) -#include extern _X_EXPORT Bool noDPMSExtension; extern void DPMSExtensionInit(void); #endif @@ -79,10 +78,10 @@ extern void GEExtensionInit(void); #ifdef GLXEXT extern _X_EXPORT Bool noGlxExtension; +extern void GlxExtensionInit(void); #endif #ifdef PANORAMIX -#include extern _X_EXPORT Bool noPanoramiXExtension; extern void PanoramiXExtensionInit(void); #endif @@ -100,23 +99,18 @@ extern _X_EXPORT Bool noRenderExtension; extern void RenderExtensionInit(void); #if defined(RES) -#include extern _X_EXPORT Bool noResExtension; extern void ResExtensionInit(void); #endif #if defined(SCREENSAVER) -#include extern _X_EXPORT Bool noScreenSaverExtension; extern void ScreenSaverExtensionInit(void); #endif -#include extern void ShapeExtensionInit(void); #ifdef MITSHM -#include -#include extern _X_EXPORT Bool noMITShmExtension; extern void ShmExtensionInit(void); #endif @@ -126,14 +120,11 @@ extern void SyncExtensionInit(void); extern void XCMiscExtensionInit(void); #ifdef XCSECURITY -#include -#include "securitysrv.h" extern _X_EXPORT Bool noSecurityExtension; extern void SecurityExtensionInit(void); #endif #ifdef XF86BIGFONT -#include extern _X_EXPORT Bool noXFree86BigfontExtension; extern void XFree86BigfontExtensionInit(void); #endif @@ -144,40 +135,29 @@ extern _X_EXPORT Bool noXFixesExtension; extern void XFixesExtensionInit(void); extern void XInputExtensionInit(void); -extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, - Atom type, - const char *name); -#include extern void XkbExtensionInit(void); #if defined(XSELINUX) -#include "xselinux.h" extern _X_EXPORT Bool noSELinuxExtension; extern void SELinuxExtensionInit(void); #endif #ifdef XTEST -#include -#include extern void XTestExtensionInit(void); #endif #if defined(XV) -#include -#include extern _X_EXPORT Bool noXvExtension; extern void XvExtensionInit(void); extern void XvMCExtensionInit(void); #endif #if defined(DRI3) -#include extern void dri3_extension_init(void); #endif #if defined(PRESENT) -#include #include "presentext.h" #endif diff --git a/xserver/include/extnsionst.h b/xserver/include/extnsionst.h index 636f0a891..80c542339 100644 --- a/xserver/include/extnsionst.h +++ b/xserver/include/extnsionst.h @@ -64,8 +64,6 @@ typedef struct _ExtensionEntry { int eventLast; int errorBase; int errorLast; - int num_aliases; - const char **aliases; void *extPrivate; unsigned short (*MinorOpcode) ( /* called for errors */ ClientPtr /* client */ ); @@ -85,11 +83,6 @@ extern _X_EXPORT void NotImplemented( /* FIXME: this may move to another file... */ xEvent *, xEvent *) _X_NORETURN; -#define SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom) \ - pGC->VectorElement = NewRoutineAddress; - -#define GetGCValue(pGC, GCElement) (pGC->GCElement) - extern _X_EXPORT ExtensionEntry * AddExtension(const char * /*name */ , int /*NumEvents */ , @@ -100,10 +93,6 @@ AddExtension(const char * /*name */ , unsigned short (* /*MinorOpcodeProc */ )(ClientPtr /*client */ ) ); -extern _X_EXPORT Bool -AddExtensionAlias(const char * /*alias */ , - ExtensionEntry * /*extension */ ); - extern _X_EXPORT ExtensionEntry * CheckExtension(const char *extname); extern _X_EXPORT ExtensionEntry * diff --git a/xserver/include/gcstruct.h b/xserver/include/gcstruct.h index e48d61045..cb1b56655 100644 --- a/xserver/include/gcstruct.h +++ b/xserver/include/gcstruct.h @@ -278,14 +278,7 @@ typedef struct _GC { const GCFuncs *funcs; const GCOps *ops; PrivateRec *devPrivates; - /* - * The following were moved here from private storage to allow device- - * independent access to them from screen wrappers. - * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org) - */ - PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */ RegionPtr pCompositeClip; - /* fExpose & freeCompClip defined above */ } GC; #endif /* GCSTRUCT_H */ diff --git a/xserver/include/globals.h b/xserver/include/globals.h index 693bdf4f2..341ce832c 100644 --- a/xserver/include/globals.h +++ b/xserver/include/globals.h @@ -4,6 +4,10 @@ #include "window.h" /* for WindowPtr */ #include "extinit.h" +#ifdef DPMSExtension +/* sigh, too many drivers assume this */ +#include +#endif /* Global X server variables that are visible to mi, dix, os, and ddx */ @@ -26,16 +30,6 @@ extern _X_EXPORT char *SeatId; extern _X_EXPORT char *ConnectionInfo; extern _X_EXPORT sig_atomic_t inSignalContext; -#ifdef DPMSExtension -extern _X_EXPORT CARD32 DPMSStandbyTime; -extern _X_EXPORT CARD32 DPMSSuspendTime; -extern _X_EXPORT CARD32 DPMSOffTime; -extern _X_EXPORT CARD16 DPMSPowerLevel; -extern _X_EXPORT Bool DPMSEnabled; -extern _X_EXPORT Bool DPMSDisabledSwitch; -extern _X_EXPORT Bool DPMSCapableFlag; -#endif - #ifdef PANORAMIX extern _X_EXPORT Bool PanoramiXExtensionDisabledHack; #endif diff --git a/xserver/include/glx_extinit.h b/xserver/include/glx_extinit.h index ad4741dd1..07f3cc855 100644 --- a/xserver/include/glx_extinit.h +++ b/xserver/include/glx_extinit.h @@ -27,8 +27,22 @@ #define GLX_EXT_INIT_H /* this is separate due to sdksyms pulling in extinit.h */ +/* XXX this comment no longer makes sense i think */ #ifdef GLXEXT -extern void GlxExtensionInit(void); +typedef struct __GLXprovider __GLXprovider; +typedef struct __GLXscreen __GLXscreen; +struct __GLXprovider { + __GLXscreen *(*screenProbe) (ScreenPtr pScreen); + const char *name; + __GLXprovider *next; +}; +extern __GLXprovider __glXDRISWRastProvider; + +void GlxPushProvider(__GLXprovider * provider); +Bool xorgGlxCreateVendor(void); +#else +static inline Bool xorgGlxCreateVendor(void) { return TRUE; } #endif + #endif diff --git a/xserver/include/glxvndabi.h b/xserver/include/glxvndabi.h new file mode 100644 index 000000000..b78306d23 --- /dev/null +++ b/xserver/include/glxvndabi.h @@ -0,0 +1,307 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +/** + * \file + * + * Defines the interface between the libglvnd server module and a vendor + * library. + * + * Each screen may have one vendor library assigned to it. The GLVND module + * will examine each GLX request to determine which screen it goes to, and then + * it will forward that request to whichever vendor is assigned to that screen. + * + * Each vendor library is represented by an opaque __GLXServerVendor handle. + * Display drivers are responsible for creating handles for its GLX + * implementations, and assigning those handles to each screen. + * + * The GLVND module keeps a list of callbacks, which are called from + * InitExtensions. Drivers should use that callback to assign a vendor + * handle to whichever screens they support. + * + * Additional notes about dispatching: + * - If a request has one or more GLXContextTag values, then the dispatch stub + * must ensure that all of the tags belong to the vendor that it forwards the + * request to. Otherwise, if a vendor library tries to look up the private + * data for the tag, it could get the data from another vendor and crash. + * - Following from the last point, if a request takes a GLXContextTag value, + * then the dispatch stub should use the tag to select a vendor. If the + * request takes two or more tags, then the vendor must ensure that they all + * map to the same vendor. + */ + +#ifndef GLXVENDORABI_H +#define GLXVENDORABI_H + +#include +#include +#include + +/*! + * Current version of the ABI. + * + * This version number contains a major number in the high-order 16 bits, and + * a minor version number in the low-order 16 bits. + * + * The major version number is incremented when an interface change will break + * backwards compatibility with existing vendor libraries. The minor version + * number is incremented when there's a change but existing vendor libraries + * will still work. + */ +#define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0 +#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 0 + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * An opaque pointer representing a vendor library. + */ +typedef struct GlxServerVendorRec GlxServerVendor; + +typedef int (* GlxServerDispatchProc) (ClientPtr client); + +typedef struct GlxServerImportsRec GlxServerImports; + +/** + * Functions exported by libglvnd to the vendor library. + */ +typedef struct GlxServerExportsRec { + int majorVersion; + int minorVersion; + + /** + * This callback is called during each server generation when the GLX + * extension is initialized. + * + * Drivers may create a __GLXServerVendor handle at any time, but may only + * assign a vendor to a screen from this callback. + * + * The callback is called with the ExtensionEntry pointer for the GLX + * extension. + */ + CallbackListPtr *extensionInitCallback; + + /** + * Allocates and zeroes a __GLXserverImports structure. + * + * Future versions of the GLVND interface may add optional members to the + * end of the __GLXserverImports struct. Letting the GLVND layer allocate + * the __GLXserverImports struct allows backward compatibility with + * existing drivers. + */ + GlxServerImports * (* allocateServerImports) (void); + + /** + * Frees a __GLXserverImports structure that was allocated with + * \c allocateServerImports. + */ + void (* freeServerImports) (GlxServerImports *imports); + + /** + * Creates a new vendor library handle. + */ + GlxServerVendor * (* createVendor) (const GlxServerImports *imports); + + /** + * Destroys a vendor library handle. + * + * This function may not be called while the vendor handle is assigned to a + * screen, but it may be called from the __GLXserverImports::extensionCloseDown + * callback. + */ + void (* destroyVendor) (GlxServerVendor *vendor); + + /** + * Sets the vendor library to use for a screen. + * + * This function should be called from the screen's CreateScreenResources + * callback. + */ + Bool (* setScreenVendor) (ScreenPtr screen, GlxServerVendor *vendor); + + + /** + * Adds an entry to the XID map. + * + * This mapping is used to dispatch requests based on an XID. + * + * Client-generated XID's (contexts, drawables, etc) must be added to the + * map by the dispatch stub. + * + * XID's that are generated in the server should be added by the vendor + * library. + * + * Vendor libraries are responsible for keeping track of any additional + * data they need for the XID's. + * + * Note that adding GLXFBConfig ID's appears to be unnecessary -- every GLX + * request I can find that takes a GLXFBConfig also takes a screen number. + * + * \param id The XID to add to the map. The XID must not already be in the + * map. + * \param vendor The vendor library to associate with \p id. + * \return True on success, or False on failure. + */ + Bool (* addXIDMap) (XID id, GlxServerVendor *vendor); + + /** + * Returns the vendor and data for an XID, as added with \c addXIDMap. + * + * If \p id wasn't added with \c addXIDMap (for example, if it's a regular + * X window), then libglvnd will try to look it up as a drawable and return + * the vendor for whatever screen it's on. + * + * \param id The XID to look up. + * \return The vendor that owns the XID, or \c NULL if no matching vendor + * was found. + */ + GlxServerVendor * (* getXIDMap) (XID id); + + /** + * Removes an entry from the XID map. + */ + void (* removeXIDMap) (XID id); + + /** + * Looks up a context tag. + * + * Context tags are created and managed by libglvnd to ensure that they're + * unique between vendors. + * + * \param client The client connection. + * \param tag The context tag. + * \return The vendor that owns the context tag, or \c NULL if the context + * tag is invalid. + */ + GlxServerVendor * (* getContextTag)(ClientPtr client, GLXContextTag tag); + + /** + * Assigns a pointer to vendor-private data for a context tag. + * + * Since the tag values are assigned by GLVND, vendors can use this + * function to store any private data they need for a context tag. + * + * \param client The client connection. + * \param tag The context tag. + * \param data An arbitrary pointer value. + */ + Bool (* setContextTagPrivate)(ClientPtr client, GLXContextTag tag, void *data); + + /** + * Returns the private data pointer that was assigned from + * setContextTagPrivate. + * + * This function is safe to use in __GLXserverImports::makeCurrent to look + * up the old context private pointer. + * + * However, this function is not safe to use from a ClientStateCallback, + * because GLVND may have alraedy deleted the tag by that point. + */ + void * (* getContextTagPrivate)(ClientPtr client, GLXContextTag tag); + + GlxServerVendor * (* getVendorForScreen) (ClientPtr client, ScreenPtr screen); + + /** + * Forwards a request to a vendor library. + * + * \param vendor The vendor to send the request to. + * \param client The client. + */ + int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client); +} GlxServerExports; + +extern _X_EXPORT const GlxServerExports glxServer; + +/** + * Functions exported by the vendor library to libglvnd. + */ +struct GlxServerImportsRec { + /** + * Called on a server reset. + * + * This is called from the extension's CloseDown callback. + * + * Note that this is called after freeing all of GLVND's per-screen data, + * so the callback may destroy any vendor handles. + * + * If the server is exiting, then GLVND will free any remaining vendor + * handles after calling the extensionCloseDown callbacks. + */ + void (* extensionCloseDown) (const ExtensionEntry *extEntry); + + /** + * Handles a GLX request. + */ + int (* handleRequest) (ClientPtr client); + + /** + * Returns a dispatch function for a request. + * + * \param minorOpcode The minor opcode of the request. + * \param vendorCode The vendor opcode, if \p minorOpcode + * is \c X_GLXVendorPrivate or \c X_GLXVendorPrivateWithReply. + * \return A dispatch function, or NULL if the vendor doesn't support this + * request. + */ + GlxServerDispatchProc (* getDispatchAddress) (CARD8 minorOpcode, CARD32 vendorCode); + + /** + * Handles a MakeCurrent request. + * + * This function is called to handle any MakeCurrent request. The vendor + * library should deal with changing the current context. After the vendor + * returns GLVND will send the reply. + * + * In addition, GLVND will call this function with any current contexts + * when a client disconnects. + * + * To ensure that context tags are unique, libglvnd will select a context + * tag and pass it to the vendor library. + * + * The vendor can use \c __GLXserverExports::getContextTagPrivate to look + * up the private data pointer for \p oldContextTag. + * + * Likewise, the vendor can use \c __GLXserverExports::setContextTagPrivate + * to assign a private data pointer to \p newContextTag. + */ + int (* makeCurrent) (ClientPtr client, + GLXContextTag oldContextTag, + XID drawable, + XID readdrawable, + XID context, + GLXContextTag newContextTag); +}; + +#if defined(__cplusplus) +} +#endif + +#endif // GLXVENDORABI_H diff --git a/xserver/include/inputstr.h b/xserver/include/inputstr.h index 568f5f991..bf35dbf4b 100644 --- a/xserver/include/inputstr.h +++ b/xserver/include/inputstr.h @@ -57,6 +57,10 @@ SOFTWARE. #include "geext.h" #include "privates.h" +extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, + Atom type, + const char *name); + #define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) @@ -515,7 +519,6 @@ typedef struct _SpriteInfoRec { CursorPtr pCursor; ScreenPtr pScreen; int elt; - CARD32 time; } anim; } SpriteInfoRec, *SpriteInfoPtr; diff --git a/xserver/include/kdrive-config.h.in b/xserver/include/kdrive-config.h.in deleted file mode 100644 index 3d7e9a4a7..000000000 --- a/xserver/include/kdrive-config.h.in +++ /dev/null @@ -1,37 +0,0 @@ -/* kdrive-config.h.in: not at all generated. -*- c -*- - */ - -#ifndef _KDRIVE_CONFIG_H_ -#define _KDRIVE_CONFIG_H_ - -#include -#include - -/* Building kdrive server. */ -#undef KDRIVESERVER - -/* Include framebuffer support in X servers */ -#undef KDRIVEFBDEV - -/* Support tslib touchscreen abstraction library */ -#undef TSLIB - -/* Support KDrive kbd driver */ -#undef KDRIVE_KBD - -/* Support KDrive mouse driver */ -#undef KDRIVE_MOUSE - -/* Support KDrive evdev driver */ -#undef KDRIVE_EVDEV - -/* Verbose debugging output hilarity */ -#undef DEBUG - -/* Have the backtrace() function. */ -#undef HAVE_BACKTRACE - -/* Have execinfo.h for backtrace(). */ -#undef HAVE_EXECINFO_H - -#endif /* _KDRIVE_CONFIG_H_ */ diff --git a/xserver/include/list.h b/xserver/include/list.h index 3f0574d43..f81d97fc1 100644 --- a/xserver/include/list.h +++ b/xserver/include/list.h @@ -211,7 +211,8 @@ xorg_list_del(struct xorg_list *entry) * Example: * xorg_list_is_empty(&bar->list_of_foos); * - * @return True if the list contains one or more elements or False otherwise. + * @return True if the list is empty or False if the list contains one or more + * elements. */ static inline int xorg_list_is_empty(struct xorg_list *head) diff --git a/xserver/include/misc.h b/xserver/include/misc.h index 2dedf6d63..546ed5c96 100644 --- a/xserver/include/misc.h +++ b/xserver/include/misc.h @@ -128,21 +128,6 @@ typedef struct _xReq *xReqPtr; #define USE_BACKGROUND_PIXEL 3 #define USE_BORDER_PIXEL 3 -/* byte swap a 32-bit literal */ -static inline uint32_t -lswapl(uint32_t x) -{ - return ((x & 0xff) << 24) | - ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x >> 24) & 0xff); -} - -/* byte swap a 16-bit literal */ -static inline uint16_t -lswaps(uint16_t x) -{ - return (uint16_t)((x & 0xff) << 8) | ((x >> 8) & 0xff); -} - #undef min #undef max @@ -311,88 +296,100 @@ __builtin_constant_p(int x) } #endif -/* byte swap a 64-bit value */ -static inline void -swap_uint64(uint64_t *x) +#ifndef bswap_64 +static inline uint64_t +bswap_64(uint64_t x) { - char n; - - n = ((char *) x)[0]; - ((char *) x)[0] = ((char *) x)[7]; - ((char *) x)[7] = n; - - n = ((char *) x)[1]; - ((char *) x)[1] = ((char *) x)[6]; - ((char *) x)[6] = n; - - n = ((char *) x)[2]; - ((char *) x)[2] = ((char *) x)[5]; - ((char *) x)[5] = n; - - n = ((char *) x)[3]; - ((char *) x)[3] = ((char *) x)[4]; - ((char *) x)[4] = n; + return (((x & 0xFF00000000000000ull) >> 56) | + ((x & 0x00FF000000000000ull) >> 40) | + ((x & 0x0000FF0000000000ull) >> 24) | + ((x & 0x000000FF00000000ull) >> 8) | + ((x & 0x00000000FF000000ull) << 8) | + ((x & 0x0000000000FF0000ull) << 24) | + ((x & 0x000000000000FF00ull) << 40) | + ((x & 0x00000000000000FFull) << 56)); } +#endif #define swapll(x) do { \ if (sizeof(*(x)) != 8) \ wrong_size(); \ - swap_uint64((uint64_t *)(x)); \ + *(x) = bswap_64(*(x)); \ } while (0) -/* byte swap a 32-bit value */ -static inline void -swap_uint32(uint32_t * x) +#ifndef bswap_32 +static inline uint32_t +bswap_32(uint32_t x) { - char n = ((char *) x)[0]; + return (((x & 0xFF000000) >> 24) | + ((x & 0x00FF0000) >> 8) | + ((x & 0x0000FF00) << 8) | + ((x & 0x000000FF) << 24)); +} +#endif - ((char *) x)[0] = ((char *) x)[3]; - ((char *) x)[3] = n; - n = ((char *) x)[1]; - ((char *) x)[1] = ((char *) x)[2]; - ((char *) x)[2] = n; +static inline Bool +checked_int64_add(int64_t *out, int64_t a, int64_t b) +{ + /* Do the potentially overflowing math as uint64_t, as signed + * integers in C are undefined on overflow (and the compiler may + * optimize out our overflow check below, otherwise) + */ + int64_t result = (uint64_t)a + (uint64_t)b; + /* signed addition overflows if operands have the same sign, and + * the sign of the result doesn't match the sign of the inputs. + */ + Bool overflow = (a < 0) == (b < 0) && (a < 0) != (result < 0); + + *out = result; + + return overflow; +} + +static inline Bool +checked_int64_subtract(int64_t *out, int64_t a, int64_t b) +{ + int64_t result = (uint64_t)a - (uint64_t)b; + Bool overflow = (a < 0) != (b < 0) && (a < 0) != (result < 0); + + *out = result; + + return overflow; } #define swapl(x) do { \ if (sizeof(*(x)) != 4) \ wrong_size(); \ - if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \ - *(x) = lswapl(*(x)); \ - else \ - swap_uint32((uint32_t *)(x)); \ + *(x) = bswap_32(*(x)); \ } while (0) -/* byte swap a 16-bit value */ -static inline void -swap_uint16(uint16_t * x) +#ifndef bswap_16 +static inline uint16_t +bswap_16(uint16_t x) { - char n = ((char *) x)[0]; - - ((char *) x)[0] = ((char *) x)[1]; - ((char *) x)[1] = n; + return (((x & 0xFF00) >> 8) | + ((x & 0x00FF) << 8)); } +#endif #define swaps(x) do { \ if (sizeof(*(x)) != 2) \ wrong_size(); \ - if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \ - *(x) = lswaps(*(x)); \ - else \ - swap_uint16((uint16_t *)(x)); \ + *(x) = bswap_16(*(x)); \ } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ #define cpswapl(src, dst) do { \ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \ wrong_size(); \ - (dst) = lswapl((src)); \ + (dst) = bswap_32((src)); \ } while (0) /* copy short from src to dst byteswapping on the way */ #define cpswaps(src, dst) do { \ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \ wrong_size(); \ - (dst) = lswaps((src)); \ + (dst) = bswap_16((src)); \ } while (0) extern _X_EXPORT void SwapLongs(CARD32 *list, unsigned long count); diff --git a/xserver/include/os.h b/xserver/include/os.h index eb6192895..d15bfb4f9 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -54,6 +54,12 @@ SOFTWARE. #ifdef MONOTONIC_CLOCK #include #endif +#if defined(HAVE_LIBBSD) && defined(HAVE_REALLOCARRAY) +#include /* for reallocarray */ +#endif +#if defined(HAVE_LIBBSD) && defined(HAVE_STRLCPY) +#include /* for strlcpy, strlcat */ +#endif #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -100,11 +106,9 @@ extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready); extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ ); -#if XTRANS_SEND_FDS extern _X_EXPORT int ReadFdFromClient(ClientPtr client); extern _X_EXPORT int WriteFdToClient(ClientPtr client, int fd, Bool do_close); -#endif extern _X_EXPORT Bool InsertFakeRequest(ClientPtr /*client */ , char * /*data */ , @@ -369,6 +373,9 @@ System(const char *cmdline); #define Fclose(a) fclose(a) #endif +extern _X_EXPORT Bool +PrivsElevated(void); + extern _X_EXPORT void CheckUserParameters(int argc, char **argv, char **envp); extern _X_EXPORT void @@ -473,7 +480,7 @@ AccessUsingXdmcp(void); extern _X_EXPORT void DefineSelf(int /*fd */ ); -#if XDMCP +#ifdef XDMCP extern _X_EXPORT void AugmentSelf(void *from, int len); diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h index 86b513d47..b7fb25723 100644 --- a/xserver/include/pixmap.h +++ b/xserver/include/pixmap.h @@ -119,14 +119,15 @@ extern _X_EXPORT void PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap); #define HAS_DIRTYTRACKING_ROTATION 1 +#define HAS_DIRTYTRACKING_DRAWABLE_SRC 1 extern _X_EXPORT Bool -PixmapStartDirtyTracking(PixmapPtr src, +PixmapStartDirtyTracking(DrawablePtr src, PixmapPtr slave_dst, int x, int y, int dst_x, int dst_y, Rotation rotation); extern _X_EXPORT Bool -PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst); +PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr slave_dst); /* helper function, drivers can do this themselves if they can do it more efficently */ diff --git a/xserver/include/pixmapstr.h b/xserver/include/pixmapstr.h index 4bd246562..de501013a 100644 --- a/xserver/include/pixmapstr.h +++ b/xserver/include/pixmapstr.h @@ -88,7 +88,8 @@ typedef struct _Pixmap { } PixmapRec; typedef struct _PixmapDirtyUpdate { - PixmapPtr src, slave_dst; + DrawablePtr src; /* Root window / shared pixmap */ + PixmapPtr slave_dst; /* Shared / scanout pixmap */ int x, y; DamagePtr damage; struct xorg_list ent; diff --git a/xserver/include/privates.h b/xserver/include/privates.h index a2bb1a43c..e89c3e440 100644 --- a/xserver/include/privates.h +++ b/xserver/include/privates.h @@ -46,7 +46,6 @@ typedef enum { PRIVATE_CURSOR_BITS, /* extension privates */ - PRIVATE_DAMAGE, PRIVATE_GLYPH, PRIVATE_GLYPHSET, PRIVATE_PICTURE, diff --git a/xserver/include/property.h b/xserver/include/property.h index be875e917..d7ccff344 100644 --- a/xserver/include/property.h +++ b/xserver/include/property.h @@ -51,6 +51,14 @@ SOFTWARE. typedef struct _Property *PropertyPtr; +typedef struct _PropertyStateRec { + WindowPtr win; + PropertyPtr prop; + int state; +} PropertyStateRec; + +extern CallbackListPtr PropertyStateCallback; + extern _X_EXPORT int dixLookupProperty(PropertyPtr * /*result */ , WindowPtr /*pWin */ , Atom /*proprty */ , diff --git a/xserver/include/protocol-versions.h b/xserver/include/protocol-versions.h index b4498927b..8e149b27f 100644 --- a/xserver/include/protocol-versions.h +++ b/xserver/include/protocol-versions.h @@ -48,7 +48,7 @@ /* DRI3 */ #define SERVER_DRI3_MAJOR_VERSION 1 -#define SERVER_DRI3_MINOR_VERSION 0 +#define SERVER_DRI3_MINOR_VERSION 2 /* DMX */ #define SERVER_DMX_MAJOR_VERSION 2 @@ -69,11 +69,11 @@ /* Present */ #define SERVER_PRESENT_MAJOR_VERSION 1 -#define SERVER_PRESENT_MINOR_VERSION 0 +#define SERVER_PRESENT_MINOR_VERSION 2 /* RandR */ #define SERVER_RANDR_MAJOR_VERSION 1 -#define SERVER_RANDR_MINOR_VERSION 5 +#define SERVER_RANDR_MINOR_VERSION 6 /* Record */ #define SERVER_RECORD_MAJOR_VERSION 1 diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h index f898392fe..9b663fa44 100644 --- a/xserver/include/scrnintstr.h +++ b/xserver/include/scrnintstr.h @@ -377,7 +377,7 @@ typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *); */ typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr); -typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr, +typedef Bool (*StartPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr, int x, int y, int dst_x, int dst_y, Rotation rotation); @@ -386,9 +386,9 @@ typedef Bool (*PresentSharedPixmapProcPtr)(PixmapPtr); typedef Bool (*RequestSharedPixmapNotifyDamageProcPtr)(PixmapPtr); -typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr); +typedef Bool (*StopPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr); -typedef Bool (*StopFlippingPixmapTrackingProcPtr)(PixmapPtr, +typedef Bool (*StopFlippingPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr, PixmapPtr); typedef Bool (*SharedPixmapNotifyDamageProcPtr)(PixmapPtr); @@ -400,6 +400,8 @@ typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen, typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32); +typedef void (*DPMSProcPtr)(ScreenPtr pScreen, int level); + /* Wrapping Screen procedures There are a few modules in the X server which dynamically add and @@ -504,14 +506,12 @@ typedef struct _Screen { char backingStoreSupport, saveUnderSupport; unsigned long whitePixel, blackPixel; GCPtr GCperDepth[MAXFORMATS + 1]; - /* next field is a stipple to use as default in - a GC. we don't build default tiles of all depths - because they are likely to be of a color - different from the default fg pixel, so - we don't win anything by building - a standard one. + /* next field is a stipple to use as default in a GC. we don't build + * default tiles of all depths because they are likely to be of a color + * different from the default fg pixel, so we don't win anything by + * building a standard one. */ - PixmapPtr PixmapPerDepth[1]; + PixmapPtr defaultStipple; void *devPrivate; short numVisuals; VisualPtr visuals; @@ -659,6 +659,7 @@ typedef struct _Screen { ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; XYToWindowProcPtr XYToWindow; + DPMSProcPtr DPMS; } ScreenRec; static inline RegionPtr diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 6e4ad44d4..fbb5427e1 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -195,6 +195,8 @@ typedef struct _XkbSrvInfo { XkbFilterPtr filters; XkbSrvCheckRepeatPtr checkRepeat; + + char overlay_perkey_state[256/8]; /* bitfield */ } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) @@ -233,7 +235,8 @@ typedef struct _XkbSrvLedInfo { * Settings for xkbClientFlags field (used by DIX) * These flags _must_ not overlap with XkbPCF_* */ -#define _XkbClientInitialized (1<<15) +#define _XkbClientInitialized (1<<7) +#define _XkbClientIsAncient (1<<6) #define _XkbWantsDetectableAutoRepeat(c)\ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask) diff --git a/xserver/include/xorg-config.h.in b/xserver/include/xorg-config.h.in index d910f84a0..ee2fe23d1 100644 --- a/xserver/include/xorg-config.h.in +++ b/xserver/include/xorg-config.h.in @@ -34,10 +34,10 @@ #undef XF86CONFIGFILE /* Path to configuration file. */ -#undef __XCONFIGFILE__ +#undef XCONFIGFILE /* Name of configuration directory. */ -#undef __XCONFIGDIR__ +#undef XCONFIGDIR /* Path to loadable modules. */ #undef DEFAULT_MODULE_PATH diff --git a/xserver/include/xorg-config.h.meson.in b/xserver/include/xorg-config.h.meson.in new file mode 100644 index 000000000..1e4213f9a --- /dev/null +++ b/xserver/include/xorg-config.h.meson.in @@ -0,0 +1,151 @@ +/* xorg-config.h.in: not at all generated. -*- c -*- + * + * This file differs from xorg-server.h.in in that -server is installed + * with the rest of the SDK for external drivers/modules to use, whereas + * -config is for internal use only (i.e. building the DDX). + * + */ + +#ifndef _XORG_CONFIG_H_ +#define _XORG_CONFIG_H_ + +#include +#include + +/* Building Xorg server. */ +#mesondefine XORGSERVER + +/* Current X.Org version. */ +#mesondefine XORG_VERSION_CURRENT + +/* Name of X server. */ +#mesondefine __XSERVERNAME__ + +/* URL to go to for support. */ +#mesondefine __VENDORDWEBSUPPORT__ + +/* Built-in output drivers. */ +#mesondefine DRIVERS + +/* Built-in input drivers. */ +#mesondefine IDRIVERS + +/* Path to configuration file. */ +#mesondefine XF86CONFIGFILE + +/* Path to configuration file. */ +#mesondefine XCONFIGFILE + +/* Name of configuration directory. */ +#mesondefine XCONFIGDIR + +/* Path to loadable modules. */ +#mesondefine DEFAULT_MODULE_PATH + +/* Path to installed libraries. */ +#mesondefine DEFAULT_LIBRARY_PATH + +/* Default log location */ +#mesondefine DEFAULT_LOGDIR + +/* Default logfile prefix */ +#mesondefine DEFAULT_LOGPREFIX + +/* Default XDG_DATA dir under HOME */ +#mesondefine DEFAULT_XDG_DATA_HOME + +/* Default log dir under XDG_DATA_HOME */ +#mesondefine DEFAULT_XDG_DATA_HOME_LOGDIR + +/* Building DRI-capable DDX. */ +#mesondefine XF86DRI + +/* Build DRI2 extension */ +#mesondefine DRI2 + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STROPTS_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_KD_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_VT_H + +/* Define to 1 if you have the `walkcontext' function (used on Solaris for + xorg_backtrace in hw/xfree86/common/xf86Events.c */ +#mesondefine HAVE_WALKCONTEXT + +/* Building vgahw module */ +#mesondefine WITH_VGAHW + +/* NetBSD PIO alpha IO */ +#mesondefine USE_ALPHA_PIO + +/* BSD AMD64 iopl */ +#mesondefine USE_AMD64_IOPL + +/* BSD /dev/io */ +#mesondefine USE_DEV_IO + +/* BSD i386 iopl */ +#mesondefine USE_I386_IOPL + +/* System is BSD-like */ +#mesondefine CSRG_BASED + +/* System has PC console */ +#mesondefine PCCONS_SUPPORT + +/* System has PCVT console */ +#mesondefine PCVT_SUPPORT + +/* System has syscons console */ +#mesondefine SYSCONS_SUPPORT + +/* System has wscons console */ +#mesondefine WSCONS_SUPPORT + +/* System has /dev/xf86 aperture driver */ +#mesondefine HAS_APERTURE_DRV + +/* Has backtrace support */ +#mesondefine HAVE_BACKTRACE + +/* Name of the period field in struct kbd_repeat */ +#mesondefine LNX_KBD_PERIOD_NAME + +/* Have execinfo.h */ +#mesondefine HAVE_EXECINFO_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_MKDEV_H + +/* Path to text files containing PCI IDs */ +#mesondefine PCI_TXT_IDS_PATH + +/* Build with libdrm support */ +#mesondefine WITH_LIBDRM + +/* Use libpciaccess */ +#mesondefine XSERVER_LIBPCIACCESS + +/* Have setugid */ +#mesondefine HAVE_ISSETUGID + +/* Have getresuid */ +#mesondefine HAVE_GETRESUID + +/* Have X server platform bus support */ +#mesondefine XSERVER_PLATFORM_BUS + +/* Define to 1 if you have the `seteuid' function. */ +#mesondefine HAVE_SETEUID + +/* Support APM/ACPI power management in the server */ +#mesondefine XF86PM + +/* Fallback input driver if the assigned driver fails */ +#mesondefine FALLBACK_INPUT_DRIVER + +#endif /* _XORG_CONFIG_H_ */ diff --git a/xserver/include/xorg-server.h.in b/xserver/include/xorg-server.h.in index ed431c3c4..3f5bc0b87 100644 --- a/xserver/include/xorg-server.h.in +++ b/xserver/include/xorg-server.h.in @@ -44,9 +44,6 @@ /* Support SHM */ #undef HAS_SHM -/* Define to 1 if you have the `ffs' function. */ -#undef HAVE_FFS - /* Define to 1 if you have the `reallocarray' function. */ #undef HAVE_REALLOCARRAY @@ -101,15 +98,9 @@ /* Support TCP socket connections */ #undef TCPCONN -/* Support tslib touchscreen abstraction library */ -#undef TSLIB - /* Support UNIX socket connections */ #undef UNIXCONN -/* unaligned word accesses behave as expected */ -#undef WORKING_UNALIGNED_INT - /* Support XCMisc extension */ #undef XCMISC @@ -134,9 +125,6 @@ /* XKB default rules */ #undef XKB_DFLT_RULES -/* Support loadable input and output drivers */ -#undef XLOADABLE - /* Build DRI extension */ #undef XF86DRI @@ -146,9 +134,6 @@ /* Build Xorg server */ #undef XORGSERVER -/* Vendor release */ -#undef XORG_RELEASE - /* Current Xorg version */ #undef XORG_VERSION_CURRENT @@ -183,7 +168,7 @@ #undef __VENDORDWEBSUPPORT__ /* Location of configuration file */ -#undef __XCONFIGFILE__ +#undef XCONFIGFILE /* Name of X server */ #undef __XSERVERNAME__ diff --git a/xserver/include/xorg-server.h.meson.in b/xserver/include/xorg-server.h.meson.in new file mode 100644 index 000000000..093801cad --- /dev/null +++ b/xserver/include/xorg-server.h.meson.in @@ -0,0 +1,222 @@ +/* xorg-server.h.in -*- c -*- + * + * This file is the template file for the xorg-server.h file which gets + * installed as part of the SDK. The #defines in this file overlap + * with those from config.h, but only for those options that we want + * to export to external modules. Boilerplate autotool #defines such + * as HAVE_STUFF and PACKAGE_NAME is kept in config.h + * + * It is still possible to update config.h.in using autoheader, since + * autoheader only creates a .h.in file for the first + * AM_CONFIG_HEADER() line, and thus does not overwrite this file. + * + * However, it should be kept in sync with this file. + */ + +#ifndef _XORG_SERVER_H_ +#define _XORG_SERVER_H_ + +#ifdef HAVE_XORG_CONFIG_H +#error Include xorg-config.h when building the X server +#endif + +/* Support BigRequests extension */ +#mesondefine BIGREQS + +/* Default font path */ +#mesondefine COMPILEDDEFAULTFONTPATH + +/* Support Composite Extension */ +#mesondefine COMPOSITE + +/* Build DPMS extension */ +#mesondefine DPMSExtension + +/* Build DRI3 extension */ +#mesondefine DRI3 + +/* Build GLX extension */ +#mesondefine GLXEXT + +/* Support XDM-AUTH*-1 */ +#mesondefine HASXDMAUTH + +/* Support SHM */ +#mesondefine HAS_SHM + +/* Define to 1 if you have the `reallocarray' function. */ +#mesondefine HAVE_REALLOCARRAY + +/* Define to 1 if you have the `strcasecmp' function. */ +#mesondefine HAVE_STRCASECMP + +/* Define to 1 if you have the `strcasestr' function. */ +#mesondefine HAVE_STRCASESTR + +/* Define to 1 if you have the `strlcat' function. */ +#mesondefine HAVE_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#mesondefine HAVE_STRLCPY + +/* Define to 1 if you have the `strncasecmp' function. */ +#mesondefine HAVE_STRNCASECMP + +/* Define to 1 if you have the `strndup' function. */ +#mesondefine HAVE_STRNDUP + +/* Support IPv6 for TCP connections */ +#mesondefine IPv6 + +/* Support MIT-SHM Extension */ +#mesondefine MITSHM + +/* Internal define for Xinerama */ +#mesondefine PANORAMIX + +/* Support Present extension */ +#mesondefine PRESENT + +/* Support RANDR extension */ +#mesondefine RANDR + +/* Support RENDER extension */ +#mesondefine RENDER + +/* Support X resource extension */ +#mesondefine RES + +/* Support MIT-SCREEN-SAVER extension */ +#mesondefine SCREENSAVER + +/* Support SHAPE extension */ +#mesondefine SHAPE + +/* Define to 1 on systems derived from System V Release 4 */ +#mesondefine SVR4 + +/* Support TCP socket connections */ +#mesondefine TCPCONN + +/* Support UNIX socket connections */ +#mesondefine UNIXCONN + +/* Support XCMisc extension */ +#mesondefine XCMISC + +/* Support Xdmcp */ +#mesondefine XDMCP + +/* Build XFree86 BigFont extension */ +#mesondefine XF86BIGFONT + +/* Support XFree86 Video Mode extension */ +#mesondefine XF86VIDMODE + +/* Build XDGA support */ +#mesondefine XFreeXDGA + +/* Support Xinerama extension */ +#mesondefine XINERAMA + +/* Support X Input extension */ +#mesondefine XINPUT + +/* XKB default rules */ +#mesondefine XKB_DFLT_RULES + +/* Build DRI extension */ +#mesondefine XF86DRI + +/* Build DRI2 extension */ +#mesondefine DRI2 + +/* Build Xorg server */ +#mesondefine XORGSERVER + +/* Current Xorg version */ +#mesondefine XORG_VERSION_CURRENT + +/* Build Xv Extension */ +#mesondefine XvExtension + +/* Build XvMC Extension */ +#mesondefine XvMCExtension + +/* Support XSync extension */ +#mesondefine XSYNC + +/* Support XTest extension */ +#mesondefine XTEST + +/* Support Xv Extension */ +#mesondefine XV + +/* Vendor name */ +#mesondefine XVENDORNAME + +/* BSD-compliant source */ +#mesondefine _BSD_SOURCE + +/* POSIX-compliant source */ +#mesondefine _POSIX_SOURCE + +/* X/Open-compliant source */ +#mesondefine _XOPEN_SOURCE + +/* Vendor web address for support */ +#mesondefine __VENDORDWEBSUPPORT__ + +/* Location of configuration file */ +#mesondefine XCONFIGFILE + +/* Name of X server */ +#mesondefine __XSERVERNAME__ + +/* Building vgahw module */ +#mesondefine WITH_VGAHW + +/* System is BSD-like */ +#mesondefine CSRG_BASED + +/* System has PC console */ +#mesondefine PCCONS_SUPPORT + +/* System has PCVT console */ +#mesondefine PCVT_SUPPORT + +/* System has syscons console */ +#mesondefine SYSCONS_SUPPORT + +/* System has wscons console */ +#mesondefine WSCONS_SUPPORT + +/* Loadable XFree86 server awesomeness */ +#define XFree86LOADER + +/* Use libpciaccess */ +#mesondefine XSERVER_LIBPCIACCESS + +/* X Access Control Extension */ +#mesondefine XACE + +/* Have X server platform bus support */ +#mesondefine XSERVER_PLATFORM_BUS + +#ifdef _LP64 +#define _XSERVER64 1 +#endif + +/* Have support for X shared memory fence library (xshmfence) */ +#mesondefine HAVE_XSHMFENCE + +/* Use XTrans FD passing support */ +#mesondefine XTRANS_SEND_FDS + +/* Ask fontsproto to make font path element names const */ +#define FONT_PATH_ELEMENT_NAME_CONST 1 + +/* byte order */ +#mesondefine X_BYTE_ORDER + +#endif /* _XORG_SERVER_H_ */ diff --git a/xserver/include/xserver_poll.h b/xserver/include/xserver_poll.h index 110d30cc7..0f3a37c73 100644 --- a/xserver/include/xserver_poll.h +++ b/xserver/include/xserver_poll.h @@ -24,10 +24,10 @@ #define _XSERVER_POLL_H_ #ifndef _DIX_CONFIG_H_ -#error must inclue dix-config.h to use xserver_poll.h +#error must include dix-config.h to use xserver_poll.h #endif -#if HAVE_POLL +#ifdef HAVE_POLL #include #define xserver_poll(fds, nfds, timeout) poll(fds, nfds, timeout) #else diff --git a/xserver/include/xwayland-config.h.in b/xserver/include/xwayland-config.h.in new file mode 100644 index 000000000..9695aae6b --- /dev/null +++ b/xserver/include/xwayland-config.h.in @@ -0,0 +1,13 @@ +/* xwayland-config.h.in: not at all generated. */ +#ifndef _XWAYLAND_CONFIG_H_ +#define _XWAYLAND_CONFIG_H_ + +#include + +/* Build glamor support for Xwayland */ +#undef XWL_HAS_GLAMOR + +/* Build eglstream support for Xwayland */ +#undef XWL_HAS_EGLSTREAM + +#endif /* _XWAYLAND_CONFIG_H_ */ diff --git a/xserver/include/xwayland-config.h.meson.in b/xserver/include/xwayland-config.h.meson.in new file mode 100644 index 000000000..0943ff57d --- /dev/null +++ b/xserver/include/xwayland-config.h.meson.in @@ -0,0 +1,11 @@ +/* xwayland-config.h.meson.in: not at all generated */ + +#pragma once + +#include + +/* Build glamor support for Xwayland */ +#mesondefine XWL_HAS_GLAMOR + +/* Build eglstream support for Xwayland */ +#mesondefine XWL_HAS_EGLSTREAM diff --git a/xserver/include/xwin-config.h.meson.in b/xserver/include/xwin-config.h.meson.in new file mode 100644 index 000000000..993227398 --- /dev/null +++ b/xserver/include/xwin-config.h.meson.in @@ -0,0 +1,24 @@ +/* + * xwin-config.h.in + * + * This file has all defines used in the xwin ddx + * + */ +#include + +/* Winsock networking */ +#mesondefine HAS_WINSOCK + +/* Cygwin has /dev/windows for signaling new win32 messages */ +#mesondefine HAS_DEVWINDOWS + +/* Switch on debug messages */ +#mesondefine CYGDEBUG +#mesondefine CYGWINDOWING_DEBUG +#mesondefine CYGMULTIWINDOW_DEBUG + +/* Default log location */ +#mesondefine DEFAULT_LOGDIR + +/* Whether we should re-locate the root to where the executable lives */ +#mesondefine RELOCATE_PROJECTROOT diff --git a/xserver/man/Makefile.in b/xserver/man/Makefile.in index a79d7ec27..5bc96ff56 100644 --- a/xserver/man/Makefile.in +++ b/xserver/man/Makefile.in @@ -72,7 +72,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -267,22 +267,36 @@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ - 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ - 's|__sysconfdir__|$(sysconfdir)|g' -e \ - 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ - 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ - 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ - 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ - 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ - 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ - 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ - 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ - 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ - 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ - 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \ + "$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \ + 's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' -e \ + 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \ + 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \ + 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \ + 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \ + 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \ + 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \ + 's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' -e \ + 's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \ + 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \ + 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \ + 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \ + 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \ + 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \ + 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -326,6 +340,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -344,15 +359,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -360,6 +378,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -431,8 +451,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/man/Xserver.man b/xserver/man/Xserver.man index 506e5bb70..31ffb8cff 100644 --- a/xserver/man/Xserver.man +++ b/xserver/man/Xserver.man @@ -26,7 +26,7 @@ .\" $XFree86: xc/programs/Xserver/Xserver.man,v 3.31 2004/01/10 22:27:46 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH XSERVER 1 __xorgversion__ +.TH XSERVER 1 @xorgversion@ .SH NAME Xserver \- X Window System display server .SH SYNOPSIS @@ -73,7 +73,7 @@ should override values specified via other mechanisms. The X server runs as the given \fIdisplaynumber\fP, which by default is 0. If multiple X servers are to run simultaneously on a host, each must have a unique display number. See the DISPLAY -NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to +NAMES section of the \fIX\fP(@miscmansuffix@) manual page to learn how to specify which display number clients should try to use. .TP 8 .B \-a \fInumber\fP @@ -98,7 +98,7 @@ Audit lines are sent as standard error output. .B \-auth \fIauthorization-file\fP specifies a file which contains a collection of authorization records used to authenticate access. See also the \fIxdm\fP(1) and -\fIXsecurity\fP(__miscmansuffix__) manual pages. +\fIXsecurity\fP(@miscmansuffix@) manual pages. .TP 8 .BI \-background\ none Asks the driver not to clear the background on startup, if the driver supports that. @@ -420,7 +420,7 @@ X servers that support the XKEYBOARD (a.k.a. \*qXKB\*q) extension accept the following options. All layout files specified on the command line must be located in the XKB base directory or a subdirectory, and specified as the relative path from the XKB base directory. The default XKB base directory is -.IR __projectroot__/lib/X11/xkb . +.IR @projectroot@/lib/X11/xkb . .TP 8 .BR [+-]accessx " [ \fItimeout\fP [ \fItimeout_mask\fP [ \fIfeedback\fP [ \fIoptions_mask\fP ] ] ] ]" enables(+) or disables(-) AccessX key sequences. @@ -444,13 +444,13 @@ loads keyboard description in \fIfilename\fP on server startup. The X server supports client connections via a platform-dependent subset of the following transport types: TCP/IP, Unix Domain sockets, and several varieties of SVR4 local connections. See the DISPLAY -NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to +NAMES section of the \fIX\fP(@miscmansuffix@) manual page to learn how to specify which transport type clients should try to use. .SH GRANTING ACCESS The X server implements a platform-dependent subset of the following authorization protocols: MIT-MAGIC-COOKIE-1, XDM-AUTHORIZATION-1, XDM-AUTHORIZATION-2, SUN-DES-1, and MIT-KERBEROS-5. See the -\fIXsecurity\fP(__miscmansuffix__) manual page for information on the +\fIXsecurity\fP(@miscmansuffix@) manual page for information on the operation of these protocols. .PP Authorization data required by the above protocols is passed to the @@ -537,7 +537,7 @@ the X server uses when trying to open a font is controlled by the \fIfont path\fP. .LP The default font path is -__default_font_path__ . +@default_font_path@ . .LP A special kind of directory can be specified using the \fBcatalogue\fP: prefix. Directories specified this way can contain symlinks pointing to the @@ -583,22 +583,22 @@ the following font path: .I /etc/X\fBn\fP.hosts Initial access control list for display number \fBn\fP .TP 30 -.IR __datadir__/fonts/X11/misc , __datadir__/fonts/X11/75dpi , __datadir__/fonts/X11/100dpi +.IR @datadir@/fonts/X11/misc , @datadir@/fonts/X11/75dpi , @datadir@/fonts/X11/100dpi Bitmap font directories .TP 30 -.IR __datadir__/fonts/X11/TTF , __datadir__/fonts/X11/Type1 +.IR @datadir@/fonts/X11/TTF , @datadir@/fonts/X11/Type1 Outline font directories .TP 30 .I /tmp/.X11-unix/X\fBn\fP Unix domain socket for display number \fBn\fP .TP 30 .I /usr/adm/X\fBn\fPmsgs -Error log file for display number \fBn\fP if run from \fIinit\fP(__adminmansuffix__) +Error log file for display number \fBn\fP if run from \fIinit\fP(@adminmansuffix@) .TP 30 -.I __projectroot__/lib/X11/xdm/xdm-errors +.I @projectroot@/lib/X11/xdm/xdm-errors Default error log file if the server is run from \fIxdm\fP(1) .SH "SEE ALSO" -General information: \fIX\fP(__miscmansuffix__) +General information: \fIX\fP(@miscmansuffix@) .PP Protocols: .I "X Window System Protocol," @@ -609,9 +609,9 @@ Fonts: \fIbdftopcf\fP(1), \fImkfontdir\fP(1), \fImkfontscale\fP(1), \fIxfs\fP(1), \fIxlsfonts\fP(1), \fIxfontsel\fP(1), \fIxfd\fP(1), .I "X Logical Font Description Conventions" .PP -Keyboards: \fIxkeyboard-config\fP(__miscmansuffix__) +Keyboards: \fIxkeyboard-config\fP(@miscmansuffix@) .PP -Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1), +Security: \fIXsecurity\fP(@miscmansuffix@), \fIxauth\fP(1), \fIXau\fP(1), \fIxdm\fP(1), \fIxhost\fP(1), \fIxfwp\fP(1), .I "Security Extension Specification" .PP diff --git a/xserver/manpages.am b/xserver/manpages.am index 648210b4e..15056905c 100644 --- a/xserver/manpages.am +++ b/xserver/manpages.am @@ -16,23 +16,39 @@ EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man +# xorg-macros.m4 has these bracketed by double underscores, but meson +# wants ats. + +MAN_SUBSTS += -e 's|@vendorversion@|"$(PACKAGE_STRING)" "$(XORG_MAN_PAGE)"|' \ + -e 's|@xorgversion@|"$(PACKAGE_STRING)" "$(XORG_MAN_PAGE)"|' \ + -e 's|@xservername@|Xorg|g' \ + -e 's|@xconfigfile@|xorg.conf|g' \ + -e 's|@projectroot@|$(prefix)|g' \ + -e 's|@apploaddir@|$(appdefaultdir)|g' \ + -e 's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' \ + -e 's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' \ + -e 's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' \ + -e 's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' + # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS += -e 's|__logdir__|$(logdir)|g' \ - -e 's|__datadir__|$(datadir)|g' \ - -e 's|__mandir__|$(mandir)|g' \ - -e 's|__sysconfdir__|$(sysconfdir)|g' \ - -e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \ - -e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \ - -e 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' \ - -e 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' \ - -e 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' \ - -e 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' \ - -e 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' \ - -e 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' \ - -e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \ - -e 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' \ - -e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \ +MAN_SUBSTS += -e 's|[@]logdir[@]|$(logdir)|g' \ + -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' \ + -e 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' \ + -e 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' \ + -e 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' \ + -e 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' \ + -e 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' \ + -e 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' \ + -e 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' \ + -e 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' \ + -e 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' \ + -e 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' \ -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' .man.$(APP_MAN_SUFFIX): diff --git a/xserver/meson_options.txt b/xserver/meson_options.txt new file mode 100644 index 000000000..3453b8df5 --- /dev/null +++ b/xserver/meson_options.txt @@ -0,0 +1,100 @@ +option('xorg', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable Xorg X Server') +option('xephyr', type: 'boolean', value: false, + description: 'Enable Xephyr nested X server') +option('xwayland', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable XWayland X server') +option('glamor', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable glamor (default yes for Xorg/Xwayland builds)') +option('xwayland_eglstream', type: 'combo', choices: ['true', 'false', 'auto'], + value: 'auto', description: 'Enable EGLStream support for glamor on Xwayland') +option('xnest', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable Xnest nested X server') +option('dmx', type: 'boolean', value: false, + description: 'Enable DMX nested X server') +option('xvfb', type: 'boolean', value: true, + description: 'Enable Xvfb X server') +option('xwin', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable XWin X server') + +option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg@lists.freedesktop.org') +option('builder_string', type: 'string', description: 'Additional builder string') + +option('log_dir', type: 'string') +option('module_dir', type: 'string', value: 'xorg/modules', + description: 'X.Org modules directory (absolute or relative to the directory specified by the libdir option)') +option('default_font_path', type: 'string') + +option('glx', type: 'boolean', value: true) +option('xdmcp', type: 'boolean', value: true) +option('xdm-auth-1', type: 'boolean', value: true) +option('secure-rpc', type: 'boolean', value: true) +option('ipv6', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto') + +option('xkb_dir', type: 'string') +option('xkb_output_dir', type: 'string') +option('xkb_bin_dir', type: 'string') +option('xkb_default_rules', type: 'string', value: 'evdev') +option('xkb_default_model', type: 'string', value: 'pc105') +option('xkb_default_layout', type: 'string', value: 'us') +option('xkb_default_variant', type: 'string') +option('xkb_default_options', type: 'string') + +option('vendor_name', type: 'string', value: 'The X.Org Foundation') +option('vendor_name_short', type: 'string', value: 'X.Org') +option('vendor_web', type: 'string', value: 'http://wiki.x.org') +option('os_vendor', type: 'string', value: '') + +option('listen_tcp', type: 'boolean', value: false, + description: 'Listen on TCP by default') +option('listen_unix', type: 'boolean', value: true, + description: 'Listen on Unix by default') +option('listen_local', type: 'boolean', value: true, + description: 'Listen on local by default') + +option('int10', type: 'combo', choices: ['stub', 'x86emu', 'vm86', 'auto', 'false'], + value: 'auto', + description: 'Xorg int10 backend (default: usually x86emu)') +option('suid_wrapper', type: 'boolean', value: 'false', + description: 'SUID wrapper for legacy driver support') +option('pciaccess', type: 'boolean', value: 'true', + description: 'Xorg pciaccess support') +option('udev', type: 'boolean', value: 'true') +option('hal', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable HAL integration') +option('systemd_logind', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable systemd-logind integration') +option('vbe', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Xorg VBE module') +option('vgahw', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Xorg VGA access module') +option('dpms', type: 'boolean', value: true, + description: 'Xorg DPMS extension') +option('xf86bigfont', type: 'boolean', value: false, + description: 'XF86 Big Font extension') +option('screensaver', type: 'boolean', value: true, + description: 'ScreenSaver extension') +option('xres', type: 'boolean', value: true, + description: 'XRes extension') +option('xace', type: 'boolean', value: true, + description: 'X-ACE extension') +option('xinerama', type: 'boolean', value: true, + description: 'Xinerama extension') +option('xcsecurity', type: 'boolean', value: false, + description: 'Security extension') +option('xv', type: 'boolean', value: true, + description: 'Xv extension') +option('xvmc', type: 'boolean', value: true, + description: 'XvMC extension') +option('dga', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'DGA extension') +option('linux_apm', type: 'boolean', value: true, + description: 'APM support on Linux') +option('linux_acpi', type: 'boolean', value: true, + description: 'ACPI support on Linux') +option('mitshm', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'SHM extension') + +option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)') +option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)') +option('dri3', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI3 extension (default: auto)') diff --git a/xserver/mi/Makefile.in b/xserver/mi/Makefile.in index ee8610d33..e7a35e02c 100644 --- a/xserver/mi/Makefile.in +++ b/xserver/mi/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -345,6 +345,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -363,15 +364,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -379,6 +383,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -450,8 +456,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/mi/miarc.c b/xserver/mi/miarc.c index 2588ee48a..71df4ab64 100644 --- a/xserver/mi/miarc.c +++ b/xserver/mi/miarc.c @@ -215,10 +215,21 @@ typedef struct _miPolyArc { miArcJoinPtr joins; } miPolyArcRec, *miPolyArcPtr; +typedef struct { + short lx, lw, rx, rw; +} miArcSpan; + +typedef struct { + miArcSpan *spans; + int count1, count2, k; + char top, bot, hole; +} miArcSpanData; + static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); static void newFinalSpan(int y, int xmin, int xmax); -static void drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, - miArcFacePtr left); +static miArcSpanData *drawArc(xArc * tarc, int l, int a0, int a1, + miArcFacePtr right, miArcFacePtr left, + miArcSpanData *spdata); static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc * tarc, int lw, miArcFacePtr left, miArcFacePtr right); static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, @@ -244,9 +255,9 @@ static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr * ppPts); * draw one segment of the arc using the arc spans generation routines */ -static void -miArcSegment(DrawablePtr pDraw, - GCPtr pGC, xArc tarc, miArcFacePtr right, miArcFacePtr left) +static miArcSpanData * +miArcSegment(DrawablePtr pDraw, GCPtr pGC, xArc tarc, miArcFacePtr right, + miArcFacePtr left, miArcSpanData *spdata) { int l = pGC->lineWidth; int a0, a1, startAngle, endAngle; @@ -257,7 +268,7 @@ miArcSegment(DrawablePtr pDraw, if (tarc.width == 0 || tarc.height == 0) { drawZeroArc(pDraw, pGC, &tarc, l, left, right); - return; + return spdata; } if (pGC->miTranslate) { @@ -298,7 +309,7 @@ miArcSegment(DrawablePtr pDraw, endAngle = FULLCIRCLE; } - drawArc(&tarc, l, startAngle, endAngle, right, left); + return drawArc(&tarc, l, startAngle, endAngle, right, left, spdata); } /* @@ -364,16 +375,6 @@ correspond to the inner and outer boundaries. */ -typedef struct { - short lx, lw, rx, rw; -} miArcSpan; - -typedef struct { - miArcSpan *spans; - int count1, count2, k; - char top, bot, hole; -} miArcSpanData; - static void drawQuadrant(struct arc_def *def, struct accelerators *acc, int a0, int a1, int mask, miArcFacePtr right, miArcFacePtr left, miArcSpanData * spdata); @@ -894,7 +895,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) int xMin, xMax, yMin, yMax; int pixmapWidth = 0, pixmapHeight = 0; int xOrg = 0, yOrg = 0; - int width; + int width = pGC->lineWidth; Bool fTricky; DrawablePtr pDrawTo; CARD32 fg, bg; @@ -904,210 +905,215 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) int iphase; int halfWidth; - width = pGC->lineWidth; if (width == 0 && pGC->lineStyle == LineSolid) { - for (i = narcs, parc = parcs; --i >= 0; parc++) - miArcSegment(pDraw, pGC, *parc, (miArcFacePtr) 0, (miArcFacePtr) 0); + for (i = narcs, parc = parcs; --i >= 0; parc++) { + miArcSpanData *spdata; + spdata = miArcSegment(pDraw, pGC, *parc, NULL, NULL, NULL); + free(spdata); + } fillSpans(pDraw, pGC); + return; } - else { - if ((pGC->lineStyle == LineSolid) && narcs) { - while (parcs->width && parcs->height && - (parcs->angle2 >= FULLCIRCLE || - parcs->angle2 <= -FULLCIRCLE)) { - miFillWideEllipse(pDraw, pGC, parcs); - if (!--narcs) - return; - parcs++; - } + + if ((pGC->lineStyle == LineSolid) && narcs) { + while (parcs->width && parcs->height && + (parcs->angle2 >= FULLCIRCLE || parcs->angle2 <= -FULLCIRCLE)) { + miFillWideEllipse(pDraw, pGC, parcs); + if (!--narcs) + return; + parcs++; + } + } + + /* Set up pDrawTo and pGCTo based on the rasterop */ + switch (pGC->alu) { + case GXclear: /* 0 */ + case GXcopy: /* src */ + case GXcopyInverted: /* NOT src */ + case GXset: /* 1 */ + fTricky = FALSE; + pDrawTo = pDraw; + pGCTo = pGC; + break; + default: + fTricky = TRUE; + + /* find bounding box around arcs */ + xMin = yMin = MAXSHORT; + xMax = yMax = MINSHORT; + + for (i = narcs, parc = parcs; --i >= 0; parc++) { + xMin = min(xMin, parc->x); + yMin = min(yMin, parc->y); + xMax = max(xMax, (parc->x + (int) parc->width)); + yMax = max(yMax, (parc->y + (int) parc->height)); } - /* Set up pDrawTo and pGCTo based on the rasterop */ - switch (pGC->alu) { - case GXclear: /* 0 */ - case GXcopy: /* src */ - case GXcopyInverted: /* NOT src */ - case GXset: /* 1 */ - fTricky = FALSE; - pDrawTo = pDraw; - pGCTo = pGC; - break; - default: - fTricky = TRUE; + /* expand box to deal with line widths */ + halfWidth = (width + 1) / 2; + xMin -= halfWidth; + yMin -= halfWidth; + xMax += halfWidth; + yMax += halfWidth; - /* find bounding box around arcs */ - xMin = yMin = MAXSHORT; - xMax = yMax = MINSHORT; + /* compute pixmap size; limit it to size of drawable */ + xOrg = max(xMin, 0); + yOrg = max(yMin, 0); + pixmapWidth = min(xMax, pDraw->width) - xOrg; + pixmapHeight = min(yMax, pDraw->height) - yOrg; - for (i = narcs, parc = parcs; --i >= 0; parc++) { - xMin = min(xMin, parc->x); - yMin = min(yMin, parc->y); - xMax = max(xMax, (parc->x + (int) parc->width)); - yMax = max(yMax, (parc->y + (int) parc->height)); - } + /* if nothing left, return */ + if ((pixmapWidth <= 0) || (pixmapHeight <= 0)) + return; - /* expand box to deal with line widths */ - halfWidth = (width + 1) / 2; - xMin -= halfWidth; - yMin -= halfWidth; - xMax += halfWidth; - yMax += halfWidth; - - /* compute pixmap size; limit it to size of drawable */ - xOrg = max(xMin, 0); - yOrg = max(yMin, 0); - pixmapWidth = min(xMax, pDraw->width) - xOrg; - pixmapHeight = min(yMax, pDraw->height) - yOrg; - - /* if nothing left, return */ - if ((pixmapWidth <= 0) || (pixmapHeight <= 0)) - return; - - for (i = narcs, parc = parcs; --i >= 0; parc++) { - parc->x -= xOrg; - parc->y -= yOrg; - } - if (pGC->miTranslate) { - xOrg += pDraw->x; - yOrg += pDraw->y; - } - - /* set up scratch GC */ - - pGCTo = GetScratchGC(1, pDraw->pScreen); - if (!pGCTo) - return; - { - ChangeGCVal gcvals[6]; - - gcvals[0].val = GXcopy; - gcvals[1].val = 1; - gcvals[2].val = 0; - gcvals[3].val = pGC->lineWidth; - gcvals[4].val = pGC->capStyle; - gcvals[5].val = pGC->joinStyle; - ChangeGC(NullClient, pGCTo, GCFunction | - GCForeground | GCBackground | GCLineWidth | - GCCapStyle | GCJoinStyle, gcvals); - } - - /* allocate a 1 bit deep pixmap of the appropriate size, and - * validate it */ - pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, - CREATE_PIXMAP_USAGE_SCRATCH); - if (!pDrawTo) { - FreeScratchGC(pGCTo); - return; - } - ValidateGC(pDrawTo, pGCTo); - miClearDrawable(pDrawTo, pGCTo); + for (i = narcs, parc = parcs; --i >= 0; parc++) { + parc->x -= xOrg; + parc->y -= yOrg; + } + if (pGC->miTranslate) { + xOrg += pDraw->x; + yOrg += pDraw->y; } - fg = pGC->fgPixel; - bg = pGC->bgPixel; - if ((pGC->fillStyle == FillTiled) || - (pGC->fillStyle == FillOpaqueStippled)) - bg = fg; /* the protocol sez these don't cause color changes */ + /* set up scratch GC */ + pGCTo = GetScratchGC(1, pDraw->pScreen); + if (!pGCTo) + return; + { + ChangeGCVal gcvals[6]; - polyArcs = miComputeArcs(parcs, narcs, pGC); + gcvals[0].val = GXcopy; + gcvals[1].val = 1; + gcvals[2].val = 0; + gcvals[3].val = pGC->lineWidth; + gcvals[4].val = pGC->capStyle; + gcvals[5].val = pGC->joinStyle; + ChangeGC(NullClient, pGCTo, GCFunction | + GCForeground | GCBackground | GCLineWidth | + GCCapStyle | GCJoinStyle, gcvals); + } - if (!polyArcs) { - if (fTricky) { - (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); - FreeScratchGC(pGCTo); - } + /* allocate a bitmap of the appropriate size, and validate it */ + pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap) + (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, + CREATE_PIXMAP_USAGE_SCRATCH); + if (!pDrawTo) { + FreeScratchGC(pGCTo); return; } + ValidateGC(pDrawTo, pGCTo); + miClearDrawable(pDrawTo, pGCTo); + } - cap[0] = cap[1] = 0; - join[0] = join[1] = 0; - for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0); - iphase >= 0; iphase--) { - ChangeGCVal gcval; + fg = pGC->fgPixel; + bg = pGC->bgPixel; - if (iphase == 1) { - gcval.val = bg; - ChangeGC(NullClient, pGC, GCForeground, &gcval); - ValidateGC(pDraw, pGC); + /* the protocol sez these don't cause color changes */ + if ((pGC->fillStyle == FillTiled) || + (pGC->fillStyle == FillOpaqueStippled)) + bg = fg; + + polyArcs = miComputeArcs(parcs, narcs, pGC); + if (!polyArcs) + goto out; + + cap[0] = cap[1] = 0; + join[0] = join[1] = 0; + for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) { + miArcSpanData *spdata = NULL; + xArc lastArc; + ChangeGCVal gcval; + + if (iphase == 1) { + gcval.val = bg; + ChangeGC(NullClient, pGC, GCForeground, &gcval); + ValidateGC(pDraw, pGC); + } + else if (pGC->lineStyle == LineDoubleDash) { + gcval.val = fg; + ChangeGC(NullClient, pGC, GCForeground, &gcval); + ValidateGC(pDraw, pGC); + } + for (i = 0; i < polyArcs[iphase].narcs; i++) { + miArcDataPtr arcData; + + arcData = &polyArcs[iphase].arcs[i]; + if (spdata) { + if (lastArc.width != arcData->arc.width || + lastArc.height != arcData->arc.height) { + free(spdata); + spdata = NULL; + } } - else if (pGC->lineStyle == LineDoubleDash) { - gcval.val = fg; - ChangeGC(NullClient, pGC, GCForeground, &gcval); - ValidateGC(pDraw, pGC); - } - for (i = 0; i < polyArcs[iphase].narcs; i++) { - miArcDataPtr arcData; + memcpy(&lastArc, &arcData->arc, sizeof(xArc)); + spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc, + &arcData->bounds[RIGHT_END], + &arcData->bounds[LEFT_END], spdata); + if (polyArcs[iphase].arcs[i].render) { + fillSpans(pDrawTo, pGCTo); + /* don't cap self-joining arcs */ + if (polyArcs[iphase].arcs[i].selfJoin && + cap[iphase] < polyArcs[iphase].arcs[i].cap) + cap[iphase]++; + while (cap[iphase] < polyArcs[iphase].arcs[i].cap) { + int arcIndex, end; + miArcDataPtr arcData0; - arcData = &polyArcs[iphase].arcs[i]; - miArcSegment(pDrawTo, pGCTo, arcData->arc, - &arcData->bounds[RIGHT_END], - &arcData->bounds[LEFT_END]); - if (polyArcs[iphase].arcs[i].render) { - fillSpans(pDrawTo, pGCTo); - /* - * don't cap self-joining arcs - */ - if (polyArcs[iphase].arcs[i].selfJoin && - cap[iphase] < polyArcs[iphase].arcs[i].cap) - cap[iphase]++; - while (cap[iphase] < polyArcs[iphase].arcs[i].cap) { - int arcIndex, end; - miArcDataPtr arcData0; + arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex; + end = polyArcs[iphase].caps[cap[iphase]].end; + arcData0 = &polyArcs[iphase].arcs[arcIndex]; + miArcCap(pDrawTo, pGCTo, + &arcData0->bounds[end], end, + arcData0->arc.x, arcData0->arc.y, + (double) arcData0->arc.width / 2.0, + (double) arcData0->arc.height / 2.0); + ++cap[iphase]; + } + while (join[iphase] < polyArcs[iphase].arcs[i].join) { + int arcIndex0, arcIndex1, end0, end1; + int phase0, phase1; + miArcDataPtr arcData0, arcData1; + miArcJoinPtr joinp; - arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex; - end = polyArcs[iphase].caps[cap[iphase]].end; - arcData0 = &polyArcs[iphase].arcs[arcIndex]; - miArcCap(pDrawTo, pGCTo, - &arcData0->bounds[end], end, - arcData0->arc.x, arcData0->arc.y, - (double) arcData0->arc.width / 2.0, - (double) arcData0->arc.height / 2.0); - ++cap[iphase]; - } - while (join[iphase] < polyArcs[iphase].arcs[i].join) { - int arcIndex0, arcIndex1, end0, end1; - int phase0, phase1; - miArcDataPtr arcData0, arcData1; - miArcJoinPtr joinp; - - joinp = &polyArcs[iphase].joins[join[iphase]]; - arcIndex0 = joinp->arcIndex0; - end0 = joinp->end0; - arcIndex1 = joinp->arcIndex1; - end1 = joinp->end1; - phase0 = joinp->phase0; - phase1 = joinp->phase1; - arcData0 = &polyArcs[phase0].arcs[arcIndex0]; - arcData1 = &polyArcs[phase1].arcs[arcIndex1]; - miArcJoin(pDrawTo, pGCTo, - &arcData0->bounds[end0], - &arcData1->bounds[end1], - arcData0->arc.x, arcData0->arc.y, - (double) arcData0->arc.width / 2.0, - (double) arcData0->arc.height / 2.0, - arcData1->arc.x, arcData1->arc.y, - (double) arcData1->arc.width / 2.0, - (double) arcData1->arc.height / 2.0); - ++join[iphase]; - } - if (fTricky) { - if (pGC->serialNumber != pDraw->serialNumber) - ValidateGC(pDraw, pGC); - (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo, - pDraw, pixmapWidth, - pixmapHeight, xOrg, yOrg); - miClearDrawable((DrawablePtr) pDrawTo, pGCTo); - } + joinp = &polyArcs[iphase].joins[join[iphase]]; + arcIndex0 = joinp->arcIndex0; + end0 = joinp->end0; + arcIndex1 = joinp->arcIndex1; + end1 = joinp->end1; + phase0 = joinp->phase0; + phase1 = joinp->phase1; + arcData0 = &polyArcs[phase0].arcs[arcIndex0]; + arcData1 = &polyArcs[phase1].arcs[arcIndex1]; + miArcJoin(pDrawTo, pGCTo, + &arcData0->bounds[end0], + &arcData1->bounds[end1], + arcData0->arc.x, arcData0->arc.y, + (double) arcData0->arc.width / 2.0, + (double) arcData0->arc.height / 2.0, + arcData1->arc.x, arcData1->arc.y, + (double) arcData1->arc.width / 2.0, + (double) arcData1->arc.height / 2.0); + ++join[iphase]; + } + if (fTricky) { + if (pGC->serialNumber != pDraw->serialNumber) + ValidateGC(pDraw, pGC); + (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo, + pDraw, pixmapWidth, + pixmapHeight, xOrg, yOrg); + miClearDrawable((DrawablePtr) pDrawTo, pGCTo); } } } - miFreeArcs(polyArcs, pGC); + free(spdata); + spdata = NULL; + } + miFreeArcs(polyArcs, pGC); - if (fTricky) { - (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); - FreeScratchGC(pGCTo); - } +out: + if (fTricky) { + (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); + FreeScratchGC(pGCTo); } } @@ -3250,9 +3256,9 @@ mirrorSppPoint(int quadrant, SppPointPtr sppPoint) * first quadrant. */ -static void -drawArc(xArc * tarc, - int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left) +static miArcSpanData * +drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, + miArcFacePtr left, miArcSpanData *spdata) { /* save end line points */ struct arc_def def; struct accelerators acc; @@ -3268,11 +3274,11 @@ drawArc(xArc * tarc, int i, j; int flipRight = 0, flipLeft = 0; int copyEnd = 0; - miArcSpanData *spdata; - spdata = miComputeWideEllipse(l, tarc); if (!spdata) - return; + spdata = miComputeWideEllipse(l, tarc); + if (!spdata) + return NULL; if (a1 < a0) a1 += 360 * 64; @@ -3482,7 +3488,7 @@ drawArc(xArc * tarc, left->counterClock = temp; } } - free(spdata); + return spdata; } static void diff --git a/xserver/mi/mibitblt.c b/xserver/mi/mibitblt.c index 28296a449..43d9bd917 100644 --- a/xserver/mi/mibitblt.c +++ b/xserver/mi/mibitblt.c @@ -62,10 +62,6 @@ SOFTWARE. #include #include "servermd.h" -#ifndef HAVE_FFS -extern int ffs(int); -#endif - /* MICOPYAREA -- public entry for the CopyArea request * For each rectangle in the source region * get the pixels with GetSpans @@ -145,6 +141,8 @@ miCopyArea(DrawablePtr pSrcDrawable, free(ordering); free(pwidthFirst); free(pptFirst); + if (realSrcClip) + RegionDestroy(prgnSrcClip); return NULL; } diff --git a/xserver/mi/mieq.c b/xserver/mi/mieq.c index a6e867df6..555f0ec7e 100644 --- a/xserver/mi/mieq.c +++ b/xserver/mi/mieq.c @@ -320,7 +320,7 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent *event) case ET_TouchOwnership: event->touch_ownership_event.deviceid = dev->id; break; -#if XFreeXDGA +#ifdef XFreeXDGA case ET_DGAEvent: break; #endif @@ -385,7 +385,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev, if (!sdev || IsMaster(sdev) || IsFloating(sdev)) return NULL; -#if XFreeXDGA +#ifdef XFreeXDGA if (type == ET_DGAEvent) type = original->dga_event.subtype; #endif diff --git a/xserver/mi/miexpose.c b/xserver/mi/miexpose.c index 148d1a63b..c34530c34 100644 --- a/xserver/mi/miexpose.c +++ b/xserver/mi/miexpose.c @@ -136,7 +136,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, the window background */ WindowPtr pSrcWin; - BoxRec expBox; + BoxRec expBox = { 0, }; Bool extents; /* avoid work if we can */ diff --git a/xserver/mi/migc.c b/xserver/mi/migc.c index 8fdd4810c..bc2e1aede 100644 --- a/xserver/mi/migc.c +++ b/xserver/mi/migc.c @@ -46,8 +46,6 @@ miChangeGC(GCPtr pGC, unsigned long mask) void miDestroyGC(GCPtr pGC) { - if (pGC->pRotatedPixmap) - (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap); if (pGC->freeCompClip) RegionDestroy(pGC->pCompositeClip); } diff --git a/xserver/mi/migc.h b/xserver/mi/migc.h index 8d06a6f9f..add601a94 100644 --- a/xserver/mi/migc.h +++ b/xserver/mi/migc.h @@ -26,6 +26,9 @@ from The Open Group. */ +#ifndef _MIGC_H +#define _MIGC_H + extern _X_EXPORT void miChangeGC(GCPtr pGC, unsigned long mask); @@ -47,3 +50,5 @@ extern _X_EXPORT void miCopyGC(GCPtr pGCSrc, extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable); + +#endif diff --git a/xserver/mi/miinitext.c b/xserver/mi/miinitext.c index 5fc44e3f4..b7c702127 100644 --- a/xserver/mi/miinitext.c +++ b/xserver/mi/miinitext.c @@ -97,14 +97,6 @@ SOFTWARE. #undef DPMSExtension #endif -#ifdef HAVE_KDRIVE_CONFIG_H -#include -#endif - -#ifdef HAVE_XGL_CONFIG_H -#include -#endif - #include "misc.h" #include "extension.h" #include "extinit.h" @@ -112,88 +104,93 @@ SOFTWARE. #include "nonsdk_extinit.h" #endif #include "micmap.h" +#include "os.h" #include "globals.h" -/* The following is only a small first step towards run-time - * configurable extensions. - */ -typedef struct { - const char *name; - Bool *disablePtr; -} ExtensionToggle; - -static ExtensionToggle ExtensionToggleList[] = { - /* sort order is extension name string as shown in xdpyinfo */ - {"Generic Events", &noGEExtension}, +/* List of built-in (statically linked) extensions */ +static const ExtensionModule staticExtensions[] = { + {GEExtensionInit, "Generic Event Extension", &noGEExtension}, + {ShapeExtensionInit, "SHAPE", NULL}, +#ifdef MITSHM + {ShmExtensionInit, "MIT-SHM", &noMITShmExtension}, +#endif + {XInputExtensionInit, "XInputExtension", NULL}, +#ifdef XTEST + {XTestExtensionInit, "XTEST", &noTestExtensions}, +#endif + {BigReqExtensionInit, "BIG-REQUESTS", NULL}, + {SyncExtensionInit, "SYNC", NULL}, + {XkbExtensionInit, "XKEYBOARD", NULL}, + {XCMiscExtensionInit, "XC-MISC", NULL}, +#ifdef XCSECURITY + {SecurityExtensionInit, "SECURITY", &noSecurityExtension}, +#endif +#ifdef PANORAMIX + {PanoramiXExtensionInit, "XINERAMA", &noPanoramiXExtension}, +#endif +#ifdef INXQUARTZ + /* PseudoramiXExtensionInit must be done before RRExtensionInit, or + * XQuartz will render windows offscreen. + */ + {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, +#endif + /* must be before Render to layer DisplayCursor correctly */ + {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, +#ifdef XF86BIGFONT + {XFree86BigfontExtensionInit, "XFree86-Bigfont", &noXFree86BigfontExtension}, +#endif + {RenderExtensionInit, "RENDER", &noRenderExtension}, +#ifdef RANDR + {RRExtensionInit, "RANDR", &noRRExtension}, +#endif #ifdef COMPOSITE - {"Composite", &noCompositeExtension}, + {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension}, #endif #ifdef DAMAGE - {"DAMAGE", &noDamageExtension}, -#endif -#ifdef DBE - {"DOUBLE-BUFFER", &noDbeExtension}, -#endif -#ifdef DPMSExtension - {"DPMS", &noDPMSExtension}, -#endif -#ifdef GLXEXT - {"GLX", &noGlxExtension}, + {DamageExtensionInit, "DAMAGE", &noDamageExtension}, #endif #ifdef SCREENSAVER - {"MIT-SCREEN-SAVER", &noScreenSaverExtension}, + {ScreenSaverExtensionInit, "MIT-SCREEN-SAVER", &noScreenSaverExtension}, #endif -#ifdef MITSHM - {SHMNAME, &noMITShmExtension}, +#ifdef DBE + {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension}, #endif -#ifdef RANDR - {"RANDR", &noRRExtension}, +#ifdef XRECORD + {RecordExtensionInit, "RECORD", &noTestExtensions}, #endif - {"RENDER", &noRenderExtension}, -#ifdef XCSECURITY - {"SECURITY", &noSecurityExtension}, +#ifdef DPMSExtension + {DPMSExtensionInit, "DPMS", &noDPMSExtension}, +#endif +#ifdef PRESENT + {present_extension_init, "Present", NULL}, +#endif +#ifdef DRI3 + {dri3_extension_init, "DRI3", NULL}, #endif #ifdef RES - {"X-Resource", &noResExtension}, + {ResExtensionInit, "X-Resource", &noResExtension}, #endif -#ifdef XF86BIGFONT - {"XFree86-Bigfont", &noXFree86BigfontExtension}, -#endif -#ifdef XORGSERVER -#ifdef XFreeXDGA - {"XFree86-DGA", &noXFree86DGAExtension}, -#endif -#ifdef XF86DRI - {"XFree86-DRI", &noXFree86DRIExtension}, -#endif -#ifdef XF86VIDMODE - {"XFree86-VidModeExtension", &noXFree86VidModeExtension}, -#endif -#endif - {"XFIXES", &noXFixesExtension}, -#ifdef PANORAMIX - {"XINERAMA", &noPanoramiXExtension}, -#endif - {"XInputExtension", NULL}, - {"XKEYBOARD", NULL}, -#ifdef XSELINUX - {"SELinux", &noSELinuxExtension}, -#endif - {"XTEST", &noTestExtensions}, #ifdef XV - {"XVideo", &noXvExtension}, + {XvExtensionInit, "XVideo", &noXvExtension}, + {XvMCExtensionInit, "XVideo-MotionCompensation", &noXvExtension}, +#endif +#ifdef XSELINUX + {SELinuxExtensionInit, "SELinux", &noSELinuxExtension}, +#endif +#ifdef GLXEXT + {GlxExtensionInit, "GLX", &noGlxExtension}, #endif }; Bool EnableDisableExtension(const char *name, Bool enable) { - ExtensionToggle *ext; + const ExtensionModule *ext; int i; - for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { - ext = &ExtensionToggleList[i]; - if (strcmp(name, ext->name) == 0) { + for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) { + ext = &staticExtensions[i]; + if (strcasecmp(name, ext->name) == 0) { if (ext->disablePtr != NULL) { *ext->disablePtr = !enable; return TRUE; @@ -212,12 +209,12 @@ EnableDisableExtension(const char *name, Bool enable) void EnableDisableExtensionError(const char *name, Bool enable) { - ExtensionToggle *ext; + const ExtensionModule *ext; int i; Bool found = FALSE; - for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { - ext = &ExtensionToggleList[i]; + for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) { + ext = &staticExtensions[i]; if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) { ErrorF("[mi] Extension \"%s\" can not be disabled\n", name); found = TRUE; @@ -228,86 +225,14 @@ EnableDisableExtensionError(const char *name, Bool enable) ErrorF("[mi] Extension \"%s\" is not recognized\n", name); ErrorF("[mi] Only the following extensions can be run-time %s:\n", enable ? "enabled" : "disabled"); - for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { - ext = &ExtensionToggleList[i]; + for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) { + ext = &staticExtensions[i]; if (ext->disablePtr != NULL) { ErrorF("[mi] %s\n", ext->name); } } } -/* List of built-in (statically linked) extensions */ -static const ExtensionModule staticExtensions[] = { - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, -#ifdef MITSHM - {ShmExtensionInit, SHMNAME, &noMITShmExtension}, -#endif - {XInputExtensionInit, "XInputExtension", NULL}, -#ifdef XTEST - {XTestExtensionInit, XTestExtensionName, &noTestExtensions}, -#endif - {BigReqExtensionInit, "BIG-REQUESTS", NULL}, - {SyncExtensionInit, "SYNC", NULL}, - {XkbExtensionInit, XkbName, NULL}, - {XCMiscExtensionInit, "XC-MISC", NULL}, -#ifdef XCSECURITY - {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension}, -#endif -#ifdef PANORAMIX - {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension}, -#endif -#ifdef INXQUARTZ - /* PseudoramiXExtensionInit must be done before RRExtensionInit, or - * XQuartz will render windows offscreen. - */ - {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, -#endif - /* must be before Render to layer DisplayCursor correctly */ - {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, -#ifdef XF86BIGFONT - {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension}, -#endif - {RenderExtensionInit, "RENDER", &noRenderExtension}, -#ifdef RANDR - {RRExtensionInit, "RANDR", &noRRExtension}, -#endif -#ifdef COMPOSITE - {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension}, -#endif -#ifdef DAMAGE - {DamageExtensionInit, "DAMAGE", &noDamageExtension}, -#endif -#ifdef SCREENSAVER - {ScreenSaverExtensionInit, ScreenSaverName, &noScreenSaverExtension}, -#endif -#ifdef DBE - {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension}, -#endif -#ifdef XRECORD - {RecordExtensionInit, "RECORD", &noTestExtensions}, -#endif -#ifdef DPMSExtension - {DPMSExtensionInit, DPMSExtensionName, &noDPMSExtension}, -#endif -#ifdef PRESENT - {present_extension_init, PRESENT_NAME, NULL}, -#endif -#ifdef DRI3 - {dri3_extension_init, DRI3_NAME, NULL}, -#endif -#ifdef RES - {ResExtensionInit, XRES_NAME, &noResExtension}, -#endif -#ifdef XV - {XvExtensionInit, XvName, &noXvExtension}, - {XvMCExtensionInit, XvMCName, &noXvExtension}, -#endif -#ifdef XSELINUX - {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension}, -#endif -}; - static ExtensionModule *ExtensionModuleList = NULL; static int numExtensionModules = 0; @@ -336,6 +261,9 @@ InitExtensions(int argc, char *argv[]) ext = &ExtensionModuleList[i]; if (ext->initFunc != NULL && (ext->disablePtr == NULL || !*ext->disablePtr)) { + LogMessageVerb(X_INFO, 3, "Initializing extension %s\n", + ext->name); + (ext->initFunc) (); } } diff --git a/xserver/mi/misprite.c b/xserver/mi/misprite.c index e682b243a..add2c5505 100644 --- a/xserver/mi/misprite.c +++ b/xserver/mi/misprite.c @@ -59,8 +59,6 @@ typedef struct { BoxRec saved; /* saved area from the screen */ Bool isUp; /* cursor in frame buffer */ Bool shouldBeUp; /* cursor should be displayed */ - WindowPtr pCacheWin; /* window the cursor last seen in */ - Bool isInCacheWin; Bool checkPixels; /* check colormap collision */ ScreenPtr pScreen; } miCursorInfoRec, *miCursorInfoPtr; @@ -137,10 +135,24 @@ typedef struct { #define SPRITE_DEBUG(x) #endif -#define MISPRITE(dev) \ - (IsFloating(dev) ? \ - (miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \ - (miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey)) +static DevPrivateKeyRec miSpriteScreenKeyRec; +static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; + +static miSpriteScreenPtr +GetSpriteScreen(ScreenPtr pScreen) +{ + return dixLookupPrivate(&pScreen->devPrivates, &miSpriteScreenKeyRec); +} + +static miCursorInfoPtr +GetSprite(DeviceIntPtr dev) +{ + if (IsFloating(dev)) + return dixLookupPrivate(&dev->devPrivates, &miSpriteDevPrivatesKeyRec); + + return dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, + &miSpriteDevPrivatesKeyRec); +} static void miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) @@ -177,15 +189,6 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor) * screen wrappers */ -static DevPrivateKeyRec miSpriteScreenKeyRec; - -#define miSpriteScreenKey (&miSpriteScreenKeyRec) -#define GetSpriteScreen(pScreen) \ - (dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey)) -static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; - -#define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec) - static Bool miSpriteCloseScreen(ScreenPtr pScreen); static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, @@ -261,7 +264,7 @@ miSpriteReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure) for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && @@ -334,7 +337,7 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) pScreenPriv->damageRegistered = 0; pScreenPriv->numberOfCursors = 0; - dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv); + dixSetPrivate(&pScreen->devPrivates, &miSpriteScreenKeyRec, pScreenPriv); pScreen->CloseScreen = miSpriteCloseScreen; pScreen->GetImage = miSpriteGetImage; @@ -390,7 +393,7 @@ miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, sx, sy, w, h)) { @@ -420,7 +423,7 @@ miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) { DDXPointPtr pts; @@ -464,7 +467,7 @@ miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width, if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, x, y, width, height)) { @@ -494,7 +497,7 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); /* * Damage will take care of destination check */ @@ -522,7 +525,7 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *timeout) for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo && !pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) { SPRITE_DEBUG(("BlockHandler save")); @@ -532,7 +535,7 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *timeout) } for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursorInfo && !pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) { SPRITE_DEBUG(("BlockHandler restore\n")); @@ -571,7 +574,7 @@ miSpriteInstallColormap(ColormapPtr pMap) for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); pCursorInfo->checkPixels = TRUE; if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) miSpriteRemoveCursor(pDev, pScreen); @@ -641,7 +644,7 @@ miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef) if (updated) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); pCursorInfo->checkPixels = TRUE; if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) miSpriteRemoveCursor(pDev, pScreen); @@ -700,7 +703,7 @@ miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) if (IsFloating(pDev)) return FALSE; - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); if (pCursor == pCursorInfo->pCursor) pCursorInfo->checkPixels = TRUE; @@ -724,7 +727,7 @@ miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, if (IsFloating(pDev)) return; - pPointer = MISPRITE(pDev); + pPointer = GetSprite(pDev); pScreenPriv = GetSpriteScreen(pScreen); if (!pCursor) { @@ -750,7 +753,6 @@ miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, } pPointer->x = x; pPointer->y = y; - pPointer->pCacheWin = NullWindow; if (pPointer->checkPixels || pPointer->pCursor != pCursor) { pPointer->pCursor = pCursor; miSpriteFindColors(pPointer, pScreen); @@ -777,7 +779,7 @@ miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) if (IsFloating(pDev)) return; - pCursor = MISPRITE(pDev)->pCursor; + pCursor = GetSprite(pDev)->pCursor; miSpriteSetCursor(pDev, pScreen, pCursor, x, y); } @@ -791,14 +793,12 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) miCursorInfoPtr pCursorInfo; pCursorInfo = - dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); + dixLookupPrivate(&pDev->devPrivates, &miSpriteDevPrivatesKeyRec); pCursorInfo->pCursor = NULL; pCursorInfo->x = 0; pCursorInfo->y = 0; pCursorInfo->isUp = FALSE; pCursorInfo->shouldBeUp = FALSE; - pCursorInfo->pCacheWin = NullWindow; - pCursorInfo->isInCacheWin = FALSE; pCursorInfo->checkPixels = TRUE; pCursorInfo->pScreen = FALSE; } @@ -810,7 +810,7 @@ static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { miCursorInfoPtr pCursorInfo = - dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); + dixLookupPrivate(&pDev->devPrivates, &miSpriteDevPrivatesKeyRec); if (DevHasCursor(pDev)) miDCDeviceCleanup(pDev, pScreen); @@ -833,11 +833,10 @@ miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen) DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); miSpriteIsDown(pCursorInfo); miSpriteRegisterBlockHandler(pScreen, pScreenPriv); - pCursorInfo->pCacheWin = NullWindow; miSpriteDisableDamage(pScreen, pScreenPriv); if (!miDCRestoreUnderCursor(pDev, pScreen, @@ -869,7 +868,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); miSpriteComputeSaved(pDev, pScreen); @@ -905,7 +904,7 @@ miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen) DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); miSpriteComputeSaved(pDev, pScreen); pCursor = pCursorInfo->pCursor; @@ -942,7 +941,7 @@ miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen) if (IsFloating(pDev)) return; - pCursorInfo = MISPRITE(pDev); + pCursorInfo = GetSprite(pDev); pCursor = pCursorInfo->pCursor; x = pCursorInfo->x - (int) pCursor->bits->xhot; diff --git a/xserver/miext/Makefile.in b/xserver/miext/Makefile.in index 5f6fc5aaa..49f60978d 100644 --- a/xserver/miext/Makefile.in +++ b/xserver/miext/Makefile.in @@ -66,7 +66,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -313,6 +313,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -331,15 +332,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -347,6 +351,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -418,8 +424,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/miext/damage/Makefile.in b/xserver/miext/damage/Makefile.in index 73c5a01b5..e6ab15f3c 100644 --- a/xserver/miext/damage/Makefile.in +++ b/xserver/miext/damage/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -338,6 +338,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -356,15 +357,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -372,6 +376,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -443,8 +449,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/miext/damage/damage.c b/xserver/miext/damage/damage.c index 2fae03fc2..f3ae4ebbc 100644 --- a/xserver/miext/damage/damage.c +++ b/xserver/miext/damage/damage.c @@ -829,16 +829,36 @@ damagePolyPoint(DrawablePtr pDrawable, /* this could be slow if the points were spread out */ - while (--nptTmp) { - pptTmp++; - if (box.x1 > pptTmp->x) - box.x1 = pptTmp->x; - else if (box.x2 < pptTmp->x) - box.x2 = pptTmp->x; - if (box.y1 > pptTmp->y) - box.y1 = pptTmp->y; - else if (box.y2 < pptTmp->y) - box.y2 = pptTmp->y; + if (mode == CoordModePrevious) { + int x = box.x1; + int y = box.y1; + + while (--nptTmp) { + pptTmp++; + x += pptTmp->x; + y += pptTmp->y; + if (box.x1 > x) + box.x1 = x; + else if (box.x2 < x) + box.x2 = x; + if (box.y1 > y) + box.y1 = y; + else if (box.y2 < y) + box.y2 = y; + } + } + else { + while (--nptTmp) { + pptTmp++; + if (box.x1 > pptTmp->x) + box.x1 = pptTmp->x; + else if (box.x2 < pptTmp->x) + box.x2 = pptTmp->x; + if (box.y1 > pptTmp->y) + box.y1 = pptTmp->y; + else if (box.y2 < pptTmp->y) + box.y2 = pptTmp->y; + } } box.x2++; @@ -1696,7 +1716,7 @@ DamageCreate(DamageReportFunc damageReport, damageScrPriv(pScreen); DamagePtr pDamage; - pDamage = dixAllocateObjectWithPrivates(DamageRec, PRIVATE_DAMAGE); + pDamage = calloc(1, sizeof(DamageRec)); if (!pDamage) return 0; pDamage->pNext = 0; @@ -1821,7 +1841,7 @@ DamageDestroy(DamagePtr pDamage) (*pScrPriv->funcs.Destroy) (pDamage); RegionUninit(&pDamage->damage); RegionUninit(&pDamage->pendingDamage); - dixFreeObjectWithPrivates(pDamage, PRIVATE_DAMAGE); + free(pDamage); } Bool diff --git a/xserver/miext/damage/damagestr.h b/xserver/miext/damage/damagestr.h index 278615634..0d07872e5 100644 --- a/xserver/miext/damage/damagestr.h +++ b/xserver/miext/damage/damagestr.h @@ -49,7 +49,6 @@ typedef struct _damage { Bool reportAfter; RegionRec pendingDamage; /* will be flushed post submission at the latest */ ScreenPtr pScreen; - PrivateRec *devPrivates; } DamageRec; typedef struct _damageScrPriv { diff --git a/xserver/miext/rootless/Makefile.in b/xserver/miext/rootless/Makefile.in index 164e7a19f..e933848bb 100644 --- a/xserver/miext/rootless/Makefile.in +++ b/xserver/miext/rootless/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -308,6 +308,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -326,15 +327,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -342,6 +346,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -413,8 +419,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/miext/shadow/Makefile.am b/xserver/miext/shadow/Makefile.am index 27cf41422..dabbf038c 100644 --- a/xserver/miext/shadow/Makefile.am +++ b/xserver/miext/shadow/Makefile.am @@ -10,9 +10,9 @@ libshadow_la_SOURCES = \ c2p_core.h \ shadow.c \ shadow.h \ + sh3224.c \ shafb4.c \ shafb8.c \ - shalloc.c \ shiplan2p4.c \ shiplan2p8.c \ shpacked.c \ diff --git a/xserver/miext/shadow/Makefile.in b/xserver/miext/shadow/Makefile.in index 2d923e799..74d19011d 100644 --- a/xserver/miext/shadow/Makefile.in +++ b/xserver/miext/shadow/Makefile.in @@ -69,13 +69,13 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libshadow_la_LIBADD = -am_libshadow_la_OBJECTS = shadow.lo shafb4.lo shafb8.lo shalloc.lo \ +am_libshadow_la_OBJECTS = shadow.lo sh3224.lo shafb4.lo shafb8.lo \ shiplan2p4.lo shiplan2p8.lo shpacked.lo shplanar8.lo \ shplanar.lo shrot16pack_180.lo shrot16pack_270.lo \ shrot16pack_270YX.lo shrot16pack_90.lo shrot16pack_90YX.lo \ @@ -344,6 +344,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -362,15 +363,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -378,6 +382,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -449,8 +455,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -522,9 +526,9 @@ libshadow_la_SOURCES = \ c2p_core.h \ shadow.c \ shadow.h \ + sh3224.c \ shafb4.c \ shafb8.c \ - shalloc.c \ shiplan2p4.c \ shiplan2p8.c \ shpacked.c \ @@ -602,10 +606,10 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh3224.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shafb4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shafb8.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shiplan2p4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shiplan2p8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shpacked.Plo@am__quote@ diff --git a/xserver/hw/xfree86/drivers/modesetting/sh3224.c b/xserver/miext/shadow/sh3224.c similarity index 95% rename from xserver/hw/xfree86/drivers/modesetting/sh3224.c rename to xserver/miext/shadow/sh3224.c index a64a1031e..5d8f27482 100644 --- a/xserver/hw/xfree86/drivers/modesetting/sh3224.c +++ b/xserver/miext/shadow/sh3224.c @@ -1,5 +1,4 @@ /* - * * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -25,10 +24,9 @@ #include "dix-config.h" #endif -#include "shadow.h" -#include "fb.h" +#include "shadow.h" +#include "fb.h" -#include "sh3224.h" #define Get8(a) ((CARD32) READ(a)) #if BITMAP_BIT_ORDER == MSBFirst @@ -100,9 +98,9 @@ sh24_32BltLine(CARD8 *srcLine, } void -ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf) +shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shadow.c b/xserver/miext/shadow/shadow.c index b8e23dae6..529402d6e 100644 --- a/xserver/miext/shadow/shadow.c +++ b/xserver/miext/shadow/shadow.c @@ -37,9 +37,12 @@ #include "shadow.h" static DevPrivateKeyRec shadowScrPrivateKeyRec; - #define shadowScrPrivateKey (&shadowScrPrivateKeyRec) +#define shadowGetBuf(pScr) ((shadowBufPtr) \ + dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey)) +#define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr) + #define wrap(priv, real, mem) {\ priv->mem = real->mem; \ real->mem = shadow##mem; \ diff --git a/xserver/miext/shadow/shadow.h b/xserver/miext/shadow/shadow.h index 7f22169dc..c08e1537c 100644 --- a/xserver/miext/shadow/shadow.h +++ b/xserver/miext/shadow/shadow.h @@ -68,13 +68,6 @@ typedef struct _shadowBuf { #define SHADOW_REFLECT_Y 32 #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y) -extern _X_EXPORT DevPrivateKey shadowScrPrivateKey; - -#define shadowGetBuf(pScr) ((shadowBufPtr) \ - dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey)) -#define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr) -#define shadowDamage(pBuf) DamageRegion(pBuf->pDamage) - extern _X_EXPORT Bool shadowSetup(ScreenPtr pScreen); @@ -88,8 +81,6 @@ shadowAdd(ScreenPtr pScreen, extern _X_EXPORT void shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap); -extern _X_EXPORT void *shadowAlloc(int width, int height, int bpp); - extern _X_EXPORT void shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf); @@ -156,11 +147,9 @@ extern _X_EXPORT void extern _X_EXPORT void shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf); +extern _X_EXPORT void + shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); + typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr); -extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void); -extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void); -extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void); -extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void); - #endif /* _SHADOW_H_ */ diff --git a/xserver/miext/shadow/shafb4.c b/xserver/miext/shadow/shafb4.c index d88ae1c2c..ae59e2d32 100644 --- a/xserver/miext/shadow/shafb4.c +++ b/xserver/miext/shadow/shafb4.c @@ -80,7 +80,7 @@ static inline void store_afb4(void *dst, unsigned int stride, void shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shafb8.c b/xserver/miext/shadow/shafb8.c index 8d84bfa01..d2b73fc64 100644 --- a/xserver/miext/shadow/shafb8.c +++ b/xserver/miext/shadow/shafb8.c @@ -84,7 +84,7 @@ static inline void store_afb8(void *dst, unsigned int stride, void shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shalloc.c b/xserver/miext/shadow/shalloc.c deleted file mode 100644 index 6a79085c4..000000000 --- a/xserver/miext/shadow/shalloc.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2000 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include -#include "dixfontstr.h" -#include -#include "mi.h" -#include "regionstr.h" -#include "globals.h" -#include "gcstruct.h" -#include "shadow.h" - -void * -shadowAlloc(int width, int height, int bpp) -{ - int stride; - void *fb; - - /* Cant use PixmapBytePad -- the structure is probably not initialized yet */ - stride = BitmapBytePad(width * bpp); - fb = xallocarray(stride, height); - return fb; -} diff --git a/xserver/miext/shadow/shiplan2p4.c b/xserver/miext/shadow/shiplan2p4.c index 0e46bae7a..f37c58d71 100644 --- a/xserver/miext/shadow/shiplan2p4.c +++ b/xserver/miext/shadow/shiplan2p4.c @@ -78,7 +78,7 @@ static inline void store_iplan2p4(void *dst, const CARD32 d[2]) void shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shiplan2p8.c b/xserver/miext/shadow/shiplan2p8.c index 17d6a132e..44cb8d336 100644 --- a/xserver/miext/shadow/shiplan2p8.c +++ b/xserver/miext/shadow/shiplan2p8.c @@ -79,7 +79,7 @@ static inline void store_iplan2p8(void *dst, const CARD32 d[4]) void shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shpacked.c b/xserver/miext/shadow/shpacked.c index 5ef18f86d..5220854c1 100644 --- a/xserver/miext/shadow/shpacked.c +++ b/xserver/miext/shadow/shpacked.c @@ -43,7 +43,7 @@ void shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); @@ -107,9 +107,3 @@ shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) pbox++; } } - -shadowUpdateProc -shadowUpdatePackedWeak(void) -{ - return shadowUpdatePacked; -} diff --git a/xserver/miext/shadow/shplanar.c b/xserver/miext/shadow/shplanar.c index 4f6542cb6..92c7971d2 100644 --- a/xserver/miext/shadow/shplanar.c +++ b/xserver/miext/shadow/shplanar.c @@ -89,7 +89,7 @@ void shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); @@ -166,15 +166,3 @@ shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf) pbox++; } } - -shadowUpdateProc -shadowUpdatePlanar4Weak(void) -{ - return shadowUpdatePlanar4; -} - -shadowUpdateProc -shadowUpdatePlanar4x8Weak(void) -{ - return shadowUpdatePlanar4x8; -} diff --git a/xserver/miext/shadow/shplanar8.c b/xserver/miext/shadow/shplanar8.c index 214fa9aac..412335940 100644 --- a/xserver/miext/shadow/shplanar8.c +++ b/xserver/miext/shadow/shplanar8.c @@ -92,7 +92,7 @@ void shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shrotate.c b/xserver/miext/shadow/shrotate.c index a0fc4ec4e..174553788 100644 --- a/xserver/miext/shadow/shrotate.c +++ b/xserver/miext/shadow/shrotate.c @@ -51,7 +51,7 @@ void shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); @@ -296,9 +296,3 @@ shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) } } } - -shadowUpdateProc -shadowUpdateRotatePackedWeak(void) -{ - return shadowUpdateRotatePacked; -} diff --git a/xserver/miext/shadow/shrotpack.h b/xserver/miext/shadow/shrotpack.h index b1cb30d5c..4814991f0 100644 --- a/xserver/miext/shadow/shrotpack.h +++ b/xserver/miext/shadow/shrotpack.h @@ -96,7 +96,7 @@ void FUNC(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/shadow/shrotpackYX.h b/xserver/miext/shadow/shrotpackYX.h index f3df6c549..3c5b3a122 100644 --- a/xserver/miext/shadow/shrotpackYX.h +++ b/xserver/miext/shadow/shrotpackYX.h @@ -56,7 +56,7 @@ void FUNC(ScreenPtr pScreen, shadowBufPtr pBuf) { - RegionPtr damage = shadowDamage(pBuf); + RegionPtr damage = DamageRegion(pBuf->pDamage); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in index 0dee79952..1896109c4 100644 --- a/xserver/miext/sync/Makefile.in +++ b/xserver/miext/sync/Makefile.in @@ -70,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -343,6 +343,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -361,15 +362,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -377,6 +381,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -448,8 +454,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/miext/sync/misync.c b/xserver/miext/sync/misync.c index 3d03d1b59..490fa0b17 100644 --- a/xserver/miext/sync/misync.c +++ b/xserver/miext/sync/misync.c @@ -127,16 +127,13 @@ void miSyncTriggerFence(SyncFence * pFence) { SyncTriggerList *ptl, *pNext; - CARD64 unused; pFence->funcs.SetTriggered(pFence); - XSyncIntToValue(&unused, 0L); - /* run through triggers to see if any fired */ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { pNext = ptl->next; - if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, unused)) + if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, 0)) (*ptl->pTrigger->TriggerFired) (ptl->pTrigger); } } diff --git a/xserver/miext/sync/misyncstr.h b/xserver/miext/sync/misyncstr.h index ad69e8eca..2eab2aa57 100644 --- a/xserver/miext/sync/misyncstr.h +++ b/xserver/miext/sync/misyncstr.h @@ -28,13 +28,12 @@ #ifndef _MISYNCSTR_H_ #define _MISYNCSTR_H_ +#include #include "dix.h" #include "misync.h" #include "scrnintstr.h" #include -#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */ - /* Sync object types */ #define SYNC_COUNTER 0 #define SYNC_FENCE 1 @@ -49,8 +48,8 @@ typedef struct _SyncObject { typedef struct _SyncCounter { SyncObject sync; /* Common sync object data */ - CARD64 value; /* counter value */ - struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */ + int64_t value; /* counter value */ + struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */ } SyncCounter; struct _SyncFence { @@ -63,17 +62,14 @@ struct _SyncFence { struct _SyncTrigger { SyncObject *pSync; - CARD64 wait_value; /* wait value */ + int64_t wait_value; /* wait value */ unsigned int value_type; /* Absolute or Relative */ unsigned int test_type; /* transition or Comparision type */ - CARD64 test_value; /* trigger event threshold value */ - Bool (*CheckTrigger) (struct _SyncTrigger * /*pTrigger */ , - CARD64 /*newval */ - ); - void (*TriggerFired) (struct _SyncTrigger * /*pTrigger */ - ); - void (*CounterDestroyed) (struct _SyncTrigger * /*pTrigger */ - ); + int64_t test_value; /* trigger event threshold value */ + Bool (*CheckTrigger)(struct _SyncTrigger *pTrigger, + int64_t newval); + void (*TriggerFired)(struct _SyncTrigger *pTrigger); + void (*CounterDestroyed)(struct _SyncTrigger *pTrigger); }; typedef struct _SyncTriggerList { diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in index 2589f56c7..a9089ae6b 100644 --- a/xserver/os/Makefile.in +++ b/xserver/os/Makefile.in @@ -78,7 +78,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -345,6 +345,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -363,15 +364,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -379,6 +383,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -450,8 +456,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/os/WaitFor.c b/xserver/os/WaitFor.c index 613608faf..dc33c1648 100644 --- a/xserver/os/WaitFor.c +++ b/xserver/os/WaitFor.c @@ -90,24 +90,6 @@ SOFTWARE. #define GetErrno() errno #endif -/* like ffs, but uses fd_mask instead of int as argument, so it works - when fd_mask is longer than an int, such as common 64-bit platforms */ -/* modifications by raphael */ -int -mffs(fd_mask mask) -{ - int i; - - if (!mask) - return 0; - i = 1; - while (!(mask & 1)) { - i++; - mask >>= 1; - } - return i; -} - #ifdef DPMSExtension #include #endif @@ -208,13 +190,13 @@ WaitForSomething(Bool are_ready) /* deal with any blocked jobs */ if (workQueue) { ProcessWorkQueue(); - are_ready = clients_are_ready(); } + timeout = check_timers(); + are_ready = clients_are_ready(); + if (are_ready) timeout = 0; - else - timeout = check_timers(); BlockHandler(&timeout); if (NewOutputPending) diff --git a/xserver/os/auth.c b/xserver/os/auth.c index c7b333ca2..d3254349d 100644 --- a/xserver/os/auth.c +++ b/xserver/os/auth.c @@ -42,6 +42,7 @@ from The Open Group. #include "dixstruct.h" #include #include +#include #ifdef WIN32 #include #endif @@ -90,8 +91,7 @@ static struct protocol protocols[] = { #endif }; -#define NUM_AUTHORIZATION (sizeof (protocols) /\ - sizeof (struct protocol)) +#define NUM_AUTHORIZATION ARRAY_SIZE(protocols) /* * Initialize all classes of authorization by reading the @@ -120,9 +120,15 @@ LoadAuthorization(void) if (!authorization_file) return 0; + errno = 0; f = Fopen(authorization_file, "r"); - if (!f) + if (!f) { + LogMessageVerb(X_ERROR, 0, + "Failed to open authorization file \"%s\": %s\n", + authorization_file, + errno != 0 ? strerror(errno) : "Unknown error"); return -1; + } while ((auth = XauReadAuth(f)) != 0) { for (i = 0; i < NUM_AUTHORIZATION; i++) { @@ -302,6 +308,8 @@ GenerateAuthorization(unsigned name_length, return -1; } +#endif /* XCSECURITY */ + void GenerateRandomData(int len, char *buf) { @@ -315,5 +323,3 @@ GenerateRandomData(int len, char *buf) close(fd); #endif } - -#endif /* XCSECURITY */ diff --git a/xserver/os/backtrace.c b/xserver/os/backtrace.c index 9e3e38edf..619bf145e 100644 --- a/xserver/os/backtrace.c +++ b/xserver/os/backtrace.c @@ -78,6 +78,7 @@ xorg_backtrace(void) break; } + off = 0; ret = unw_get_proc_name(&cursor, procname, 256, &off); if (ret && ret != -UNW_ENOMEM) { if (ret != -UNW_EUNSPEC) diff --git a/xserver/os/client.c b/xserver/os/client.c index ef5e3935d..213492d6c 100644 --- a/xserver/os/client.c +++ b/xserver/os/client.c @@ -142,45 +142,7 @@ DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) if (pid == -1) return; -#ifdef __sun /* Solaris */ - /* Solaris does not support /proc/pid/cmdline, but makes information - * similar to what ps shows available in a binary structure in the - * /proc/pid/psinfo file. */ - if (snprintf(path, sizeof(path), "/proc/%d/psinfo", pid) < 0) - return; - fd = open(path, O_RDONLY); - if (fd < 0) { - ErrorF("Failed to open %s: %s\n", path, strerror(errno)); - return; - } - else { - psinfo_t psinfo = { 0 }; - char *sp; - - totsize = read(fd, &psinfo, sizeof(psinfo_t)); - close(fd); - if (totsize <= 0) - return; - - /* pr_psargs is the first PRARGSZ (80) characters of the command - * line string - assume up to the first space is the command name, - * since it's not delimited. While there is also pr_fname, that's - * more limited, giving only the first 16 chars of the basename of - * the file that was exec'ed, thus cutting off many long gnome - * command names, or returning "isapython2.6" for all python scripts. - */ - psinfo.pr_psargs[PRARGSZ - 1] = '\0'; - sp = strchr(psinfo.pr_psargs, ' '); - if (sp) - *sp++ = '\0'; - - if (cmdname) - *cmdname = strdup(psinfo.pr_psargs); - - if (cmdargs && sp) - *cmdargs = strdup(sp); - } -#elif defined(__OpenBSD__) +#if defined(__OpenBSD__) /* on OpenBSD use kvm_getargv() */ { kvm_t *kd; @@ -221,7 +183,11 @@ DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) return; fd = open(path, O_RDONLY); if (fd < 0) +#ifdef __sun + goto fallback; +#else return; +#endif /* Read the contents of /proc/pid/cmdline. It should contain the * process name and arguments. */ @@ -256,6 +222,48 @@ DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) *cmdargs = args; } } + return; +#endif + +#ifdef __sun /* Solaris */ + fallback: + /* Solaris prior to 11.3.5 does not support /proc/pid/cmdline, but + * makes information similar to what ps shows available in a binary + * structure in the /proc/pid/psinfo file. */ + if (snprintf(path, sizeof(path), "/proc/%d/psinfo", pid) < 0) + return; + fd = open(path, O_RDONLY); + if (fd < 0) { + ErrorF("Failed to open %s: %s\n", path, strerror(errno)); + return; + } + else { + psinfo_t psinfo = { 0 }; + char *sp; + + totsize = read(fd, &psinfo, sizeof(psinfo_t)); + close(fd); + if (totsize <= 0) + return; + + /* pr_psargs is the first PRARGSZ (80) characters of the command + * line string - assume up to the first space is the command name, + * since it's not delimited. While there is also pr_fname, that's + * more limited, giving only the first 16 chars of the basename of + * the file that was exec'ed, thus cutting off many long gnome + * command names, or returning "isapython2.6" for all python scripts. + */ + psinfo.pr_psargs[PRARGSZ - 1] = '\0'; + sp = strchr(psinfo.pr_psargs, ' '); + if (sp) + *sp++ = '\0'; + + if (cmdname) + *cmdname = strdup(psinfo.pr_psargs); + + if (cmdargs && sp) + *cmdargs = strdup(sp); + } #endif } diff --git a/xserver/os/connection.c b/xserver/os/connection.c index 862f6c622..3a083c01c 100644 --- a/xserver/os/connection.c +++ b/xserver/os/connection.c @@ -142,96 +142,6 @@ set_poll_client(ClientPtr client); static void set_poll_clients(void); -#if !defined(WIN32) -int *ConnectionTranslation = NULL; -int ConnectionTranslationSize = 0; -#else -/* - * On NT fds are not small integers, they are unrelated, and there is - * not even a known maximum value, so use something quite arbitrary for now. - * Do storage is a hash table of size 256. Collisions are handled in a linked - * list. - */ - -struct _ct_node { - struct _ct_node *next; - int key; - int value; -}; - -struct _ct_node *ct_head[256]; - -void -InitConnectionTranslation(void) -{ - memset(ct_head, 0, sizeof(ct_head)); -} - -int -GetConnectionTranslation(int conn) -{ - struct _ct_node *node = ct_head[conn & 0xff]; - - while (node != NULL) { - if (node->key == conn) - return node->value; - node = node->next; - } - return 0; -} - -void -SetConnectionTranslation(int conn, int client) -{ - struct _ct_node **node = ct_head + (conn & 0xff); - - if (client == 0) { /* remove entry */ - while (*node != NULL) { - if ((*node)->key == conn) { - struct _ct_node *temp = *node; - - *node = (*node)->next; - free(temp); - return; - } - node = &((*node)->next); - } - return; - } - else { - while (*node != NULL) { - if ((*node)->key == conn) { - (*node)->value = client; - return; - } - node = &((*node)->next); - } - *node = malloc(sizeof(struct _ct_node)); - (*node)->next = NULL; - (*node)->key = conn; - (*node)->value = client; - return; - } -} - -void -ClearConnectionTranslation(void) -{ - unsigned i; - - for (i = 0; i < 256; i++) { - struct _ct_node *node = ct_head[i]; - - while (node != NULL) { - struct _ct_node *temp = node; - - node = node->next; - free(temp); - } - } -} -#endif - static XtransConnInfo *ListenTransConns = NULL; static int *ListenTransFds = NULL; static int ListenTransCount; @@ -252,7 +162,7 @@ lookup_trans_conn(int fd) return NULL; } -/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ +/* Set MaxClients */ void InitConnectionLimits(void) @@ -262,15 +172,6 @@ InitConnectionLimits(void) #ifdef DEBUG ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); #endif - -#if !defined(WIN32) - if (!ConnectionTranslation) { - ConnectionTranslation = xnfallocarray(MaxClients, sizeof(int)); - ConnectionTranslationSize = MaxClients; - } -#else - InitConnectionTranslation(); -#endif } /* @@ -352,13 +253,6 @@ CreateWellKnownSockets(void) int i; int partial; -#if !defined(WIN32) - for (i = 0; i < ConnectionTranslationSize; i++) - ConnectionTranslation[i] = 0; -#else - ClearConnectionTranslation(); -#endif - /* display is initialized to "0" by main(). It is then set to the display * number if specified on the command line. */ @@ -744,15 +638,6 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) return NullClient; } client->local = ComputeLocalClient(client); -#if !defined(WIN32) - if (fd >= ConnectionTranslationSize) { - ConnectionTranslationSize *= 2; - ConnectionTranslation = xnfreallocarray(ConnectionTranslation, ConnectionTranslationSize, sizeof (int)); - } - ConnectionTranslation[fd] = client->index; -#else - SetConnectionTranslation(fd, client->index); -#endif ospoll_add(server_poll, fd, ospoll_trigger_edge, ClientReady, @@ -788,7 +673,6 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure) OsCommPtr oc; XtransConnInfo trans_conn, new_trans_conn; int status; - int clientid; connect_time = GetTimeInMillis(); /* kill off stragglers */ @@ -810,10 +694,6 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure) newconn = _XSERVTransGetConnectionNumber(new_trans_conn); - clientid = GetConnectionTranslation(newconn); - if (clientid && (client = clients[clientid])) - CloseDownClient(client); - _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); if (trans_conn->flags & TRANS_NOXAUTH) @@ -884,24 +764,23 @@ ErrorConnMax(XtransConnInfo trans_conn) /************ * CloseDownFileDescriptor: - * Remove this file descriptor and it's I/O buffers, etc. + * Remove this file descriptor ************/ -static void +void CloseDownFileDescriptor(OsCommPtr oc) { - int connection = oc->fd; - if (oc->trans_conn) { + int connection = oc->fd; +#ifdef XDMCP + XdmcpCloseDisplay(connection); +#endif + ospoll_remove(server_poll, connection); _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); + oc->trans_conn = NULL; + oc->fd = -1; } -#ifndef WIN32 - ConnectionTranslation[connection] = 0; -#else - SetConnectionTranslation(connection, 0); -#endif - ospoll_remove(server_poll, connection); } /***************** @@ -919,9 +798,6 @@ CloseDownConnection(ClientPtr client) if (oc->output) FlushClient(client, oc, (char *) NULL, 0); -#ifdef XDMCP - XdmcpCloseDisplay(oc->fd); -#endif CloseDownFileDescriptor(oc); FreeOsBuffers(oc); free(client->osPrivate); @@ -1216,10 +1092,12 @@ set_poll_client(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - if (listen_to_client(client)) - ospoll_listen(server_poll, oc->fd, X_NOTIFY_READ); - else - ospoll_mute(server_poll, oc->fd, X_NOTIFY_READ); + if (oc->trans_conn) { + if (listen_to_client(client)) + ospoll_listen(server_poll, oc->trans_conn->fd, X_NOTIFY_READ); + else + ospoll_mute(server_poll, oc->trans_conn->fd, X_NOTIFY_READ); + } } static void diff --git a/xserver/os/inputthread.c b/xserver/os/inputthread.c index dc4eb9f20..97e59d21f 100644 --- a/xserver/os/inputthread.c +++ b/xserver/os/inputthread.c @@ -410,6 +410,8 @@ InputThreadPreInit(void) if (!inputThreadInfo) FatalError("input-thread: could not allocate memory"); + inputThreadInfo->changed = FALSE; + inputThreadInfo->thread = 0; xorg_list_init(&inputThreadInfo->devs); inputThreadInfo->fds = ospoll_create(); diff --git a/xserver/os/io.c b/xserver/os/io.c index 70f07f3be..b099f0967 100644 --- a/xserver/os/io.c +++ b/xserver/os/io.c @@ -108,15 +108,14 @@ static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr) NULL; static OsCommPtr AvailableInput = (OsCommPtr) NULL; #define get_req_len(req,cli) ((cli)->swapped ? \ - lswaps((req)->length) : (req)->length) + bswap_16((req)->length) : (req)->length) #include #define get_big_req_len(req,cli) ((cli)->swapped ? \ - lswapl(((xBigReq *)(req))->length) : \ + bswap_32(((xBigReq *)(req))->length) : \ ((xBigReq *)(req))->length) -#define MAX_TIMES_PER 10 #define BUFSIZE 16384 #define BUFWATERMARK 32768 @@ -184,10 +183,12 @@ YieldControl(void) } static void -YieldControlNoInput(int fd) +YieldControlNoInput(ClientPtr client) { + OsCommPtr oc = client->osPrivate; YieldControl(); - ospoll_reset_events(server_poll, fd); + if (oc->trans_conn) + ospoll_reset_events(server_poll, oc->fd); } static void @@ -227,7 +228,6 @@ ReadRequestFromClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; ConnectionInputPtr oci = oc->input; - int fd = oc->fd; unsigned int gotnow, needed; int result; register xReq *request; @@ -358,7 +358,7 @@ ReadRequestFromClient(ClientPtr client) if (0) #endif { - YieldControlNoInput(fd); + YieldControlNoInput(client); return 0; } } @@ -395,7 +395,7 @@ ReadRequestFromClient(ClientPtr client) } if (gotnow < needed) { /* Still don't have enough; punt. */ - YieldControlNoInput(fd); + YieldControlNoInput(client); return 0; } } @@ -464,12 +464,12 @@ ReadRequestFromClient(ClientPtr client) return needed; } -#if XTRANS_SEND_FDS int ReadFdFromClient(ClientPtr client) { int fd = -1; +#if XTRANS_SEND_FDS if (client->req_fds > 0) { OsCommPtr oc = (OsCommPtr) client->osPrivate; @@ -477,17 +477,22 @@ ReadFdFromClient(ClientPtr client) fd = _XSERVTransRecvFd(oc->trans_conn); } else LogMessage(X_ERROR, "Request asks for FD without setting req_fds\n"); +#endif + return fd; } int WriteFdToClient(ClientPtr client, int fd, Bool do_close) { +#if XTRANS_SEND_FDS OsCommPtr oc = (OsCommPtr) client->osPrivate; return _XSERVTransSendFd(oc->trans_conn, fd, do_close); -} +#else + return -1; #endif +} /***************************************************************** * InsertFakeRequest @@ -500,7 +505,6 @@ InsertFakeRequest(ClientPtr client, char *data, int count) { OsCommPtr oc = (OsCommPtr) client->osPrivate; ConnectionInputPtr oci = oc->input; - int fd = oc->fd; int gotnow, moveup; NextAvailableInput(oc); @@ -539,7 +543,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count) (gotnow >= (int) (get_req_len((xReq *) oci->bufptr, client) << 2))) mark_client_ready(client); else - YieldControlNoInput(fd); + YieldControlNoInput(client); return TRUE; } @@ -554,7 +558,6 @@ ResetCurrentRequest(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; register ConnectionInputPtr oci = oc->input; - int fd = oc->fd; register xReq *request; int gotnow, needed; @@ -563,7 +566,7 @@ ResetCurrentRequest(ClientPtr client) oci->lenLastReq = 0; gotnow = oci->bufcnt + oci->buffer - oci->bufptr; if (gotnow < sizeof(xReq)) { - YieldControlNoInput(fd); + YieldControlNoInput(client); } else { request = (xReq *) oci->bufptr; @@ -582,7 +585,7 @@ ResetCurrentRequest(ClientPtr client) YieldControl(); } else - YieldControlNoInput(fd); + YieldControlNoInput(client); } } @@ -653,9 +656,7 @@ AbortClient(ClientPtr client) OsCommPtr oc = client->osPrivate; if (oc->trans_conn) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - oc->trans_conn = NULL; + CloseDownFileDescriptor(oc); mark_client_ready(client); } } diff --git a/xserver/os/log.c b/xserver/os/log.c index 91e55a532..803639ef0 100644 --- a/xserver/os/log.c +++ b/xserver/os/log.c @@ -194,6 +194,8 @@ LogFilePrep(const char *fname, const char *backup, const char *idstring) { char *logFileName = NULL; + /* the format string below is controlled by the user, + this code should never be called with elevated privileges */ if (asprintf(&logFileName, fname, idstring) == -1) FatalError("Cannot allocate space for the log file name\n"); @@ -296,7 +298,7 @@ LogInit(const char *fname, const char *backup) void LogSetDisplay(void) { - if (saved_log_fname) { + if (saved_log_fname && strstr(saved_log_fname, "%s")) { char *logFileName; logFileName = LogFilePrep(saved_log_fname, saved_log_backup, display); diff --git a/xserver/os/mitauth.c b/xserver/os/mitauth.c index e75d700e1..a268f62f9 100644 --- a/xserver/os/mitauth.c +++ b/xserver/os/mitauth.c @@ -133,8 +133,6 @@ MitRemoveCookie(unsigned short data_length, const char *data) return 0; } -#ifdef XCSECURITY - static char cookie[16]; /* 128 bits */ XID @@ -161,5 +159,3 @@ MitGenerateCookie(unsigned data_length, } return id; } - -#endif /* XCSECURITY */ diff --git a/xserver/os/oscolor.c b/xserver/os/oscolor.c index 017aab1f2..af83c6ada 100644 --- a/xserver/os/oscolor.c +++ b/xserver/os/oscolor.c @@ -49,6 +49,7 @@ SOFTWARE. #endif #include +#include "dix.h" #include "os.h" typedef struct _builtinColor { @@ -1628,8 +1629,6 @@ static const BuiltinColor BuiltinColors[] = { {154, 205, 50, 7602}, /* YellowGreen */ }; -#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) - Bool OsLookupColor(int screen, char *name, @@ -1642,7 +1641,7 @@ OsLookupColor(int screen, int r; low = 0; - high = NUM_BUILTIN_COLORS - 1; + high = ARRAY_SIZE(BuiltinColors) - 1; while (high >= low) { mid = (low + high) / 2; c = &BuiltinColors[mid]; diff --git a/xserver/os/osdep.h b/xserver/os/osdep.h index 3cd1216a7..ff55f890b 100644 --- a/xserver/os/osdep.h +++ b/xserver/os/osdep.h @@ -55,14 +55,7 @@ SOFTWARE. #include #endif -#ifdef _POSIX_SOURCE #include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif - #include #include @@ -140,6 +133,9 @@ extern int FlushClient(ClientPtr /*who */ , extern void FreeOsBuffers(OsCommPtr /*oc */ ); +void +CloseDownFileDescriptor(OsCommPtr oc); + #include "dix.h" #include "ospoll.h" @@ -148,31 +144,10 @@ extern struct ospoll *server_poll; Bool listen_to_client(ClientPtr client); -#if !defined(WIN32) || defined(__CYGWIN__) -extern int *ConnectionTranslation; -extern int ConnectionTranslationSize; -static inline int GetConnectionTranslation(int conn) { - if (conn >= ConnectionTranslationSize) - return 0; - return ConnectionTranslation[conn]; -} -#else -extern int GetConnectionTranslation(int conn); -extern void SetConnectionTranslation(int conn, int client); -extern void ClearConnectionTranslation(void); -#endif - extern Bool NewOutputPending; extern WorkQueuePtr workQueue; -/* in WaitFor.c */ -#if defined(WIN32) && !defined(__CYGWIN__) -typedef long int fd_mask; -#endif -#define ffs mffs -extern int mffs(fd_mask); - /* in access.c */ extern Bool ComputeLocalClient(ClientPtr client); diff --git a/xserver/os/osinit.c b/xserver/os/osinit.c index 684ee040a..a8aa8b0bc 100644 --- a/xserver/os/osinit.c +++ b/xserver/os/osinit.c @@ -52,6 +52,7 @@ SOFTWARE. #include #include "os.h" #include "osdep.h" +#include "opaque.h" #include #include #include @@ -74,8 +75,6 @@ SOFTWARE. #define ADMPATH "/usr/adm/X%smsgs" #endif -extern char *display; - #ifdef RLIMIT_DATA int limitDataSpace = -1; #endif @@ -151,6 +150,9 @@ OsSigHandler(int signo) } #endif + if (signo != SIGQUIT) + CoreDump = TRUE; + FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } diff --git a/xserver/os/ospoll.c b/xserver/os/ospoll.c index 51bd02dc7..db9e73811 100644 --- a/xserver/os/ospoll.c +++ b/xserver/os/ospoll.c @@ -32,7 +32,19 @@ #include "ospoll.h" #include "list.h" -#if !HAVE_OSPOLL && HAVE_EPOLL_CREATE1 +#if !HAVE_OSPOLL && defined(HAVE_POLLSET_CREATE) +#include +#define POLLSET 1 +#define HAVE_OSPOLL 1 +#endif + +#if !HAVE_OSPOLL && defined(HAVE_PORT_CREATE) +#include +#define PORT 1 +#define HAVE_OSPOLL 1 +#endif + +#if !HAVE_OSPOLL && defined(HAVE_EPOLL_CREATE1) #include #define EPOLL 1 #define HAVE_OSPOLL 1 @@ -44,7 +56,28 @@ #define HAVE_OSPOLL 1 #endif -#if EPOLL +#if POLLSET + +// pollset-based implementation (as seen on AIX) +struct ospollfd { + int fd; + int xevents; + short revents; + enum ospoll_trigger trigger; + void (*callback)(int fd, int xevents, void *data); + void *data; +}; + +struct ospoll { + pollset_t ps; + struct ospollfd *fds; + int num; + int size; +}; + +#endif + +#if EPOLL || PORT #include /* epoll-based implementation */ @@ -101,10 +134,10 @@ ospoll_find(struct ospoll *ospoll, int fd) while (lo <= hi) { int m = (lo + hi) >> 1; -#if EPOLL +#if EPOLL || PORT int t = ospoll->fds[m]->fd; #endif -#if POLL +#if POLL || POLLSET int t = ospoll->fds[m].fd; #endif @@ -118,7 +151,7 @@ ospoll_find(struct ospoll *ospoll, int fd) return -(lo + 1); } -#if EPOLL +#if EPOLL || PORT static void ospoll_clean_deleted(struct ospoll *ospoll) { @@ -168,6 +201,27 @@ array_delete(void *base, size_t num, size_t size, size_t pos) struct ospoll * ospoll_create(void) { +#if POLLSET + struct ospoll *ospoll = calloc(1, sizeof (struct ospoll)); + + ospoll->ps = pollset_create(-1); + if (ospoll->ps < 0) { + free (ospoll); + return NULL; + } + return ospoll; +#endif +#if PORT + struct ospoll *ospoll = calloc(1, sizeof (struct ospoll)); + + ospoll->epoll_fd = port_create(); + if (ospoll->epoll_fd < 0) { + free (ospoll); + return NULL; + } + xorg_list_init(&ospoll->deleted); + return ospoll; +#endif #if EPOLL struct ospoll *ospoll = calloc(1, sizeof (struct ospoll)); @@ -187,7 +241,15 @@ ospoll_create(void) void ospoll_destroy(struct ospoll *ospoll) { -#if EPOLL +#if POLLSET + if (ospoll) { + assert (ospoll->num == 0); + pollset_destroy(ospoll->ps); + free(ospoll->fds); + free(ospoll); + } +#endif +#if EPOLL || PORT if (ospoll) { assert (ospoll->num == 0); close(ospoll->epoll_fd); @@ -213,6 +275,65 @@ ospoll_add(struct ospoll *ospoll, int fd, void *data) { int pos = ospoll_find(ospoll, fd); +#if POLLSET + if (pos < 0) { + if (ospoll->num == ospoll->size) { + struct ospollfd *new_fds; + int new_size = ospoll->size ? ospoll->size * 2 : MAXCLIENTS * 2; + + new_fds = reallocarray(ospoll->fds, new_size, sizeof (ospoll->fds[0])); + if (!new_fds) + return FALSE; + ospoll->fds = new_fds; + ospoll->size = new_size; + } + pos = -pos - 1; + array_insert(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->num++; + + ospoll->fds[pos].fd = fd; + ospoll->fds[pos].xevents = 0; + ospoll->fds[pos].revents = 0; + } + ospoll->fds[pos].trigger = trigger; + ospoll->fds[pos].callback = callback; + ospoll->fds[pos].data = data; +#endif +#if PORT + struct ospollfd *osfd; + + if (pos < 0) { + osfd = calloc(1, sizeof (struct ospollfd)); + if (!osfd) + return FALSE; + + if (ospoll->num >= ospoll->size) { + struct ospollfd **new_fds; + int new_size = ospoll->size ? ospoll->size * 2 : MAXCLIENTS * 2; + + new_fds = reallocarray(ospoll->fds, new_size, sizeof (ospoll->fds[0])); + if (!new_fds) { + free (osfd); + return FALSE; + } + ospoll->fds = new_fds; + ospoll->size = new_size; + } + + osfd->fd = fd; + osfd->xevents = 0; + + pos = -pos - 1; + array_insert(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->fds[pos] = osfd; + ospoll->num++; + } else { + osfd = ospoll->fds[pos]; + } + osfd->data = data; + osfd->callback = callback; + osfd->trigger = trigger; +#endif #if EPOLL struct ospollfd *osfd; @@ -301,6 +422,24 @@ ospoll_remove(struct ospoll *ospoll, int fd) pos = ospoll_find(ospoll, fd); if (pos >= 0) { +#if POLLSET + struct ospollfd *osfd = &ospoll->fds[pos]; + struct poll_ctl ctl = { .cmd = PS_DELETE, .fd = fd }; + pollset_ctl(ospoll->ps, &ctl, 1); + + array_delete(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->num--; +#endif +#if PORT + struct ospollfd *osfd = ospoll->fds[pos]; + port_dissociate(ospoll->epoll_fd, PORT_SOURCE_FD, fd); + + array_delete(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->num--; + osfd->callback = NULL; + osfd->data = NULL; + xorg_list_add(&osfd->deleted, &ospoll->deleted); +#endif #if EPOLL struct ospollfd *osfd = ospoll->fds[pos]; struct epoll_event ev; @@ -323,6 +462,19 @@ ospoll_remove(struct ospoll *ospoll, int fd) } } +#if PORT +static void +epoll_mod(struct ospoll *ospoll, struct ospollfd *osfd) +{ + int events = 0; + if (osfd->xevents & X_NOTIFY_READ) + events |= EPOLLIN; + if (osfd->xevents & X_NOTIFY_WRITE) + events |= EPOLLOUT; + port_associate(ospool->epoll_fd, PORT_SOURCE_FD, osfd->fd, events, osfd); +} +#endif + #if EPOLL static void epoll_mod(struct ospoll *ospoll, struct ospollfd *osfd) @@ -346,7 +498,20 @@ ospoll_listen(struct ospoll *ospoll, int fd, int xevents) int pos = ospoll_find(ospoll, fd); if (pos >= 0) { -#if EPOLL +#if POLLSET + struct poll_ctl ctl = { .cmd = PS_MOD, .fd = fd }; + if (xevents & X_NOTIFY_READ) { + ctl.events |= POLLIN; + ospoll->fds[pos].revents &= ~POLLIN; + } + if (xevents & X_NOTIFY_WRITE) { + ctl.events |= POLLOUT; + ospoll->fds[pos].revents &= ~POLLOUT; + } + pollset_ctl(ospoll->ps, &ctl, 1); + ospoll->fds[pos].xevents |= xevents; +#endif +#if EPOLL || PORT struct ospollfd *osfd = ospoll->fds[pos]; osfd->xevents |= xevents; epoll_mod(ospoll, osfd); @@ -370,7 +535,23 @@ ospoll_mute(struct ospoll *ospoll, int fd, int xevents) int pos = ospoll_find(ospoll, fd); if (pos >= 0) { -#if EPOLL +#if POLLSET + struct ospollfd *osfd = &ospoll->fds[pos]; + osfd->xevents &= ~xevents; + struct poll_ctl ctl = { .cmd = PS_DELETE, .fd = fd }; + pollset_ctl(ospoll->ps, &ctl, 1); + if (osfd->xevents) { + ctl.cmd = PS_ADD; + if (osfd->xevents & X_NOTIFY_READ) { + ctl.events |= POLLIN; + } + if (osfd->xevents & X_NOTIFY_WRITE) { + ctl.events |= POLLOUT; + } + pollset_ctl(ospoll->ps, &ctl, 1); + } +#endif +#if EPOLL || PORT struct ospollfd *osfd = ospoll->fds[pos]; osfd->xevents &= ~xevents; epoll_mod(ospoll, osfd); @@ -389,6 +570,64 @@ int ospoll_wait(struct ospoll *ospoll, int timeout) { int nready; +#if POLLSET +#define MAX_EVENTS 256 + struct pollfd events[MAX_EVENTS]; + + nready = pollset_poll(ospoll->ps, events, MAX_EVENTS, timeout); + for (int i = 0; i < nready; i++) { + struct pollfd *ev = &events[i]; + int pos = ospoll_find(ospoll, ev->fd); + struct ospollfd *osfd = &ospoll->fds[pos]; + short revents = ev->revents; + short oldevents = osfd->revents; + + osfd->revents = (revents & (POLLIN|POLLOUT)); + if (osfd->trigger == ospoll_trigger_edge) + revents &= ~oldevents; + if (revents) { + int xevents = 0; + if (revents & POLLIN) + xevents |= X_NOTIFY_READ; + if (revents & POLLOUT) + xevents |= X_NOTIFY_WRITE; + if (revents & (~(POLLIN|POLLOUT))) + xevents |= X_NOTIFY_ERROR; + osfd->callback(osfd->fd, xevents, osfd->data); + } + } +#endif +#if PORT +#define MAX_EVENTS 256 + port_event_t events[MAX_EVENTS]; + uint_t nget = 1; + + nready = 0; + if (port_getn(ospoll->epoll_fd, events, MAX_EVENTS, &nget, &timeout) == 0) { + nready = nget; + } + for (int i = 0; i < nready; i++) { + port_event_t *ev = &events[i]; + struct ospollfd *osfd = ev->portev_user; + uint32_t revents = ev->portev_events; + int xevents = 0; + + if (revents & EPOLLIN) + xevents |= X_NOTIFY_READ; + if (revents & EPOLLOUT) + xevents |= X_NOTIFY_WRITE; + if (revents & (~(EPOLLIN|EPOLLOUT))) + xevents |= X_NOTIFY_ERROR; + + if (osfd->callback) + osfd->callback(osfd->fd, xevents, osfd->data); + + if (osfd->trigger == ospoll_trigger_level && !osfd->deleted) { + epoll_mod(ospoll, osfd); + } + } + ospoll_clean_deleted(ospoll); +#endif #if EPOLL #define MAX_EVENTS 256 struct epoll_event events[MAX_EVENTS]; @@ -451,6 +690,22 @@ ospoll_wait(struct ospoll *ospoll, int timeout) void ospoll_reset_events(struct ospoll *ospoll, int fd) { +#if POLLSET + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return; + + ospoll->fds[pos].revents = 0; +#endif +#if PORT + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return; + + epoll_mod(ospoll, ospoll->fds[pos]); +#endif #if POLL int pos = ospoll_find(ospoll, fd); @@ -468,7 +723,10 @@ ospoll_data(struct ospoll *ospoll, int fd) if (pos < 0) return NULL; -#if EPOLL +#if POLLSET + return ospoll->fds[pos].data; +#endif +#if EPOLL || PORT return ospoll->fds[pos]->data; #endif #if POLL diff --git a/xserver/os/timingsafe_memcmp.c b/xserver/os/timingsafe_memcmp.c index 65679c87a..4eaba627e 100644 --- a/xserver/os/timingsafe_memcmp.c +++ b/xserver/os/timingsafe_memcmp.c @@ -14,10 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include #include -#include #include "os.h" int diff --git a/xserver/os/utils.c b/xserver/os/utils.c index 05dbeb781..331fe1aa2 100644 --- a/xserver/os/utils.c +++ b/xserver/os/utils.c @@ -83,19 +83,7 @@ __stdcall unsigned long GetTickCount(void); #include #include "osdep.h" #include "extension.h" -#ifdef X_POSIX_C_SOURCE -#define _POSIX_C_SOURCE X_POSIX_C_SOURCE #include -#undef _POSIX_C_SOURCE -#else -#if defined(_POSIX_SOURCE) -#include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif -#endif #ifndef WIN32 #include #endif @@ -135,6 +123,7 @@ Bool noDamageExtension = FALSE; Bool noDbeExtension = FALSE; #endif #ifdef DPMSExtension +#include "dpmsproc.h" Bool noDPMSExtension = FALSE; #endif #ifdef GLXEXT @@ -508,19 +497,20 @@ GetTimeInMicros(void) struct timeval tv; #ifdef MONOTONIC_CLOCK struct timespec tp; + static clockid_t uclockid; - if (!clockid) { + if (!uclockid) { if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - clockid = CLOCK_MONOTONIC; + uclockid = CLOCK_MONOTONIC; else - clockid = ~0L; + uclockid = ~0L; } - if (clockid != ~0L && clock_gettime(clockid, &tp) == 0) + if (uclockid != ~0L && clock_gettime(uclockid, &tp) == 0) return (CARD64) tp.tv_sec * (CARD64)1000000 + tp.tv_nsec / 1000; #endif X_GETTIMEOFDAY(&tv); - return (CARD64) tv.tv_sec * (CARD64)1000000000 + (CARD64) tv.tv_usec * 1000; + return (CARD64) tv.tv_sec * (CARD64)1000000 + (CARD64) tv.tv_usec; } #endif @@ -1028,7 +1018,7 @@ ProcessCommandLine(int argc, char *argv[]) #endif else if (strcmp(argv[i], "-dumbSched") == 0) { InputThreadEnable = FALSE; -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER SmartScheduleSignalEnable = FALSE; #endif } @@ -1230,7 +1220,7 @@ XNFstrdup(const char *s) void SmartScheduleStopTimer(void) { -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER struct itimerval timer; if (!SmartScheduleSignalEnable) @@ -1246,7 +1236,7 @@ SmartScheduleStopTimer(void) void SmartScheduleStartTimer(void) { -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER struct itimerval timer; if (!SmartScheduleSignalEnable) @@ -1259,7 +1249,7 @@ SmartScheduleStartTimer(void) #endif } -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER static void SmartScheduleTimer(int sig) { @@ -1307,7 +1297,7 @@ SmartSchedulePause(void) void SmartScheduleInit(void) { -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("sigaction for smart scheduler"); SmartScheduleSignalEnable = FALSE; @@ -1464,7 +1454,7 @@ Popen(const char *command, const char *type) } /* Ignore the smart scheduler while this is going on */ -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER if (SmartSchedulePause() < 0) { close(pdes[0]); close(pdes[1]); @@ -1479,7 +1469,7 @@ Popen(const char *command, const char *type) close(pdes[0]); close(pdes[1]); free(cur); -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER if (SmartScheduleEnable() < 0) perror("signal"); #endif @@ -1656,7 +1646,7 @@ Pclose(void *iop) /* allow EINTR again */ OsReleaseSignals(); -#if HAVE_SETITIMER +#ifdef HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("signal"); return -1; @@ -1751,6 +1741,69 @@ System(const char *cmdline) } #endif +Bool +PrivsElevated(void) +{ + static Bool privsTested = FALSE; + static Bool privsElevated = TRUE; + + if (!privsTested) { +#if defined(WIN32) + privsElevated = FALSE; +#else + if ((getuid() != geteuid()) || (getgid() != getegid())) { + privsElevated = TRUE; + } + else { +#if defined(HAVE_ISSETUGID) + privsElevated = issetugid(); +#elif defined(HAVE_GETRESUID) + uid_t ruid, euid, suid; + gid_t rgid, egid, sgid; + + if ((getresuid(&ruid, &euid, &suid) == 0) && + (getresgid(&rgid, &egid, &sgid) == 0)) { + privsElevated = (euid != suid) || (egid != sgid); + } + else { + printf("Failed getresuid or getresgid"); + /* Something went wrong, make defensive assumption */ + privsElevated = TRUE; + } +#else + if (getuid() == 0) { + /* running as root: uid==euid==0 */ + privsElevated = FALSE; + } + else { + /* + * If there are saved ID's the process might still be privileged + * even though the above test succeeded. If issetugid() and + * getresgid() aren't available, test this by trying to set + * euid to 0. + */ + unsigned int oldeuid; + + oldeuid = geteuid(); + + if (seteuid(0) != 0) { + privsElevated = FALSE; + } + else { + if (seteuid(oldeuid) != 0) { + FatalError("Failed to drop privileges. Exiting\n"); + } + privsElevated = TRUE; + } + } +#endif + } +#endif + privsTested = TRUE; + } + return privsElevated; +} + /* * CheckUserParameters: check for long command line arguments and long * environment variables. By default, these checks are only done when @@ -1832,7 +1885,7 @@ CheckUserParameters(int argc, char **argv, char **envp) char *a, *e = NULL; #if CHECK_EUID - if (geteuid() == 0 && getuid() != geteuid()) + if (PrivsElevated()) #endif { /* Check each argv[] */ diff --git a/xserver/os/xdmcp.c b/xserver/os/xdmcp.c index d8c81fbf8..62adead84 100644 --- a/xserver/os/xdmcp.c +++ b/xserver/os/xdmcp.c @@ -569,10 +569,9 @@ XdmcpRegisterDisplayClass(const char *name, int length) } static void -xdmcp_start(void) +xdmcp_reset(void) { timeOutRtx = 0; - get_xdmcp_sock(); if (xdmcpSocket >= 0) SetNotifyFd(xdmcpSocket, XdmcpSocketNotify, X_NOTIFY_READ, NULL); #if defined(IPv6) && defined(AF_INET6) @@ -583,6 +582,13 @@ xdmcp_start(void) send_packet(); } +static void +xdmcp_start(void) +{ + get_xdmcp_sock(); + xdmcp_reset(); +} + /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine @@ -611,7 +617,7 @@ XdmcpReset(void) { state = XDM_INIT_STATE; if (state != XDM_OFF) - xdmcp_start(); + xdmcp_reset(); } /* diff --git a/xserver/present/Makefile.am b/xserver/present/Makefile.am index 7fea6699f..542f4ca9c 100644 --- a/xserver/present/Makefile.am +++ b/xserver/present/Makefile.am @@ -7,11 +7,15 @@ libpresent_la_SOURCES = \ present.h \ present.c \ present_event.c \ + present_execute.c \ present_fake.c \ present_fence.c \ present_notify.c \ present_priv.h \ present_request.c \ - present_screen.c + present_scmd.c \ + present_screen.c \ + present_vblank.c \ + present_wnmd.c sdk_HEADERS = present.h presentext.h diff --git a/xserver/present/Makefile.in b/xserver/present/Makefile.in index bd1838010..bd9d7f759 100644 --- a/xserver/present/Makefile.in +++ b/xserver/present/Makefile.in @@ -69,15 +69,16 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libpresent_la_LIBADD = -am_libpresent_la_OBJECTS = present.lo present_event.lo present_fake.lo \ - present_fence.lo present_notify.lo present_request.lo \ - present_screen.lo +am_libpresent_la_OBJECTS = present.lo present_event.lo \ + present_execute.lo present_fake.lo present_fence.lo \ + present_notify.lo present_request.lo present_scmd.lo \ + present_screen.lo present_vblank.lo present_wnmd.lo libpresent_la_OBJECTS = $(am_libpresent_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -339,6 +340,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -357,15 +359,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -373,6 +378,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -444,8 +451,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -519,12 +524,16 @@ libpresent_la_SOURCES = \ present.h \ present.c \ present_event.c \ + present_execute.c \ present_fake.c \ present_fence.c \ present_notify.c \ present_priv.h \ present_request.c \ - present_screen.c + present_scmd.c \ + present_screen.c \ + present_vblank.c \ + present_wnmd.c sdk_HEADERS = present.h presentext.h all: all-am @@ -583,11 +592,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_execute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_fake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_fence.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_notify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_request.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_scmd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_screen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_vblank.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_wnmd.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/present/present.c b/xserver/present/present.c index 7d428fca7..3eddb7434 100644 --- a/xserver/present/present.c +++ b/xserver/present/present.c @@ -26,35 +26,6 @@ #include "present_priv.h" #include -#include -#include -#ifdef MONOTONIC_CLOCK -#include -#endif - -static uint64_t present_event_id; -static struct xorg_list present_exec_queue; -static struct xorg_list present_flip_queue; - -#if 0 -#define DebugPresent(x) ErrorF x -#else -#define DebugPresent(x) -#endif - -static void -present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); - -/* - * Returns: - * TRUE if the first MSC value is after the second one - * FALSE if the first MSC value is equal to or before the second one - */ -static Bool -msc_is_after(uint64_t test, uint64_t reference) -{ - return (int64_t)(test - reference) > 0; -} /* * Returns: @@ -67,10 +38,38 @@ msc_is_equal_or_after(uint64_t test, uint64_t reference) return (int64_t)(test - reference) >= 0; } +uint32_t +present_query_capabilities(RRCrtcPtr crtc) +{ + present_screen_priv_ptr screen_priv; + + if (!crtc) + return 0; + + screen_priv = present_screen_priv(crtc->pScreen); + + if (!screen_priv) + return 0; + + return screen_priv->query_capabilities(screen_priv); +} + +RRCrtcPtr +present_get_crtc(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!screen_priv) + return NULL; + + return screen_priv->get_crtc(screen_priv, window); +} + /* * Copies the update region from a pixmap to the target drawable */ -static void +void present_copy_region(DrawablePtr drawable, PixmapPtr pixmap, RegionPtr update, @@ -103,297 +102,17 @@ present_copy_region(DrawablePtr drawable, FreeScratchGC(gc); } -static inline PixmapPtr -present_flip_pending_pixmap(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (!screen_priv) - return NULL; - - if (!screen_priv->flip_pending) - return NULL; - - return screen_priv->flip_pending->pixmap; -} - -static Bool -present_check_output_slaves_active(ScreenPtr pScreen) -{ - ScreenPtr pSlave; - - xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { - if (RRHasScanoutPixmap(pSlave)) - return TRUE; - } - return FALSE; -} - -static Bool -present_check_flip(RRCrtcPtr crtc, - WindowPtr window, - PixmapPtr pixmap, - Bool sync_flip, - RegionPtr valid, - int16_t x_off, - int16_t y_off) -{ - ScreenPtr screen = window->drawable.pScreen; - PixmapPtr window_pixmap; - WindowPtr root = screen->root; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (!screen_priv) - return FALSE; - - if (!screen_priv->info) - return FALSE; - - if (!crtc) - return FALSE; - - /* Check to see if the driver supports flips at all */ - if (!screen_priv->info->flip) - return FALSE; - - /* Fail to flip if we have slave outputs */ - if (screen->output_slaves && present_check_output_slaves_active(screen)) - return FALSE; - - /* Make sure the window hasn't been redirected with Composite */ - window_pixmap = screen->GetWindowPixmap(window); - if (window_pixmap != screen->GetScreenPixmap(screen) && - window_pixmap != screen_priv->flip_pixmap && - window_pixmap != present_flip_pending_pixmap(screen)) - return FALSE; - - /* Check for full-screen window */ - if (!RegionEqual(&window->clipList, &root->winSize)) { - return FALSE; - } - - /* Source pixmap must align with window exactly */ - if (x_off || y_off) { - return FALSE; - } - - /* Make sure the area marked as valid fills the screen */ - if (valid && !RegionEqual(valid, &root->winSize)) { - return FALSE; - } - - /* Does the window match the pixmap exactly? */ - if (window->drawable.x != 0 || window->drawable.y != 0 || -#ifdef COMPOSITE - window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || -#endif - window->drawable.width != pixmap->drawable.width || - window->drawable.height != pixmap->drawable.height) { - return FALSE; - } - - /* Ask the driver for permission */ - if (screen_priv->info->check_flip) { - if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) { - DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0)); - return FALSE; - } - } - - return TRUE; -} - -static Bool -present_flip(RRCrtcPtr crtc, - uint64_t event_id, - uint64_t target_msc, - PixmapPtr pixmap, - Bool sync_flip) -{ - ScreenPtr screen = crtc->pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - return (*screen_priv->info->flip) (crtc, event_id, target_msc, pixmap, sync_flip); -} - -static void -present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_t ust, uint64_t crtc_msc) -{ - int n; - - if (vblank->window) - present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset); - for (n = 0; n < vblank->num_notifies; n++) { - WindowPtr window = vblank->notifies[n].window; - CARD32 serial = vblank->notifies[n].serial; - - if (window) - present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset); - } -} - -static void +void present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct present_fence *present_fence) { if (present_fence) present_fence_set_triggered(present_fence); if (window) { - DebugPresent(("\ti %08lx\n", pixmap ? pixmap->drawable.id : 0)); + DebugPresent(("\ti %08" PRIx32 "\n", pixmap ? pixmap->drawable.id : 0)); present_send_idle_notify(window, serial, pixmap, present_fence); } } -RRCrtcPtr -present_get_crtc(WindowPtr window) -{ - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (!screen_priv) - return NULL; - - if (!screen_priv->info) - return NULL; - - return (*screen_priv->info->get_crtc)(window); -} - -uint32_t -present_query_capabilities(RRCrtcPtr crtc) -{ - present_screen_priv_ptr screen_priv; - - if (!crtc) - return 0; - - screen_priv = present_screen_priv(crtc->pScreen); - - if (!screen_priv) - return 0; - - if (!screen_priv->info) - return 0; - - return screen_priv->info->capabilities; -} - -static int -present_get_ust_msc(ScreenPtr screen, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (crtc == NULL) - return present_fake_get_ust_msc(screen, ust, msc); - else - return (*screen_priv->info->get_ust_msc)(crtc, ust, msc); -} - -static void -present_flush(WindowPtr window) -{ - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (!screen_priv) - return; - - if (!screen_priv->info) - return; - - (*screen_priv->info->flush) (window); -} - -static int -present_queue_vblank(ScreenPtr screen, - RRCrtcPtr crtc, - uint64_t event_id, - uint64_t msc) -{ - Bool ret; - - if (crtc == NULL) - ret = present_fake_queue_vblank(screen, event_id, msc); - else - { - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - ret = (*screen_priv->info->queue_vblank) (crtc, event_id, msc); - } - return ret; -} - -static uint64_t -present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) -{ - present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); - - if (crtc != window_priv->crtc) { - uint64_t old_ust, old_msc; - - if (window_priv->crtc == PresentCrtcNeverSet) { - window_priv->msc_offset = 0; - } else { - /* The old CRTC may have been turned off, in which case - * we'll just use whatever previous MSC we'd seen from this CRTC - */ - - if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success) - old_msc = window_priv->msc; - - window_priv->msc_offset += new_msc - old_msc; - } - window_priv->crtc = crtc; - } - - return window_msc + window_priv->msc_offset; -} - -/* - * When the wait fence or previous flip is completed, it's time - * to re-try the request - */ -static void -present_re_execute(present_vblank_ptr vblank) -{ - uint64_t ust = 0, crtc_msc = 0; - - if (vblank->crtc) - (void) present_get_ust_msc(vblank->screen, vblank->crtc, &ust, &crtc_msc); - - present_execute(vblank, ust, crtc_msc); -} - -static void -present_flip_try_ready(ScreenPtr screen) -{ - present_vblank_ptr vblank; - - xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { - if (vblank->queued) { - present_re_execute(vblank); - return; - } - } -} - -static void -present_flip_idle(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (screen_priv->flip_pixmap) { - present_pixmap_idle(screen_priv->flip_pixmap, screen_priv->flip_window, - screen_priv->flip_serial, screen_priv->flip_idle_fence); - if (screen_priv->flip_idle_fence) - present_fence_destroy(screen_priv->flip_idle_fence); - dixDestroyPixmap(screen_priv->flip_pixmap, screen_priv->flip_pixmap->drawable.id); - screen_priv->flip_crtc = NULL; - screen_priv->flip_window = NULL; - screen_priv->flip_serial = 0; - screen_priv->flip_pixmap = NULL; - screen_priv->flip_idle_fence = NULL; - } -} - struct pixmap_visit { PixmapPtr old; PixmapPtr new; @@ -411,7 +130,7 @@ present_set_tree_pixmap_visit(WindowPtr window, void *data) return WT_WALKCHILDREN; } -static void +void present_set_tree_pixmap(WindowPtr window, PixmapPtr expected, PixmapPtr pixmap) @@ -429,360 +148,40 @@ present_set_tree_pixmap(WindowPtr window, TraverseTree(window, present_set_tree_pixmap_visit, &visit); } -void -present_restore_screen_pixmap(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - PixmapPtr screen_pixmap = (*screen->GetScreenPixmap)(screen); - PixmapPtr flip_pixmap; - WindowPtr flip_window; - - if (screen_priv->flip_pending) { - flip_window = screen_priv->flip_pending->window; - flip_pixmap = screen_priv->flip_pending->pixmap; - } else { - flip_window = screen_priv->flip_window; - flip_pixmap = screen_priv->flip_pixmap; - } - - assert (flip_pixmap); - - /* Update the screen pixmap with the current flip pixmap contents - * Only do this the first time for a particular unflip operation, or - * we'll probably scribble over other windows - */ - if (screen->root && screen->GetWindowPixmap(screen->root) == flip_pixmap) - present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0); - - /* Switch back to using the screen pixmap now to avoid - * 2D applications drawing to the wrong pixmap. - */ - if (flip_window) - present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap); - if (screen->root) - present_set_tree_pixmap(screen->root, NULL, screen_pixmap); -} - -void -present_set_abort_flip(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (!screen_priv->flip_pending->abort_flip) { - present_restore_screen_pixmap(screen); - screen_priv->flip_pending->abort_flip = TRUE; - } -} - -static void -present_unflip(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - assert (!screen_priv->unflip_event_id); - assert (!screen_priv->flip_pending); - - present_restore_screen_pixmap(screen); - - screen_priv->unflip_event_id = ++present_event_id; - DebugPresent(("u %lld\n", screen_priv->unflip_event_id)); - (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id); -} - -static void -present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) -{ - ScreenPtr screen = vblank->screen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n", - vblank->event_id, vblank, vblank->target_msc, - vblank->pixmap ? vblank->pixmap->drawable.id : 0, - vblank->window ? vblank->window->drawable.id : 0)); - - assert (vblank == screen_priv->flip_pending); - - present_flip_idle(screen); - - xorg_list_del(&vblank->event_queue); - - /* Transfer reference for pixmap and fence from vblank to screen_priv */ - screen_priv->flip_crtc = vblank->crtc; - screen_priv->flip_window = vblank->window; - screen_priv->flip_serial = vblank->serial; - screen_priv->flip_pixmap = vblank->pixmap; - screen_priv->flip_sync = vblank->sync_flip; - screen_priv->flip_idle_fence = vblank->idle_fence; - - vblank->pixmap = NULL; - vblank->idle_fence = NULL; - - screen_priv->flip_pending = NULL; - - if (vblank->abort_flip) - present_unflip(screen); - - present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); - present_vblank_destroy(vblank); - - present_flip_try_ready(screen); -} - -void -present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc) -{ - present_vblank_ptr vblank; - int s; - - if (!event_id) - return; - DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc)); - xorg_list_for_each_entry(vblank, &present_exec_queue, event_queue) { - int64_t match = event_id - vblank->event_id; - if (match == 0) { - present_execute(vblank, ust, msc); - return; - } - } - xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { - if (vblank->event_id == event_id) { - if (vblank->queued) - present_execute(vblank, ust, msc); - else - present_flip_notify(vblank, ust, msc); - return; - } - } - - for (s = 0; s < screenInfo.numScreens; s++) { - ScreenPtr screen = screenInfo.screens[s]; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - if (event_id == screen_priv->unflip_event_id) { - DebugPresent(("\tun %lld\n", event_id)); - screen_priv->unflip_event_id = 0; - present_flip_idle(screen); - present_flip_try_ready(screen); - return; - } - } -} - -/* - * 'window' is being reconfigured. Check to see if it is involved - * in flipping and clean up as necessary - */ -void -present_check_flip_window (WindowPtr window) +Bool +present_can_window_flip(WindowPtr window) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_window_priv_ptr window_priv = present_window_priv(window); - present_vblank_ptr flip_pending = screen_priv->flip_pending; - present_vblank_ptr vblank; - /* If this window hasn't ever been used with Present, it can't be - * flipping + return screen_priv->can_window_flip(window); +} + +void +present_adjust_timings(uint32_t options, + uint64_t *crtc_msc, + uint64_t *target_msc, + uint64_t divisor, + uint64_t remainder) +{ + /* Adjust target_msc to match modulus */ - if (!window_priv) - return; - - if (screen_priv->unflip_event_id) - return; - - if (flip_pending) { - /* - * Check pending flip - */ - if (flip_pending->window == window) { - if (!present_check_flip(flip_pending->crtc, window, flip_pending->pixmap, - flip_pending->sync_flip, NULL, 0, 0)) - present_set_abort_flip(screen); - } - } else { - /* - * Check current flip - */ - if (window == screen_priv->flip_window) { - if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, screen_priv->flip_sync, NULL, 0, 0)) - present_unflip(screen); - } - } - - /* Now check any queued vblanks */ - xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) { - if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, vblank->sync_flip, NULL, 0, 0)) { - vblank->flip = FALSE; - if (vblank->sync_flip) - vblank->requeue = TRUE; - } - } -} - -/* - * Called when the wait fence is triggered; just gets the current msc/ust and - * calls present_execute again. That will re-check the fence and pend the - * request again if it's still not actually ready - */ -static void -present_wait_fence_triggered(void *param) -{ - present_vblank_ptr vblank = param; - present_re_execute(vblank); -} - -/* - * Once the required MSC has been reached, execute the pending request. - * - * For requests to actually present something, either blt contents to - * the screen or queue a frame buffer swap. - * - * For requests to just get the current MSC/UST combo, skip that part and - * go straight to event delivery - */ - -static void -present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) -{ - WindowPtr window = vblank->window; - ScreenPtr screen = window->drawable.pScreen; - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - uint8_t mode; - - if (vblank->requeue) { - vblank->requeue = FALSE; - if (msc_is_after(vblank->target_msc, crtc_msc) && - Success == present_queue_vblank(screen, - vblank->crtc, - vblank->event_id, - vblank->target_msc)) - return; - } - - if (vblank->wait_fence) { - if (!present_fence_check_triggered(vblank->wait_fence)) { - present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank); - return; - } - } - - if (vblank->flip && vblank->pixmap && vblank->window) { - if (screen_priv->flip_pending || screen_priv->unflip_event_id) { - DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n", - vblank->event_id, vblank, - screen_priv->flip_pending, screen_priv->unflip_event_id)); - xorg_list_del(&vblank->event_queue); - xorg_list_append(&vblank->event_queue, &present_flip_queue); - vblank->flip_ready = TRUE; - return; - } - } - - xorg_list_del(&vblank->event_queue); - xorg_list_del(&vblank->window_list); - vblank->queued = FALSE; - - if (vblank->pixmap && vblank->window) { - - if (vblank->flip) { - - DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n", - vblank->event_id, vblank, crtc_msc, - vblank->pixmap->drawable.id, vblank->window->drawable.id)); - - /* Prepare to flip by placing it in the flip queue and - * and sticking it into the flip_pending field - */ - screen_priv->flip_pending = vblank; - - xorg_list_add(&vblank->event_queue, &present_flip_queue); - /* Try to flip - */ - if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) { - RegionPtr damage; - - /* Fix window pixmaps: - * 1) Restore previous flip window pixmap - * 2) Set current flip window pixmap to the new pixmap - */ - if (screen_priv->flip_window && screen_priv->flip_window != window) - present_set_tree_pixmap(screen_priv->flip_window, - screen_priv->flip_pixmap, - (*screen->GetScreenPixmap)(screen)); - present_set_tree_pixmap(vblank->window, NULL, vblank->pixmap); - present_set_tree_pixmap(screen->root, NULL, vblank->pixmap); - - /* Report update region as damaged - */ - if (vblank->update) { - damage = vblank->update; - RegionIntersect(damage, damage, &window->clipList); - } else - damage = &window->clipList; - - DamageDamageRegion(&vblank->window->drawable, damage); - return; + if (msc_is_equal_or_after(*crtc_msc, *target_msc)) { + if (divisor != 0) { + *target_msc = *crtc_msc - (*crtc_msc % divisor) + remainder; + if (options & PresentOptionAsync) { + if (msc_is_after(*crtc_msc, *target_msc)) + *target_msc += divisor; + } else { + if (msc_is_equal_or_after(*crtc_msc, *target_msc)) + *target_msc += divisor; } - - xorg_list_del(&vblank->event_queue); - /* Oops, flip failed. Clear the flip_pending field - */ - screen_priv->flip_pending = NULL; - vblank->flip = FALSE; + } else { + *target_msc = *crtc_msc; + if (!(options & PresentOptionAsync)) + (*target_msc)++; } - DebugPresent(("\tc %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); - if (screen_priv->flip_pending) { - - /* Check pending flip - */ - if (window == screen_priv->flip_pending->window) - present_set_abort_flip(screen); - } else if (!screen_priv->unflip_event_id) { - - /* Check current flip - */ - if (window == screen_priv->flip_window) - present_unflip(screen); - } - - /* If present_flip failed, we may have to requeue for the target MSC */ - if (vblank->target_msc == crtc_msc + 1 && - Success == present_queue_vblank(screen, - vblank->crtc, - vblank->event_id, - vblank->target_msc)) { - xorg_list_add(&vblank->event_queue, &present_exec_queue); - xorg_list_append(&vblank->window_list, - &present_get_window_priv(window, TRUE)->vblank); - vblank->queued = TRUE; - return; - } - - present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off); - - /* present_copy_region sticks the region into a scratch GC, - * which is then freed, freeing the region - */ - vblank->update = NULL; - present_flush(window); - - present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); } - - /* Compute correct CompleteMode - */ - if (vblank->kind == PresentCompleteKindPixmap) { - if (vblank->pixmap && vblank->window) - mode = PresentCompleteModeCopy; - else - mode = PresentCompleteModeSkip; - } - else - mode = PresentCompleteModeCopy; - - - present_vblank_notify(vblank, vblank->kind, mode, ust, crtc_msc); - present_vblank_destroy(vblank); } int @@ -803,216 +202,25 @@ present_pixmap(WindowPtr window, present_notify_ptr notifies, int num_notifies) { - uint64_t ust = 0; - uint64_t target_msc; - uint64_t crtc_msc = 0; - int ret; - present_vblank_ptr vblank, tmp; ScreenPtr screen = window->drawable.pScreen; - present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); present_screen_priv_ptr screen_priv = present_screen_priv(screen); - if (!window_priv) - return BadAlloc; - - if (!screen_priv || !screen_priv->info) - target_crtc = NULL; - else if (!target_crtc) { - /* Update the CRTC if we have a pixmap or we don't have a CRTC - */ - if (!pixmap) - target_crtc = window_priv->crtc; - - if (!target_crtc || target_crtc == PresentCrtcNeverSet) - target_crtc = present_get_crtc(window); - } - - ret = present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); - - target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); - - if (ret == Success) { - /* Stash the current MSC away in case we need it later - */ - window_priv->msc = crtc_msc; - } - - /* Adjust target_msc to match modulus - */ - if (msc_is_equal_or_after(crtc_msc, target_msc)) { - if (divisor != 0) { - target_msc = crtc_msc - (crtc_msc % divisor) + remainder; - if (options & PresentOptionAsync) { - if (msc_is_after(crtc_msc, target_msc)) - target_msc += divisor; - } else { - if (msc_is_equal_or_after(crtc_msc, target_msc)) - target_msc += divisor; - } - } else { - target_msc = crtc_msc; - if (!(options & PresentOptionAsync)) - target_msc++; - } - } - - /* - * Look for a matching presentation already on the list and - * don't bother doing the previous one if this one will overwrite it - * in the same frame - */ - - if (!update && pixmap) { - xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { - - if (!vblank->pixmap) - continue; - - if (!vblank->queued) - continue; - - if (vblank->crtc != target_crtc || vblank->target_msc != target_msc) - continue; - - DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n", - vblank->event_id, vblank, vblank->target_msc, - vblank->pixmap->drawable.id, vblank->window->drawable.id, - vblank->crtc)); - - present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); - present_fence_destroy(vblank->idle_fence); - dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); - - vblank->pixmap = NULL; - vblank->idle_fence = NULL; - vblank->flip = FALSE; - if (vblank->flip_ready) - present_re_execute(vblank); - } - } - - vblank = calloc (1, sizeof (present_vblank_rec)); - if (!vblank) - return BadAlloc; - - xorg_list_append(&vblank->window_list, &window_priv->vblank); - xorg_list_init(&vblank->event_queue); - - vblank->screen = screen; - vblank->window = window; - vblank->pixmap = pixmap; - vblank->event_id = ++present_event_id; - if (pixmap) { - vblank->kind = PresentCompleteKindPixmap; - pixmap->refcnt++; - } else - vblank->kind = PresentCompleteKindNotifyMSC; - - vblank->serial = serial; - - if (valid) { - vblank->valid = RegionDuplicate(valid); - if (!vblank->valid) - goto no_mem; - } - if (update) { - vblank->update = RegionDuplicate(update); - if (!vblank->update) - goto no_mem; - } - - vblank->x_off = x_off; - vblank->y_off = y_off; - vblank->target_msc = target_msc; - vblank->crtc = target_crtc; - vblank->msc_offset = window_priv->msc_offset; - vblank->notifies = notifies; - vblank->num_notifies = num_notifies; - - if (pixmap != NULL && - !(options & PresentOptionCopy) && - screen_priv->info) { - if (msc_is_after(target_msc, crtc_msc) && - present_check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off)) - { - vblank->flip = TRUE; - vblank->sync_flip = TRUE; - target_msc--; - } else if ((screen_priv->info->capabilities & PresentCapabilityAsync) && - present_check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off)) - { - vblank->flip = TRUE; - } - } - - if (wait_fence) { - vblank->wait_fence = present_fence_create(wait_fence); - if (!vblank->wait_fence) - goto no_mem; - } - - if (idle_fence) { - vblank->idle_fence = present_fence_create(idle_fence); - if (!vblank->idle_fence) - goto no_mem; - } - - if (pixmap) - DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p) flip %d vsync %d serial %d\n", - vblank->event_id, vblank, target_msc, - vblank->pixmap->drawable.id, vblank->window->drawable.id, - target_crtc, vblank->flip, vblank->sync_flip, vblank->serial)); - - xorg_list_append(&vblank->event_queue, &present_exec_queue); - vblank->queued = TRUE; - if (msc_is_after(target_msc, crtc_msc)) { - ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc); - if (ret == Success) - return Success; - - DebugPresent(("present_queue_vblank failed\n")); - } - - present_execute(vblank, ust, crtc_msc); - - return Success; - -no_mem: - ret = BadAlloc; - vblank->notifies = NULL; - present_vblank_destroy(vblank); - return ret; -} - -void -present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) -{ - present_vblank_ptr vblank; - - if (crtc == NULL) - present_fake_abort_vblank(screen, event_id, msc); - else - { - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - (*screen_priv->info->abort_vblank) (crtc, event_id, msc); - } - - xorg_list_for_each_entry(vblank, &present_exec_queue, event_queue) { - int64_t match = event_id - vblank->event_id; - if (match == 0) { - xorg_list_del(&vblank->event_queue); - vblank->queued = FALSE; - return; - } - } - xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { - if (vblank->event_id == event_id) { - xorg_list_del(&vblank->event_queue); - vblank->queued = FALSE; - return; - } - } + return screen_priv->present_pixmap(window, + pixmap, + serial, + valid, + update, + x_off, + y_off, + target_crtc, + wait_fence, + idle_fence, + options, + window_msc, + divisor, + remainder, + notifies, + num_notifies); } int @@ -1032,58 +240,3 @@ present_notify_msc(WindowPtr window, divisor == 0 ? PresentOptionAsync : 0, target_msc, divisor, remainder, NULL, 0); } - -void -present_flip_destroy(ScreenPtr screen) -{ - present_screen_priv_ptr screen_priv = present_screen_priv(screen); - - /* Reset window pixmaps back to the screen pixmap */ - if (screen_priv->flip_pending) - present_set_abort_flip(screen); - - /* Drop reference to any pending flip or unflip pixmaps. */ - present_flip_idle(screen); -} - -void -present_vblank_destroy(present_vblank_ptr vblank) -{ - /* Remove vblank from window and screen lists */ - xorg_list_del(&vblank->window_list); - - DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n", - vblank->event_id, vblank, vblank->target_msc, - vblank->pixmap ? vblank->pixmap->drawable.id : 0, - vblank->window ? vblank->window->drawable.id : 0)); - - /* Drop pixmap reference */ - if (vblank->pixmap) - dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); - - /* Free regions */ - if (vblank->valid) - RegionDestroy(vblank->valid); - if (vblank->update) - RegionDestroy(vblank->update); - - if (vblank->wait_fence) - present_fence_destroy(vblank->wait_fence); - - if (vblank->idle_fence) - present_fence_destroy(vblank->idle_fence); - - if (vblank->notifies) - present_destroy_notifies(vblank->notifies, vblank->num_notifies); - - free(vblank); -} - -Bool -present_init(void) -{ - xorg_list_init(&present_exec_queue); - xorg_list_init(&present_flip_queue); - present_fake_queue_init(); - return TRUE; -} diff --git a/xserver/present/present.h b/xserver/present/present.h index aab2e168a..3d0b9722b 100644 --- a/xserver/present/present.h +++ b/xserver/present/present.h @@ -27,6 +27,11 @@ #include "randrstr.h" #include "presentext.h" +typedef enum { + PRESENT_FLIP_REASON_UNKNOWN, + PRESENT_FLIP_REASON_BUFFER_FORMAT +} PresentFlipReason; + typedef struct present_vblank present_vblank_rec, *present_vblank_ptr; /* Return the current CRTC for 'window'. @@ -36,6 +41,7 @@ typedef RRCrtcPtr (*present_get_crtc_ptr) (WindowPtr window); /* Return the current ust/msc for 'crtc' */ typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc); +typedef int (*present_wnmd_get_ust_msc_ptr) (WindowPtr window, uint64_t *ust, uint64_t *msc); /* Queue callback on 'crtc' for time 'msc'. Call present_event_notify with 'event_id' * at or after 'msc'. Return false if it didn't happen (which might occur if 'crtc' @@ -44,12 +50,20 @@ typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t typedef Bool (*present_queue_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); +typedef Bool (*present_wnmd_queue_vblank_ptr) (WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc); /* Abort pending vblank. The extension is no longer interested in * 'event_id' which was to be notified at 'msc'. If possible, the * driver is free to de-queue the notification. */ typedef void (*present_abort_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); +typedef void (*present_wnmd_abort_vblank_ptr) (WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc); /* Flush pending drawing on 'window' to the hardware. */ @@ -59,6 +73,10 @@ typedef void (*present_flush_ptr) (WindowPtr window); */ typedef Bool (*present_check_flip_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip); +/* Same as 'check_flip' but it can return a 'reason' why the flip would fail. + */ +typedef Bool (*present_check_flip2_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip, PresentFlipReason *reason); + /* Flip pixmap, return false if it didn't happen. * * 'crtc' is to be used for any necessary synchronization. @@ -75,6 +93,20 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc, uint64_t target_msc, PixmapPtr pixmap, Bool sync_flip); +/* Flip pixmap for window, return false if it didn't happen. + * + * Like present_flip_ptr, additionaly with: + * + * 'window' used for synchronization. + * + */ +typedef Bool (*present_wnmd_flip_ptr) (WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr damage); /* "unflip" back to the regular screen scanout buffer * @@ -83,7 +115,13 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc, typedef void (*present_unflip_ptr) (ScreenPtr screen, uint64_t event_id); -#define PRESENT_SCREEN_INFO_VERSION 0 +/* Doing flips has been discontinued. + * + * Inform driver for potential cleanup on its side. + */ +typedef void (*present_wnmd_flips_stop_ptr) (WindowPtr window); + +#define PRESENT_SCREEN_INFO_VERSION 1 typedef struct present_screen_info { uint32_t version; @@ -97,15 +135,37 @@ typedef struct present_screen_info { present_check_flip_ptr check_flip; present_flip_ptr flip; present_unflip_ptr unflip; + present_check_flip2_ptr check_flip2; } present_screen_info_rec, *present_screen_info_ptr; +typedef struct present_wnmd_info { + uint32_t version; + + present_get_crtc_ptr get_crtc; + present_wnmd_get_ust_msc_ptr get_ust_msc; + present_wnmd_queue_vblank_ptr queue_vblank; + present_wnmd_abort_vblank_ptr abort_vblank; + present_flush_ptr flush; + uint32_t capabilities; + present_check_flip2_ptr check_flip2; + present_wnmd_flip_ptr flip; + present_wnmd_flips_stop_ptr flips_stop; + +} present_wnmd_info_rec, *present_wnmd_info_ptr; + /* * Called when 'event_id' occurs. 'ust' and 'msc' indicate when the * event actually happened */ extern _X_EXPORT void present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc); +/* + * Called when 'event_id' occurs for 'window'. + * 'ust' and 'msc' indicate when the event actually happened + */ +extern _X_EXPORT void +present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint64_t msc); /* 'crtc' has been turned off, so any pending events will never occur. */ @@ -114,6 +174,8 @@ present_event_abandon(RRCrtcPtr crtc); extern _X_EXPORT Bool present_screen_init(ScreenPtr screen, present_screen_info_ptr info); +extern _X_EXPORT Bool +present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info); typedef void (*present_complete_notify_proc)(WindowPtr window, CARD8 kind, @@ -125,4 +187,7 @@ typedef void (*present_complete_notify_proc)(WindowPtr window, extern _X_EXPORT void present_register_complete_notify(present_complete_notify_proc proc); +extern _X_EXPORT Bool +present_can_window_flip(WindowPtr window); + #endif /* _PRESENT_H_ */ diff --git a/xserver/present/present_event.c b/xserver/present/present_event.c index c222dd5ff..9aebfdfce 100644 --- a/xserver/present/present_event.c +++ b/xserver/present/present_event.c @@ -91,6 +91,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) swapl(&c->serial); swapll(&c->ust); swapll(&c->msc); + break; } case PresentIdleNotify: { @@ -99,6 +100,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) swapl(&c->window); swapl(&c->serial); swapl(&c->idle_fence); + break; } } } diff --git a/xserver/present/present_execute.c b/xserver/present/present_execute.c new file mode 100644 index 000000000..8d1ef4a8c --- /dev/null +++ b/xserver/present/present_execute.c @@ -0,0 +1,122 @@ +/* + * Copyright © 2013 Keith Packard + * + * 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, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "present_priv.h" + +/* + * Called when the wait fence is triggered; just gets the current msc/ust and + * calls the proper execute again. That will re-check the fence and pend the + * request again if it's still not actually ready + */ +static void +present_wait_fence_triggered(void *param) +{ + present_vblank_ptr vblank = param; + ScreenPtr screen = vblank->screen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + screen_priv->re_execute(vblank); +} + +Bool +present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc) +{ + WindowPtr window = vblank->window; + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (vblank->requeue) { + vblank->requeue = FALSE; + if (msc_is_after(vblank->target_msc, crtc_msc) && + Success == screen_priv->queue_vblank(screen, + window, + vblank->crtc, + vblank->event_id, + vblank->target_msc)) + return TRUE; + } + + if (vblank->wait_fence) { + if (!present_fence_check_triggered(vblank->wait_fence)) { + present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank); + return TRUE; + } + } + return FALSE; +} + +void +present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc) +{ + WindowPtr window = vblank->window; + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + /* If present_flip failed, we may have to requeue for the target MSC */ + if (vblank->target_msc == crtc_msc + 1 && + Success == screen_priv->queue_vblank(screen, + window, + vblank->crtc, + vblank->event_id, + vblank->target_msc)) { + vblank->queued = TRUE; + return; + } + + present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off); + + /* present_copy_region sticks the region into a scratch GC, + * which is then freed, freeing the region + */ + vblank->update = NULL; + screen_priv->flush(window); + + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); +} + +void +present_execute_post(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) +{ + uint8_t mode; + + /* Compute correct CompleteMode + */ + if (vblank->kind == PresentCompleteKindPixmap) { + if (vblank->pixmap && vblank->window) { + if (vblank->has_suboptimal && vblank->reason == PRESENT_FLIP_REASON_BUFFER_FORMAT) + mode = PresentCompleteModeSuboptimalCopy; + else + mode = PresentCompleteModeCopy; + } else { + mode = PresentCompleteModeSkip; + } + } + else + mode = PresentCompleteModeCopy; + + present_vblank_notify(vblank, vblank->kind, mode, ust, crtc_msc); + present_vblank_destroy(vblank); +} diff --git a/xserver/present/present_fence.c b/xserver/present/present_fence.c index e09657d31..87e7e17d8 100644 --- a/xserver/present/present_fence.c +++ b/xserver/present/present_fence.c @@ -45,7 +45,7 @@ struct present_fence { * SyncTrigger callbacks */ static Bool -present_fence_sync_check_trigger(SyncTrigger *trigger, XSyncValue oldval) +present_fence_sync_check_trigger(SyncTrigger *trigger, int64_t oldval) { struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); diff --git a/xserver/present/present_priv.h b/xserver/present/present_priv.h index dfb4bdea9..5849b9e0b 100644 --- a/xserver/present/present_priv.h +++ b/xserver/present/present_priv.h @@ -34,6 +34,13 @@ #include #include #include +#include + +#if 0 +#define DebugPresent(x) ErrorF x +#else +#define DebugPresent(x) +#endif extern int present_request; @@ -73,11 +80,70 @@ struct present_vblank { Bool requeue; /* on queue, but target_msc has changed */ Bool flip; /* planning on using flip */ Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */ + Bool flip_idler; /* driver explicitly permitted idling */ Bool sync_flip; /* do flip synchronous to vblank */ Bool abort_flip; /* aborting this flip */ + PresentFlipReason reason; /* reason for which flip is not possible */ + Bool has_suboptimal; /* whether client can support SuboptimalCopy mode */ }; -typedef struct present_screen_priv { +typedef struct present_screen_priv present_screen_priv_rec, *present_screen_priv_ptr; +typedef struct present_window_priv present_window_priv_rec, *present_window_priv_ptr; + +/* + * Mode hooks + */ +typedef uint32_t (*present_priv_query_capabilities_ptr)(present_screen_priv_ptr screen_priv); +typedef RRCrtcPtr (*present_priv_get_crtc_ptr)(present_screen_priv_ptr screen_priv, + WindowPtr window); + +typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc, + WindowPtr window, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr valid, + int16_t x_off, + int16_t y_off, + PresentFlipReason *reason); +typedef void (*present_priv_check_flip_window_ptr)(WindowPtr window); +typedef Bool (*present_priv_can_window_flip_ptr)(WindowPtr window); + +typedef int (*present_priv_pixmap_ptr)(WindowPtr window, + PixmapPtr pixmap, + CARD32 serial, + RegionPtr valid, + RegionPtr update, + int16_t x_off, + int16_t y_off, + RRCrtcPtr target_crtc, + SyncFence *wait_fence, + SyncFence *idle_fence, + uint32_t options, + uint64_t window_msc, + uint64_t divisor, + uint64_t remainder, + present_notify_ptr notifies, + int num_notifies); + +typedef void (*present_priv_create_event_id_ptr)(present_window_priv_ptr window_priv, + present_vblank_ptr vblank); + +typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen, + WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc); +typedef void (*present_priv_flush_ptr)(WindowPtr window); +typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank); + +typedef void (*present_priv_abort_vblank_ptr)(ScreenPtr screen, + WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc); +typedef void (*present_priv_flip_destroy_ptr)(ScreenPtr screen); + +struct present_screen_priv { CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; DestroyWindowProcPtr DestroyWindow; @@ -97,7 +163,26 @@ typedef struct present_screen_priv { Bool flip_sync; present_screen_info_ptr info; -} present_screen_priv_rec, *present_screen_priv_ptr; + present_wnmd_info_ptr wnmd_info; + + /* Mode hooks */ + present_priv_query_capabilities_ptr query_capabilities; + present_priv_get_crtc_ptr get_crtc; + + present_priv_check_flip_ptr check_flip; + present_priv_check_flip_window_ptr check_flip_window; + present_priv_can_window_flip_ptr can_window_flip; + + present_priv_pixmap_ptr present_pixmap; + present_priv_create_event_id_ptr create_event_id; + + present_priv_queue_vblank_ptr queue_vblank; + present_priv_flush_ptr flush; + present_priv_re_execute_ptr re_execute; + + present_priv_abort_vblank_ptr abort_vblank; + present_priv_flip_destroy_ptr flip_destroy; +}; #define wrap(priv,real,mem,func) {\ priv->mem = real->mem; \ @@ -127,14 +212,24 @@ typedef struct present_event { int mask; } present_event_rec; -typedef struct present_window_priv { +struct present_window_priv { + WindowPtr window; present_event_ptr events; RRCrtcPtr crtc; /* Last reported CRTC from get_ust_msc */ uint64_t msc_offset; uint64_t msc; /* Last reported MSC from the current crtc */ struct xorg_list vblank; struct xorg_list notifies; -} present_window_priv_rec, *present_window_priv_ptr; + + /* Used for window flips */ + uint64_t event_id; + struct xorg_list exec_queue; + struct xorg_list flip_queue; + struct xorg_list idle_queue; + + present_vblank_ptr flip_pending; + present_vblank_ptr flip_active; +}; #define PresentCrtcNeverSet ((RRCrtcPtr) 1) @@ -149,9 +244,48 @@ present_window_priv(WindowPtr window) present_window_priv_ptr present_get_window_priv(WindowPtr window, Bool create); +/* + * Returns: + * TRUE if the first MSC value is after the second one + * FALSE if the first MSC value is equal to or before the second one + */ +static inline Bool +msc_is_after(uint64_t test, uint64_t reference) +{ + return (int64_t)(test - reference) > 0; +} + /* * present.c */ +uint32_t +present_query_capabilities(RRCrtcPtr crtc); + +RRCrtcPtr +present_get_crtc(WindowPtr window); + +void +present_copy_region(DrawablePtr drawable, + PixmapPtr pixmap, + RegionPtr update, + int16_t x_off, + int16_t y_off); + +void +present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct present_fence *present_fence); + +void +present_set_tree_pixmap(WindowPtr window, + PixmapPtr expected, + PixmapPtr pixmap); + +void +present_adjust_timings(uint32_t options, + uint64_t *crtc_msc, + uint64_t *target_msc, + uint64_t divisor, + uint64_t remainder); + int present_pixmap(WindowPtr window, PixmapPtr pixmap, @@ -177,33 +311,6 @@ present_notify_msc(WindowPtr window, uint64_t divisor, uint64_t remainder); -void -present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); - -void -present_vblank_destroy(present_vblank_ptr vblank); - -void -present_flip_destroy(ScreenPtr screen); - -void -present_restore_screen_pixmap(ScreenPtr screen); - -void -present_set_abort_flip(ScreenPtr screen); - -void -present_check_flip_window(WindowPtr window); - -RRCrtcPtr -present_get_crtc(WindowPtr window); - -uint32_t -present_query_capabilities(RRCrtcPtr crtc); - -Bool -present_init(void); - /* * present_event.c */ @@ -229,6 +336,18 @@ present_select_input(ClientPtr client, Bool present_event_init(void); +/* + * present_execute.c + */ +Bool +present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc); + +void +present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc); + +void +present_execute_post(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); + /* * present_fake.c */ @@ -304,8 +423,68 @@ proc_present_dispatch(ClientPtr client); int sproc_present_dispatch(ClientPtr client); +/* + * present_scmd.c + */ +void +present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); + +void +present_flip_destroy(ScreenPtr screen); + +void +present_restore_screen_pixmap(ScreenPtr screen); + +void +present_set_abort_flip(ScreenPtr screen); + +Bool +present_init(void); + +void +present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv); + /* * present_screen.c */ +/* + * present_vblank.c + */ +void +present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_t ust, uint64_t crtc_msc); + +present_vblank_ptr +present_vblank_create(WindowPtr window, + PixmapPtr pixmap, + CARD32 serial, + RegionPtr valid, + RegionPtr update, + int16_t x_off, + int16_t y_off, + RRCrtcPtr target_crtc, + SyncFence *wait_fence, + SyncFence *idle_fence, + uint32_t options, + const uint32_t *capabilities, + present_notify_ptr notifies, + int num_notifies, + uint64_t *target_msc, + uint64_t crtc_msc); + +void +present_vblank_scrap(present_vblank_ptr vblank); + +void +present_vblank_destroy(present_vblank_ptr vblank); + +/* + * present_wnmd.c + */ +void +present_wnmd_set_abort_flip(WindowPtr window); + +void +present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv); + #endif /* _PRESENT_PRIV_H_ */ diff --git a/xserver/present/present_request.c b/xserver/present/present_request.c index c7663fcc8..f52efa52b 100644 --- a/xserver/present/present_request.c +++ b/xserver/present/present_request.c @@ -41,7 +41,19 @@ proc_present_query_version(ClientPtr client) }; REQUEST_SIZE_MATCH(xPresentQueryVersionReq); - (void) stuff; + /* From presentproto: + * + * The client sends the highest supported version to the server + * and the server sends the highest version it supports, but no + * higher than the requested version. + */ + + if (rep.majorVersion > stuff->majorVersion || + rep.minorVersion > stuff->minorVersion) { + rep.majorVersion = stuff->majorVersion; + rep.minorVersion = stuff->minorVersion; + } + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -249,7 +261,7 @@ proc_present_dispatch(ClientPtr client) return (*proc_present_vector[stuff->data]) (client); } -static int +static int _X_COLD sproc_present_query_version(ClientPtr client) { REQUEST(xPresentQueryVersionReq); @@ -261,7 +273,7 @@ sproc_present_query_version(ClientPtr client) return (*proc_present_vector[stuff->presentReqType]) (client); } -static int +static int _X_COLD sproc_present_pixmap(ClientPtr client) { REQUEST(xPresentPixmapReq); @@ -281,7 +293,7 @@ sproc_present_pixmap(ClientPtr client) return (*proc_present_vector[stuff->presentReqType]) (client); } -static int +static int _X_COLD sproc_present_notify_msc(ClientPtr client) { REQUEST(xPresentNotifyMSCReq); @@ -295,7 +307,7 @@ sproc_present_notify_msc(ClientPtr client) return (*proc_present_vector[stuff->presentReqType]) (client); } -static int +static int _X_COLD sproc_present_select_input (ClientPtr client) { REQUEST(xPresentSelectInputReq); @@ -307,7 +319,7 @@ sproc_present_select_input (ClientPtr client) return (*proc_present_vector[stuff->presentReqType]) (client); } -static int +static int _X_COLD sproc_present_query_capabilities (ClientPtr client) { REQUEST(xPresentQueryCapabilitiesReq); @@ -325,7 +337,7 @@ static int (*sproc_present_vector[PresentNumberRequests]) (ClientPtr) = { sproc_present_query_capabilities, /* 4 */ }; -int +int _X_COLD sproc_present_dispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/present/present_scmd.c b/xserver/present/present_scmd.c new file mode 100644 index 000000000..3b7fbd832 --- /dev/null +++ b/xserver/present/present_scmd.c @@ -0,0 +1,843 @@ +/* + * Copyright © 2013 Keith Packard + * + * 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, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "present_priv.h" +#include +#include +#ifdef MONOTONIC_CLOCK +#include +#endif + +/* + * Screen flip mode + * + * Provides the default mode for drivers, that do not + * support flips and the full screen flip mode. + * + */ + +static uint64_t present_event_id; +static struct xorg_list present_exec_queue; +static struct xorg_list present_flip_queue; + +static void +present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); + +static void +present_scmd_create_event_id(present_window_priv_ptr window_priv, + present_vblank_ptr vblank) +{ + vblank->event_id = ++present_event_id; +} + +static inline PixmapPtr +present_flip_pending_pixmap(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!screen_priv) + return NULL; + + if (!screen_priv->flip_pending) + return NULL; + + return screen_priv->flip_pending->pixmap; +} + +static Bool +present_check_flip(RRCrtcPtr crtc, + WindowPtr window, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr valid, + int16_t x_off, + int16_t y_off, + PresentFlipReason *reason) +{ + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr screen_pixmap, window_pixmap; + WindowPtr root = screen->root; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (reason) + *reason = PRESENT_FLIP_REASON_UNKNOWN; + + if (!screen_priv) + return FALSE; + + if (!screen_priv->info) + return FALSE; + + if (!crtc) + return FALSE; + + /* Check to see if the driver supports flips at all */ + if (!screen_priv->info->flip) + return FALSE; + + /* Make sure the window hasn't been redirected with Composite */ + screen_pixmap = screen->GetScreenPixmap(screen); + window_pixmap = screen->GetWindowPixmap(window); + if (window_pixmap != screen_pixmap && + window_pixmap != screen_priv->flip_pixmap && + window_pixmap != present_flip_pending_pixmap(screen)) + return FALSE; + + /* Check for full-screen window */ + if (!RegionEqual(&window->clipList, &root->winSize)) { + return FALSE; + } + + /* Source pixmap must align with window exactly */ + if (x_off || y_off) { + return FALSE; + } + + /* Make sure the area marked as valid fills the screen */ + if (valid && !RegionEqual(valid, &root->winSize)) { + return FALSE; + } + + /* Does the window match the pixmap exactly? */ + if (window->drawable.x != 0 || window->drawable.y != 0 || +#ifdef COMPOSITE + window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || +#endif + window->drawable.width != pixmap->drawable.width || + window->drawable.height != pixmap->drawable.height || + pixmap->devKind != screen_pixmap->devKind) { + return FALSE; + } + + /* Ask the driver for permission */ + if (screen_priv->info->version >= 1 && screen_priv->info->check_flip2) { + if (!(*screen_priv->info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) { + DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0)); + return FALSE; + } + } else if (screen_priv->info->check_flip) { + if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) { + DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0)); + return FALSE; + } + } + + return TRUE; +} + +static Bool +present_flip(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip) +{ + ScreenPtr screen = crtc->pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + return (*screen_priv->info->flip) (crtc, event_id, target_msc, pixmap, sync_flip); +} + +static RRCrtcPtr +present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) +{ + if (!screen_priv->info) + return NULL; + + return (*screen_priv->info->get_crtc)(window); +} + +static uint32_t +present_scmd_query_capabilities(present_screen_priv_ptr screen_priv) +{ + if (!screen_priv->info) + return 0; + + return screen_priv->info->capabilities; +} + +static int +present_get_ust_msc(ScreenPtr screen, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (crtc == NULL) + return present_fake_get_ust_msc(screen, ust, msc); + else + return (*screen_priv->info->get_ust_msc)(crtc, ust, msc); +} + +static void +present_flush(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!screen_priv) + return; + + if (!screen_priv->info) + return; + + (*screen_priv->info->flush) (window); +} + +static int +present_queue_vblank(ScreenPtr screen, + WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + Bool ret; + + if (crtc == NULL) + ret = present_fake_queue_vblank(screen, event_id, msc); + else + { + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + ret = (*screen_priv->info->queue_vblank) (crtc, event_id, msc); + } + return ret; +} + +static uint64_t +present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) +{ + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + + if (crtc != window_priv->crtc) { + uint64_t old_ust, old_msc; + + if (window_priv->crtc == PresentCrtcNeverSet) { + window_priv->msc_offset = 0; + } else { + /* The old CRTC may have been turned off, in which case + * we'll just use whatever previous MSC we'd seen from this CRTC + */ + + if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success) + old_msc = window_priv->msc; + + window_priv->msc_offset += new_msc - old_msc; + } + window_priv->crtc = crtc; + } + + return window_msc + window_priv->msc_offset; +} + +/* + * When the wait fence or previous flip is completed, it's time + * to re-try the request + */ +static void +present_re_execute(present_vblank_ptr vblank) +{ + uint64_t ust = 0, crtc_msc = 0; + + if (vblank->crtc) + (void) present_get_ust_msc(vblank->screen, vblank->crtc, &ust, &crtc_msc); + + present_execute(vblank, ust, crtc_msc); +} + +static void +present_flip_try_ready(ScreenPtr screen) +{ + present_vblank_ptr vblank; + + xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { + if (vblank->queued) { + present_re_execute(vblank); + return; + } + } +} + +static void +present_flip_idle(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (screen_priv->flip_pixmap) { + present_pixmap_idle(screen_priv->flip_pixmap, screen_priv->flip_window, + screen_priv->flip_serial, screen_priv->flip_idle_fence); + if (screen_priv->flip_idle_fence) + present_fence_destroy(screen_priv->flip_idle_fence); + dixDestroyPixmap(screen_priv->flip_pixmap, screen_priv->flip_pixmap->drawable.id); + screen_priv->flip_crtc = NULL; + screen_priv->flip_window = NULL; + screen_priv->flip_serial = 0; + screen_priv->flip_pixmap = NULL; + screen_priv->flip_idle_fence = NULL; + } +} + +void +present_restore_screen_pixmap(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + PixmapPtr screen_pixmap = (*screen->GetScreenPixmap)(screen); + PixmapPtr flip_pixmap; + WindowPtr flip_window; + + if (screen_priv->flip_pending) { + flip_window = screen_priv->flip_pending->window; + flip_pixmap = screen_priv->flip_pending->pixmap; + } else { + flip_window = screen_priv->flip_window; + flip_pixmap = screen_priv->flip_pixmap; + } + + assert (flip_pixmap); + + /* Update the screen pixmap with the current flip pixmap contents + * Only do this the first time for a particular unflip operation, or + * we'll probably scribble over other windows + */ + if (screen->root && screen->GetWindowPixmap(screen->root) == flip_pixmap) + present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0); + + /* Switch back to using the screen pixmap now to avoid + * 2D applications drawing to the wrong pixmap. + */ + if (flip_window) + present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap); + if (screen->root) + present_set_tree_pixmap(screen->root, NULL, screen_pixmap); +} + +void +present_set_abort_flip(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!screen_priv->flip_pending->abort_flip) { + present_restore_screen_pixmap(screen); + screen_priv->flip_pending->abort_flip = TRUE; + } +} + +static void +present_unflip(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + assert (!screen_priv->unflip_event_id); + assert (!screen_priv->flip_pending); + + present_restore_screen_pixmap(screen); + + screen_priv->unflip_event_id = ++present_event_id; + DebugPresent(("u %" PRIu64 "\n", screen_priv->unflip_event_id)); + (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id); +} + +static void +present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) +{ + ScreenPtr screen = vblank->screen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank->event_id, vblank, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + + assert (vblank == screen_priv->flip_pending); + + present_flip_idle(screen); + + xorg_list_del(&vblank->event_queue); + + /* Transfer reference for pixmap and fence from vblank to screen_priv */ + screen_priv->flip_crtc = vblank->crtc; + screen_priv->flip_window = vblank->window; + screen_priv->flip_serial = vblank->serial; + screen_priv->flip_pixmap = vblank->pixmap; + screen_priv->flip_sync = vblank->sync_flip; + screen_priv->flip_idle_fence = vblank->idle_fence; + + vblank->pixmap = NULL; + vblank->idle_fence = NULL; + + screen_priv->flip_pending = NULL; + + if (vblank->abort_flip) + present_unflip(screen); + + present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); + present_vblank_destroy(vblank); + + present_flip_try_ready(screen); +} + +void +present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc) +{ + present_vblank_ptr vblank; + int s; + + if (!event_id) + return; + DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", event_id, ust, msc)); + xorg_list_for_each_entry(vblank, &present_exec_queue, event_queue) { + int64_t match = event_id - vblank->event_id; + if (match == 0) { + present_execute(vblank, ust, msc); + return; + } + } + xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { + if (vblank->event_id == event_id) { + if (vblank->queued) + present_execute(vblank, ust, msc); + else + present_flip_notify(vblank, ust, msc); + return; + } + } + + for (s = 0; s < screenInfo.numScreens; s++) { + ScreenPtr screen = screenInfo.screens[s]; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (event_id == screen_priv->unflip_event_id) { + DebugPresent(("\tun %" PRIu64 "\n", event_id)); + screen_priv->unflip_event_id = 0; + present_flip_idle(screen); + present_flip_try_ready(screen); + return; + } + } +} + +/* + * 'window' is being reconfigured. Check to see if it is involved + * in flipping and clean up as necessary + */ +static void +present_check_flip_window (WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr flip_pending = screen_priv->flip_pending; + present_vblank_ptr vblank; + PresentFlipReason reason; + + /* If this window hasn't ever been used with Present, it can't be + * flipping + */ + if (!window_priv) + return; + + if (screen_priv->unflip_event_id) + return; + + if (flip_pending) { + /* + * Check pending flip + */ + if (flip_pending->window == window) { + if (!present_check_flip(flip_pending->crtc, window, flip_pending->pixmap, + flip_pending->sync_flip, NULL, 0, 0, NULL)) + present_set_abort_flip(screen); + } + } else { + /* + * Check current flip + */ + if (window == screen_priv->flip_window) { + if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, screen_priv->flip_sync, NULL, 0, 0, NULL)) + present_unflip(screen); + } + } + + /* Now check any queued vblanks */ + xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) { + if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, vblank->sync_flip, NULL, 0, 0, &reason)) { + vblank->flip = FALSE; + vblank->reason = reason; + if (vblank->sync_flip) + vblank->requeue = TRUE; + } + } +} + +static Bool +present_scmd_can_window_flip(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr window_pixmap; + WindowPtr root = screen->root; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!screen_priv) + return FALSE; + + if (!screen_priv->info) + return FALSE; + + /* Check to see if the driver supports flips at all */ + if (!screen_priv->info->flip) + return FALSE; + + /* Make sure the window hasn't been redirected with Composite */ + window_pixmap = screen->GetWindowPixmap(window); + if (window_pixmap != screen->GetScreenPixmap(screen) && + window_pixmap != screen_priv->flip_pixmap && + window_pixmap != present_flip_pending_pixmap(screen)) + return FALSE; + + /* Check for full-screen window */ + if (!RegionEqual(&window->clipList, &root->winSize)) { + return FALSE; + } + + /* Does the window match the pixmap exactly? */ + if (window->drawable.x != 0 || window->drawable.y != 0) { + return FALSE; + } + + return TRUE; +} + +/* + * Once the required MSC has been reached, execute the pending request. + * + * For requests to actually present something, either blt contents to + * the screen or queue a frame buffer swap. + * + * For requests to just get the current MSC/UST combo, skip that part and + * go straight to event delivery + */ + +static void +present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) +{ + WindowPtr window = vblank->window; + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (present_execute_wait(vblank, crtc_msc)) + return; + + if (vblank->flip && vblank->pixmap && vblank->window) { + if (screen_priv->flip_pending || screen_priv->unflip_event_id) { + DebugPresent(("\tr %" PRIu64 " %p (pending %p unflip %" PRIu64 ")\n", + vblank->event_id, vblank, + screen_priv->flip_pending, screen_priv->unflip_event_id)); + xorg_list_del(&vblank->event_queue); + xorg_list_append(&vblank->event_queue, &present_flip_queue); + vblank->flip_ready = TRUE; + return; + } + } + + xorg_list_del(&vblank->event_queue); + xorg_list_del(&vblank->window_list); + vblank->queued = FALSE; + + if (vblank->pixmap && vblank->window) { + + if (vblank->flip) { + + DebugPresent(("\tf %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank->event_id, vblank, crtc_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id)); + + /* Prepare to flip by placing it in the flip queue and + * and sticking it into the flip_pending field + */ + screen_priv->flip_pending = vblank; + + xorg_list_add(&vblank->event_queue, &present_flip_queue); + /* Try to flip + */ + if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) { + RegionPtr damage; + + /* Fix window pixmaps: + * 1) Restore previous flip window pixmap + * 2) Set current flip window pixmap to the new pixmap + */ + if (screen_priv->flip_window && screen_priv->flip_window != window) + present_set_tree_pixmap(screen_priv->flip_window, + screen_priv->flip_pixmap, + (*screen->GetScreenPixmap)(screen)); + present_set_tree_pixmap(vblank->window, NULL, vblank->pixmap); + present_set_tree_pixmap(screen->root, NULL, vblank->pixmap); + + /* Report update region as damaged + */ + if (vblank->update) { + damage = vblank->update; + RegionIntersect(damage, damage, &window->clipList); + } else + damage = &window->clipList; + + DamageDamageRegion(&vblank->window->drawable, damage); + return; + } + + xorg_list_del(&vblank->event_queue); + /* Oops, flip failed. Clear the flip_pending field + */ + screen_priv->flip_pending = NULL; + vblank->flip = FALSE; + } + DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); + if (screen_priv->flip_pending) { + + /* Check pending flip + */ + if (window == screen_priv->flip_pending->window) + present_set_abort_flip(screen); + } else if (!screen_priv->unflip_event_id) { + + /* Check current flip + */ + if (window == screen_priv->flip_window) + present_unflip(screen); + } + + present_execute_copy(vblank, crtc_msc); + + if (vblank->queued) { + xorg_list_add(&vblank->event_queue, &present_exec_queue); + xorg_list_append(&vblank->window_list, + &present_get_window_priv(window, TRUE)->vblank); + return; + } + } + + present_execute_post(vblank, ust, crtc_msc); +} + +static int +present_scmd_pixmap(WindowPtr window, + PixmapPtr pixmap, + CARD32 serial, + RegionPtr valid, + RegionPtr update, + int16_t x_off, + int16_t y_off, + RRCrtcPtr target_crtc, + SyncFence *wait_fence, + SyncFence *idle_fence, + uint32_t options, + uint64_t window_msc, + uint64_t divisor, + uint64_t remainder, + present_notify_ptr notifies, + int num_notifies) +{ + uint64_t ust = 0; + uint64_t target_msc; + uint64_t crtc_msc = 0; + int ret; + present_vblank_ptr vblank, tmp; + ScreenPtr screen = window->drawable.pScreen; + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!window_priv) + return BadAlloc; + + if (!screen_priv || !screen_priv->info) + target_crtc = NULL; + else if (!target_crtc) { + /* Update the CRTC if we have a pixmap or we don't have a CRTC + */ + if (!pixmap) + target_crtc = window_priv->crtc; + + if (!target_crtc || target_crtc == PresentCrtcNeverSet) + target_crtc = present_get_crtc(window); + } + + ret = present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); + + target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); + + if (ret == Success) { + /* Stash the current MSC away in case we need it later + */ + window_priv->msc = crtc_msc; + } + + present_adjust_timings(options, + &crtc_msc, + &target_msc, + divisor, + remainder); + + /* + * Look for a matching presentation already on the list and + * don't bother doing the previous one if this one will overwrite it + * in the same frame + */ + + if (!update && pixmap) { + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { + + if (!vblank->pixmap) + continue; + + if (!vblank->queued) + continue; + + if (vblank->crtc != target_crtc || vblank->target_msc != target_msc) + continue; + + DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", + vblank->event_id, vblank, vblank->target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + vblank->crtc)); + + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + present_fence_destroy(vblank->idle_fence); + dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); + + vblank->pixmap = NULL; + vblank->idle_fence = NULL; + vblank->flip = FALSE; + if (vblank->flip_ready) + present_re_execute(vblank); + } + } + + vblank = present_vblank_create(window, + pixmap, + serial, + valid, + update, + x_off, + y_off, + target_crtc, + wait_fence, + idle_fence, + options, + screen_priv->info ? &screen_priv->info->capabilities : NULL, + notifies, + num_notifies, + &target_msc, + crtc_msc); + + if (!vblank) + return BadAlloc; + + xorg_list_append(&vblank->event_queue, &present_exec_queue); + vblank->queued = TRUE; + if (msc_is_after(target_msc, crtc_msc)) { + ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc); + if (ret == Success) + return Success; + + DebugPresent(("present_queue_vblank failed\n")); + } + + present_execute(vblank, ust, crtc_msc); + + return Success; +} + +static void +present_scmd_abort_vblank(ScreenPtr screen, WindowPtr window, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + present_vblank_ptr vblank; + + if (crtc == NULL) + present_fake_abort_vblank(screen, event_id, msc); + else + { + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + (*screen_priv->info->abort_vblank) (crtc, event_id, msc); + } + + xorg_list_for_each_entry(vblank, &present_exec_queue, event_queue) { + int64_t match = event_id - vblank->event_id; + if (match == 0) { + xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; + return; + } + } + xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { + if (vblank->event_id == event_id) { + xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; + return; + } + } +} + +static void +present_scmd_flip_destroy(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + /* Reset window pixmaps back to the screen pixmap */ + if (screen_priv->flip_pending) + present_set_abort_flip(screen); + + /* Drop reference to any pending flip or unflip pixmaps. */ + present_flip_idle(screen); +} + +void +present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv) +{ + screen_priv->query_capabilities = &present_scmd_query_capabilities; + screen_priv->get_crtc = &present_scmd_get_crtc; + + screen_priv->check_flip = &present_check_flip; + screen_priv->check_flip_window = &present_check_flip_window; + screen_priv->can_window_flip = &present_scmd_can_window_flip; + + screen_priv->present_pixmap = &present_scmd_pixmap; + screen_priv->create_event_id = &present_scmd_create_event_id; + + screen_priv->queue_vblank = &present_queue_vblank; + screen_priv->flush = &present_flush; + screen_priv->re_execute = &present_re_execute; + + screen_priv->abort_vblank = &present_scmd_abort_vblank; + screen_priv->flip_destroy = &present_scmd_flip_destroy; +} + +Bool +present_init(void) +{ + xorg_list_init(&present_exec_queue); + xorg_list_init(&present_flip_queue); + present_fake_queue_init(); + return TRUE; +} diff --git a/xserver/present/present_screen.c b/xserver/present/present_screen.c index 9d03c8aa4..c7e37c5fd 100644 --- a/xserver/present/present_screen.c +++ b/xserver/present/present_screen.c @@ -45,6 +45,12 @@ present_get_window_priv(WindowPtr window, Bool create) return NULL; xorg_list_init(&window_priv->vblank); xorg_list_init(&window_priv->notifies); + + xorg_list_init(&window_priv->exec_queue); + xorg_list_init(&window_priv->flip_queue); + xorg_list_init(&window_priv->idle_queue); + + window_priv->window = window; window_priv->crtc = PresentCrtcNeverSet; dixSetPrivate(&window->devPrivates, &present_window_private_key, window_priv); return window_priv; @@ -58,7 +64,7 @@ present_close_screen(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_flip_destroy(screen); + screen_priv->flip_destroy(screen); unwrap(screen_priv, screen, CloseScreen); (*screen->CloseScreen) (screen); @@ -72,11 +78,13 @@ present_close_screen(ScreenPtr screen) static void present_free_window_vblank(WindowPtr window) { + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_window_priv_ptr window_priv = present_window_priv(window); present_vblank_ptr vblank, tmp; xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { - present_abort_vblank(window->drawable.pScreen, vblank->crtc, vblank->event_id, vblank->target_msc); + screen_priv->abort_vblank(window->drawable.pScreen, window, vblank->crtc, vblank->event_id, vblank->target_msc); present_vblank_destroy(vblank); } } @@ -101,6 +109,32 @@ present_clear_window_flip(WindowPtr window) } } +static void +present_wnmd_clear_window_flip(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr vblank, tmp; + + if (window_priv->flip_pending) { + present_wnmd_set_abort_flip(window); + window_priv->flip_pending->window = NULL; + } + + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) { + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + /* The pixmap will be destroyed by freeing the window resources. */ + vblank->pixmap = NULL; + present_vblank_destroy(vblank); + } + + vblank = window_priv->flip_active; + if (vblank) { + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + present_vblank_destroy(vblank); + } + window_priv->flip_active = NULL; +} + /* * Hook the close window function to clean up our window private */ @@ -116,7 +150,12 @@ present_destroy_window(WindowPtr window) present_clear_window_notifies(window); present_free_events(window); present_free_window_vblank(window); - present_clear_window_flip(window); + + if (screen_priv->wnmd_info) + present_wnmd_clear_window_flip(window); + else + present_clear_window_flip(window); + free(window_priv); } unwrap(screen_priv, screen, DestroyWindow); @@ -161,18 +200,15 @@ present_clip_notify(WindowPtr window, int dx, int dy) ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_check_flip_window(window); + screen_priv->check_flip_window(window); unwrap(screen_priv, screen, ClipNotify) if (screen->ClipNotify) screen->ClipNotify (window, dx, dy); wrap(screen_priv, screen, ClipNotify, present_clip_notify); } -/* - * Initialize a screen for use with present - */ -int -present_screen_init(ScreenPtr screen, present_screen_info_ptr info) +static Bool +present_screen_register_priv_keys(void) { if (!dixRegisterPrivateKey(&present_screen_private_key, PRIVATE_SCREEN, 0)) return FALSE; @@ -180,19 +216,65 @@ present_screen_init(ScreenPtr screen, present_screen_info_ptr info) if (!dixRegisterPrivateKey(&present_window_private_key, PRIVATE_WINDOW, 0)) return FALSE; + return TRUE; +} + +static present_screen_priv_ptr +present_screen_priv_init(ScreenPtr screen) +{ + present_screen_priv_ptr screen_priv; + + screen_priv = calloc(1, sizeof (present_screen_priv_rec)); + if (!screen_priv) + return NULL; + + wrap(screen_priv, screen, CloseScreen, present_close_screen); + wrap(screen_priv, screen, DestroyWindow, present_destroy_window); + wrap(screen_priv, screen, ConfigNotify, present_config_notify); + wrap(screen_priv, screen, ClipNotify, present_clip_notify); + + dixSetPrivate(&screen->devPrivates, &present_screen_private_key, screen_priv); + + return screen_priv; +} + +/* + * Initialize a screen for use with present in window flip mode (wnmd) + */ +int +present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info) +{ + if (!present_screen_register_priv_keys()) + return FALSE; + if (!present_screen_priv(screen)) { - present_screen_priv_ptr screen_priv = calloc(1, sizeof (present_screen_priv_rec)); + present_screen_priv_ptr screen_priv = present_screen_priv_init(screen); if (!screen_priv) return FALSE; - wrap(screen_priv, screen, CloseScreen, present_close_screen); - wrap(screen_priv, screen, DestroyWindow, present_destroy_window); - wrap(screen_priv, screen, ConfigNotify, present_config_notify); - wrap(screen_priv, screen, ClipNotify, present_clip_notify); + screen_priv->wnmd_info = info; + present_wnmd_init_mode_hooks(screen_priv); + } + + return TRUE; +} + +/* + * Initialize a screen for use with present in default screen flip mode (scmd) + */ +int +present_screen_init(ScreenPtr screen, present_screen_info_ptr info) +{ + if (!present_screen_register_priv_keys()) + return FALSE; + + if (!present_screen_priv(screen)) { + present_screen_priv_ptr screen_priv = present_screen_priv_init(screen); + if (!screen_priv) + return FALSE; screen_priv->info = info; - - dixSetPrivate(&screen->devPrivates, &present_screen_private_key, screen_priv); + present_scmd_init_mode_hooks(screen_priv); present_fake_screen_init(screen); } diff --git a/xserver/present/present_vblank.c b/xserver/present/present_vblank.c new file mode 100644 index 000000000..2c124f4bb --- /dev/null +++ b/xserver/present/present_vblank.c @@ -0,0 +1,203 @@ +/* + * Copyright © 2013 Keith Packard + * + * 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, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "present_priv.h" + +void +present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_t ust, uint64_t crtc_msc) +{ + int n; + + if (vblank->window) + present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset); + for (n = 0; n < vblank->num_notifies; n++) { + WindowPtr window = vblank->notifies[n].window; + CARD32 serial = vblank->notifies[n].serial; + + if (window) + present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset); + } +} + +present_vblank_ptr +present_vblank_create(WindowPtr window, + PixmapPtr pixmap, + CARD32 serial, + RegionPtr valid, + RegionPtr update, + int16_t x_off, + int16_t y_off, + RRCrtcPtr target_crtc, + SyncFence *wait_fence, + SyncFence *idle_fence, + uint32_t options, + const uint32_t *capabilities, + present_notify_ptr notifies, + int num_notifies, + uint64_t *target_msc, + uint64_t crtc_msc) +{ + ScreenPtr screen = window->drawable.pScreen; + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + present_vblank_ptr vblank; + PresentFlipReason reason = PRESENT_FLIP_REASON_UNKNOWN; + + vblank = calloc (1, sizeof (present_vblank_rec)); + if (!vblank) + return NULL; + + xorg_list_append(&vblank->window_list, &window_priv->vblank); + xorg_list_init(&vblank->event_queue); + + vblank->screen = screen; + vblank->window = window; + vblank->pixmap = pixmap; + + screen_priv->create_event_id(window_priv, vblank); + + if (pixmap) { + vblank->kind = PresentCompleteKindPixmap; + pixmap->refcnt++; + } else + vblank->kind = PresentCompleteKindNotifyMSC; + + vblank->serial = serial; + + if (valid) { + vblank->valid = RegionDuplicate(valid); + if (!vblank->valid) + goto no_mem; + } + if (update) { + vblank->update = RegionDuplicate(update); + if (!vblank->update) + goto no_mem; + } + + vblank->x_off = x_off; + vblank->y_off = y_off; + vblank->target_msc = *target_msc; + vblank->crtc = target_crtc; + vblank->msc_offset = window_priv->msc_offset; + vblank->notifies = notifies; + vblank->num_notifies = num_notifies; + vblank->has_suboptimal = (options & PresentOptionSuboptimal); + vblank->flip_idler = FALSE; + + if (pixmap != NULL && + !(options & PresentOptionCopy) && + capabilities) { + if (msc_is_after(*target_msc, crtc_msc) && + screen_priv->check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off, &reason)) + { + vblank->flip = TRUE; + vblank->sync_flip = TRUE; + *target_msc = *target_msc - 1; + } else if ((*capabilities & PresentCapabilityAsync) && + screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason)) + { + vblank->flip = TRUE; + } + } + vblank->reason = reason; + + if (wait_fence) { + vblank->wait_fence = present_fence_create(wait_fence); + if (!vblank->wait_fence) + goto no_mem; + } + + if (idle_fence) { + vblank->idle_fence = present_fence_create(idle_fence); + if (!vblank->idle_fence) + goto no_mem; + } + + if (pixmap) + DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n", + vblank->event_id, vblank, *target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + target_crtc, vblank->flip, vblank->sync_flip, vblank->serial)); + return vblank; + +no_mem: + vblank->notifies = NULL; + present_vblank_destroy(vblank); + return NULL; +} + +void +present_vblank_scrap(present_vblank_ptr vblank) +{ + DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n", + vblank->event_id, vblank, vblank->target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + vblank->crtc)); + + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + present_fence_destroy(vblank->idle_fence); + dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); + + vblank->pixmap = NULL; + vblank->idle_fence = NULL; + vblank->flip = FALSE; +} + +void +present_vblank_destroy(present_vblank_ptr vblank) +{ + /* Remove vblank from window and screen lists */ + xorg_list_del(&vblank->window_list); + /* Also make sure vblank is removed from event queue (wnmd) */ + xorg_list_del(&vblank->event_queue); + + DebugPresent(("\td %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank->event_id, vblank, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + + /* Drop pixmap reference */ + if (vblank->pixmap) + dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); + + /* Free regions */ + if (vblank->valid) + RegionDestroy(vblank->valid); + if (vblank->update) + RegionDestroy(vblank->update); + + if (vblank->wait_fence) + present_fence_destroy(vblank->wait_fence); + + if (vblank->idle_fence) + present_fence_destroy(vblank->idle_fence); + + if (vblank->notifies) + present_destroy_notifies(vblank->notifies, vblank->num_notifies); + + free(vblank); +} diff --git a/xserver/present/present_wnmd.c b/xserver/present/present_wnmd.c new file mode 100644 index 000000000..9d0b147cc --- /dev/null +++ b/xserver/present/present_wnmd.c @@ -0,0 +1,705 @@ +/* + * Copyright © 2018 Roman Gilg + * + * 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, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "present_priv.h" + +/* + * Window flip mode + * + * Provides per-window flips. Flips can be processed on windows that + * have the same size as their parents, which they share their pixmap with. + * + * A flip still requires a copy currently, since the original pixmap needs + * to be updated with the new pixmap content. Just a flip of all windows + * to the new pixmap is diffcult, because the original pixmap might not be + * controlled by the Xserver. + * + */ + +static void +present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); + +static void +present_wnmd_create_event_id(present_window_priv_ptr window_priv, present_vblank_ptr vblank) +{ + vblank->event_id = ++window_priv->event_id; +} + +static uint32_t +present_wnmd_query_capabilities(present_screen_priv_ptr screen_priv) +{ + return screen_priv->wnmd_info->capabilities; +} + +static RRCrtcPtr +present_wnmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) +{ + return (*screen_priv->wnmd_info->get_crtc)(window); +} + +static int +present_wnmd_get_ust_msc(ScreenPtr screen, WindowPtr window, uint64_t *ust, uint64_t *msc) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + return (*screen_priv->wnmd_info->get_ust_msc)(window, ust, msc); +} + +/* + * When the wait fence or previous flip is completed, it's time + * to re-try the request + */ +static void +present_wnmd_re_execute(present_vblank_ptr vblank) +{ + uint64_t ust = 0, crtc_msc = 0; + + (void) present_wnmd_get_ust_msc(vblank->screen, vblank->window, &ust, &crtc_msc); + present_wnmd_execute(vblank, ust, crtc_msc); +} + +static void +present_wnmd_flip_try_ready(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr vblank; + + xorg_list_for_each_entry(vblank, &window_priv->flip_queue, event_queue) { + if (vblank->queued) { + present_wnmd_re_execute(vblank); + return; + } + } +} + +static void +present_wnmd_free_idle_vblank(present_vblank_ptr vblank) +{ + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + present_vblank_destroy(vblank); +} + +/* + * Free any left over idle vblanks + */ +static void +present_wnmd_free_idle_vblanks(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr vblank, tmp; + + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) { + present_wnmd_free_idle_vblank(vblank); + } + + if (window_priv->flip_active) { + present_wnmd_free_idle_vblank(window_priv->flip_active); + window_priv->flip_active = NULL; + } +} + +static WindowPtr +present_wnmd_toplvl_pixmap_window(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr pixmap = (*screen->GetWindowPixmap)(window); + WindowPtr w = window; + WindowPtr next_w; + + while(w->parent) { + next_w = w->parent; + if ( (*screen->GetWindowPixmap)(next_w) != pixmap) { + break; + } + w = next_w; + } + return w; +} + +void +present_wnmd_set_abort_flip(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + + if (!window_priv->flip_pending->abort_flip) { + window_priv->flip_pending->abort_flip = TRUE; + } +} + +static void +present_wnmd_flips_stop(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_screen_priv_ptr screen_priv = present_screen_priv(window->drawable.pScreen); + + assert (!window_priv->flip_pending); + + (*screen_priv->wnmd_info->flips_stop) (window); + + present_wnmd_free_idle_vblanks(window_priv->window); + present_wnmd_flip_try_ready(window_priv->window); +} + +static void +present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) +{ + WindowPtr window = vblank->window; + present_window_priv_ptr window_priv = present_window_priv(window); + + DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank->event_id, vblank, vblank->target_msc, + vblank->pixmap ? vblank->pixmap->drawable.id : 0, + vblank->window ? vblank->window->drawable.id : 0)); + + assert (vblank == window_priv->flip_pending); + + xorg_list_del(&vblank->event_queue); + + if (window_priv->flip_active) { + if (window_priv->flip_active->flip_idler) + present_wnmd_free_idle_vblank(window_priv->flip_active); + else + /* Put the previous flip in the idle_queue and wait for further notice from DDX */ + xorg_list_append(&window_priv->flip_active->event_queue, &window_priv->idle_queue); + } + + window_priv->flip_active = vblank; + window_priv->flip_pending = NULL; + + present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); + + if (vblank->abort_flip) + present_wnmd_flips_stop(window); + + present_wnmd_flip_try_ready(window); +} + +void +present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint64_t msc) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr vblank; + + if (!window_priv) + return; + if (!event_id) + return; + + if (window_priv->flip_active && window_priv->flip_active->event_id == event_id) { + /* Notify for active flip, means it is allowed to become idle */ + window_priv->flip_active->flip_idler = TRUE; + return; + } + + DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", event_id, ust, msc)); + xorg_list_for_each_entry(vblank, &window_priv->exec_queue, event_queue) { + if (event_id == vblank->event_id) { + present_wnmd_execute(vblank, ust, msc); + return; + } + } + xorg_list_for_each_entry(vblank, &window_priv->flip_queue, event_queue) { + if (vblank->event_id == event_id) { + if (vblank->queued) { + present_wnmd_execute(vblank, ust, msc); + } else { + assert(vblank->window); + present_wnmd_flip_notify(vblank, ust, msc); + } + return; + } + } + + xorg_list_for_each_entry(vblank, &window_priv->idle_queue, event_queue) { + if (vblank->event_id == event_id) { + present_wnmd_free_idle_vblank(vblank); + return; + } + } +} + +static Bool +present_wnmd_check_flip(RRCrtcPtr crtc, + WindowPtr window, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr valid, + int16_t x_off, + int16_t y_off, + PresentFlipReason *reason) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + WindowPtr toplvl_window = present_wnmd_toplvl_pixmap_window(window); + + if (reason) + *reason = PRESENT_FLIP_REASON_UNKNOWN; + + if (!screen_priv) + return FALSE; + + if (!screen_priv->wnmd_info) + return FALSE; + + if (!crtc) + return FALSE; + + /* Check to see if the driver supports flips at all */ + if (!screen_priv->wnmd_info->flip) + return FALSE; + + /* Can't flip redirected child windows */ + if (screen->GetWindowPixmap(window) != screen->GetWindowPixmap(toplvl_window)) + return FALSE; + + /* Source pixmap must align with window exactly */ + if (x_off || y_off) + return FALSE; + + // TODO: Check for valid region? + + /* Flip pixmap must have same dimensions as window */ + if (window->drawable.width != pixmap->drawable.width || + window->drawable.height != pixmap->drawable.height) + return FALSE; + + /* Window must be same region as toplevel window */ + if ( !RegionEqual(&window->winSize, &toplvl_window->winSize) ) + return FALSE; + + /* Ask the driver for permission */ + if (screen_priv->wnmd_info->check_flip2) { + if (!(*screen_priv->wnmd_info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) { + DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n", + window->drawable.id, pixmap ? pixmap->drawable.id : 0)); + return FALSE; + } + } + + return TRUE; +} + +/* + * 'window' is being reconfigured. Check to see if it is involved + * in flipping and clean up as necessary. + */ +static void +present_wnmd_check_flip_window (WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr flip_pending; + present_vblank_ptr flip_active; + present_vblank_ptr vblank; + PresentFlipReason reason; + + /* If this window hasn't ever been used with Present, it can't be + * flipping + */ + if (!window_priv) + return; + + flip_pending = window_priv->flip_pending; + flip_active = window_priv->flip_active; + + if (flip_pending) { + if (!present_wnmd_check_flip(flip_pending->crtc, flip_pending->window, flip_pending->pixmap, + flip_pending->sync_flip, NULL, 0, 0, NULL)) + present_wnmd_set_abort_flip(window); + } else if (flip_active) { + if (!present_wnmd_check_flip(flip_active->crtc, flip_active->window, flip_active->pixmap, + flip_active->sync_flip, NULL, 0, 0, NULL)) + present_wnmd_flips_stop(window); + } + + /* Now check any queued vblanks */ + xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) { + if (vblank->queued && vblank->flip && + !present_wnmd_check_flip(vblank->crtc, window, vblank->pixmap, + vblank->sync_flip, NULL, 0, 0, &reason)) { + vblank->flip = FALSE; + vblank->reason = reason; + if (vblank->sync_flip) + vblank->requeue = TRUE; + } + } +} + +static Bool +present_wnmd_flip(WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip, + RegionPtr damage) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + return (*screen_priv->wnmd_info->flip) (window, + crtc, + event_id, + target_msc, + pixmap, + sync_flip, + damage); +} + +static void +present_wnmd_cancel_flip(WindowPtr window) +{ + present_window_priv_ptr window_priv = present_window_priv(window); + + if (window_priv->flip_pending) + present_wnmd_set_abort_flip(window); + else if (window_priv->flip_active) + present_wnmd_flips_stop(window); +} + +static Bool +present_wnmd_can_window_flip(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + WindowPtr toplvl_window = present_wnmd_toplvl_pixmap_window(window); + + if (!screen_priv) + return FALSE; + + if (!screen_priv->wnmd_info) + return FALSE; + + /* Check to see if the driver supports flips at all */ + if (!screen_priv->wnmd_info->flip) + return FALSE; + + /* Don't flip redirected windows */ + if (window->redirectDraw != RedirectDrawNone) + return FALSE; + + /* Window must be same region as toplevel window */ + if ( !RegionEqual(&window->winSize, &toplvl_window->winSize) ) + return FALSE; + + return TRUE; +} + +/* + * Once the required MSC has been reached, execute the pending request. + * + * For requests to actually present something, either blt contents to + * the window pixmap or queue a window buffer swap on the backend. + * + * For requests to just get the current MSC/UST combo, skip that part and + * go straight to event delivery. + */ +static void +present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) +{ + WindowPtr window = vblank->window; + present_window_priv_ptr window_priv = present_window_priv(window); + + if (present_execute_wait(vblank, crtc_msc)) + return; + + if (vblank->flip && vblank->pixmap && vblank->window) { + if (window_priv->flip_pending) { + DebugPresent(("\tr %" PRIu64 " %p (pending %p)\n", + vblank->event_id, vblank, + window_priv->flip_pending)); + xorg_list_del(&vblank->event_queue); + xorg_list_append(&vblank->event_queue, &window_priv->flip_queue); + vblank->flip_ready = TRUE; + return; + } + } + + xorg_list_del(&vblank->event_queue); + xorg_list_del(&vblank->window_list); + vblank->queued = FALSE; + + if (vblank->pixmap && vblank->window) { + + if (vblank->flip) { + RegionPtr damage; + + DebugPresent(("\tf %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank->event_id, vblank, crtc_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id)); + + /* Prepare to flip by placing it in the flip queue + */ + xorg_list_add(&vblank->event_queue, &window_priv->flip_queue); + + /* Set update region as damaged */ + if (vblank->update) { + damage = vblank->update; + RegionIntersect(damage, damage, &window->clipList); + } else + damage = &window->clipList; + + /* Try to flip - the vblank is now pending + */ + window_priv->flip_pending = vblank; + // ask the driver + if (present_wnmd_flip(vblank->window, vblank->crtc, vblank->event_id, + vblank->target_msc, vblank->pixmap, vblank->sync_flip, damage)) { + ScreenPtr screen = window->drawable.pScreen; + WindowPtr toplvl_window = present_wnmd_toplvl_pixmap_window(vblank->window); + PixmapPtr old_pixmap = screen->GetWindowPixmap(window); + + /* Replace window pixmap with flip pixmap */ +#ifdef COMPOSITE + vblank->pixmap->screen_x = old_pixmap->screen_x; + vblank->pixmap->screen_y = old_pixmap->screen_y; +#endif + present_set_tree_pixmap(toplvl_window, old_pixmap, vblank->pixmap); + vblank->pixmap->refcnt++; + dixDestroyPixmap(old_pixmap, old_pixmap->drawable.id); + + /* Report damage */ + DamageDamageRegion(&vblank->window->drawable, damage); + return; + } + + xorg_list_del(&vblank->event_queue); + /* Flip failed. Clear the flip_pending field + */ + window_priv->flip_pending = NULL; + vblank->flip = FALSE; + } + DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n", + vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); + + present_wnmd_cancel_flip(window); + + present_execute_copy(vblank, crtc_msc); + + if (vblank->queued) { + xorg_list_add(&vblank->event_queue, &window_priv->exec_queue); + xorg_list_append(&vblank->window_list, &window_priv->vblank); + + return; + } + } + + present_execute_post(vblank, ust, crtc_msc); +} + +static int +present_wnmd_queue_vblank(ScreenPtr screen, + WindowPtr window, + RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); +} + +static uint64_t +present_wnmd_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) +{ + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + + if (crtc != window_priv->crtc) { + if (window_priv->crtc == PresentCrtcNeverSet) { + window_priv->msc_offset = 0; + } else { + /* The old CRTC may have been turned off, in which case + * we'll just use whatever previous MSC we'd seen from this CRTC + */ + + window_priv->msc_offset += new_msc - window_priv->msc; + } + window_priv->crtc = crtc; + } + + return window_msc + window_priv->msc_offset; +} + +static int +present_wnmd_pixmap(WindowPtr window, + PixmapPtr pixmap, + CARD32 serial, + RegionPtr valid, + RegionPtr update, + int16_t x_off, + int16_t y_off, + RRCrtcPtr target_crtc, + SyncFence *wait_fence, + SyncFence *idle_fence, + uint32_t options, + uint64_t window_msc, + uint64_t divisor, + uint64_t remainder, + present_notify_ptr notifies, + int num_notifies) +{ + uint64_t ust = 0; + uint64_t target_msc; + uint64_t crtc_msc = 0; + int ret; + present_vblank_ptr vblank, tmp; + ScreenPtr screen = window->drawable.pScreen; + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + if (!window_priv) + return BadAlloc; + + target_crtc = present_wnmd_get_crtc(screen_priv, window); + + ret = present_wnmd_get_ust_msc(screen, window, &ust, &crtc_msc); + + target_msc = present_wnmd_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); + + if (ret == Success) { + /* Stash the current MSC away in case we need it later + */ + window_priv->msc = crtc_msc; + } + + present_adjust_timings(options, + &crtc_msc, + &target_msc, + divisor, + remainder); + + /* + * Look for a matching presentation already on the list... + */ + + if (!update && pixmap) { + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { + + if (!vblank->pixmap) + continue; + + if (!vblank->queued) + continue; + + if (vblank->target_msc != target_msc) + continue; + + present_vblank_scrap(vblank); + if (vblank->flip_ready) + present_wnmd_re_execute(vblank); + } + } + + vblank = present_vblank_create(window, + pixmap, + serial, + valid, + update, + x_off, + y_off, + target_crtc, + wait_fence, + idle_fence, + options, + &screen_priv->wnmd_info->capabilities, + notifies, + num_notifies, + &target_msc, + crtc_msc); + if (!vblank) + return BadAlloc; + + xorg_list_append(&vblank->event_queue, &window_priv->exec_queue); + vblank->queued = TRUE; + if (crtc_msc < target_msc) { + if (present_wnmd_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc) == Success) { + return Success; + } + DebugPresent(("present_queue_vblank failed\n")); + } + + present_wnmd_execute(vblank, ust, crtc_msc); + return Success; +} + +static void +present_wnmd_abort_vblank(ScreenPtr screen, WindowPtr window, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + present_window_priv_ptr window_priv = present_window_priv(window); + present_vblank_ptr vblank; + + assert(crtc); + + (*screen_priv->wnmd_info->abort_vblank) (window, crtc, event_id, msc); + + xorg_list_for_each_entry(vblank, &window_priv->exec_queue, event_queue) { + if (vblank->event_id == event_id) { + xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; + return; + } + } + xorg_list_for_each_entry(vblank, &window_priv->flip_queue, event_queue) { + if (vblank->event_id == event_id) { + xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; + return; + } + } +} + +static void +present_wnmd_flip_destroy(ScreenPtr screen) +{ + /* Cleanup done on window destruction */ +} + +static void +present_wnmd_flush(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); + + (*screen_priv->wnmd_info->flush) (window); +} + +void +present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv) +{ + screen_priv->query_capabilities = &present_wnmd_query_capabilities; + screen_priv->get_crtc = &present_wnmd_get_crtc; + + screen_priv->check_flip = &present_wnmd_check_flip; + screen_priv->check_flip_window = &present_wnmd_check_flip_window; + screen_priv->can_window_flip = &present_wnmd_can_window_flip; + + screen_priv->present_pixmap = &present_wnmd_pixmap; + screen_priv->create_event_id = &present_wnmd_create_event_id; + screen_priv->queue_vblank = &present_wnmd_queue_vblank; + screen_priv->flush = &present_wnmd_flush; + screen_priv->re_execute = &present_wnmd_re_execute; + + screen_priv->abort_vblank = &present_wnmd_abort_vblank; + screen_priv->flip_destroy = &present_wnmd_flip_destroy; +} diff --git a/xserver/pseudoramiX/Makefile.in b/xserver/pseudoramiX/Makefile.in index 3f17d6364..9be9786d9 100644 --- a/xserver/pseudoramiX/Makefile.in +++ b/xserver/pseudoramiX/Makefile.in @@ -70,7 +70,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -309,6 +309,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -327,15 +328,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -343,6 +347,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -414,8 +420,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/randr/Makefile.am b/xserver/randr/Makefile.am index 90dc9ec9a..f9cefd18a 100644 --- a/xserver/randr/Makefile.am +++ b/xserver/randr/Makefile.am @@ -14,6 +14,7 @@ librandr_la_SOURCES = \ rrcrtc.c \ rrdispatch.c \ rrinfo.c \ + rrlease.c \ rrmode.c \ rrmonitor.c \ rroutput.c \ diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in index 222ad36c1..82ff00b40 100644 --- a/xserver/randr/Makefile.in +++ b/xserver/randr/Makefile.in @@ -70,23 +70,23 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librandr_la_LIBADD = am__librandr_la_SOURCES_DIST = randr.c randrstr.h rrcrtc.c \ - rrdispatch.c rrinfo.c rrmode.c rrmonitor.c rroutput.c \ - rrpointer.c rrproperty.c rrprovider.c rrproviderproperty.c \ - rrscreen.c rrsdispatch.c rrtransform.h rrtransform.c \ - rrxinerama.c + rrdispatch.c rrinfo.c rrlease.c rrmode.c rrmonitor.c \ + rroutput.c rrpointer.c rrproperty.c rrprovider.c \ + rrproviderproperty.c rrscreen.c rrsdispatch.c rrtransform.h \ + rrtransform.c rrxinerama.c am__objects_1 = rrxinerama.lo @XINERAMA_TRUE@am__objects_2 = $(am__objects_1) am_librandr_la_OBJECTS = randr.lo rrcrtc.lo rrdispatch.lo rrinfo.lo \ - rrmode.lo rrmonitor.lo rroutput.lo rrpointer.lo rrproperty.lo \ - rrprovider.lo rrproviderproperty.lo rrscreen.lo rrsdispatch.lo \ - rrtransform.lo $(am__objects_2) + rrlease.lo rrmode.lo rrmonitor.lo rroutput.lo rrpointer.lo \ + rrproperty.lo rrprovider.lo rrproviderproperty.lo rrscreen.lo \ + rrsdispatch.lo rrtransform.lo $(am__objects_2) librandr_la_OBJECTS = $(am_librandr_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -349,6 +349,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -367,15 +368,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -383,6 +387,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -454,8 +460,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -525,7 +529,7 @@ AM_CFLAGS = $(DIX_CFLAGS) XINERAMA_SRCS = rrxinerama.c @XORG_TRUE@sdk_HEADERS = randrstr.h rrtransform.h librandr_la_SOURCES = randr.c randrstr.h rrcrtc.c rrdispatch.c \ - rrinfo.c rrmode.c rrmonitor.c rroutput.c rrpointer.c \ + rrinfo.c rrlease.c rrmode.c rrmonitor.c rroutput.c rrpointer.c \ rrproperty.c rrprovider.c rrproviderproperty.c rrscreen.c \ rrsdispatch.c rrtransform.h rrtransform.c $(am__append_1) all: all-am @@ -586,6 +590,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrcrtc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrdispatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrlease.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrmonitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rroutput.Plo@am__quote@ diff --git a/xserver/randr/randr.c b/xserver/randr/randr.c index 0138dc100..5db8b5ced 100644 --- a/xserver/randr/randr.c +++ b/xserver/randr/randr.c @@ -2,6 +2,7 @@ * Copyright © 2000 Compaq Computer Corporation * Copyright © 2002 Hewlett-Packard Company * Copyright © 2006 Intel Corporation + * Copyright © 2017 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -88,8 +89,12 @@ RRCloseScreen(ScreenPtr pScreen) { rrScrPriv(pScreen); int j; + RRLeasePtr lease, next; unwrap(pScrPriv, pScreen, CloseScreen); + + xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list) + RRTerminateLease(lease); for (j = pScrPriv->numCrtcs - 1; j >= 0; j--) RRCrtcDestroy(pScrPriv->crtcs[j]); for (j = pScrPriv->numOutputs - 1; j >= 0; j--) @@ -211,7 +216,7 @@ SRRProviderPropertyNotifyEvent(xRRProviderPropertyNotifyEvent * from, /* pad4 */ } -static void +static void _X_COLD SRRResourceChangeNotifyEvent(xRRResourceChangeNotifyEvent * from, xRRResourceChangeNotifyEvent * to) { @@ -222,7 +227,20 @@ SRRResourceChangeNotifyEvent(xRRResourceChangeNotifyEvent * from, cpswapl(from->window, to->window); } -static void +static void _X_COLD +SRRLeaseNotifyEvent(xRRLeaseNotifyEvent * from, + xRRLeaseNotifyEvent * to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->timestamp, to->timestamp); + cpswapl(from->window, to->window); + cpswapl(from->lease, to->lease); + to->created = from->created; +} + +static void _X_COLD SRRNotifyEvent(xEvent *from, xEvent *to) { switch (from->u.u.detail) { @@ -249,6 +267,11 @@ SRRNotifyEvent(xEvent *from, xEvent *to) case RRNotify_ResourceChange: SRRResourceChangeNotifyEvent((xRRResourceChangeNotifyEvent *) from, (xRRResourceChangeNotifyEvent *) to); + break; + case RRNotify_Lease: + SRRLeaseNotifyEvent((xRRLeaseNotifyEvent *) from, + (xRRLeaseNotifyEvent *) to); + break; default: break; } @@ -268,6 +291,8 @@ RRInit(void) return FALSE; if (!RRProviderInit()) return FALSE; + if (!RRLeaseInit()) + return FALSE; RRGeneration = serverGeneration; } if (!dixRegisterPrivateKey(&rrPrivKeyRec, PRIVATE_SCREEN, 0)) @@ -335,6 +360,8 @@ RRScreenInit(ScreenPtr pScreen) pScrPriv->numCrtcs = 0; pScrPriv->crtcs = NULL; + xorg_list_init(&pScrPriv->leases); + RRMonitorInit(pScreen); RRNScreens += 1; /* keep count of screens that implement randr */ @@ -532,6 +559,12 @@ TellChanged(WindowPtr pWin, void *value) RRDeliverResourceEvent(client, pWin); } } + + if (pRREvent->mask & RRLeaseNotifyMask) { + if (pScrPriv->leasesChanged) { + RRDeliverLeaseEvent(client, pWin); + } + } } return WT_WALKCHILDREN; } @@ -573,6 +606,8 @@ RRTellChanged(ScreenPtr pScreen) if (pScreen->isGPU) { master = pScreen->current_master; + if (!master) + return; mastersp = rrGetScrPriv(master); } else { @@ -682,7 +717,7 @@ ProcRRDispatch(ClientPtr client) return (*ProcRandrVector[stuff->data]) (client); } -static int +static int _X_COLD SProcRRDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h index 706e9a7b0..2cede92e3 100644 --- a/xserver/randr/randrstr.h +++ b/xserver/randr/randrstr.h @@ -63,6 +63,7 @@ typedef XID RRMode; typedef XID RROutput; typedef XID RRCrtc; typedef XID RRProvider; +typedef XID RRLease; extern int RREventBase, RRErrorBase; @@ -81,6 +82,7 @@ typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; typedef struct _rrOutput RROutputRec, *RROutputPtr; typedef struct _rrProvider RRProviderRec, *RRProviderPtr; typedef struct _rrMonitor RRMonitorRec, *RRMonitorPtr; +typedef struct _rrLease RRLeaseRec, *RRLeasePtr; struct _rrMode { int refcnt; @@ -153,6 +155,7 @@ struct _rrOutput { int numUserModes; RRModePtr *userModes; Bool changed; + Bool nonDesktop; RRPropertyPtr properties; Bool pendingProperties; void *devPrivate; @@ -187,6 +190,20 @@ struct _rrMonitor { RRMonitorGeometryRec geometry; }; +typedef enum _rrLeaseState { RRLeaseCreating, RRLeaseRunning, RRLeaseTerminating } RRLeaseState; + +struct _rrLease { + struct xorg_list list; + ScreenPtr screen; + RRLease id; + RRLeaseState state; + void *devPrivate; + int numCrtcs; + RRCrtcPtr *crtcs; + int numOutputs; + RROutputPtr *outputs; +}; + #if RANDR_12_INTERFACE typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, CARD16 width, @@ -254,6 +271,15 @@ typedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen, typedef void (*RRProviderDestroyProcPtr)(ScreenPtr pScreen, RRProviderPtr provider); +/* Additions for 1.6 */ + +typedef int (*RRCreateLeaseProcPtr)(ScreenPtr screen, + RRLeasePtr lease, + int *fd); + +typedef void (*RRTerminateLeaseProcPtr)(ScreenPtr screen, + RRLeasePtr lease); + /* These are for 1.0 compatibility */ typedef struct _rrRefresh { @@ -279,7 +305,7 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap); -typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, PixmapPtr, +typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, DrawablePtr, PixmapPtr, PixmapPtr, int x, int y, int dst_x, int dst_y, @@ -326,6 +352,10 @@ typedef struct _rrScrPriv { RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink; RRProviderGetPropertyProcPtr rrProviderGetProperty; RRProviderSetPropertyProcPtr rrProviderSetProperty; + + RRCreateLeaseProcPtr rrCreateLease; + RRTerminateLeaseProcPtr rrTerminateLease; + /* * Private part of the structure; not considered part of the ABI */ @@ -337,6 +367,7 @@ typedef struct _rrScrPriv { Bool configChanged; /* configuration changed */ Bool layoutChanged; /* screen layout changed */ Bool resourcesChanged; /* screen resources change */ + Bool leasesChanged; /* leases change */ CARD16 minWidth, minHeight; CARD16 maxWidth, maxHeight; @@ -376,6 +407,7 @@ typedef struct _rrScrPriv { int numMonitors; RRMonitorPtr *monitors; + struct xorg_list leases; } rrScrPrivRec, *rrScrPrivPtr; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; @@ -419,7 +451,7 @@ extern RESTYPE RRClientType, RREventType; /* resource types for event masks extern DevPrivateKeyRec RRClientPrivateKeyRec; #define RRClientPrivateKey (&RRClientPrivateKeyRec) -extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; +extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType, RRLeaseType; #define VERIFY_RR_OUTPUT(id, ptr, a)\ {\ @@ -461,6 +493,16 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; }\ } +#define VERIFY_RR_LEASE(id, ptr, a)\ + {\ + int rc = dixLookupResourceByType((void **)&(ptr), id,\ + RRLeaseType, client, a);\ + if (rc != Success) {\ + client->errorValue = id;\ + return rc;\ + }\ + } + #define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey)) #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) @@ -551,6 +593,8 @@ extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen); extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen); +extern _X_EXPORT Bool RROutputSetNonDesktop(RROutputPtr output, Bool non_desktop); + extern _X_EXPORT CARD16 RRVerticalRefresh(xRRModeInfo * mode); @@ -769,6 +813,28 @@ void extern _X_EXPORT Bool RRClientKnowsRates(ClientPtr pClient); +/* rrlease.c */ +void +RRDeliverLeaseEvent(ClientPtr client, WindowPtr window); + +extern _X_EXPORT void +RRLeaseTerminated(RRLeasePtr lease); + +extern _X_EXPORT void +RRLeaseFree(RRLeasePtr lease); + +extern _X_EXPORT Bool +RRCrtcIsLeased(RRCrtcPtr crtc); + +extern _X_EXPORT Bool +RROutputIsLeased(RROutputPtr output); + +void +RRTerminateLease(RRLeasePtr lease); + +Bool +RRLeaseInit(void); + /* rrmode.c */ /* * Find, and if necessary, create a mode @@ -915,13 +981,13 @@ extern _X_EXPORT int RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - void *value, Bool sendevent, Bool pending); + const void *value, Bool sendevent, Bool pending); extern _X_EXPORT int RRConfigureOutputProperty(RROutputPtr output, Atom property, Bool pending, Bool range, Bool immutable, - int num_values, INT32 *values); + int num_values, const INT32 *values); extern _X_EXPORT int ProcRRChangeOutputProperty(ClientPtr client); @@ -1059,6 +1125,12 @@ ProcRRSetMonitor(ClientPtr client); int ProcRRDeleteMonitor(ClientPtr client); +int +ProcRRCreateLease(ClientPtr client); + +int +ProcRRFreeLease(ClientPtr client); + #endif /* _RANDRSTR_H_ */ /* diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c index 401a1c178..a851aebcc 100644 --- a/xserver/randr/rrcrtc.c +++ b/xserver/randr/rrcrtc.c @@ -66,13 +66,10 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) pScrPriv = rrGetScrPriv(pScreen); /* make space for the crtc pointer */ - if (pScrPriv->numCrtcs) - crtcs = reallocarray(pScrPriv->crtcs, - pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); - else - crtcs = malloc(sizeof(RRCrtcPtr)); + crtcs = reallocarray(pScrPriv->crtcs, + pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); if (!crtcs) - return FALSE; + return NULL; pScrPriv->crtcs = crtcs; crtc = calloc(1, sizeof(RRCrtcRec)); @@ -275,25 +272,34 @@ RRCrtcPendingProperties(RRCrtcPtr crtc) return FALSE; } -static void -crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) +static Bool +cursor_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) { - *left = crtc->x; - *top = crtc->y; + rrScrPriv(crtc->pScreen); + BoxRec bounds; - switch (crtc->rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_180: - default: - *right = crtc->x + crtc->mode->mode.width; - *bottom = crtc->y + crtc->mode->mode.height; - return; - case RR_Rotate_90: - case RR_Rotate_270: - *right = crtc->x + crtc->mode->mode.height; - *bottom = crtc->y + crtc->mode->mode.width; - return; + if (crtc->mode == NULL) + return FALSE; + + memset(&bounds, 0, sizeof(bounds)); + if (pScrPriv->rrGetPanning) + pScrPriv->rrGetPanning(crtc->pScreen, crtc, NULL, &bounds, NULL); + + if (bounds.y2 <= bounds.y1 || bounds.x2 <= bounds.x1) { + bounds.x1 = 0; + bounds.y1 = 0; + bounds.x2 = crtc->mode->mode.width; + bounds.y2 = crtc->mode->mode.height; } + + pixman_f_transform_bounds(&crtc->f_transform, &bounds); + + *left = bounds.x1; + *right = bounds.x2; + *top = bounds.y1; + *bottom = bounds.y2; + + return TRUE; } /* overlapping counts as adjacent */ @@ -305,8 +311,10 @@ crtcs_adjacent(const RRCrtcPtr a, const RRCrtcPtr b) int bl, br, bt, bb; int cl, cr, ct, cb; /* the overlap, if any */ - crtc_bounds(a, &al, &ar, &at, &ab); - crtc_bounds(b, &bl, &br, &bt, &bb); + if (!cursor_bounds(a, &al, &ar, &at, &ab)) + return FALSE; + if (!cursor_bounds(b, &bl, &br, &bt, &bb)) + return FALSE; cl = max(al, bl); cr = min(ar, br); @@ -324,7 +332,7 @@ mark_crtcs(rrScrPrivPtr pScrPriv, int *reachable, int cur) reachable[cur] = TRUE; for (i = 0; i < pScrPriv->numCrtcs; ++i) { - if (reachable[i] || !pScrPriv->crtcs[i]->mode) + if (reachable[i]) continue; if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i])) mark_crtcs(pScrPriv, reachable, i); @@ -388,12 +396,12 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) if (crtc->scanout_pixmap) { ScreenPtr master = crtc->pScreen->current_master; - PixmapPtr mscreenpix = master->GetScreenPixmap(master); + DrawablePtr mrootdraw = &master->root->drawable; if (crtc->scanout_pixmap_back) { pScrPriv->rrDisableSharedPixmapFlipping(crtc); - master->StopFlippingPixmapTracking(mscreenpix, + master->StopFlippingPixmapTracking(mrootdraw, crtc->scanout_pixmap, crtc->scanout_pixmap_back); @@ -402,7 +410,8 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) } else { pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); - master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + master->StopPixmapTracking(mrootdraw, + crtc->scanout_pixmap); } rrDestroySharedPixmap(crtc, crtc->scanout_pixmap); @@ -491,9 +500,8 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, ScreenPtr master = crtc->pScreen->current_master; rrScrPrivPtr pMasterScrPriv = rrGetScrPriv(master); rrScrPrivPtr pSlaveScrPriv = rrGetScrPriv(crtc->pScreen); - - int depth; - PixmapPtr mscreenpix; + DrawablePtr mrootdraw = &master->root->drawable; + int depth = mrootdraw->depth; PixmapPtr spix_front; /* Create a pixmap on the master screen, then get a shared handle for it. @@ -515,9 +523,6 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, defer to the slave. */ - mscreenpix = master->GetScreenPixmap(master); - depth = mscreenpix->drawable.depth; - if (crtc->scanout_pixmap) RRCrtcDetachScanoutPixmap(crtc); @@ -529,6 +534,7 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, width, height, depth, x, y, rotation); if (spix_front == NULL) { + ErrorF("randr: failed to create shared pixmap\n"); return FALSE; } @@ -553,7 +559,8 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, crtc->scanout_pixmap = spix_front; crtc->scanout_pixmap_back = spix_back; - if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, mscreenpix, + if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, + mrootdraw, spix_front, spix_back, x, y, 0, 0, @@ -588,7 +595,7 @@ fail: /* If flipping funcs fail, just fall back to unsynchronized */ } crtc->scanout_pixmap = spix_front; - master->StartPixmapTracking(mscreenpix, spix_front, x, y, 0, 0, rotation); + master->StartPixmapTracking(mrootdraw, spix_front, x, y, 0, 0, rotation); return TRUE; } @@ -695,8 +702,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen, if (new_height < screen_pixmap->drawable.height) new_height = screen_pixmap->drawable.height; - if (new_width == screen_pixmap->drawable.width && - new_height == screen_pixmap->drawable.height) { + if (new_width <= screen_pixmap->drawable.width && + new_height <= screen_pixmap->drawable.height) { } else { pScrPriv->rrScreenSetSize(pScreen, new_width, new_height, 0, 0); } @@ -865,6 +872,17 @@ RRCrtcDestroyResource(void *value, XID pid) if (pScreen) { rrScrPriv(pScreen); int i; + RRLeasePtr lease, next; + + xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list) { + int c; + for (c = 0; c < lease->numCrtcs; c++) { + if (lease->crtcs[c] == crtc) { + RRTerminateLease(lease); + break; + } + } + } for (i = 0; i < pScrPriv->numCrtcs; i++) { if (pScrPriv->crtcs[i] == crtc) { @@ -883,6 +901,7 @@ RRCrtcDestroyResource(void *value, XID pid) free(crtc->gammaRed); if (crtc->mode) RRModeDestroy(crtc->mode); + free(crtc->outputs); free(crtc); return 1; } @@ -1079,7 +1098,7 @@ ProcRRGetCrtcInfo(ClientPtr client) REQUEST(xRRGetCrtcInfoReq); xRRGetCrtcInfoReply rep; RRCrtcPtr crtc; - CARD8 *extra; + CARD8 *extra = NULL; unsigned long extraLen; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; @@ -1089,10 +1108,13 @@ ProcRRGetCrtcInfo(ClientPtr client) int i, j, k; int width, height; BoxRec panned_area; + Bool leased; REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); + leased = RRCrtcIsLeased(crtc); + /* All crtcs must be associated with screens before client * requests are processed */ @@ -1108,61 +1130,77 @@ ProcRRGetCrtcInfo(ClientPtr client) .length = 0, .timestamp = pScrPriv->lastSetTime.milliseconds }; - if (pScrPriv->rrGetPanning && - pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) && - (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) - { - rep.x = panned_area.x1; - rep.y = panned_area.y1; - rep.width = panned_area.x2 - panned_area.x1; - rep.height = panned_area.y2 - panned_area.y1; - } - else { - RRCrtcGetScanoutSize(crtc, &width, &height); - rep.x = crtc->x; - rep.y = crtc->y; - rep.width = width; - rep.height = height; - } - rep.mode = mode ? mode->mode.id : 0; - rep.rotation = crtc->rotation; - rep.rotations = crtc->rotations; - rep.nOutput = crtc->numOutputs; - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) - k++; - rep.nPossibleOutput = k; - - rep.length = rep.nOutput + rep.nPossibleOutput; - - extraLen = rep.length << 2; - if (extraLen) { - extra = malloc(extraLen); - if (!extra) - return BadAlloc; - } - else - extra = NULL; - - outputs = (RROutput *) extra; - possible = (RROutput *) (outputs + rep.nOutput); - - for (i = 0; i < crtc->numOutputs; i++) { - outputs[i] = crtc->outputs[i]->id; - if (client->swapped) - swapl(&outputs[i]); - } - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) { - possible[k] = pScrPriv->outputs[i]->id; - if (client->swapped) - swapl(&possible[k]); - k++; + if (leased) { + rep.x = rep.y = rep.width = rep.height = 0; + rep.mode = 0; + rep.rotation = RR_Rotate_0; + rep.rotations = RR_Rotate_0; + rep.nOutput = 0; + rep.nPossibleOutput = 0; + rep.length = 0; + extraLen = 0; + } else { + if (pScrPriv->rrGetPanning && + pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) && + (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) + { + rep.x = panned_area.x1; + rep.y = panned_area.y1; + rep.width = panned_area.x2 - panned_area.x1; + rep.height = panned_area.y2 - panned_area.y1; + } + else { + RRCrtcGetScanoutSize(crtc, &width, &height); + rep.x = crtc->x; + rep.y = crtc->y; + rep.width = width; + rep.height = height; + } + rep.mode = mode ? mode->mode.id : 0; + rep.rotation = crtc->rotation; + rep.rotations = crtc->rotations; + rep.nOutput = crtc->numOutputs; + k = 0; + for (i = 0; i < pScrPriv->numOutputs; i++) { + if (!RROutputIsLeased(pScrPriv->outputs[i])) { + for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) + if (pScrPriv->outputs[i]->crtcs[j] == crtc) + k++; } + } + + rep.nPossibleOutput = k; + + rep.length = rep.nOutput + rep.nPossibleOutput; + + extraLen = rep.length << 2; + if (extraLen) { + extra = malloc(extraLen); + if (!extra) + return BadAlloc; + } + + outputs = (RROutput *) extra; + possible = (RROutput *) (outputs + rep.nOutput); + + for (i = 0; i < crtc->numOutputs; i++) { + outputs[i] = crtc->outputs[i]->id; + if (client->swapped) + swapl(&outputs[i]); + } + k = 0; + for (i = 0; i < pScrPriv->numOutputs; i++) { + if (!RROutputIsLeased(pScrPriv->outputs[i])) { + for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) + if (pScrPriv->outputs[i]->crtcs[j] == crtc) { + possible[k] = pScrPriv->outputs[i]->id; + if (client->swapped) + swapl(&possible[k]); + k++; + } + } + } + } if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1209,6 +1247,9 @@ ProcRRSetCrtcConfig(ClientPtr client) VERIFY_RR_CRTC(stuff->crtc, crtc, DixSetAttrAccess); + if (RRCrtcIsLeased(crtc)) + return BadAccess; + if (stuff->mode == None) { mode = NULL; if (numOutputs > 0) @@ -1235,6 +1276,12 @@ ProcRRSetCrtcConfig(ClientPtr client) free(outputs); return ret; } + + if (RROutputIsLeased(outputs[i])) { + free(outputs); + return BadAccess; + } + /* validate crtc for this output */ for (j = 0; j < outputs[i]->numCrtcs; j++) if (outputs[i]->crtcs[j] == crtc) @@ -1478,6 +1525,9 @@ ProcRRSetPanning(ClientPtr client) REQUEST_SIZE_MATCH(xRRSetPanningReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); + if (RRCrtcIsLeased(crtc)) + return BadAccess; + /* All crtcs must be associated with screens before client * requests are processed */ @@ -1618,6 +1668,9 @@ ProcRRSetCrtcGamma(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); + if (RRCrtcIsLeased(crtc)) + return BadAccess; + len = client->req_len - bytes_to_int32(sizeof(xRRSetCrtcGammaReq)); if (len < (stuff->size * 3 + 1) >> 1) return BadLength; @@ -1651,6 +1704,9 @@ ProcRRSetCrtcTransform(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); + if (RRCrtcIsLeased(crtc)) + return BadAccess; + PictTransform_from_xRenderTransform(&transform, &stuff->transform); pixman_f_transform_from_pixman_transform(&f_transform, &transform); if (!pixman_f_transform_invert(&f_inverse, &f_transform)) @@ -1778,10 +1834,8 @@ check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y) int left, right, top, bottom; - if (!crtc->mode) - continue; - - crtc_bounds(crtc, &left, &right, &top, &bottom); + if (!cursor_bounds(crtc, &left, &right, &top, &bottom)) + continue; if ((*x >= left) && (*x < right) && (*y >= top) && (*y < bottom)) return TRUE; @@ -1801,10 +1855,9 @@ constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y) int nx, ny; int left, right, top, bottom; - if (!crtc->mode) - continue; + if (!cursor_bounds(crtc, &left, &right, &top, &bottom)) + continue; - crtc_bounds(crtc, &left, &right, &top, &bottom); miPointerGetPosition(pDev, &nx, &ny); if ((nx >= left) && (nx < right) && (ny >= top) && (ny < bottom)) { diff --git a/xserver/randr/rrdispatch.c b/xserver/randr/rrdispatch.c index 314e4ea52..a5b390914 100644 --- a/xserver/randr/rrdispatch.c +++ b/xserver/randr/rrdispatch.c @@ -256,7 +256,11 @@ int (*ProcRandrVector[RRNumberRequests]) (ClientPtr) = { ProcRRChangeProviderProperty, /* 39 */ ProcRRDeleteProviderProperty, /* 40 */ ProcRRGetProviderProperty, /* 41 */ +/* V1.5 additions */ ProcRRGetMonitors, /* 42 */ ProcRRSetMonitor, /* 43 */ ProcRRDeleteMonitor, /* 44 */ +/* V1.6 additions */ + ProcRRCreateLease, /* 45 */ + ProcRRFreeLease, /* 46 */ }; diff --git a/xserver/randr/rrlease.c b/xserver/randr/rrlease.c new file mode 100644 index 000000000..e25d9ca99 --- /dev/null +++ b/xserver/randr/rrlease.c @@ -0,0 +1,351 @@ +/* + * Copyright © 2017 Keith Packard + * + * 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, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#include "randrstr.h" +#include "swaprep.h" +#include + +RESTYPE RRLeaseType; + +/* + * Notify of some lease change + */ +void +RRDeliverLeaseEvent(ClientPtr client, WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + RRLeasePtr lease; + + UpdateCurrentTimeIf(); + xorg_list_for_each_entry(lease, &scr_priv->leases, list) { + if (lease->id != None && (lease->state == RRLeaseCreating || + lease->state == RRLeaseTerminating)) + { + xRRLeaseNotifyEvent le = (xRRLeaseNotifyEvent) { + .type = RRNotify + RREventBase, + .subCode = RRNotify_Lease, + .timestamp = currentTime.milliseconds, + .window = window->drawable.id, + .lease = lease->id, + .created = lease->state == RRLeaseCreating, + }; + WriteEventsToClient(client, 1, (xEvent *) &le); + } + } +} + +/* + * Change the state of a lease and let anyone watching leases know + */ +static void +RRLeaseChangeState(RRLeasePtr lease, RRLeaseState old, RRLeaseState new) +{ + ScreenPtr screen = lease->screen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + + lease->state = old; + scr_priv->leasesChanged = TRUE; + RRSetChanged(lease->screen); + RRTellChanged(lease->screen); + scr_priv->leasesChanged = FALSE; + lease->state = new; +} + +/* + * Allocate and initialize a lease + */ +static RRLeasePtr +RRLeaseAlloc(ScreenPtr screen, RRLease lid, int numCrtcs, int numOutputs) +{ + RRLeasePtr lease; + lease = calloc(1, + sizeof(RRLeaseRec) + + numCrtcs * sizeof (RRCrtcPtr) + + numOutputs * sizeof(RROutputPtr)); + if (!lease) + return NULL; + lease->screen = screen; + xorg_list_init(&lease->list); + lease->id = lid; + lease->state = RRLeaseCreating; + lease->numCrtcs = numCrtcs; + lease->numOutputs = numOutputs; + lease->crtcs = (RRCrtcPtr *) (lease + 1); + lease->outputs = (RROutputPtr *) (lease->crtcs + numCrtcs); + return lease; +} + +/* + * Check if a crtc is leased + */ +Bool +RRCrtcIsLeased(RRCrtcPtr crtc) +{ + ScreenPtr screen = crtc->pScreen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + RRLeasePtr lease; + int c; + + xorg_list_for_each_entry(lease, &scr_priv->leases, list) { + for (c = 0; c < lease->numCrtcs; c++) + if (lease->crtcs[c] == crtc) + return TRUE; + } + return FALSE; +} + +/* + * Check if an output is leased + */ +Bool +RROutputIsLeased(RROutputPtr output) +{ + ScreenPtr screen = output->pScreen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + RRLeasePtr lease; + int o; + + xorg_list_for_each_entry(lease, &scr_priv->leases, list) { + for (o = 0; o < lease->numOutputs; o++) + if (lease->outputs[o] == output) + return TRUE; + } + return FALSE; +} + +/* + * A lease has been terminated. + * The driver is responsible for noticing and + * calling this function when that happens + */ + +void +RRLeaseTerminated(RRLeasePtr lease) +{ + /* Notify clients with events, but only if this isn't during lease creation */ + if (lease->state == RRLeaseRunning) + RRLeaseChangeState(lease, RRLeaseTerminating, RRLeaseTerminating); + + if (lease->id != None) + FreeResource(lease->id, RT_NONE); + + xorg_list_del(&lease->list); +} + +/* + * A lease is completely shut down and is + * ready to be deallocated + */ + +void +RRLeaseFree(RRLeasePtr lease) +{ + free(lease); +} + +/* + * Ask the driver to terminate a lease. The + * driver will call RRLeaseTerminated when that has + * finished, which may be some time after this function returns + * if the driver operation is asynchronous + */ +void +RRTerminateLease(RRLeasePtr lease) +{ + ScreenPtr screen = lease->screen; + rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + + scr_priv->rrTerminateLease(screen, lease); +} + +/* + * Destroy a lease resource ID. All this + * does is note that the lease no longer has an ID, and + * so doesn't appear over the protocol anymore. + */ +static int +RRLeaseDestroyResource(void *value, XID pid) +{ + RRLeasePtr lease = value; + + lease->id = None; + return 1; +} + +/* + * Create the lease resource type during server initialization + */ +Bool +RRLeaseInit(void) +{ + RRLeaseType = CreateNewResourceType(RRLeaseDestroyResource, "LEASE"); + if (!RRLeaseType) + return FALSE; + return TRUE; +} + +int +ProcRRCreateLease(ClientPtr client) +{ + REQUEST(xRRCreateLeaseReq); + xRRCreateLeaseReply rep; + WindowPtr window; + ScreenPtr screen; + rrScrPrivPtr scr_priv; + RRLeasePtr lease; + RRCrtc *crtcIds; + RROutput *outputIds; + int fd; + int rc; + unsigned long len; + int c, o; + + REQUEST_AT_LEAST_SIZE(xRRCreateLeaseReq); + + LEGAL_NEW_RESOURCE(stuff->lid, client); + + rc = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; + + len = client->req_len - bytes_to_int32(sizeof(xRRCreateLeaseReq)); + + if (len != stuff->nCrtcs + stuff->nOutputs) + return BadLength; + + screen = window->drawable.pScreen; + scr_priv = rrGetScrPriv(screen); + + if (!scr_priv) + return BadMatch; + + if (!scr_priv->rrCreateLease) + return BadMatch; + + /* Allocate a structure to hold all of the lease information */ + + lease = RRLeaseAlloc(screen, stuff->lid, stuff->nCrtcs, stuff->nOutputs); + if (!lease) + return BadAlloc; + + /* Look up all of the crtcs */ + crtcIds = (RRCrtc *) (stuff + 1); + for (c = 0; c < stuff->nCrtcs; c++) { + RRCrtcPtr crtc; + + rc = dixLookupResourceByType((void **)&crtc, crtcIds[c], + RRCrtcType, client, DixSetAttrAccess); + + if (rc != Success) { + client->errorValue = crtcIds[c]; + goto bail_lease; + } + + if (RRCrtcIsLeased(crtc)) { + client->errorValue = crtcIds[c]; + rc = BadAccess; + goto bail_lease; + } + + lease->crtcs[c] = crtc; + } + + /* Look up all of the outputs */ + outputIds = (RROutput *) (crtcIds + stuff->nCrtcs); + for (o = 0; o < stuff->nOutputs; o++) { + RROutputPtr output; + + rc = dixLookupResourceByType((void **)&output, outputIds[o], + RROutputType, client, DixSetAttrAccess); + if (rc != Success) { + client->errorValue = outputIds[o]; + goto bail_lease; + } + + if (RROutputIsLeased(output)) { + client->errorValue = outputIds[o]; + rc = BadAccess; + goto bail_lease; + } + + lease->outputs[o] = output; + } + + rc = scr_priv->rrCreateLease(screen, lease, &fd); + if (rc != Success) + goto bail_lease; + + xorg_list_add(&scr_priv->leases, &lease->list); + + if (!AddResource(stuff->lid, RRLeaseType, lease)) { + close(fd); + return BadAlloc; + } + + if (WriteFdToClient(client, fd, TRUE) < 0) { + RRTerminateLease(lease); + close(fd); + return BadAlloc; + } + + RRLeaseChangeState(lease, RRLeaseCreating, RRLeaseRunning); + + rep = (xRRCreateLeaseReply) { + .type = X_Reply, + .nfd = 1, + .sequenceNumber = client->sequence, + .length = 0, + }; + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + } + + WriteToClient(client, sizeof (rep), &rep); + + return Success; + +bail_lease: + free(lease); + return rc; +} + +int +ProcRRFreeLease(ClientPtr client) +{ + REQUEST(xRRFreeLeaseReq); + RRLeasePtr lease; + + REQUEST_SIZE_MATCH(xRRFreeLeaseReq); + + VERIFY_RR_LEASE(stuff->lid, lease, DixDestroyAccess); + + if (stuff->terminate) + RRTerminateLease(lease); + else + /* Get rid of the resource database entry */ + FreeResource(stuff->lid, RT_NONE); + + return Success; +} diff --git a/xserver/randr/rrmode.c b/xserver/randr/rrmode.c index a7aa43320..d34025bd0 100644 --- a/xserver/randr/rrmode.c +++ b/xserver/randr/rrmode.c @@ -357,6 +357,9 @@ ProcRRAddOutputMode(ClientPtr client) VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess); + if (RROutputIsLeased(output)) + return BadAccess; + return RROutputAddUserMode(output, mode); } @@ -371,5 +374,8 @@ ProcRRDeleteOutputMode(ClientPtr client) VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess); + if (RROutputIsLeased(output)) + return BadAccess; + return RROutputDeleteUserMode(output, mode); } diff --git a/xserver/randr/rrmonitor.c b/xserver/randr/rrmonitor.c index 3f6e03e7d..1bb5018fe 100644 --- a/xserver/randr/rrmonitor.c +++ b/xserver/randr/rrmonitor.c @@ -92,7 +92,7 @@ RRMonitorSetFromServer(RRCrtcPtr crtc, RRMonitorPtr monitor) monitor->name = RRMonitorCrtcName(crtc); monitor->pScreen = crtc->pScreen; monitor->numOutputs = crtc->numOutputs; - monitor->outputs = calloc(crtc->numOutputs, sizeof(RRCrtc)); + monitor->outputs = calloc(crtc->numOutputs, sizeof(RROutput)); if (!monitor->outputs) return FALSE; for (o = 0; o < crtc->numOutputs; o++) diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c index 647f19a52..e52ad7671 100644 --- a/xserver/randr/rroutput.c +++ b/xserver/randr/rroutput.c @@ -22,6 +22,7 @@ */ #include "randrstr.h" +#include RESTYPE RROutputType; @@ -65,19 +66,17 @@ RROutputCreate(ScreenPtr pScreen, RROutputPtr output; RROutputPtr *outputs; rrScrPrivPtr pScrPriv; + Atom nonDesktopAtom; if (!RRInit()) return NULL; pScrPriv = rrGetScrPriv(pScreen); - if (pScrPriv->numOutputs) - outputs = reallocarray(pScrPriv->outputs, - pScrPriv->numOutputs + 1, sizeof(RROutputPtr)); - else - outputs = malloc(sizeof(RROutputPtr)); + outputs = reallocarray(pScrPriv->outputs, + pScrPriv->numOutputs + 1, sizeof(RROutputPtr)); if (!outputs) - return FALSE; + return NULL; pScrPriv->outputs = outputs; @@ -107,6 +106,7 @@ RROutputCreate(ScreenPtr pScreen, output->properties = NULL; output->pendingProperties = FALSE; output->changed = FALSE; + output->nonDesktop = FALSE; output->devPrivate = devPrivate; if (!AddResource(output->id, RROutputType, (void *) output)) @@ -114,6 +114,13 @@ RROutputCreate(ScreenPtr pScreen, pScrPriv->outputs[pScrPriv->numOutputs++] = output; + nonDesktopAtom = MakeAtom(RR_PROPERTY_NON_DESKTOP, strlen(RR_PROPERTY_NON_DESKTOP), TRUE); + if (nonDesktopAtom != BAD_RESOURCE) { + static const INT32 values[2] = { 0, 1 }; + (void) RRConfigureOutputProperty(output, nonDesktopAtom, FALSE, FALSE, FALSE, + 2, values); + } + RROutputSetNonDesktop(output, FALSE); RRResourcesChanged(pScreen); return output; @@ -314,6 +321,20 @@ RROutputSetPhysicalSize(RROutputPtr output, int mmWidth, int mmHeight) return TRUE; } +Bool +RROutputSetNonDesktop(RROutputPtr output, Bool nonDesktop) +{ + const char *nonDesktopStr = RR_PROPERTY_NON_DESKTOP; + Atom nonDesktopProp = MakeAtom(nonDesktopStr, strlen(nonDesktopStr), TRUE); + uint32_t value = nonDesktop ? 1 : 0; + + if (nonDesktopProp == None || nonDesktopProp == BAD_RESOURCE) + return FALSE; + + return RRChangeOutputProperty(output, nonDesktopProp, XA_INTEGER, 32, + PropModeReplace, 1, &value, TRUE, FALSE) == Success; +} + void RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) { @@ -333,7 +354,7 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) .crtc = crtc ? crtc->id : None, .mode = mode ? mode->mode.id : None, .rotation = crtc ? crtc->rotation : RR_Rotate_0, - .connection = output->connection, + .connection = output->nonDesktop ? RR_Disconnected : output->connection, .subpixelOrder = output->subpixelOrder }; WriteEventsToClient(client, 1, (xEvent *) &oe); @@ -358,6 +379,17 @@ RROutputDestroyResource(void *value, XID pid) if (pScreen) { rrScrPriv(pScreen); int i; + RRLeasePtr lease, next; + + xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list) { + int o; + for (o = 0; o < lease->numOutputs; o++) { + if (lease->outputs[o] == output) { + RRTerminateLease(lease); + break; + } + } + } if (pScrPriv->primaryOutput == output) pScrPriv->primaryOutput = NULL; @@ -429,65 +461,99 @@ ProcRRGetOutputInfo(ClientPtr client) RROutput *clones; char *name; int i; + Bool leased; REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); + leased = RROutputIsLeased(output); + pScreen = output->pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep = (xRRGetOutputInfoReply) { - .type = X_Reply, - .status = RRSetConfigSuccess, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(OutputInfoExtra), - .timestamp = pScrPriv->lastSetTime.milliseconds, - .crtc = output->crtc ? output->crtc->id : None, - .mmWidth = output->mmWidth, - .mmHeight = output->mmHeight, - .connection = output->connection, - .subpixelOrder = output->subpixelOrder, - .nCrtcs = output->numCrtcs, - .nModes = output->numModes + output->numUserModes, - .nPreferred = output->numPreferred, - .nClones = output->numClones, - .nameLength = output->nameLength - }; - extraLen = ((output->numCrtcs + - output->numModes + output->numUserModes + - output->numClones + bytes_to_int32(rep.nameLength)) << 2); - - if (extraLen) { - rep.length += bytes_to_int32(extraLen); - extra = calloc(1, extraLen); - if (!extra) - return BadAlloc; - } - else - extra = NULL; - - crtcs = (RRCrtc *) extra; - modes = (RRMode *) (crtcs + output->numCrtcs); - clones = (RROutput *) (modes + output->numModes + output->numUserModes); - name = (char *) (clones + output->numClones); - - for (i = 0; i < output->numCrtcs; i++) { - crtcs[i] = output->crtcs[i]->id; - if (client->swapped) - swapl(&crtcs[i]); - } - for (i = 0; i < output->numModes + output->numUserModes; i++) { - if (i < output->numModes) - modes[i] = output->modes[i]->mode.id; + if (leased) { + rep = (xRRGetOutputInfoReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(OutputInfoExtra), + .timestamp = pScrPriv->lastSetTime.milliseconds, + .crtc = None, + .mmWidth = 0, + .mmHeight = 0, + .connection = RR_Disconnected, + .subpixelOrder = SubPixelUnknown, + .nCrtcs = 0, + .nModes = 0, + .nPreferred = 0, + .nClones = 0, + .nameLength = output->nameLength + }; + extraLen = bytes_to_int32(rep.nameLength) << 2; + if (extraLen) { + rep.length += bytes_to_int32(extraLen); + extra = calloc(1, extraLen); + if (!extra) + return BadAlloc; + } else - modes[i] = output->userModes[i - output->numModes]->mode.id; - if (client->swapped) - swapl(&modes[i]); - } - for (i = 0; i < output->numClones; i++) { - clones[i] = output->clones[i]->id; - if (client->swapped) - swapl(&clones[i]); + extra = NULL; + + name = (char *) extra; + } else { + rep = (xRRGetOutputInfoReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(OutputInfoExtra), + .timestamp = pScrPriv->lastSetTime.milliseconds, + .crtc = output->crtc ? output->crtc->id : None, + .mmWidth = output->mmWidth, + .mmHeight = output->mmHeight, + .connection = output->nonDesktop ? RR_Disconnected : output->connection, + .subpixelOrder = output->subpixelOrder, + .nCrtcs = output->numCrtcs, + .nModes = output->numModes + output->numUserModes, + .nPreferred = output->numPreferred, + .nClones = output->numClones, + .nameLength = output->nameLength + }; + extraLen = ((output->numCrtcs + + output->numModes + output->numUserModes + + output->numClones + bytes_to_int32(rep.nameLength)) << 2); + + if (extraLen) { + rep.length += bytes_to_int32(extraLen); + extra = calloc(1, extraLen); + if (!extra) + return BadAlloc; + } + else + extra = NULL; + + crtcs = (RRCrtc *) extra; + modes = (RRMode *) (crtcs + output->numCrtcs); + clones = (RROutput *) (modes + output->numModes + output->numUserModes); + name = (char *) (clones + output->numClones); + + for (i = 0; i < output->numCrtcs; i++) { + crtcs[i] = output->crtcs[i]->id; + if (client->swapped) + swapl(&crtcs[i]); + } + for (i = 0; i < output->numModes + output->numUserModes; i++) { + if (i < output->numModes) + modes[i] = output->modes[i]->mode.id; + else + modes[i] = output->userModes[i - output->numModes]->mode.id; + if (client->swapped) + swapl(&modes[i]); + } + for (i = 0; i < output->numClones; i++) { + clones[i] = output->clones[i]->id; + if (client->swapped) + swapl(&clones[i]); + } } memcpy(name, output->name, output->nameLength); if (client->swapped) { @@ -554,6 +620,9 @@ ProcRRSetOutputPrimary(ClientPtr client) if (stuff->output) { VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); + if (RROutputIsLeased(output)) + return BadAccess; + if (!output->pScreen->isGPU && output->pScreen != pWin->drawable.pScreen) { client->errorValue = stuff->window; return BadMatch; diff --git a/xserver/randr/rrproperty.c b/xserver/randr/rrproperty.c index e56626cd2..c2fb9585c 100644 --- a/xserver/randr/rrproperty.c +++ b/xserver/randr/rrproperty.c @@ -23,6 +23,7 @@ #include "randrstr.h" #include "propertyst.h" #include "swaprep.h" +#include static int DeliverPropertyEvent(WindowPtr pWin, void *value) @@ -132,10 +133,33 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property) } } +static void +RRNoticePropertyChange(RROutputPtr output, Atom property, RRPropertyValuePtr value) +{ + const char *non_desktop_str = RR_PROPERTY_NON_DESKTOP; + Atom non_desktop_prop = MakeAtom(non_desktop_str, strlen(non_desktop_str), FALSE); + + if (property == non_desktop_prop) { + if (value->type == XA_INTEGER && value->format == 32 && value->size >= 1) { + uint32_t nonDesktopData; + Bool nonDesktop; + + memcpy(&nonDesktopData, value->data, sizeof (nonDesktopData)); + nonDesktop = nonDesktopData != 0; + + if (nonDesktop != output->nonDesktop) { + output->nonDesktop = nonDesktop; + RROutputChanged(output, 0); + RRTellChanged(output->pScreen); + } + } + } +} + int RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - void *value, Bool sendevent, Bool pending) + const void *value, Bool sendevent, Bool pending) { RRPropertyPtr prop; rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); @@ -235,6 +259,9 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, if (pending && prop->is_pending) output->pendingProperties = TRUE; + if (!(pending && prop->is_pending)) + RRNoticePropertyChange(output, prop->propertyName, prop_value); + if (sendevent) { xRROutputPropertyNotifyEvent event = { .type = RREventBase + RRNotify, @@ -324,7 +351,7 @@ RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending) int RRConfigureOutputProperty(RROutputPtr output, Atom property, Bool pending, Bool range, Bool immutable, - int num_values, INT32 *values) + int num_values, const INT32 *values) { RRPropertyPtr prop = RRQueryOutputProperty(output, property); Bool add = FALSE; @@ -485,6 +512,9 @@ ProcRRConfigureOutputProperty(ClientPtr client) VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); + if (RROutputIsLeased(output)) + return BadAccess; + num_valid = stuff->length - bytes_to_int32(sizeof(xRRConfigureOutputPropertyReq)); return RRConfigureOutputProperty(output, stuff->property, stuff->pending, @@ -555,6 +585,9 @@ ProcRRDeleteOutputProperty(ClientPtr client) UpdateCurrentTime(); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); + if (RROutputIsLeased(output)) + return BadAccess; + if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; diff --git a/xserver/randr/rrprovider.c b/xserver/randr/rrprovider.c index e4bc2bf6a..c430f7477 100644 --- a/xserver/randr/rrprovider.c +++ b/xserver/randr/rrprovider.c @@ -276,7 +276,7 @@ RRInitPrimeSyncProps(ScreenPtr pScreen) Atom syncProp = MakeAtom(syncStr, strlen(syncStr), TRUE); int defaultVal = TRUE; - int validVals[2] = {FALSE, TRUE}; + INT32 validVals[2] = {FALSE, TRUE}; int i; for (i = 0; i < pScrPriv->numOutputs; i++) { diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c index d059ce74a..58fd47be0 100644 --- a/xserver/randr/rrscreen.c +++ b/xserver/randr/rrscreen.c @@ -267,7 +267,7 @@ ProcRRSetScreenSize(ClientPtr client) RRCrtcPtr crtc = pScrPriv->crtcs[i]; RRModePtr mode = crtc->mode; - if (mode) { + if (!RRCrtcIsLeased(crtc) && mode) { int source_width = mode->mode.width; int source_height = mode->mode.height; Rotation rotation = crtc->rotation; diff --git a/xserver/randr/rrsdispatch.c b/xserver/randr/rrsdispatch.c index cf2a3b024..7d7b5a884 100644 --- a/xserver/randr/rrsdispatch.c +++ b/xserver/randr/rrsdispatch.c @@ -22,7 +22,7 @@ #include "randrstr.h" -static int +static int _X_COLD SProcRRQueryVersion(ClientPtr client) { REQUEST(xRRQueryVersionReq); @@ -34,7 +34,7 @@ SProcRRQueryVersion(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetScreenInfo(ClientPtr client) { REQUEST(xRRGetScreenInfoReq); @@ -45,7 +45,7 @@ SProcRRGetScreenInfo(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetScreenConfig(ClientPtr client) { REQUEST(xRRSetScreenConfigReq); @@ -66,7 +66,7 @@ SProcRRSetScreenConfig(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSelectInput(ClientPtr client) { REQUEST(xRRSelectInputReq); @@ -78,7 +78,7 @@ SProcRRSelectInput(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetScreenSizeRange(ClientPtr client) { REQUEST(xRRGetScreenSizeRangeReq); @@ -89,7 +89,7 @@ SProcRRGetScreenSizeRange(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetScreenSize(ClientPtr client) { REQUEST(xRRSetScreenSizeReq); @@ -104,7 +104,7 @@ SProcRRSetScreenSize(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetScreenResources(ClientPtr client) { REQUEST(xRRGetScreenResourcesReq); @@ -115,7 +115,7 @@ SProcRRGetScreenResources(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetOutputInfo(ClientPtr client) { REQUEST(xRRGetOutputInfoReq); @@ -127,7 +127,7 @@ SProcRRGetOutputInfo(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRListOutputProperties(ClientPtr client) { REQUEST(xRRListOutputPropertiesReq); @@ -138,7 +138,7 @@ SProcRRListOutputProperties(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRQueryOutputProperty(ClientPtr client) { REQUEST(xRRQueryOutputPropertyReq); @@ -150,7 +150,7 @@ SProcRRQueryOutputProperty(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRConfigureOutputProperty(ClientPtr client) { REQUEST(xRRConfigureOutputPropertyReq); @@ -163,7 +163,7 @@ SProcRRConfigureOutputProperty(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRChangeOutputProperty(ClientPtr client) { REQUEST(xRRChangeOutputPropertyReq); @@ -190,7 +190,7 @@ SProcRRChangeOutputProperty(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRDeleteOutputProperty(ClientPtr client) { REQUEST(xRRDeleteOutputPropertyReq); @@ -202,7 +202,7 @@ SProcRRDeleteOutputProperty(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetOutputProperty(ClientPtr client) { REQUEST(xRRGetOutputPropertyReq); @@ -217,7 +217,7 @@ SProcRRGetOutputProperty(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRCreateMode(ClientPtr client) { xRRModeInfo *modeinfo; @@ -244,7 +244,7 @@ SProcRRCreateMode(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRDestroyMode(ClientPtr client) { REQUEST(xRRDestroyModeReq); @@ -255,7 +255,7 @@ SProcRRDestroyMode(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRAddOutputMode(ClientPtr client) { REQUEST(xRRAddOutputModeReq); @@ -267,7 +267,7 @@ SProcRRAddOutputMode(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRDeleteOutputMode(ClientPtr client) { REQUEST(xRRDeleteOutputModeReq); @@ -279,7 +279,7 @@ SProcRRDeleteOutputMode(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetCrtcInfo(ClientPtr client) { REQUEST(xRRGetCrtcInfoReq); @@ -291,7 +291,7 @@ SProcRRGetCrtcInfo(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetCrtcConfig(ClientPtr client) { REQUEST(xRRSetCrtcConfigReq); @@ -309,7 +309,7 @@ SProcRRSetCrtcConfig(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetCrtcGammaSize(ClientPtr client) { REQUEST(xRRGetCrtcGammaSizeReq); @@ -320,7 +320,7 @@ SProcRRGetCrtcGammaSize(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetCrtcGamma(ClientPtr client) { REQUEST(xRRGetCrtcGammaReq); @@ -331,7 +331,7 @@ SProcRRGetCrtcGamma(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetCrtcGamma(ClientPtr client) { REQUEST(xRRSetCrtcGammaReq); @@ -344,7 +344,7 @@ SProcRRSetCrtcGamma(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetCrtcTransform(ClientPtr client) { int nparams; @@ -369,7 +369,7 @@ SProcRRSetCrtcTransform(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetCrtcTransform(ClientPtr client) { REQUEST(xRRGetCrtcTransformReq); @@ -380,7 +380,7 @@ SProcRRGetCrtcTransform(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRGetPanning(ClientPtr client) { REQUEST(xRRGetPanningReq); @@ -391,7 +391,7 @@ SProcRRGetPanning(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetPanning(ClientPtr client) { REQUEST(xRRSetPanningReq); @@ -415,7 +415,7 @@ SProcRRSetPanning(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } -static int +static int _X_COLD SProcRRSetOutputPrimary(ClientPtr client) { REQUEST(xRRSetOutputPrimaryReq); @@ -427,7 +427,7 @@ SProcRRSetOutputPrimary(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int +static int _X_COLD SProcRRGetOutputPrimary(ClientPtr client) { REQUEST(xRRGetOutputPrimaryReq); @@ -438,7 +438,8 @@ SProcRRGetOutputPrimary(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRGetProviders(ClientPtr client) +static int _X_COLD +SProcRRGetProviders(ClientPtr client) { REQUEST(xRRGetProvidersReq); @@ -448,7 +449,8 @@ static int SProcRRGetProviders(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRGetProviderInfo(ClientPtr client) +static int _X_COLD +SProcRRGetProviderInfo(ClientPtr client) { REQUEST(xRRGetProviderInfoReq); @@ -459,7 +461,8 @@ static int SProcRRGetProviderInfo(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRSetProviderOffloadSink(ClientPtr client) +static int _X_COLD +SProcRRSetProviderOffloadSink(ClientPtr client) { REQUEST(xRRSetProviderOffloadSinkReq); @@ -471,7 +474,8 @@ static int SProcRRSetProviderOffloadSink(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRSetProviderOutputSource(ClientPtr client) +static int _X_COLD +SProcRRSetProviderOutputSource(ClientPtr client) { REQUEST(xRRSetProviderOutputSourceReq); @@ -483,7 +487,8 @@ static int SProcRRSetProviderOutputSource(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRListProviderProperties(ClientPtr client) +static int _X_COLD +SProcRRListProviderProperties(ClientPtr client) { REQUEST(xRRListProviderPropertiesReq); @@ -493,7 +498,8 @@ static int SProcRRListProviderProperties(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRQueryProviderProperty(ClientPtr client) +static int _X_COLD +SProcRRQueryProviderProperty(ClientPtr client) { REQUEST(xRRQueryProviderPropertyReq); @@ -504,7 +510,8 @@ static int SProcRRQueryProviderProperty(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRConfigureProviderProperty(ClientPtr client) +static int _X_COLD +SProcRRConfigureProviderProperty(ClientPtr client) { REQUEST(xRRConfigureProviderPropertyReq); @@ -517,7 +524,8 @@ static int SProcRRConfigureProviderProperty(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRChangeProviderProperty(ClientPtr client) +static int _X_COLD +SProcRRChangeProviderProperty(ClientPtr client) { REQUEST(xRRChangeProviderPropertyReq); @@ -540,7 +548,8 @@ static int SProcRRChangeProviderProperty(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRDeleteProviderProperty(ClientPtr client) +static int _X_COLD +SProcRRDeleteProviderProperty(ClientPtr client) { REQUEST(xRRDeleteProviderPropertyReq); @@ -551,7 +560,8 @@ static int SProcRRDeleteProviderProperty(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRGetProviderProperty(ClientPtr client) +static int _X_COLD +SProcRRGetProviderProperty(ClientPtr client) { REQUEST(xRRGetProviderPropertyReq); @@ -565,7 +575,8 @@ static int SProcRRGetProviderProperty(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRGetMonitors(ClientPtr client) { +static int _X_COLD +SProcRRGetMonitors(ClientPtr client) { REQUEST(xRRGetMonitorsReq); REQUEST_SIZE_MATCH(xRRGetMonitorsReq); @@ -574,7 +585,8 @@ static int SProcRRGetMonitors(ClientPtr client) { return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRSetMonitor(ClientPtr client) { +static int _X_COLD +SProcRRSetMonitor(ClientPtr client) { REQUEST(xRRSetMonitorReq); REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq); @@ -590,7 +602,8 @@ static int SProcRRSetMonitor(ClientPtr client) { return ProcRandrVector[stuff->randrReqType] (client); } -static int SProcRRDeleteMonitor(ClientPtr client) { +static int _X_COLD +SProcRRDeleteMonitor(ClientPtr client) { REQUEST(xRRDeleteMonitorReq); REQUEST_SIZE_MATCH(xRRDeleteMonitorReq); @@ -600,6 +613,29 @@ static int SProcRRDeleteMonitor(ClientPtr client) { return ProcRandrVector[stuff->randrReqType] (client); } +static int _X_COLD +SProcRRCreateLease(ClientPtr client) { + REQUEST(xRRCreateLeaseReq); + + REQUEST_AT_LEAST_SIZE(xRRCreateLeaseReq); + swaps(&stuff->length); + swapl(&stuff->window); + swaps(&stuff->nCrtcs); + swaps(&stuff->nOutputs); + SwapRestL(stuff); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int _X_COLD +SProcRRFreeLease(ClientPtr client) { + REQUEST(xRRFreeLeaseReq); + + REQUEST_SIZE_MATCH(xRRFreeLeaseReq); + swaps(&stuff->length); + swapl(&stuff->lid); + return ProcRandrVector[stuff->randrReqType] (client); +} + int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = { SProcRRQueryVersion, /* 0 */ /* we skip 1 to make old clients fail pretty immediately */ @@ -649,7 +685,11 @@ int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = { SProcRRChangeProviderProperty, /* 39 */ SProcRRDeleteProviderProperty, /* 40 */ SProcRRGetProviderProperty, /* 41 */ +/* V1.5 additions */ SProcRRGetMonitors, /* 42 */ SProcRRSetMonitor, /* 43 */ SProcRRDeleteMonitor, /* 44 */ +/* V1.6 additions */ + SProcRRCreateLease, /* 45 */ + SProcRRFreeLease, /* 46 */ }; diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c index 8f499dfa9..5f01e953c 100644 --- a/xserver/randr/rrxinerama.c +++ b/xserver/randr/rrxinerama.c @@ -82,7 +82,7 @@ static int ProcRRXineramaGetScreenCount(ClientPtr client); static int ProcRRXineramaGetScreenSize(ClientPtr client); static int ProcRRXineramaIsActive(ClientPtr client); static int ProcRRXineramaQueryScreens(ClientPtr client); -static int SProcRRXineramaDispatch(ClientPtr client); +static int _X_COLD SProcRRXineramaDispatch(ClientPtr client); Bool noRRXineramaExtension = FALSE; @@ -332,7 +332,7 @@ ProcRRXineramaDispatch(ClientPtr client) /* SProc */ -static int +static int _X_COLD SProcRRXineramaQueryVersion(ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); @@ -341,7 +341,7 @@ SProcRRXineramaQueryVersion(ClientPtr client) return ProcRRXineramaQueryVersion(client); } -static int +static int _X_COLD SProcRRXineramaGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); @@ -351,7 +351,7 @@ SProcRRXineramaGetState(ClientPtr client) return ProcRRXineramaGetState(client); } -static int +static int _X_COLD SProcRRXineramaGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); @@ -361,7 +361,7 @@ SProcRRXineramaGetScreenCount(ClientPtr client) return ProcRRXineramaGetScreenCount(client); } -static int +static int _X_COLD SProcRRXineramaGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); @@ -372,7 +372,7 @@ SProcRRXineramaGetScreenSize(ClientPtr client) return ProcRRXineramaGetScreenSize(client); } -static int +static int _X_COLD SProcRRXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); @@ -381,7 +381,7 @@ SProcRRXineramaIsActive(ClientPtr client) return ProcRRXineramaIsActive(client); } -static int +static int _X_COLD SProcRRXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); diff --git a/xserver/record/Makefile.in b/xserver/record/Makefile.in index 1e8e8ff9c..e87057861 100644 --- a/xserver/record/Makefile.in +++ b/xserver/record/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -307,6 +307,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -325,15 +326,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -341,6 +345,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -412,8 +418,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/record/record.c b/xserver/record/record.c index 600d55f53..fdcee7e00 100644 --- a/xserver/record/record.c +++ b/xserver/record/record.c @@ -2486,7 +2486,7 @@ ProcRecordDispatch(ClientPtr client) } } /* ProcRecordDispatch */ -static int +static int _X_COLD SProcRecordQueryVersion(ClientPtr client) { REQUEST(xRecordQueryVersionReq); @@ -2498,7 +2498,7 @@ SProcRecordQueryVersion(ClientPtr client) return ProcRecordQueryVersion(client); } /* SProcRecordQueryVersion */ -static int +static int _X_COLD SwapCreateRegister(xRecordRegisterClientsReq * stuff) { int i; @@ -2522,7 +2522,7 @@ SwapCreateRegister(xRecordRegisterClientsReq * stuff) return Success; } /* SwapCreateRegister */ -static int +static int _X_COLD SProcRecordCreateContext(ClientPtr client) { REQUEST(xRecordCreateContextReq); @@ -2535,7 +2535,7 @@ SProcRecordCreateContext(ClientPtr client) return ProcRecordCreateContext(client); } /* SProcRecordCreateContext */ -static int +static int _X_COLD SProcRecordRegisterClients(ClientPtr client) { REQUEST(xRecordRegisterClientsReq); @@ -2548,7 +2548,7 @@ SProcRecordRegisterClients(ClientPtr client) return ProcRecordRegisterClients(client); } /* SProcRecordRegisterClients */ -static int +static int _X_COLD SProcRecordUnregisterClients(ClientPtr client) { REQUEST(xRecordUnregisterClientsReq); @@ -2561,7 +2561,7 @@ SProcRecordUnregisterClients(ClientPtr client) return ProcRecordUnregisterClients(client); } /* SProcRecordUnregisterClients */ -static int +static int _X_COLD SProcRecordGetContext(ClientPtr client) { REQUEST(xRecordGetContextReq); @@ -2572,7 +2572,7 @@ SProcRecordGetContext(ClientPtr client) return ProcRecordGetContext(client); } /* SProcRecordGetContext */ -static int +static int _X_COLD SProcRecordEnableContext(ClientPtr client) { REQUEST(xRecordEnableContextReq); @@ -2583,7 +2583,7 @@ SProcRecordEnableContext(ClientPtr client) return ProcRecordEnableContext(client); } /* SProcRecordEnableContext */ -static int +static int _X_COLD SProcRecordDisableContext(ClientPtr client) { REQUEST(xRecordDisableContextReq); @@ -2594,7 +2594,7 @@ SProcRecordDisableContext(ClientPtr client) return ProcRecordDisableContext(client); } /* SProcRecordDisableContext */ -static int +static int _X_COLD SProcRecordFreeContext(ClientPtr client) { REQUEST(xRecordFreeContextReq); @@ -2605,7 +2605,7 @@ SProcRecordFreeContext(ClientPtr client) return ProcRecordFreeContext(client); } /* SProcRecordFreeContext */ -static int +static int _X_COLD SProcRecordDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in index a6aecd6d2..d76403f4b 100644 --- a/xserver/render/Makefile.in +++ b/xserver/render/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -340,6 +340,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -358,15 +359,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -374,6 +378,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -445,8 +451,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/render/animcur.c b/xserver/render/animcur.c index e585a8f23..ef27bda27 100644 --- a/xserver/render/animcur.c +++ b/xserver/render/animcur.c @@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) ScreenPtr pScreen = dev->spriteInfo->anim.pScreen; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); - AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); + AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current); int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor; @@ -147,7 +147,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) pScreen->DisplayCursor = DisplayCursor; dev->spriteInfo->anim.elt = elt; - dev->spriteInfo->anim.time = now + ac->elts[elt].delay; + dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor; return ac->elts[elt].delay; } @@ -155,7 +155,8 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) static void AnimCurCancelTimer(DeviceIntPtr pDev) { - CursorPtr cur = pDev->spriteInfo->anim.pCursor; + CursorPtr cur = pDev->spriteInfo->sprite ? + pDev->spriteInfo->sprite->current : NULL; if (IsAnimCur(cur)) TimerCancel(GetAnimCur(cur)->timer); @@ -172,7 +173,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) Unwrap(as, pScreen, DisplayCursor); if (IsAnimCur(pCursor)) { - if (pCursor != pDev->spriteInfo->anim.pCursor) { + if (pCursor != pDev->spriteInfo->sprite->current) { AnimCurPtr ac = GetAnimCur(pCursor); AnimCurCancelTimer(pDev); @@ -181,8 +182,6 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) if (ret) { pDev->spriteInfo->anim.elt = 0; - pDev->spriteInfo->anim.time = - GetTimeInMillis() + ac->elts[0].delay; pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; @@ -302,7 +301,7 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid) { CursorPtr pCursor; - int rc, i; + int rc = BadAlloc, i; AnimCurPtr ac; for (i = 0; i < screenInfo.numScreens; i++) @@ -317,7 +316,7 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, sizeof(AnimCurRec) + ncursor * sizeof(AnimCurElt), 1); if (!pCursor) - return BadAlloc; + return rc; dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR); pCursor->bits = &animCursorBits; pCursor->refcnt = 1; @@ -336,8 +335,10 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, ac->timer = TimerSet(NULL, 0, 0, AnimCurTimerNotify, NULL); /* security creation/labeling check */ - rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor, - RT_NONE, NULL, DixCreateAccess); + if (ac->timer) + rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor, + RT_NONE, NULL, DixCreateAccess); + if (rc != Success) { TimerFree(ac->timer); dixFiniPrivates(pCursor, PRIVATE_CURSOR); diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c index ea865af58..f3ed9cf4c 100644 --- a/xserver/render/glyph.c +++ b/xserver/render/glyph.c @@ -78,7 +78,7 @@ static GlyphHashSetRec glyphHashSets[] = { {536870912, 590559793, 590559791} }; -#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) +#define NGLYPHHASHSETS ARRAY_SIZE(glyphHashSets) static GlyphHashRec globalGlyphs[GlyphFormatNum]; diff --git a/xserver/render/mirect.c b/xserver/render/mirect.c index a36d1d6e3..65f8d5efd 100644 --- a/xserver/render/mirect.c +++ b/xserver/render/mirect.c @@ -91,8 +91,6 @@ miCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { - ScreenPtr pScreen = pDst->pDrawable->pScreen; - if (color->alpha == 0xffff) { if (op == PictOpOver) op = PictOpSrc; @@ -108,61 +106,18 @@ miCompositeRects(CARD8 op, pDst->alphaOrigin.x, pDst->alphaOrigin.y); } else { - PictFormatPtr rgbaFormat; - PixmapPtr pPixmap; - PicturePtr pSrc; - xRectangle one; int error; - Pixel pixel; - GCPtr pGC; - ChangeGCVal gcvals[2]; - XID tmpval[1]; + PicturePtr pSrc = CreateSolidPicture(0, color, &error); - rgbaFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); - if (!rgbaFormat) - goto bail1; + if (pSrc) { + while (nRect--) { + CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0, + rects->x, rects->y, + rects->width, rects->height); + rects++; + } - pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth, - CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) - goto bail2; - - miRenderColorToPixel(rgbaFormat, color, &pixel); - - pGC = GetScratchGC(rgbaFormat->depth, pScreen); - if (!pGC) - goto bail3; - gcvals[0].val = GXcopy; - gcvals[1].val = pixel; - - ChangeGC(NullClient, pGC, GCFunction | GCForeground, gcvals); - ValidateGC(&pPixmap->drawable, pGC); - one.x = 0; - one.y = 0; - one.width = 1; - one.height = 1; - (*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one); - - tmpval[0] = xTrue; - pSrc = CreatePicture(0, &pPixmap->drawable, rgbaFormat, - CPRepeat, tmpval, serverClient, &error); - - if (!pSrc) - goto bail4; - - while (nRect--) { - CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0, - rects->x, rects->y, rects->width, rects->height); - rects++; + FreePicture((void *) pSrc, 0); } - - FreePicture((void *) pSrc, 0); - bail4: - FreeScratchGC(pGC); - bail3: - (*pScreen->DestroyPixmap) (pPixmap); - bail2: - bail1: - ; } } diff --git a/xserver/render/picture.c b/xserver/render/picture.c index 9e4036e7d..a53f3b560 100644 --- a/xserver/render/picture.c +++ b/xserver/render/picture.c @@ -148,17 +148,17 @@ typedef struct _formatInit { CARD8 depth; } FormatInitRec, *FormatInitPtr; -static int -addFormat(FormatInitRec formats[256], int nformat, CARD32 format, CARD8 depth) +static void +addFormat(FormatInitRec formats[256], int *nformat, CARD32 format, CARD8 depth) { int n; - for (n = 0; n < nformat; n++) + for (n = 0; n < *nformat; n++) if (formats[n].format == format && formats[n].depth == depth) - return nformat; - formats[nformat].format = format; - formats[nformat].depth = depth; - return ++nformat; + return; + formats[*nformat].format = format; + formats[*nformat].depth = depth; + ++*nformat; } #define Mask(n) ((1 << (n)) - 1) @@ -166,7 +166,7 @@ addFormat(FormatInitRec formats[256], int nformat, CARD32 format, CARD8 depth) static PictFormatPtr PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp) { - int nformats, f; + int nformats = 0, f; PictFormatPtr pFormats; FormatInitRec formats[1024]; CARD32 format; @@ -239,18 +239,18 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp) } if (type != PICT_TYPE_OTHER) { format = PICT_FORMAT(bpp, type, 0, r, g, b); - nformats = addFormat(formats, nformats, format, depth); + addFormat(formats, &nformats, format, depth); } break; case StaticColor: case PseudoColor: format = PICT_VISFORMAT(bpp, PICT_TYPE_COLOR, v); - nformats = addFormat(formats, nformats, format, depth); + addFormat(formats, &nformats, format, depth); break; case StaticGray: case GrayScale: format = PICT_VISFORMAT(bpp, PICT_TYPE_GRAY, v); - nformats = addFormat(formats, nformats, format, depth); + addFormat(formats, &nformats, format, depth); break; } } @@ -265,58 +265,34 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp) case 16: /* depth 12 formats */ if (pDepth->depth >= 12) { - nformats = addFormat(formats, nformats, - PICT_x4r4g4b4, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_x4b4g4r4, pDepth->depth); + addFormat(formats, &nformats, PICT_x4r4g4b4, pDepth->depth); + addFormat(formats, &nformats, PICT_x4b4g4r4, pDepth->depth); } /* depth 15 formats */ if (pDepth->depth >= 15) { - nformats = addFormat(formats, nformats, - PICT_x1r5g5b5, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_x1b5g5r5, pDepth->depth); + addFormat(formats, &nformats, PICT_x1r5g5b5, pDepth->depth); + addFormat(formats, &nformats, PICT_x1b5g5r5, pDepth->depth); } /* depth 16 formats */ if (pDepth->depth >= 16) { - nformats = addFormat(formats, nformats, - PICT_a1r5g5b5, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_a1b5g5r5, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_r5g6b5, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_b5g6r5, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_a4r4g4b4, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_a4b4g4r4, pDepth->depth); - } - break; - case 24: - if (pDepth->depth >= 24) { - nformats = addFormat(formats, nformats, - PICT_r8g8b8, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_b8g8r8, pDepth->depth); + addFormat(formats, &nformats, PICT_a1r5g5b5, pDepth->depth); + addFormat(formats, &nformats, PICT_a1b5g5r5, pDepth->depth); + addFormat(formats, &nformats, PICT_r5g6b5, pDepth->depth); + addFormat(formats, &nformats, PICT_b5g6r5, pDepth->depth); + addFormat(formats, &nformats, PICT_a4r4g4b4, pDepth->depth); + addFormat(formats, &nformats, PICT_a4b4g4r4, pDepth->depth); } break; case 32: if (pDepth->depth >= 24) { - nformats = addFormat(formats, nformats, - PICT_x8r8g8b8, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_x8b8g8r8, pDepth->depth); + addFormat(formats, &nformats, PICT_x8r8g8b8, pDepth->depth); + addFormat(formats, &nformats, PICT_x8b8g8r8, pDepth->depth); } if (pDepth->depth >= 30) { - nformats = addFormat(formats, nformats, - PICT_a2r10g10b10, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_x2r10g10b10, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_a2b10g10r10, pDepth->depth); - nformats = addFormat(formats, nformats, - PICT_x2b10g10r10, pDepth->depth); + addFormat(formats, &nformats, PICT_a2r10g10b10, pDepth->depth); + addFormat(formats, &nformats, PICT_x2r10g10b10, pDepth->depth); + addFormat(formats, &nformats, PICT_a2b10g10r10, pDepth->depth); + addFormat(formats, &nformats, PICT_x2b10g10r10, pDepth->depth); } break; } @@ -899,6 +875,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) } pPicture->pSourcePict->type = SourcePictTypeSolidFill; pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); + memcpy(&pPicture->pSourcePict->solidFill.fullcolor, color, sizeof(*color)); return pPicture; } diff --git a/xserver/render/picturestr.h b/xserver/render/picturestr.h index 33baef9bf..dd25a272d 100644 --- a/xserver/render/picturestr.h +++ b/xserver/render/picturestr.h @@ -68,6 +68,7 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr; typedef struct _PictSolidFill { unsigned int type; CARD32 color; + xRenderColor fullcolor; } PictSolidFill, *PictSolidFillPtr; typedef struct _PictGradientStop { diff --git a/xserver/render/render.c b/xserver/render/render.c index 3a41e331e..7d94bd5ff 100644 --- a/xserver/render/render.c +++ b/xserver/render/render.c @@ -1985,7 +1985,7 @@ ProcRenderDispatch(ClientPtr client) return BadRequest; } -static int +static int _X_COLD SProcRenderQueryVersion(ClientPtr client) { REQUEST(xRenderQueryVersionReq); @@ -1996,7 +1996,7 @@ SProcRenderQueryVersion(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderQueryPictFormats(ClientPtr client) { REQUEST(xRenderQueryPictFormatsReq); @@ -2005,7 +2005,7 @@ SProcRenderQueryPictFormats(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderQueryPictIndexValues(ClientPtr client) { REQUEST(xRenderQueryPictIndexValuesReq); @@ -2015,13 +2015,13 @@ SProcRenderQueryPictIndexValues(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderQueryDithers(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderCreatePicture(ClientPtr client) { REQUEST(xRenderCreatePictureReq); @@ -2035,7 +2035,7 @@ SProcRenderCreatePicture(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderChangePicture(ClientPtr client) { REQUEST(xRenderChangePictureReq); @@ -2047,7 +2047,7 @@ SProcRenderChangePicture(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderSetPictureClipRectangles(ClientPtr client) { REQUEST(xRenderSetPictureClipRectanglesReq); @@ -2060,7 +2060,7 @@ SProcRenderSetPictureClipRectangles(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderFreePicture(ClientPtr client) { REQUEST(xRenderFreePictureReq); @@ -2070,7 +2070,7 @@ SProcRenderFreePicture(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderComposite(ClientPtr client) { REQUEST(xRenderCompositeReq); @@ -2090,13 +2090,13 @@ SProcRenderComposite(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderScale(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderTrapezoids(ClientPtr client) { REQUEST(xRenderTrapezoidsReq); @@ -2112,7 +2112,7 @@ SProcRenderTrapezoids(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderTriangles(ClientPtr client) { REQUEST(xRenderTrianglesReq); @@ -2128,7 +2128,7 @@ SProcRenderTriangles(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderTriStrip(ClientPtr client) { REQUEST(xRenderTriStripReq); @@ -2144,7 +2144,7 @@ SProcRenderTriStrip(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderTriFan(ClientPtr client) { REQUEST(xRenderTriFanReq); @@ -2160,25 +2160,25 @@ SProcRenderTriFan(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderColorTrapezoids(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderColorTriangles(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderTransform(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderCreateGlyphSet(ClientPtr client) { REQUEST(xRenderCreateGlyphSetReq); @@ -2189,7 +2189,7 @@ SProcRenderCreateGlyphSet(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderReferenceGlyphSet(ClientPtr client) { REQUEST(xRenderReferenceGlyphSetReq); @@ -2200,7 +2200,7 @@ SProcRenderReferenceGlyphSet(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderFreeGlyphSet(ClientPtr client) { REQUEST(xRenderFreeGlyphSetReq); @@ -2210,7 +2210,7 @@ SProcRenderFreeGlyphSet(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderAddGlyphs(ClientPtr client) { register int i; @@ -2244,13 +2244,13 @@ SProcRenderAddGlyphs(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderAddGlyphsFromPicture(ClientPtr client) { return BadImplementation; } -static int +static int _X_COLD SProcRenderFreeGlyphs(ClientPtr client) { REQUEST(xRenderFreeGlyphsReq); @@ -2261,7 +2261,7 @@ SProcRenderFreeGlyphs(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCompositeGlyphs(ClientPtr client) { xGlyphElt *elt; @@ -2333,7 +2333,7 @@ SProcRenderCompositeGlyphs(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderFillRectangles(ClientPtr client) { REQUEST(xRenderFillRectanglesReq); @@ -2349,7 +2349,7 @@ SProcRenderFillRectangles(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCreateCursor(ClientPtr client) { REQUEST(xRenderCreateCursorReq); @@ -2363,7 +2363,7 @@ SProcRenderCreateCursor(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderSetPictureTransform(ClientPtr client) { REQUEST(xRenderSetPictureTransformReq); @@ -2383,7 +2383,7 @@ SProcRenderSetPictureTransform(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderQueryFilters(ClientPtr client) { REQUEST(xRenderQueryFiltersReq); @@ -2394,7 +2394,7 @@ SProcRenderQueryFilters(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderSetPictureFilter(ClientPtr client) { REQUEST(xRenderSetPictureFilterReq); @@ -2406,7 +2406,7 @@ SProcRenderSetPictureFilter(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCreateAnimCursor(ClientPtr client) { REQUEST(xRenderCreateAnimCursorReq); @@ -2418,7 +2418,7 @@ SProcRenderCreateAnimCursor(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderAddTraps(ClientPtr client) { REQUEST(xRenderAddTrapsReq); @@ -2432,7 +2432,7 @@ SProcRenderAddTraps(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCreateSolidFill(ClientPtr client) { REQUEST(xRenderCreateSolidFillReq); @@ -2447,7 +2447,7 @@ SProcRenderCreateSolidFill(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static void +static void _X_COLD swapStops(void *stuff, int num) { int i; @@ -2466,7 +2466,7 @@ swapStops(void *stuff, int num) } } -static int +static int _X_COLD SProcRenderCreateLinearGradient(ClientPtr client) { int len; @@ -2493,7 +2493,7 @@ SProcRenderCreateLinearGradient(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCreateRadialGradient(ClientPtr client) { int len; @@ -2522,7 +2522,7 @@ SProcRenderCreateRadialGradient(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderCreateConicalGradient(ClientPtr client) { int len; @@ -2548,7 +2548,7 @@ SProcRenderCreateConicalGradient(ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } -static int +static int _X_COLD SProcRenderDispatch(ClientPtr client) { REQUEST(xReq); diff --git a/xserver/test/Makefile.am b/xserver/test/Makefile.am index dc60057f5..12ac327a3 100644 --- a/xserver/test/Makefile.am +++ b/xserver/test/Makefile.am @@ -1,21 +1,20 @@ if ENABLE_UNIT_TESTS SUBDIRS= . -TEST_PROGS = list string -if XORG -# Tests that require at least some DDX functions in order to fully link -# For now, requires xf86 ddx, could be adjusted to use another -SUBDIRS += xi1 xi2 -TEST_PROGS += xkb input xtest misc fixes xfree86 signal-logging touch -if RES -TEST_PROGS += hashtabletest -endif -endif -check_LTLIBRARIES = libxservertest.la +AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ +AM_CPPFLAGS = $(XORG_INCS) -noinst_PROGRAMS = \ - simple-xinit \ - $(TEST_PROGS) \ - $(NULL) +tests_CPPFLAGS= +CLEANFILES= + +tests_SOURCES = \ + tests-common.c \ + tests-common.h \ + list.c \ + string.c \ + tests.c \ + tests.h + +noinst_PROGRAMS = simple-xinit tests if XVFB XVFB_TESTS = scripts/xvfb-piglit.sh @@ -31,8 +30,7 @@ SCRIPT_TESTS = \ $(XEPHYR_GLAMOR_TESTS) \ $(NULL) -TESTS = \ - $(TEST_PROGS) \ +TESTS = tests \ $(SCRIPT_TESTS) \ $(NULL) @@ -42,39 +40,104 @@ TESTS_ENVIRONMENT = \ $(XORG_MALLOC_DEBUG_ENV) \ $(NULL) -AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -AM_CPPFLAGS = $(XORG_INCS) +tests_LDADD = + if XORG -AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/parser \ + +# Tests that require at least some DDX functions in order to fully link +# For now, requires xf86 ddx, could be adjusted to use another + +AM_CPPFLAGS += \ + -I$(srcdir)/xi1 \ + -I$(srcdir)/xi2 \ + -I$(top_srcdir)/hw/xfree86/common \ + -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 -endif -TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) +tests_CPPFLAGS += $(AM_CPPFLAGS) -if SPECIAL_DTRACE_OBJECTS -TEST_LDADD += $(OS_LIB) $(DIX_LIB) +tests_SOURCES += \ + fixes.c \ + input.c \ + misc.c \ + signal-logging.c \ + touch.c \ + xfree86.c \ + test_xkb.c \ + xtest.c +tests_CPPFLAGS += -DXORG_TESTS + +if RES +tests_SOURCES += hashtabletest.c +tests_CPPFLAGS += -DRES_TESTS endif -xkb_LDADD=$(TEST_LDADD) -input_LDADD=$(TEST_LDADD) -xtest_LDADD=$(TEST_LDADD) -misc_LDADD=$(TEST_LDADD) -fixes_LDADD=$(TEST_LDADD) -xfree86_LDADD=$(TEST_LDADD) -touch_LDADD=$(TEST_LDADD) -signal_logging_LDADD=$(TEST_LDADD) -hashtabletest_LDADD=$(TEST_LDADD) +endif XORG + +if HAVE_LD_WRAP + +tests_CPPFLAGS += -DLDWRAP_TESTS + +if XORG +tests_SOURCES += \ + xi1/protocol-xchangedevicecontrol.c \ + xi2/protocol-common.c \ + xi2/protocol-xiqueryversion.c \ + xi2/protocol-xiquerydevice.c \ + xi2/protocol-xiselectevents.c \ + xi2/protocol-xigetselectedevents.c \ + xi2/protocol-xisetclientpointer.c \ + xi2/protocol-xigetclientpointer.c \ + xi2/protocol-xiquerypointer.c \ + xi2/protocol-xipassivegrabdevice.c \ + xi2/protocol-xiwarppointer.c \ + xi2/protocol-eventconvert.c \ + xi2/xi2.c \ + xi2/protocol-common.h + +tests_LDFLAGS = \ + -Wl,-wrap,dixLookupWindow \ + -Wl,-wrap,dixLookupClient \ + -Wl,-wrap,WriteToClient \ + -Wl,-wrap,dixLookupWindow \ + -Wl,-wrap,XISetEventMask \ + -Wl,-wrap,AddResource \ + -Wl,-wrap,GrabButton \ + $() +endif XORG + +else !HAVE_LD_WRAP + +# Print that xi1-tests were skipped (exit code 77 for automake test harness) +TESTS += xi1-tests +CLEANFILES += xi1-tests + +xi1-tests: + @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ + @echo 'exit 77' >> $@ + $(AM_V_GEN)chmod +x $@ + +# Print that xi2-tests were skipped (exit code 77 for automake test harness) +TESTS += xi2-tests +CLEANFILES += xi2-tests + +xi2-tests: + @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ + @echo 'exit 77' >> $@ + $(AM_V_GEN)chmod +x $@ + +endif !HAVE_LD_WRAP -libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG -nodist_libxservertest_la_SOURCES = sdksyms.c -libxservertest_la_LIBADD += \ +nodist_tests_SOURCES = sdksyms.c + +tests_LDADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ - $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ $(top_builddir)/hw/xfree86/common/libcommon.la \ + $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ $(top_builddir)/hw/xfree86/parser/libxf86config.la \ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ @@ -83,93 +146,47 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ $(top_builddir)/Xext/libXvidmode.la \ - @XORG_LIBS@ + $(XSERVER_LIBS) \ + $(XORG_LIBS) + +if !SPECIAL_DTRACE_OBJECTS +tests_LDADD += $(top_builddir)/os/libos.la +endif + +if GLX +tests_LDADD += $(top_builddir)/glx/libglxvnd.la +endif BUILT_SOURCES = sdksyms.c -CLEANFILES = sdksyms.c +CLEANFILES += sdksyms.c sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c if DRI -libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la +tests_LDADD += $(top_builddir)/hw/xfree86/dri/libdri.la endif if DRI2 -libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la +tests_LDADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la endif if DRI3 -libxservertest_la_LIBADD += $(top_builddir)/dri3/libdri3.la +tests_LDADD += $(top_builddir)/dri3/libdri3.la endif -else -nodist_libxservertest_la_SOURCES = \ - ddxstubs.c \ - $(top_srcdir)/mi/miinitext.c +endif XORG -libxservertest_la_LIBADD += \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/fb/libwfb.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/miext/sync/libsync.la \ - $(top_builddir)/randr/librandr.la \ - $(top_builddir)/render/librender.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ - $(top_builddir)/Xext/libXvidmode.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/Xi/libXistubs.la \ - $(top_builddir)/xfixes/libxfixes.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la +# GNU LD scans only in one direction, add the following dependencies at the end +# so as they get picked up by the previously-linked libraries +tests_LDADD += $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) -if COMPOSITE -libxservertest_la_LIBADD += \ - $(top_builddir)/composite/libcomposite.la -endif - -if DBE -libxservertest_la_LIBADD += \ - $(top_builddir)/dbe/libdbe.la -endif - -if GLX -libxservertest_la_LIBADD += \ - $(top_builddir)/glx/libglx.la -endif - -if RECORD -libxservertest_la_LIBADD += \ - $(top_builddir)/record/librecord.la -endif - -if DRI3 -libxservertest_la_LIBADD += \ - $(top_builddir)/dri3/libdri3.la -endif - -if XQUARTZ -libxservertest_la_LIBADD += \ - $(top_builddir)/miext/rootless/librootless.la -TEST_LDADD += -lXplugin -endif - -if XWIN_MULTIWINDOWEXTWM -libxservertest_la_LIBADD += \ - $(top_builddir)/miext/rootless/librootless.la -endif -endif - -libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) -endif +endif ENABLE_UNIT_TESTS EXTRA_DIST = \ scripts/xvfb-piglit.sh \ scripts/xephyr-glamor-piglit.sh \ scripts/xinit-piglit-session.sh \ scripts/run-piglit.sh \ - ddxstubs.c \ $(NULL) diff --git a/xserver/test/Makefile.in b/xserver/test/Makefile.in index b78843e0b..67e9e07f2 100644 --- a/xserver/test/Makefile.in +++ b/xserver/test/Makefile.in @@ -50,25 +50,66 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = simple-xinit$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ tests$(EXEEXT) +@ENABLE_UNIT_TESTS_TRUE@TESTS = tests$(EXEEXT) $(am__EXEEXT_1) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_8) + # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_1 = xi1 xi2 -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 signal-logging touch -@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_3 = hashtabletest -@ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = simple-xinit$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_3) -@ENABLE_UNIT_TESTS_TRUE@TESTS = $(am__EXEEXT_3) $(am__EXEEXT_4) -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_4 = -I$(top_srcdir)/hw/xfree86/parser \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_1 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(srcdir)/xi1 \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(srcdir)/xi2 \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/common \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/parser \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ddc \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_5 = $(OS_LIB) $(DIX_LIB) -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_6 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = $(AM_CPPFLAGS) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -DXORG_TESTS +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_3 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ fixes.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ input.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ misc.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ touch.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ test_xkb.c \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xtest.c + +@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_4 = hashtabletest.c +@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_5 = -DRES_TESTS +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am__append_6 = -DLDWRAP_TESTS +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@am__append_7 = \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi1/protocol-xchangedevicecontrol.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-common.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xiqueryversion.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xiquerydevice.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xiselectevents.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xigetselectedevents.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xisetclientpointer.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xigetclientpointer.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xiquerypointer.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xipassivegrabdevice.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-xiwarppointer.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-eventconvert.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/xi2.c \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ xi2/protocol-common.h + + +# Print that xi1-tests were skipped (exit code 77 for automake test harness) + +# Print that xi2-tests were skipped (exit code 77 for automake test harness) +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@am__append_8 = xi1-tests \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ xi2-tests +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@am__append_9 = xi1-tests \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ xi2-tests +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_10 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/loader/libloader.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ @@ -77,50 +118,15 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/Xext/libXvidmode.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@ - -@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri/libdri.la -@DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_8 = $(top_builddir)/hw/xfree86/dri2/libdri2.la -@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_9 = $(top_builddir)/dri3/libdri3.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_10 = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/damageext/libdamageext.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libfb.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libwfb.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/miext/damage/libdamage.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/miext/sync/libsync.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/randr/librandr.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/render/librender.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXext.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXextdpmsstubs.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXvidmode.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXi.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXistubs.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xfixes/libxfixes.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkb.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkbstubs.la - -@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_11 = \ -@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/composite/libcomposite.la - -@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_12 = \ -@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dbe/libdbe.la - -@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_13 = \ -@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@ $(top_builddir)/glx/libglx.la - -@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_14 = \ -@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@ $(top_builddir)/record/librecord.la - -@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_15 = \ -@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dri3/libdri3.la - -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_16 = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@ $(top_builddir)/miext/rootless/librootless.la - -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_17 = -lXplugin -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_18 = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@ $(top_builddir)/miext/rootless/librootless.la +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(XSERVER_LIBS) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(XORG_LIBS) +@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_FALSE@@XORG_TRUE@am__append_11 = $(top_builddir)/os/libos.la +@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_TRUE@am__append_12 = $(top_builddir)/glx/libglxvnd.la +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_13 = sdksyms.c +@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_14 = $(top_builddir)/hw/xfree86/dri/libdri.la +@DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_15 = $(top_builddir)/hw/xfree86/dri2/libdri2.la +@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_16 = $(top_builddir)/dri3/libdri3.la subdir = test DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -139,14 +145,67 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +simple_xinit_SOURCES = simple-xinit.c +simple_xinit_OBJECTS = simple-xinit.$(OBJEXT) +simple_xinit_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am__tests_SOURCES_DIST = tests-common.c tests-common.h list.c string.c \ + tests.c tests.h fixes.c input.c misc.c signal-logging.c \ + touch.c xfree86.c test_xkb.c xtest.c hashtabletest.c \ + xi1/protocol-xchangedevicecontrol.c xi2/protocol-common.c \ + xi2/protocol-xiqueryversion.c xi2/protocol-xiquerydevice.c \ + xi2/protocol-xiselectevents.c \ + xi2/protocol-xigetselectedevents.c \ + xi2/protocol-xisetclientpointer.c \ + xi2/protocol-xigetclientpointer.c \ + xi2/protocol-xiquerypointer.c \ + xi2/protocol-xipassivegrabdevice.c \ + xi2/protocol-xiwarppointer.c xi2/protocol-eventconvert.c \ + xi2/xi2.c xi2/protocol-common.h +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__objects_1 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-fixes.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-input.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-misc.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-signal-logging.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-touch.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-xfree86.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-test_xkb.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-xtest.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__objects_2 = tests-hashtabletest.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@am__objects_3 = tests-protocol-xchangedevicecontrol.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-common.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xiqueryversion.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xiquerydevice.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xiselectevents.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xigetselectedevents.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xisetclientpointer.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xigetclientpointer.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xiquerypointer.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xipassivegrabdevice.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-xiwarppointer.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-protocol-eventconvert.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ tests-xi2.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@am_tests_OBJECTS = \ +@ENABLE_UNIT_TESTS_TRUE@ tests-tests-common.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ tests-list.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ tests-string.$(OBJEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ tests-tests.$(OBJEXT) $(am__objects_1) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__objects_2) $(am__objects_3) +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_tests_OBJECTS = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ tests-sdksyms.$(OBJEXT) +tests_OBJECTS = $(am_tests_OBJECTS) $(nodist_tests_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/hw/xfree86/loader/libloader.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ @@ -154,75 +213,18 @@ am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/Xext/libXvidmode.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_OBJECTS = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.lo miinitext.lo -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_libxservertest_la_OBJECTS = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ sdksyms.lo -libxservertest_la_OBJECTS = $(nodist_libxservertest_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -@ENABLE_UNIT_TESTS_TRUE@am_libxservertest_la_rpath = -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__EXEEXT_1 = xkb$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ input$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xtest$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ misc$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ fixes$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ touch$(EXEEXT) -@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__EXEEXT_2 = hashtabletest$(EXEEXT) -@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_3 = list$(EXEEXT) string$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_1) $(am__EXEEXT_2) -PROGRAMS = $(noinst_PROGRAMS) -fixes_SOURCES = fixes.c -fixes_OBJECTS = fixes.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) \ -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@ $(am__DEPENDENCIES_1) -@ENABLE_UNIT_TESTS_TRUE@am__DEPENDENCIES_4 = libxservertest.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/Xext/libXvidmode.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(am__DEPENDENCIES_1) +@ENABLE_UNIT_TESTS_TRUE@tests_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_11) $(am__append_12) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) $(am__append_15) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_3) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) -@ENABLE_UNIT_TESTS_TRUE@fixes_DEPENDENCIES = $(am__DEPENDENCIES_4) -hashtabletest_SOURCES = hashtabletest.c -hashtabletest_OBJECTS = hashtabletest.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@hashtabletest_DEPENDENCIES = \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_4) -input_SOURCES = input.c -input_OBJECTS = input.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@input_DEPENDENCIES = $(am__DEPENDENCIES_4) -list_SOURCES = list.c -list_OBJECTS = list.$(OBJEXT) -list_LDADD = $(LDADD) -misc_SOURCES = misc.c -misc_OBJECTS = misc.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@misc_DEPENDENCIES = $(am__DEPENDENCIES_4) -signal_logging_SOURCES = signal-logging.c -signal_logging_OBJECTS = signal-logging.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@signal_logging_DEPENDENCIES = \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_4) -simple_xinit_SOURCES = simple-xinit.c -simple_xinit_OBJECTS = simple-xinit.$(OBJEXT) -simple_xinit_LDADD = $(LDADD) -string_SOURCES = string.c -string_OBJECTS = string.$(OBJEXT) -string_LDADD = $(LDADD) -touch_SOURCES = touch.c -touch_OBJECTS = touch.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@touch_DEPENDENCIES = $(am__DEPENDENCIES_4) -xfree86_SOURCES = xfree86.c -xfree86_OBJECTS = xfree86.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@xfree86_DEPENDENCIES = $(am__DEPENDENCIES_4) -xkb_SOURCES = xkb.c -xkb_OBJECTS = xkb.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@xkb_DEPENDENCIES = $(am__DEPENDENCIES_4) -xtest_SOURCES = xtest.c -xtest_OBJECTS = xtest.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@xtest_DEPENDENCIES = $(am__DEPENDENCIES_4) +tests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(tests_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -257,12 +259,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(nodist_libxservertest_la_SOURCES) fixes.c hashtabletest.c \ - input.c list.c misc.c signal-logging.c simple-xinit.c string.c \ - touch.c xfree86.c xkb.c xtest.c -DIST_SOURCES = fixes.c hashtabletest.c input.c list.c misc.c \ - signal-logging.c simple-xinit.c string.c touch.c xfree86.c \ - xkb.c xtest.c +SOURCES = simple-xinit.c $(tests_SOURCES) $(nodist_tests_SOURCES) +DIST_SOURCES = simple-xinit.c $(am__tests_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -286,9 +284,9 @@ am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = $(am__tty_colors_dummy) -@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_4 = $(XVFB_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_1 = $(XVFB_TESTS) \ @ENABLE_UNIT_TESTS_TRUE@ $(XEPHYR_GLAMOR_TESTS) -DIST_SUBDIRS = . xi1 xi2 +DIST_SUBDIRS = . DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -498,6 +496,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -516,15 +515,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -532,6 +534,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -603,8 +607,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ @@ -669,10 +671,16 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@ENABLE_UNIT_TESTS_TRUE@SUBDIRS = . $(am__append_1) -@ENABLE_UNIT_TESTS_TRUE@TEST_PROGS = list string $(am__append_2) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_3) -@ENABLE_UNIT_TESTS_TRUE@check_LTLIBRARIES = libxservertest.la +@ENABLE_UNIT_TESTS_TRUE@SUBDIRS = . +@ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ +@ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) $(am__append_1) +@ENABLE_UNIT_TESTS_TRUE@tests_CPPFLAGS = $(am__append_2) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_5) $(am__append_6) +@ENABLE_UNIT_TESTS_TRUE@CLEANFILES = $(am__append_9) $(am__append_13) +@ENABLE_UNIT_TESTS_TRUE@tests_SOURCES = tests-common.c tests-common.h \ +@ENABLE_UNIT_TESTS_TRUE@ list.c string.c tests.c tests.h \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_3) $(am__append_4) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_7) @ENABLE_UNIT_TESTS_TRUE@@XVFB_TRUE@XVFB_TESTS = scripts/xvfb-piglit.sh @ENABLE_UNIT_TESTS_TRUE@@GLAMOR_TRUE@@XEPHYR_TRUE@@XVFB_TRUE@XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh @ENABLE_UNIT_TESTS_TRUE@SCRIPT_TESTS = \ @@ -686,42 +694,31 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@ $(XORG_MALLOC_DEBUG_ENV) \ @ENABLE_UNIT_TESTS_TRUE@ $(NULL) -@ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -@ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) $(am__append_4) -@ENABLE_UNIT_TESTS_TRUE@TEST_LDADD = libxservertest.la \ -@ENABLE_UNIT_TESTS_TRUE@ $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) \ -@ENABLE_UNIT_TESTS_TRUE@ $(GLX_SYS_LIBS) $(am__append_5) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_17) -@ENABLE_UNIT_TESTS_TRUE@xkb_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@input_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@xtest_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@misc_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@fixes_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@xfree86_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@touch_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@signal_logging_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@hashtabletest_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@libxservertest_la_LIBADD = $(XSERVER_LIBS) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_6) $(am__append_7) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_8) $(am__append_9) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_10) $(am__append_11) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_12) $(am__append_13) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) $(am__append_15) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) $(am__append_18) -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_SOURCES = \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.c \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_srcdir)/mi/miinitext.c -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_libxservertest_la_SOURCES = sdksyms.c +# GNU LD scans only in one direction, add the following dependencies at the end +# so as they get picked up by the previously-linked libraries +@ENABLE_UNIT_TESTS_TRUE@tests_LDADD = $(am__append_10) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_11) $(am__append_12) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) $(am__append_15) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) $(XORG_SYS_LIBS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@tests_LDFLAGS = \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,dixLookupWindow \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,dixLookupClient \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,WriteToClient \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,dixLookupWindow \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,XISetEventMask \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,AddResource \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ -Wl,-wrap,GrabButton \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@XORG_TRUE@ $() + +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_tests_SOURCES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@BUILT_SOURCES = sdksyms.c -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@CLEANFILES = sdksyms.c -@ENABLE_UNIT_TESTS_TRUE@libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) EXTRA_DIST = \ scripts/xvfb-piglit.sh \ scripts/xephyr-glamor-piglit.sh \ scripts/xinit-piglit-session.sh \ scripts/run-piglit.sh \ - ddxstubs.c \ $(NULL) all: $(BUILT_SOURCES) @@ -760,19 +757,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -clean-checkLTLIBRARIES: - -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) - @list='$(check_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libxservertest.la: $(libxservertest_la_OBJECTS) $(libxservertest_la_DEPENDENCIES) $(EXTRA_libxservertest_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libxservertest_la_rpath) $(libxservertest_la_OBJECTS) $(libxservertest_la_LIBADD) $(LIBS) - clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ @@ -781,42 +765,12 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -fixes$(EXEEXT): $(fixes_OBJECTS) $(fixes_DEPENDENCIES) $(EXTRA_fixes_DEPENDENCIES) - @rm -f fixes$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(fixes_OBJECTS) $(fixes_LDADD) $(LIBS) -hashtabletest$(EXEEXT): $(hashtabletest_OBJECTS) $(hashtabletest_DEPENDENCIES) $(EXTRA_hashtabletest_DEPENDENCIES) - @rm -f hashtabletest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(hashtabletest_OBJECTS) $(hashtabletest_LDADD) $(LIBS) -input$(EXEEXT): $(input_OBJECTS) $(input_DEPENDENCIES) $(EXTRA_input_DEPENDENCIES) - @rm -f input$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(input_OBJECTS) $(input_LDADD) $(LIBS) -list$(EXEEXT): $(list_OBJECTS) $(list_DEPENDENCIES) $(EXTRA_list_DEPENDENCIES) - @rm -f list$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(list_OBJECTS) $(list_LDADD) $(LIBS) -misc$(EXEEXT): $(misc_OBJECTS) $(misc_DEPENDENCIES) $(EXTRA_misc_DEPENDENCIES) - @rm -f misc$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(misc_OBJECTS) $(misc_LDADD) $(LIBS) -signal-logging$(EXEEXT): $(signal_logging_OBJECTS) $(signal_logging_DEPENDENCIES) $(EXTRA_signal_logging_DEPENDENCIES) - @rm -f signal-logging$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(signal_logging_OBJECTS) $(signal_logging_LDADD) $(LIBS) simple-xinit$(EXEEXT): $(simple_xinit_OBJECTS) $(simple_xinit_DEPENDENCIES) $(EXTRA_simple_xinit_DEPENDENCIES) @rm -f simple-xinit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simple_xinit_OBJECTS) $(simple_xinit_LDADD) $(LIBS) -string$(EXEEXT): $(string_OBJECTS) $(string_DEPENDENCIES) $(EXTRA_string_DEPENDENCIES) - @rm -f string$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(string_OBJECTS) $(string_LDADD) $(LIBS) -touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) $(EXTRA_touch_DEPENDENCIES) - @rm -f touch$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) -xfree86$(EXEEXT): $(xfree86_OBJECTS) $(xfree86_DEPENDENCIES) $(EXTRA_xfree86_DEPENDENCIES) - @rm -f xfree86$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(xfree86_OBJECTS) $(xfree86_LDADD) $(LIBS) -xkb$(EXEEXT): $(xkb_OBJECTS) $(xkb_DEPENDENCIES) $(EXTRA_xkb_DEPENDENCIES) - @rm -f xkb$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(xkb_OBJECTS) $(xkb_LDADD) $(LIBS) -xtest$(EXEEXT): $(xtest_OBJECTS) $(xtest_DEPENDENCIES) $(EXTRA_xtest_DEPENDENCIES) - @rm -f xtest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(xtest_OBJECTS) $(xtest_LDADD) $(LIBS) +tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) $(EXTRA_tests_DEPENDENCIES) + @rm -f tests$(EXEEXT) + $(AM_V_CCLD)$(tests_LINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -824,21 +778,34 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxstubs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashtabletest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdksyms.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal-logging.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-xinit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfree86.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-fixes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-hashtabletest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-input.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-misc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-eventconvert.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xchangedevicecontrol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xigetclientpointer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xigetselectedevents.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xipassivegrabdevice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xiquerydevice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xiquerypointer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xiqueryversion.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xiselectevents.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xisetclientpointer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-protocol-xiwarppointer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-sdksyms.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-signal-logging.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-string.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-test_xkb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-tests-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-tests.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-touch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-xfree86.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-xi2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-xtest.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -861,12 +828,383 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -miinitext.lo: $(top_srcdir)/mi/miinitext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.lo -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='miinitext.lo' libtool=yes @AMDEPBACKSLASH@ +tests-tests-common.o: tests-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-tests-common.o -MD -MP -MF $(DEPDIR)/tests-tests-common.Tpo -c -o tests-tests-common.o `test -f 'tests-common.c' || echo '$(srcdir)/'`tests-common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-tests-common.Tpo $(DEPDIR)/tests-tests-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests-common.c' object='tests-tests-common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-tests-common.o `test -f 'tests-common.c' || echo '$(srcdir)/'`tests-common.c + +tests-tests-common.obj: tests-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-tests-common.obj -MD -MP -MF $(DEPDIR)/tests-tests-common.Tpo -c -o tests-tests-common.obj `if test -f 'tests-common.c'; then $(CYGPATH_W) 'tests-common.c'; else $(CYGPATH_W) '$(srcdir)/tests-common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-tests-common.Tpo $(DEPDIR)/tests-tests-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests-common.c' object='tests-tests-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-tests-common.obj `if test -f 'tests-common.c'; then $(CYGPATH_W) 'tests-common.c'; else $(CYGPATH_W) '$(srcdir)/tests-common.c'; fi` + +tests-list.o: list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-list.o -MD -MP -MF $(DEPDIR)/tests-list.Tpo -c -o tests-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-list.Tpo $(DEPDIR)/tests-list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list.c' object='tests-list.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c + +tests-list.obj: list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-list.obj -MD -MP -MF $(DEPDIR)/tests-list.Tpo -c -o tests-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-list.Tpo $(DEPDIR)/tests-list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list.c' object='tests-list.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi` + +tests-string.o: string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-string.o -MD -MP -MF $(DEPDIR)/tests-string.Tpo -c -o tests-string.o `test -f 'string.c' || echo '$(srcdir)/'`string.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-string.Tpo $(DEPDIR)/tests-string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string.c' object='tests-string.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-string.o `test -f 'string.c' || echo '$(srcdir)/'`string.c + +tests-string.obj: string.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-string.obj -MD -MP -MF $(DEPDIR)/tests-string.Tpo -c -o tests-string.obj `if test -f 'string.c'; then $(CYGPATH_W) 'string.c'; else $(CYGPATH_W) '$(srcdir)/string.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-string.Tpo $(DEPDIR)/tests-string.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string.c' object='tests-string.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-string.obj `if test -f 'string.c'; then $(CYGPATH_W) 'string.c'; else $(CYGPATH_W) '$(srcdir)/string.c'; fi` + +tests-tests.o: tests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-tests.o -MD -MP -MF $(DEPDIR)/tests-tests.Tpo -c -o tests-tests.o `test -f 'tests.c' || echo '$(srcdir)/'`tests.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests.c' object='tests-tests.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-tests.o `test -f 'tests.c' || echo '$(srcdir)/'`tests.c + +tests-tests.obj: tests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-tests.obj -MD -MP -MF $(DEPDIR)/tests-tests.Tpo -c -o tests-tests.obj `if test -f 'tests.c'; then $(CYGPATH_W) 'tests.c'; else $(CYGPATH_W) '$(srcdir)/tests.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests.c' object='tests-tests.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-tests.obj `if test -f 'tests.c'; then $(CYGPATH_W) 'tests.c'; else $(CYGPATH_W) '$(srcdir)/tests.c'; fi` + +tests-fixes.o: fixes.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-fixes.o -MD -MP -MF $(DEPDIR)/tests-fixes.Tpo -c -o tests-fixes.o `test -f 'fixes.c' || echo '$(srcdir)/'`fixes.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-fixes.Tpo $(DEPDIR)/tests-fixes.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fixes.c' object='tests-fixes.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-fixes.o `test -f 'fixes.c' || echo '$(srcdir)/'`fixes.c + +tests-fixes.obj: fixes.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-fixes.obj -MD -MP -MF $(DEPDIR)/tests-fixes.Tpo -c -o tests-fixes.obj `if test -f 'fixes.c'; then $(CYGPATH_W) 'fixes.c'; else $(CYGPATH_W) '$(srcdir)/fixes.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-fixes.Tpo $(DEPDIR)/tests-fixes.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fixes.c' object='tests-fixes.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-fixes.obj `if test -f 'fixes.c'; then $(CYGPATH_W) 'fixes.c'; else $(CYGPATH_W) '$(srcdir)/fixes.c'; fi` + +tests-input.o: input.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-input.o -MD -MP -MF $(DEPDIR)/tests-input.Tpo -c -o tests-input.o `test -f 'input.c' || echo '$(srcdir)/'`input.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-input.Tpo $(DEPDIR)/tests-input.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='input.c' object='tests-input.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-input.o `test -f 'input.c' || echo '$(srcdir)/'`input.c + +tests-input.obj: input.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-input.obj -MD -MP -MF $(DEPDIR)/tests-input.Tpo -c -o tests-input.obj `if test -f 'input.c'; then $(CYGPATH_W) 'input.c'; else $(CYGPATH_W) '$(srcdir)/input.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-input.Tpo $(DEPDIR)/tests-input.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='input.c' object='tests-input.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-input.obj `if test -f 'input.c'; then $(CYGPATH_W) 'input.c'; else $(CYGPATH_W) '$(srcdir)/input.c'; fi` + +tests-misc.o: misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-misc.o -MD -MP -MF $(DEPDIR)/tests-misc.Tpo -c -o tests-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-misc.Tpo $(DEPDIR)/tests-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc.c' object='tests-misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c + +tests-misc.obj: misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-misc.obj -MD -MP -MF $(DEPDIR)/tests-misc.Tpo -c -o tests-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-misc.Tpo $(DEPDIR)/tests-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc.c' object='tests-misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` + +tests-signal-logging.o: signal-logging.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-signal-logging.o -MD -MP -MF $(DEPDIR)/tests-signal-logging.Tpo -c -o tests-signal-logging.o `test -f 'signal-logging.c' || echo '$(srcdir)/'`signal-logging.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-signal-logging.Tpo $(DEPDIR)/tests-signal-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal-logging.c' object='tests-signal-logging.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-signal-logging.o `test -f 'signal-logging.c' || echo '$(srcdir)/'`signal-logging.c + +tests-signal-logging.obj: signal-logging.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-signal-logging.obj -MD -MP -MF $(DEPDIR)/tests-signal-logging.Tpo -c -o tests-signal-logging.obj `if test -f 'signal-logging.c'; then $(CYGPATH_W) 'signal-logging.c'; else $(CYGPATH_W) '$(srcdir)/signal-logging.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-signal-logging.Tpo $(DEPDIR)/tests-signal-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal-logging.c' object='tests-signal-logging.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-signal-logging.obj `if test -f 'signal-logging.c'; then $(CYGPATH_W) 'signal-logging.c'; else $(CYGPATH_W) '$(srcdir)/signal-logging.c'; fi` + +tests-touch.o: touch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-touch.o -MD -MP -MF $(DEPDIR)/tests-touch.Tpo -c -o tests-touch.o `test -f 'touch.c' || echo '$(srcdir)/'`touch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-touch.Tpo $(DEPDIR)/tests-touch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='touch.c' object='tests-touch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-touch.o `test -f 'touch.c' || echo '$(srcdir)/'`touch.c + +tests-touch.obj: touch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-touch.obj -MD -MP -MF $(DEPDIR)/tests-touch.Tpo -c -o tests-touch.obj `if test -f 'touch.c'; then $(CYGPATH_W) 'touch.c'; else $(CYGPATH_W) '$(srcdir)/touch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-touch.Tpo $(DEPDIR)/tests-touch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='touch.c' object='tests-touch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-touch.obj `if test -f 'touch.c'; then $(CYGPATH_W) 'touch.c'; else $(CYGPATH_W) '$(srcdir)/touch.c'; fi` + +tests-xfree86.o: xfree86.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xfree86.o -MD -MP -MF $(DEPDIR)/tests-xfree86.Tpo -c -o tests-xfree86.o `test -f 'xfree86.c' || echo '$(srcdir)/'`xfree86.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xfree86.Tpo $(DEPDIR)/tests-xfree86.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfree86.c' object='tests-xfree86.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xfree86.o `test -f 'xfree86.c' || echo '$(srcdir)/'`xfree86.c + +tests-xfree86.obj: xfree86.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xfree86.obj -MD -MP -MF $(DEPDIR)/tests-xfree86.Tpo -c -o tests-xfree86.obj `if test -f 'xfree86.c'; then $(CYGPATH_W) 'xfree86.c'; else $(CYGPATH_W) '$(srcdir)/xfree86.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xfree86.Tpo $(DEPDIR)/tests-xfree86.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfree86.c' object='tests-xfree86.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xfree86.obj `if test -f 'xfree86.c'; then $(CYGPATH_W) 'xfree86.c'; else $(CYGPATH_W) '$(srcdir)/xfree86.c'; fi` + +tests-test_xkb.o: test_xkb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-test_xkb.o -MD -MP -MF $(DEPDIR)/tests-test_xkb.Tpo -c -o tests-test_xkb.o `test -f 'test_xkb.c' || echo '$(srcdir)/'`test_xkb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-test_xkb.Tpo $(DEPDIR)/tests-test_xkb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xkb.c' object='tests-test_xkb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-test_xkb.o `test -f 'test_xkb.c' || echo '$(srcdir)/'`test_xkb.c + +tests-test_xkb.obj: test_xkb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-test_xkb.obj -MD -MP -MF $(DEPDIR)/tests-test_xkb.Tpo -c -o tests-test_xkb.obj `if test -f 'test_xkb.c'; then $(CYGPATH_W) 'test_xkb.c'; else $(CYGPATH_W) '$(srcdir)/test_xkb.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-test_xkb.Tpo $(DEPDIR)/tests-test_xkb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xkb.c' object='tests-test_xkb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-test_xkb.obj `if test -f 'test_xkb.c'; then $(CYGPATH_W) 'test_xkb.c'; else $(CYGPATH_W) '$(srcdir)/test_xkb.c'; fi` + +tests-xtest.o: xtest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xtest.o -MD -MP -MF $(DEPDIR)/tests-xtest.Tpo -c -o tests-xtest.o `test -f 'xtest.c' || echo '$(srcdir)/'`xtest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xtest.Tpo $(DEPDIR)/tests-xtest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xtest.c' object='tests-xtest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xtest.o `test -f 'xtest.c' || echo '$(srcdir)/'`xtest.c + +tests-xtest.obj: xtest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xtest.obj -MD -MP -MF $(DEPDIR)/tests-xtest.Tpo -c -o tests-xtest.obj `if test -f 'xtest.c'; then $(CYGPATH_W) 'xtest.c'; else $(CYGPATH_W) '$(srcdir)/xtest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xtest.Tpo $(DEPDIR)/tests-xtest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xtest.c' object='tests-xtest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xtest.obj `if test -f 'xtest.c'; then $(CYGPATH_W) 'xtest.c'; else $(CYGPATH_W) '$(srcdir)/xtest.c'; fi` + +tests-hashtabletest.o: hashtabletest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-hashtabletest.o -MD -MP -MF $(DEPDIR)/tests-hashtabletest.Tpo -c -o tests-hashtabletest.o `test -f 'hashtabletest.c' || echo '$(srcdir)/'`hashtabletest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-hashtabletest.Tpo $(DEPDIR)/tests-hashtabletest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashtabletest.c' object='tests-hashtabletest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-hashtabletest.o `test -f 'hashtabletest.c' || echo '$(srcdir)/'`hashtabletest.c + +tests-hashtabletest.obj: hashtabletest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-hashtabletest.obj -MD -MP -MF $(DEPDIR)/tests-hashtabletest.Tpo -c -o tests-hashtabletest.obj `if test -f 'hashtabletest.c'; then $(CYGPATH_W) 'hashtabletest.c'; else $(CYGPATH_W) '$(srcdir)/hashtabletest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-hashtabletest.Tpo $(DEPDIR)/tests-hashtabletest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashtabletest.c' object='tests-hashtabletest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-hashtabletest.obj `if test -f 'hashtabletest.c'; then $(CYGPATH_W) 'hashtabletest.c'; else $(CYGPATH_W) '$(srcdir)/hashtabletest.c'; fi` + +tests-protocol-xchangedevicecontrol.o: xi1/protocol-xchangedevicecontrol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xchangedevicecontrol.o -MD -MP -MF $(DEPDIR)/tests-protocol-xchangedevicecontrol.Tpo -c -o tests-protocol-xchangedevicecontrol.o `test -f 'xi1/protocol-xchangedevicecontrol.c' || echo '$(srcdir)/'`xi1/protocol-xchangedevicecontrol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xchangedevicecontrol.Tpo $(DEPDIR)/tests-protocol-xchangedevicecontrol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi1/protocol-xchangedevicecontrol.c' object='tests-protocol-xchangedevicecontrol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xchangedevicecontrol.o `test -f 'xi1/protocol-xchangedevicecontrol.c' || echo '$(srcdir)/'`xi1/protocol-xchangedevicecontrol.c + +tests-protocol-xchangedevicecontrol.obj: xi1/protocol-xchangedevicecontrol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xchangedevicecontrol.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xchangedevicecontrol.Tpo -c -o tests-protocol-xchangedevicecontrol.obj `if test -f 'xi1/protocol-xchangedevicecontrol.c'; then $(CYGPATH_W) 'xi1/protocol-xchangedevicecontrol.c'; else $(CYGPATH_W) '$(srcdir)/xi1/protocol-xchangedevicecontrol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xchangedevicecontrol.Tpo $(DEPDIR)/tests-protocol-xchangedevicecontrol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi1/protocol-xchangedevicecontrol.c' object='tests-protocol-xchangedevicecontrol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xchangedevicecontrol.obj `if test -f 'xi1/protocol-xchangedevicecontrol.c'; then $(CYGPATH_W) 'xi1/protocol-xchangedevicecontrol.c'; else $(CYGPATH_W) '$(srcdir)/xi1/protocol-xchangedevicecontrol.c'; fi` + +tests-protocol-common.o: xi2/protocol-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-common.o -MD -MP -MF $(DEPDIR)/tests-protocol-common.Tpo -c -o tests-protocol-common.o `test -f 'xi2/protocol-common.c' || echo '$(srcdir)/'`xi2/protocol-common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-common.Tpo $(DEPDIR)/tests-protocol-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-common.c' object='tests-protocol-common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-common.o `test -f 'xi2/protocol-common.c' || echo '$(srcdir)/'`xi2/protocol-common.c + +tests-protocol-common.obj: xi2/protocol-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-common.obj -MD -MP -MF $(DEPDIR)/tests-protocol-common.Tpo -c -o tests-protocol-common.obj `if test -f 'xi2/protocol-common.c'; then $(CYGPATH_W) 'xi2/protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-common.Tpo $(DEPDIR)/tests-protocol-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-common.c' object='tests-protocol-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-common.obj `if test -f 'xi2/protocol-common.c'; then $(CYGPATH_W) 'xi2/protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-common.c'; fi` + +tests-protocol-xiqueryversion.o: xi2/protocol-xiqueryversion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiqueryversion.o -MD -MP -MF $(DEPDIR)/tests-protocol-xiqueryversion.Tpo -c -o tests-protocol-xiqueryversion.o `test -f 'xi2/protocol-xiqueryversion.c' || echo '$(srcdir)/'`xi2/protocol-xiqueryversion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiqueryversion.Tpo $(DEPDIR)/tests-protocol-xiqueryversion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiqueryversion.c' object='tests-protocol-xiqueryversion.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiqueryversion.o `test -f 'xi2/protocol-xiqueryversion.c' || echo '$(srcdir)/'`xi2/protocol-xiqueryversion.c + +tests-protocol-xiqueryversion.obj: xi2/protocol-xiqueryversion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiqueryversion.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xiqueryversion.Tpo -c -o tests-protocol-xiqueryversion.obj `if test -f 'xi2/protocol-xiqueryversion.c'; then $(CYGPATH_W) 'xi2/protocol-xiqueryversion.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiqueryversion.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiqueryversion.Tpo $(DEPDIR)/tests-protocol-xiqueryversion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiqueryversion.c' object='tests-protocol-xiqueryversion.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiqueryversion.obj `if test -f 'xi2/protocol-xiqueryversion.c'; then $(CYGPATH_W) 'xi2/protocol-xiqueryversion.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiqueryversion.c'; fi` + +tests-protocol-xiquerydevice.o: xi2/protocol-xiquerydevice.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiquerydevice.o -MD -MP -MF $(DEPDIR)/tests-protocol-xiquerydevice.Tpo -c -o tests-protocol-xiquerydevice.o `test -f 'xi2/protocol-xiquerydevice.c' || echo '$(srcdir)/'`xi2/protocol-xiquerydevice.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiquerydevice.Tpo $(DEPDIR)/tests-protocol-xiquerydevice.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiquerydevice.c' object='tests-protocol-xiquerydevice.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiquerydevice.o `test -f 'xi2/protocol-xiquerydevice.c' || echo '$(srcdir)/'`xi2/protocol-xiquerydevice.c + +tests-protocol-xiquerydevice.obj: xi2/protocol-xiquerydevice.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiquerydevice.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xiquerydevice.Tpo -c -o tests-protocol-xiquerydevice.obj `if test -f 'xi2/protocol-xiquerydevice.c'; then $(CYGPATH_W) 'xi2/protocol-xiquerydevice.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiquerydevice.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiquerydevice.Tpo $(DEPDIR)/tests-protocol-xiquerydevice.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiquerydevice.c' object='tests-protocol-xiquerydevice.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiquerydevice.obj `if test -f 'xi2/protocol-xiquerydevice.c'; then $(CYGPATH_W) 'xi2/protocol-xiquerydevice.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiquerydevice.c'; fi` + +tests-protocol-xiselectevents.o: xi2/protocol-xiselectevents.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiselectevents.o -MD -MP -MF $(DEPDIR)/tests-protocol-xiselectevents.Tpo -c -o tests-protocol-xiselectevents.o `test -f 'xi2/protocol-xiselectevents.c' || echo '$(srcdir)/'`xi2/protocol-xiselectevents.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiselectevents.Tpo $(DEPDIR)/tests-protocol-xiselectevents.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiselectevents.c' object='tests-protocol-xiselectevents.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiselectevents.o `test -f 'xi2/protocol-xiselectevents.c' || echo '$(srcdir)/'`xi2/protocol-xiselectevents.c + +tests-protocol-xiselectevents.obj: xi2/protocol-xiselectevents.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiselectevents.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xiselectevents.Tpo -c -o tests-protocol-xiselectevents.obj `if test -f 'xi2/protocol-xiselectevents.c'; then $(CYGPATH_W) 'xi2/protocol-xiselectevents.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiselectevents.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiselectevents.Tpo $(DEPDIR)/tests-protocol-xiselectevents.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiselectevents.c' object='tests-protocol-xiselectevents.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiselectevents.obj `if test -f 'xi2/protocol-xiselectevents.c'; then $(CYGPATH_W) 'xi2/protocol-xiselectevents.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiselectevents.c'; fi` + +tests-protocol-xigetselectedevents.o: xi2/protocol-xigetselectedevents.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xigetselectedevents.o -MD -MP -MF $(DEPDIR)/tests-protocol-xigetselectedevents.Tpo -c -o tests-protocol-xigetselectedevents.o `test -f 'xi2/protocol-xigetselectedevents.c' || echo '$(srcdir)/'`xi2/protocol-xigetselectedevents.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xigetselectedevents.Tpo $(DEPDIR)/tests-protocol-xigetselectedevents.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xigetselectedevents.c' object='tests-protocol-xigetselectedevents.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xigetselectedevents.o `test -f 'xi2/protocol-xigetselectedevents.c' || echo '$(srcdir)/'`xi2/protocol-xigetselectedevents.c + +tests-protocol-xigetselectedevents.obj: xi2/protocol-xigetselectedevents.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xigetselectedevents.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xigetselectedevents.Tpo -c -o tests-protocol-xigetselectedevents.obj `if test -f 'xi2/protocol-xigetselectedevents.c'; then $(CYGPATH_W) 'xi2/protocol-xigetselectedevents.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xigetselectedevents.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xigetselectedevents.Tpo $(DEPDIR)/tests-protocol-xigetselectedevents.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xigetselectedevents.c' object='tests-protocol-xigetselectedevents.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xigetselectedevents.obj `if test -f 'xi2/protocol-xigetselectedevents.c'; then $(CYGPATH_W) 'xi2/protocol-xigetselectedevents.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xigetselectedevents.c'; fi` + +tests-protocol-xisetclientpointer.o: xi2/protocol-xisetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xisetclientpointer.o -MD -MP -MF $(DEPDIR)/tests-protocol-xisetclientpointer.Tpo -c -o tests-protocol-xisetclientpointer.o `test -f 'xi2/protocol-xisetclientpointer.c' || echo '$(srcdir)/'`xi2/protocol-xisetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xisetclientpointer.Tpo $(DEPDIR)/tests-protocol-xisetclientpointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xisetclientpointer.c' object='tests-protocol-xisetclientpointer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xisetclientpointer.o `test -f 'xi2/protocol-xisetclientpointer.c' || echo '$(srcdir)/'`xi2/protocol-xisetclientpointer.c + +tests-protocol-xisetclientpointer.obj: xi2/protocol-xisetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xisetclientpointer.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xisetclientpointer.Tpo -c -o tests-protocol-xisetclientpointer.obj `if test -f 'xi2/protocol-xisetclientpointer.c'; then $(CYGPATH_W) 'xi2/protocol-xisetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xisetclientpointer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xisetclientpointer.Tpo $(DEPDIR)/tests-protocol-xisetclientpointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xisetclientpointer.c' object='tests-protocol-xisetclientpointer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xisetclientpointer.obj `if test -f 'xi2/protocol-xisetclientpointer.c'; then $(CYGPATH_W) 'xi2/protocol-xisetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xisetclientpointer.c'; fi` + +tests-protocol-xigetclientpointer.o: xi2/protocol-xigetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xigetclientpointer.o -MD -MP -MF $(DEPDIR)/tests-protocol-xigetclientpointer.Tpo -c -o tests-protocol-xigetclientpointer.o `test -f 'xi2/protocol-xigetclientpointer.c' || echo '$(srcdir)/'`xi2/protocol-xigetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xigetclientpointer.Tpo $(DEPDIR)/tests-protocol-xigetclientpointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xigetclientpointer.c' object='tests-protocol-xigetclientpointer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xigetclientpointer.o `test -f 'xi2/protocol-xigetclientpointer.c' || echo '$(srcdir)/'`xi2/protocol-xigetclientpointer.c + +tests-protocol-xigetclientpointer.obj: xi2/protocol-xigetclientpointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xigetclientpointer.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xigetclientpointer.Tpo -c -o tests-protocol-xigetclientpointer.obj `if test -f 'xi2/protocol-xigetclientpointer.c'; then $(CYGPATH_W) 'xi2/protocol-xigetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xigetclientpointer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xigetclientpointer.Tpo $(DEPDIR)/tests-protocol-xigetclientpointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xigetclientpointer.c' object='tests-protocol-xigetclientpointer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xigetclientpointer.obj `if test -f 'xi2/protocol-xigetclientpointer.c'; then $(CYGPATH_W) 'xi2/protocol-xigetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xigetclientpointer.c'; fi` + +tests-protocol-xiquerypointer.o: xi2/protocol-xiquerypointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiquerypointer.o -MD -MP -MF $(DEPDIR)/tests-protocol-xiquerypointer.Tpo -c -o tests-protocol-xiquerypointer.o `test -f 'xi2/protocol-xiquerypointer.c' || echo '$(srcdir)/'`xi2/protocol-xiquerypointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiquerypointer.Tpo $(DEPDIR)/tests-protocol-xiquerypointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiquerypointer.c' object='tests-protocol-xiquerypointer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiquerypointer.o `test -f 'xi2/protocol-xiquerypointer.c' || echo '$(srcdir)/'`xi2/protocol-xiquerypointer.c + +tests-protocol-xiquerypointer.obj: xi2/protocol-xiquerypointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiquerypointer.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xiquerypointer.Tpo -c -o tests-protocol-xiquerypointer.obj `if test -f 'xi2/protocol-xiquerypointer.c'; then $(CYGPATH_W) 'xi2/protocol-xiquerypointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiquerypointer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiquerypointer.Tpo $(DEPDIR)/tests-protocol-xiquerypointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiquerypointer.c' object='tests-protocol-xiquerypointer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiquerypointer.obj `if test -f 'xi2/protocol-xiquerypointer.c'; then $(CYGPATH_W) 'xi2/protocol-xiquerypointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiquerypointer.c'; fi` + +tests-protocol-xipassivegrabdevice.o: xi2/protocol-xipassivegrabdevice.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xipassivegrabdevice.o -MD -MP -MF $(DEPDIR)/tests-protocol-xipassivegrabdevice.Tpo -c -o tests-protocol-xipassivegrabdevice.o `test -f 'xi2/protocol-xipassivegrabdevice.c' || echo '$(srcdir)/'`xi2/protocol-xipassivegrabdevice.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xipassivegrabdevice.Tpo $(DEPDIR)/tests-protocol-xipassivegrabdevice.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xipassivegrabdevice.c' object='tests-protocol-xipassivegrabdevice.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xipassivegrabdevice.o `test -f 'xi2/protocol-xipassivegrabdevice.c' || echo '$(srcdir)/'`xi2/protocol-xipassivegrabdevice.c + +tests-protocol-xipassivegrabdevice.obj: xi2/protocol-xipassivegrabdevice.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xipassivegrabdevice.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xipassivegrabdevice.Tpo -c -o tests-protocol-xipassivegrabdevice.obj `if test -f 'xi2/protocol-xipassivegrabdevice.c'; then $(CYGPATH_W) 'xi2/protocol-xipassivegrabdevice.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xipassivegrabdevice.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xipassivegrabdevice.Tpo $(DEPDIR)/tests-protocol-xipassivegrabdevice.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xipassivegrabdevice.c' object='tests-protocol-xipassivegrabdevice.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xipassivegrabdevice.obj `if test -f 'xi2/protocol-xipassivegrabdevice.c'; then $(CYGPATH_W) 'xi2/protocol-xipassivegrabdevice.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xipassivegrabdevice.c'; fi` + +tests-protocol-xiwarppointer.o: xi2/protocol-xiwarppointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiwarppointer.o -MD -MP -MF $(DEPDIR)/tests-protocol-xiwarppointer.Tpo -c -o tests-protocol-xiwarppointer.o `test -f 'xi2/protocol-xiwarppointer.c' || echo '$(srcdir)/'`xi2/protocol-xiwarppointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiwarppointer.Tpo $(DEPDIR)/tests-protocol-xiwarppointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiwarppointer.c' object='tests-protocol-xiwarppointer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiwarppointer.o `test -f 'xi2/protocol-xiwarppointer.c' || echo '$(srcdir)/'`xi2/protocol-xiwarppointer.c + +tests-protocol-xiwarppointer.obj: xi2/protocol-xiwarppointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-xiwarppointer.obj -MD -MP -MF $(DEPDIR)/tests-protocol-xiwarppointer.Tpo -c -o tests-protocol-xiwarppointer.obj `if test -f 'xi2/protocol-xiwarppointer.c'; then $(CYGPATH_W) 'xi2/protocol-xiwarppointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiwarppointer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-xiwarppointer.Tpo $(DEPDIR)/tests-protocol-xiwarppointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-xiwarppointer.c' object='tests-protocol-xiwarppointer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-xiwarppointer.obj `if test -f 'xi2/protocol-xiwarppointer.c'; then $(CYGPATH_W) 'xi2/protocol-xiwarppointer.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-xiwarppointer.c'; fi` + +tests-protocol-eventconvert.o: xi2/protocol-eventconvert.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-eventconvert.o -MD -MP -MF $(DEPDIR)/tests-protocol-eventconvert.Tpo -c -o tests-protocol-eventconvert.o `test -f 'xi2/protocol-eventconvert.c' || echo '$(srcdir)/'`xi2/protocol-eventconvert.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-eventconvert.Tpo $(DEPDIR)/tests-protocol-eventconvert.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-eventconvert.c' object='tests-protocol-eventconvert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-eventconvert.o `test -f 'xi2/protocol-eventconvert.c' || echo '$(srcdir)/'`xi2/protocol-eventconvert.c + +tests-protocol-eventconvert.obj: xi2/protocol-eventconvert.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-protocol-eventconvert.obj -MD -MP -MF $(DEPDIR)/tests-protocol-eventconvert.Tpo -c -o tests-protocol-eventconvert.obj `if test -f 'xi2/protocol-eventconvert.c'; then $(CYGPATH_W) 'xi2/protocol-eventconvert.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-eventconvert.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-protocol-eventconvert.Tpo $(DEPDIR)/tests-protocol-eventconvert.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/protocol-eventconvert.c' object='tests-protocol-eventconvert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-protocol-eventconvert.obj `if test -f 'xi2/protocol-eventconvert.c'; then $(CYGPATH_W) 'xi2/protocol-eventconvert.c'; else $(CYGPATH_W) '$(srcdir)/xi2/protocol-eventconvert.c'; fi` + +tests-xi2.o: xi2/xi2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xi2.o -MD -MP -MF $(DEPDIR)/tests-xi2.Tpo -c -o tests-xi2.o `test -f 'xi2/xi2.c' || echo '$(srcdir)/'`xi2/xi2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xi2.Tpo $(DEPDIR)/tests-xi2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/xi2.c' object='tests-xi2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xi2.o `test -f 'xi2/xi2.c' || echo '$(srcdir)/'`xi2/xi2.c + +tests-xi2.obj: xi2/xi2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-xi2.obj -MD -MP -MF $(DEPDIR)/tests-xi2.Tpo -c -o tests-xi2.obj `if test -f 'xi2/xi2.c'; then $(CYGPATH_W) 'xi2/xi2.c'; else $(CYGPATH_W) '$(srcdir)/xi2/xi2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-xi2.Tpo $(DEPDIR)/tests-xi2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xi2/xi2.c' object='tests-xi2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-xi2.obj `if test -f 'xi2/xi2.c'; then $(CYGPATH_W) 'xi2/xi2.c'; else $(CYGPATH_W) '$(srcdir)/xi2/xi2.c'; fi` + +tests-sdksyms.o: sdksyms.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-sdksyms.o -MD -MP -MF $(DEPDIR)/tests-sdksyms.Tpo -c -o tests-sdksyms.o `test -f 'sdksyms.c' || echo '$(srcdir)/'`sdksyms.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-sdksyms.Tpo $(DEPDIR)/tests-sdksyms.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sdksyms.c' object='tests-sdksyms.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-sdksyms.o `test -f 'sdksyms.c' || echo '$(srcdir)/'`sdksyms.c + +tests-sdksyms.obj: sdksyms.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-sdksyms.obj -MD -MP -MF $(DEPDIR)/tests-sdksyms.Tpo -c -o tests-sdksyms.obj `if test -f 'sdksyms.c'; then $(CYGPATH_W) 'sdksyms.c'; else $(CYGPATH_W) '$(srcdir)/sdksyms.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-sdksyms.Tpo $(DEPDIR)/tests-sdksyms.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sdksyms.c' object='tests-sdksyms.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-sdksyms.obj `if test -f 'sdksyms.c'; then $(CYGPATH_W) 'sdksyms.c'; else $(CYGPATH_W) '$(srcdir)/sdksyms.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -1149,7 +1487,6 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive @@ -1191,8 +1528,8 @@ maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive -clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ - clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) @@ -1265,22 +1602,32 @@ uninstall-am: install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-TESTS check-am clean \ - clean-checkLTLIBRARIES clean-generic clean-libtool \ - clean-noinstPROGRAMS cscopelist cscopelist-recursive ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am + all all-am check check-TESTS check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist \ + cscopelist-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@xi1-tests: +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'exit 77' >> $@ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ $(AM_V_GEN)chmod +x $@ + +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@xi2-tests: +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'exit 77' >> $@ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ $(AM_V_GEN)chmod +x $@ + @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c diff --git a/xserver/test/bigreq/request-length.c b/xserver/test/bigreq/request-length.c new file mode 100644 index 000000000..8174813ae --- /dev/null +++ b/xserver/test/bigreq/request-length.c @@ -0,0 +1,101 @@ +/* + * Copyright © 2017 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + xcb_connection_t *c = xcb_connect(NULL, NULL); + int fd = xcb_get_file_descriptor(c); + + struct { + uint8_t extension; + uint8_t opcode; + uint16_t length; + uint32_t length_bigreq; + uint32_t win; + int num_masks; + uint16_t pad; + } xise_req = { + .extension = 0, + .opcode = XCB_INPUT_XI_SELECT_EVENTS, + /* The server triggers BadValue on a zero num_mask */ + .num_masks = 0, + .win = 0, + + /* This is the value that triggers the bug. */ + .length_bigreq = 0, + }; + + xcb_query_extension_cookie_t cookie; + xcb_query_extension_reply_t *rep; + + cookie = xcb_query_extension(c, 15, "XInputExtension"); + rep = xcb_query_extension_reply(c, cookie, NULL); + xise_req.extension = rep->major_opcode; + + free(xcb_big_requests_enable_reply(c, xcb_big_requests_enable(c), NULL)); + + /* Manually write out the bad request. XCB can't help us here.*/ + write(fd, &xise_req, sizeof(xise_req)); + + /* Block until the server has processed our mess and throws an + * error. If we get disconnected, then the server has noticed what we're + * up to. If we get an error back from the server, it looked at our fake + * request - which shouldn't happen. + */ + struct pollfd pfd = { + .fd = fd, + .events = POLLIN, + }; + poll(&pfd, 1, -1); + + if (pfd.revents & POLLHUP) { + /* We got killed by the server for being naughty. Yay! */ + return 0; + } + + /* We didn't get disconnected, that's bad. If we get a BadValue from our + * request, we at least know that the bug triggered. + * + * If we get anything else back, something else has gone wrong. + */ + xcb_generic_error_t error; + int r = read(fd, &error, sizeof(error)); + + if (r == sizeof(error) && + error.error_code == 2 /* BadValue */ && + error.major_code == xise_req.extension && + error.minor_code == XCB_INPUT_XI_SELECT_EVENTS) + return 1; /* Our request was processed, which shouldn't happen */ + + /* Something else bad happened. We got something back but it's not the + * error we expected. If this happens, it needs to be investigated. */ + + return 2; +} diff --git a/xserver/test/fixes.c b/xserver/test/fixes.c index 4ac6750e4..573d948dc 100644 --- a/xserver/test/fixes.c +++ b/xserver/test/fixes.c @@ -31,6 +31,8 @@ #include #include +#include "tests-common.h" + static void _fixes_test_direction(struct PointerBarrier *barrier, int d[4], int permitted) { @@ -343,7 +345,7 @@ fixes_pointer_barrier_clamp_test(void) } int -main(int argc, char **argv) +fixes_test(void) { fixes_pointer_barriers_test(); diff --git a/xserver/test/hashtabletest.c b/xserver/test/hashtabletest.c index 86a0c58c6..0387587cb 100644 --- a/xserver/test/hashtabletest.c +++ b/xserver/test/hashtabletest.c @@ -8,6 +8,8 @@ #include "hashtable.h" #include "resource.h" +#include "tests-common.h" + static void print_xid(void* ptr, void* v) { @@ -154,7 +156,7 @@ test3(void) } int -main(void) +hashtabletest_test(void) { int ok = test1(); ok = ok && test2(); diff --git a/xserver/test/input.c b/xserver/test/input.c index 92dd8910c..9ff1a2fab 100644 --- a/xserver/test/input.c +++ b/xserver/test/input.c @@ -43,6 +43,8 @@ #include "mi.h" #include "assert.h" +#include "tests-common.h" + /** * Init a device with axes. * Verify values set on the device. @@ -1425,7 +1427,7 @@ include_bit_test_macros(void) uint8_t mask[9] = { 0 }; int i; - for (i = 0; i < sizeof(mask) / sizeof(mask[0]); i++) { + for (i = 0; i < ARRAY_SIZE(mask); i++) { assert(BitIsOn(mask, i) == 0); SetBit(mask, i); assert(BitIsOn(mask, i) == 1); @@ -1904,7 +1906,7 @@ dix_enqueue_events(void) } int -main(int argc, char **argv) +input_test(void) { dix_enqueue_events(); dix_double_fp_conversion(); diff --git a/xserver/test/list.c b/xserver/test/list.c index 28d9609ef..d710f4693 100644 --- a/xserver/test/list.c +++ b/xserver/test/list.c @@ -31,6 +31,8 @@ #include #include +#include "tests-common.h" + struct parent { int a; struct xorg_list children; @@ -369,7 +371,7 @@ test_nt_list_delete(void) } int -main(int argc, char **argv) +list_test(void) { test_xorg_list_init(); test_xorg_list_add(); diff --git a/xserver/test/misc.c b/xserver/test/misc.c index 66330a140..3c669b677 100644 --- a/xserver/test/misc.c +++ b/xserver/test/misc.c @@ -31,6 +31,8 @@ #include "dix.h" #include "dixstruct.h" +#include "tests-common.h" + ScreenInfo screenInfo; static void @@ -190,13 +192,43 @@ dix_request_size_checks(void) assert(rc == Success); } +static void +bswap_test(void) +{ + const uint16_t test_16 = 0xaabb; + const uint16_t expect_16 = 0xbbaa; + const uint32_t test_32 = 0xaabbccdd; + const uint32_t expect_32 = 0xddccbbaa; + const uint64_t test_64 = 0x11223344aabbccddull; + const uint64_t expect_64 = 0xddccbbaa44332211ull; + uint16_t result_16; + uint32_t result_32; + uint64_t result_64; + + assert(bswap_16(test_16) == expect_16); + assert(bswap_32(test_32) == expect_32); + assert(bswap_64(test_64) == expect_64); + + result_16 = test_16; + swaps(&result_16); + assert(result_16 == expect_16); + + result_32 = test_32; + swapl(&result_32); + assert(result_32 == expect_32); + + result_64 = test_64; + swapll(&result_64); + assert(result_64 == expect_64); +} int -main(int argc, char **argv) +misc_test(void) { dix_version_compare(); dix_update_desktop_dimensions(); dix_request_size_checks(); + bswap_test(); return 0; } diff --git a/xserver/test/scripts/run-piglit.sh b/xserver/test/scripts/run-piglit.sh index b999c2598..8b9fda1a4 100644 --- a/xserver/test/scripts/run-piglit.sh +++ b/xserver/test/scripts/run-piglit.sh @@ -46,8 +46,8 @@ $XSERVER_BUILDDIR/test/simple-xinit \ # Write out piglit-summaries. SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary LONG_SUMMARY=$PIGLIT_RESULTS_DIR/long-summary -$PIGLIT_DIR/piglit-summary.py -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY -$PIGLIT_DIR/piglit-summary.py $PIGLIT_RESULTS_DIR > $LONG_SUMMARY +$PIGLIT_DIR/piglit summary console -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY +$PIGLIT_DIR/piglit summary console $PIGLIT_RESULTS_DIR > $LONG_SUMMARY # Write the short summary to make check's log file. cat $SHORT_SUMMARY @@ -66,7 +66,7 @@ if ! grep "^ *crash: *0$" $SHORT_SUMMARY > /dev/null; then status=1 fi -$PIGLIT_DIR/piglit-summary-html.py \ +$PIGLIT_DIR/piglit summary html \ --overwrite \ $PIGLIT_RESULTS_DIR/html \ $PIGLIT_RESULTS_DIR diff --git a/xserver/test/scripts/xephyr-glamor-piglit.sh b/xserver/test/scripts/xephyr-glamor-piglit.sh index 51d42c313..c16fdc4f3 100644 --- a/xserver/test/scripts/xephyr-glamor-piglit.sh +++ b/xserver/test/scripts/xephyr-glamor-piglit.sh @@ -1,3 +1,10 @@ +#!/bin/sh + +# this times out on Travis, because the tests take too long. +if test "x$TRAVIS_BUILD_DIR" != "x"; then + exit 77 +fi + # Start a Xephyr server using glamor. Since the test environment is # headless, we start an Xvfb first to host the Xephyr. export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor diff --git a/xserver/test/scripts/xinit-piglit-session.sh b/xserver/test/scripts/xinit-piglit-session.sh index c26735d49..b495c96d6 100644 --- a/xserver/test/scripts/xinit-piglit-session.sh +++ b/xserver/test/scripts/xinit-piglit-session.sh @@ -24,15 +24,6 @@ fi cd $PIGLIT_DIR -# Write the piglit.conf we'll use for our testing. Don't use the -# default piglit.conf name because that may overwrite a local -# piglit.conf. -PIGLITCONF=piglit-xserver-test.conf -cat < $PIGLITCONF -[xts] -path=$XTEST_DIR -EOF - # Skip some tests that are failing at the time of importing the script. # "REPORT: min_bounds, rbearing was 0, expecting 2" PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@3" @@ -41,4 +32,4 @@ PIGLIT_ARGS="$PIGLIT_ARGS -x xloadqueryfont@1" PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@1" PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@2" -exec ./piglit-run.py xts-render -f $PIGLITCONF $PIGLIT_ARGS $PIGLIT_RESULTS_DIR +exec ./piglit run xts-render $PIGLIT_ARGS $PIGLIT_RESULTS_DIR diff --git a/xserver/test/scripts/xvfb-piglit.sh b/xserver/test/scripts/xvfb-piglit.sh index 763599ef4..b18a39918 100644 --- a/xserver/test/scripts/xvfb-piglit.sh +++ b/xserver/test/scripts/xvfb-piglit.sh @@ -1,3 +1,10 @@ +#!/bin/sh + +# this times out on Travis, because the tests take too long. +#if test "x$TRAVIS_BUILD_DIR" != "x"; then +# exit 77 +#fi + export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/vfb/Xvfb \ -noreset \ -screen scrn 1280x1024x24" diff --git a/xserver/test/signal-logging.c b/xserver/test/signal-logging.c index 1af6316de..afbdeb241 100644 --- a/xserver/test/signal-logging.c +++ b/xserver/test/signal-logging.c @@ -30,6 +30,8 @@ #include "assert.h" #include "misc.h" +#include "tests-common.h" + struct number_format_test { uint64_t number; char string[21]; @@ -143,13 +145,13 @@ number_formatting(void) -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ } ; - for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(unsigned_tests); i++) assert(check_number_format_test(unsigned_tests[i])); - for (i = 0; i < sizeof(signed_tests) / sizeof(signed_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(signed_tests); i++) assert(check_signed_number_format_test(signed_tests[i])); - for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(float_tests); i++) assert(check_float_format_test(float_tests[i])); } #pragma GCC diagnostic pop @@ -364,7 +366,7 @@ static void logging_format(void) } while(ptr); - for (i = 0; i < sizeof(float_tests)/sizeof(float_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(float_tests); i++) { double d = float_tests[i]; char expected[30]; sprintf(expected, "(EE) %.2f\n", d); @@ -395,7 +397,7 @@ static void logging_format(void) #pragma GCC diagnostic pop /* "-Wformat-security" */ int -main(int argc, char **argv) +signal_logging_test(void) { number_formatting(); logging_format(); diff --git a/xserver/test/simple-xinit.c b/xserver/test/simple-xinit.c index 89189a609..26ff12bf7 100644 --- a/xserver/test/simple-xinit.c +++ b/xserver/test/simple-xinit.c @@ -87,7 +87,7 @@ get_display(int displayfd) char display_string[10]; ssize_t ret; - ret = read(displayfd, display_string, sizeof(display_string - 1)); + ret = read(displayfd, display_string, sizeof(display_string) - 1); if (ret <= 0) { fprintf(stderr, "Failed reading displayfd: %s\n", strerror(errno)); exit(1); @@ -133,6 +133,9 @@ start_client(char *const *client_args, int display) return 1; } + if (!WIFEXITED(wstatus)) + return 1; + return WEXITSTATUS(wstatus); } else { execvp(client_args[0], client_args); diff --git a/xserver/test/string.c b/xserver/test/string.c index 93867e04a..406b7bf8a 100644 --- a/xserver/test/string.c +++ b/xserver/test/string.c @@ -32,6 +32,7 @@ #include #include "os.h" +#include "tests-common.h" /* Ensure we're testing our functions, even on platforms with libc versions */ #include @@ -62,7 +63,7 @@ strndup_checks(void) } int -main(int argc, char **argv) +string_test(void) { strndup_checks(); diff --git a/xserver/test/sync/sync.c b/xserver/test/sync/sync.c new file mode 100644 index 000000000..bd1b0addd --- /dev/null +++ b/xserver/test/sync/sync.c @@ -0,0 +1,304 @@ +/* + * Copyright © 2017 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#include +#include +#include +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const int64_t some_values[] = { + 0, + 1, + -1, + LLONG_MAX, + LLONG_MIN, +}; + +static int64_t +pack_sync_value(xcb_sync_int64_t val) +{ + return ((int64_t)val.hi << 32) | val.lo; +} + +static int64_t +counter_value(struct xcb_connection_t *c, + xcb_sync_query_counter_cookie_t cookie) +{ + xcb_sync_query_counter_reply_t *reply = + xcb_sync_query_counter_reply(c, cookie, NULL); + int64_t value = pack_sync_value(reply->counter_value); + + free(reply); + return value; +} + +static xcb_sync_int64_t +sync_value(int64_t value) +{ + xcb_sync_int64_t v = { + .hi = value >> 32, + .lo = value, + }; + + return v; +} + +/* Initializes counters with a bunch of interesting values and makes + * sure it comes back the same. + */ +static void +test_create_counter(xcb_connection_t *c) +{ + xcb_sync_query_counter_cookie_t queries[ARRAY_SIZE(some_values)]; + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + xcb_sync_counter_t counter = xcb_generate_id(c); + xcb_sync_create_counter(c, counter, sync_value(some_values[i])); + queries[i] = xcb_sync_query_counter_unchecked(c, counter); + } + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + int64_t value = counter_value(c, queries[i]); + + if (value != some_values[i]) { + fprintf(stderr, "Creating counter with %lld returned %lld\n", + (long long)some_values[i], + (long long)value); + exit(1); + } + } +} + +/* Set a single counter to a bunch of interesting values and make sure + * it comes the same. + */ +static void +test_set_counter(xcb_connection_t *c) +{ + xcb_sync_counter_t counter = xcb_generate_id(c); + xcb_sync_query_counter_cookie_t queries[ARRAY_SIZE(some_values)]; + + xcb_sync_create_counter(c, counter, sync_value(0)); + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + xcb_sync_set_counter(c, counter, sync_value(some_values[i])); + queries[i] = xcb_sync_query_counter_unchecked(c, counter); + } + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + int64_t value = counter_value(c, queries[i]); + + if (value != some_values[i]) { + fprintf(stderr, "Setting counter to %lld returned %lld\n", + (long long)some_values[i], + (long long)value); + exit(1); + } + } +} + +/* Add [0, 1, 2, 3] to a counter and check that the values stick. */ +static void +test_change_counter_basic(xcb_connection_t *c) +{ + int iterations = 4; + xcb_sync_query_counter_cookie_t queries[iterations]; + + xcb_sync_counter_t counter = xcb_generate_id(c); + xcb_sync_create_counter(c, counter, sync_value(0)); + + for (int i = 0; i < iterations; i++) { + xcb_sync_change_counter(c, counter, sync_value(i)); + queries[i] = xcb_sync_query_counter_unchecked(c, counter); + } + + int64_t expected_value = 0; + for (int i = 0; i < iterations; i++) { + expected_value += i; + int64_t value = counter_value(c, queries[i]); + + if (value != expected_value) { + fprintf(stderr, "Adding %d to counter expected %lld returned %lld\n", + i, + (long long)expected_value, + (long long)value); + exit(1); + } + } +} + +/* Test change_counter where we trigger an integer overflow. */ +static void +test_change_counter_overflow(xcb_connection_t *c) +{ + int iterations = 4; + xcb_sync_query_counter_cookie_t queries[iterations]; + xcb_void_cookie_t changes[iterations]; + static const struct { + int64_t a, b; + } overflow_args[] = { + { LLONG_MAX, 1 }, + { LLONG_MAX, LLONG_MAX }, + { LLONG_MIN, -1 }, + { LLONG_MIN, LLONG_MIN }, + }; + + xcb_sync_counter_t counter = xcb_generate_id(c); + xcb_sync_create_counter(c, counter, sync_value(0)); + + for (int i = 0; i < ARRAY_SIZE(overflow_args); i++) { + int64_t a = overflow_args[i].a; + int64_t b = overflow_args[i].b; + xcb_sync_set_counter(c, counter, sync_value(a)); + changes[i] = xcb_sync_change_counter_checked(c, counter, + sync_value(b)); + queries[i] = xcb_sync_query_counter(c, counter); + } + + for (int i = 0; i < ARRAY_SIZE(overflow_args); i++) { + int64_t a = overflow_args[i].a; + int64_t b = overflow_args[i].b; + xcb_sync_query_counter_reply_t *reply = + xcb_sync_query_counter_reply(c, queries[i], NULL); + int64_t value = (((int64_t)reply->counter_value.hi << 32) | + reply->counter_value.lo); + int64_t expected_value = a; + + /* The change_counter should have thrown BadValue */ + xcb_generic_error_t *e = xcb_request_check(c, changes[i]); + if (!e) { + fprintf(stderr, "(%lld + %lld) failed to return an error\n", + (long long)a, + (long long)b); + exit(1); + } + + if (e->error_code != XCB_VALUE) { + fprintf(stderr, "(%lld + %lld) returned %d, not BadValue\n", + (long long)a, + (long long)b, + e->error_code); + exit(1); + } + + /* The change_counter should have had no other effect if it + * errored out. + */ + if (value != expected_value) { + fprintf(stderr, "(%lld + %lld) expected %lld returned %lld\n", + (long long)a, + (long long)b, + (long long)expected_value, + (long long)value); + exit(1); + } + + free(e); + free(reply); + } +} + +static void +test_change_alarm_value(xcb_connection_t *c) +{ + xcb_sync_alarm_t alarm = xcb_generate_id(c); + xcb_sync_query_alarm_cookie_t queries[ARRAY_SIZE(some_values)]; + + xcb_sync_create_alarm(c, alarm, 0, NULL); + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + uint32_t values[] = { some_values[i] >> 32, some_values[i] }; + + xcb_sync_change_alarm(c, alarm, XCB_SYNC_CA_VALUE, values); + queries[i] = xcb_sync_query_alarm_unchecked(c, alarm); + } + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + xcb_sync_query_alarm_reply_t *reply = + xcb_sync_query_alarm_reply(c, queries[i], NULL); + int64_t value = pack_sync_value(reply->trigger.wait_value); + + if (value != some_values[i]) { + fprintf(stderr, "Setting alarm value to %lld returned %lld\n", + (long long)some_values[i], + (long long)value); + exit(1); + } + free(reply); + } +} + +static void +test_change_alarm_delta(xcb_connection_t *c) +{ + xcb_sync_alarm_t alarm = xcb_generate_id(c); + xcb_sync_query_alarm_cookie_t queries[ARRAY_SIZE(some_values)]; + + xcb_sync_create_alarm(c, alarm, 0, NULL); + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + uint32_t values[] = { some_values[i] >> 32, some_values[i] }; + + xcb_sync_change_alarm(c, alarm, XCB_SYNC_CA_DELTA, values); + queries[i] = xcb_sync_query_alarm_unchecked(c, alarm); + } + + for (int i = 0; i < ARRAY_SIZE(some_values); i++) { + xcb_sync_query_alarm_reply_t *reply = + xcb_sync_query_alarm_reply(c, queries[i], NULL); + int64_t value = pack_sync_value(reply->delta); + + if (value != some_values[i]) { + fprintf(stderr, "Setting alarm delta to %lld returned %lld\n", + (long long)some_values[i], + (long long)value); + exit(1); + } + free(reply); + } +} + +int main(int argc, char **argv) +{ + int screen; + xcb_connection_t *c = xcb_connect(NULL, &screen); + const xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id); + + if (!ext->present) { + printf("No XSync present\n"); + exit(77); + } + + test_create_counter(c); + test_set_counter(c); + test_change_counter_basic(c); + test_change_counter_overflow(c); + test_change_alarm_value(c); + test_change_alarm_delta(c); + + xcb_disconnect(c); + exit(0); +} diff --git a/xserver/test/xkb.c b/xserver/test/test_xkb.c similarity index 99% rename from xserver/test/xkb.c rename to xserver/test/test_xkb.c index 9047f594c..23d5b22a6 100644 --- a/xserver/test/xkb.c +++ b/xserver/test/test_xkb.c @@ -48,6 +48,8 @@ #include "../xkb/xkb.h" #include +#include "tests-common.h" + /** * Initialize an empty XkbRMLVOSet. * Call XkbGetRulesDflts to obtain the default ruleset. @@ -164,7 +166,7 @@ xkb_set_get_rules_test(void) } int -main(int argc, char **argv) +xkb_test(void) { xkb_set_get_rules_test(); xkb_get_rules_test(); diff --git a/xserver/test/tests-common.c b/xserver/test/tests-common.c new file mode 100644 index 000000000..686852827 --- /dev/null +++ b/xserver/test/tests-common.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +#include "tests-common.h" + +void +run_test_in_child(int (*func)(void), const char *funcname) +{ + int cpid; + int csts; + int exit_code = -1; + + printf("\n---------------------\n%s...\n", funcname); + cpid = fork(); + if (cpid) { + waitpid(cpid, &csts, 0); + if (!WIFEXITED(csts)) + goto child_failed; + exit_code = WEXITSTATUS(csts); + if (exit_code == 0) + printf(" Pass\n"); + else { +child_failed: + printf(" FAIL\n"); + exit(exit_code); + } + } else { + exit(func()); + } +} diff --git a/xserver/test/tests-common.h b/xserver/test/tests-common.h new file mode 100644 index 000000000..ea0642247 --- /dev/null +++ b/xserver/test/tests-common.h @@ -0,0 +1,12 @@ +#ifndef TESTS_COMMON_H +#define TESTS_COMMON_H + +#include "tests.h" + +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + +#define run_test(func) run_test_in_child(func, #func) + +void run_test_in_child(int (*func)(void), const char *funcname); + +#endif /* TESTS_COMMON_H */ diff --git a/xserver/test/tests.c b/xserver/test/tests.c new file mode 100644 index 000000000..97603822a --- /dev/null +++ b/xserver/test/tests.c @@ -0,0 +1,44 @@ +#include +#include "tests.h" +#include "tests-common.h" + +int +main(int argc, char **argv) +{ + run_test(list_test); + run_test(string_test); + +#ifdef XORG_TESTS + run_test(fixes_test); + run_test(input_test); + run_test(misc_test); + run_test(signal_logging_test); + run_test(touch_test); + run_test(xfree86_test); + run_test(xkb_test); + run_test(xtest_test); + +#ifdef RES_TESTS + run_test(hashtabletest_test); +#endif + +#ifdef LDWRAP_TESTS + run_test(protocol_xchangedevicecontrol_test); + + run_test(protocol_xiqueryversion_test); + run_test(protocol_xiquerydevice_test); + run_test(protocol_xiselectevents_test); + run_test(protocol_xigetselectedevents_test); + run_test(protocol_xisetclientpointer_test); + run_test(protocol_xigetclientpointer_test); + run_test(protocol_xipassivegrabdevice_test); + run_test(protocol_xiquerypointer_test); + run_test(protocol_xiwarppointer_test); + run_test(protocol_eventconvert_test); + run_test(xi2_test); +#endif + +#endif /* XORG_TESTS */ + + return 0; +} diff --git a/xserver/test/tests.h b/xserver/test/tests.h new file mode 100644 index 000000000..b96ca78bb --- /dev/null +++ b/xserver/test/tests.h @@ -0,0 +1,38 @@ +#ifndef TESTS_H +#define TESTS_H + +int fixes_test(void); +int hashtabletest_test(void); +int input_test(void); +int list_test(void); +int misc_test(void); +int signal_logging_test(void); +int string_test(void); +int touch_test(void); +int xfree86_test(void); +int xkb_test(void); +int xtest_test(void); + +int protocol_xchangedevicecontrol_test(void); + +int protocol_xiqueryversion_test(void); +int protocol_xiquerydevice_test(void); +int protocol_xiselectevents_test(void); +int protocol_xigetselectedevents_test(void); +int protocol_xisetclientpointer_test(void); +int protocol_xigetclientpointer_test(void); +int protocol_xipassivegrabdevice_test(void); +int protocol_xiquerypointer_test(void); +int protocol_xiwarppointer_test(void); +int protocol_eventconvert_test(void); +int xi2_test(void); + +#ifndef INSIDE_PROTOCOL_COMMON + +extern int enable_XISetEventMask_wrap; +extern int enable_GrabButton_wrap; + +#endif /* INSIDE_PROTOCOL_COMMON */ + +#endif /* TESTS_H */ + diff --git a/xserver/test/touch.c b/xserver/test/touch.c index 19c68784d..16aaf4bbb 100644 --- a/xserver/test/touch.c +++ b/xserver/test/touch.c @@ -30,6 +30,8 @@ #include "assert.h" #include "scrnintstr.h" +#include "tests-common.h" + static void touch_grow_queue(void) { @@ -278,13 +280,15 @@ touch_init(void) } int -main(int argc, char **argv) +touch_test(void) { + printf("touch_test: start...\n"); touch_grow_queue(); touch_find_ddxid(); touch_begin_ddxtouch(); touch_init(); touch_begin_touch(); + printf("touch_test: exiting successfully\n"); return 0; } diff --git a/xserver/test/xfree86.c b/xserver/test/xfree86.c index a98671183..ff8ad2d2d 100644 --- a/xserver/test/xfree86.c +++ b/xserver/test/xfree86.c @@ -30,6 +30,8 @@ #include "xf86.h" #include "xf86Parser.h" +#include "tests-common.h" + static void xfree86_option_list_duplicate(void) { @@ -96,7 +98,7 @@ xfree86_add_comment(void) } int -main(int argc, char **argv) +xfree86_test(void) { xfree86_option_list_duplicate(); xfree86_add_comment(); diff --git a/xserver/test/xi1/Makefile.am b/xserver/test/xi1/Makefile.am deleted file mode 100644 index 907fa7aea..000000000 --- a/xserver/test/xi1/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -if ENABLE_UNIT_TESTS -if HAVE_LD_WRAP -noinst_PROGRAMS = \ - protocol-xchangedevicecontrol - -TESTS=$(noinst_PROGRAMS) -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) - -AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -AM_CPPFLAGS = @XORG_INCS@ -I$(srcdir)/../xi2 -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) -COMMON_SOURCES=$(srcdir)/../xi2/protocol-common.c - -if SPECIAL_DTRACE_OBJECTS -TEST_LDADD += $(OS_LIB) $(DIX_LIB) -endif - -protocol_xchangedevicecontrol_LDADD=$(TEST_LDADD) - -protocol_xchangedevicecontrol_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient - -protocol_xchangedevicecontrol_SOURCES=$(COMMON_SOURCES) protocol-xchangedevicecontrol.c - -else -# Print that xi1-tests were skipped (exit code 77 for automake test harness) -TESTS = xi1-tests -CLEANFILES = $(TESTS) - -xi1-tests: - @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ - @echo 'exit 77' >> $@ - $(AM_V_GEN)chmod +x $@ -endif -endif diff --git a/xserver/test/xi1/protocol-xchangedevicecontrol.c b/xserver/test/xi1/protocol-xchangedevicecontrol.c index 8e638b218..57a15c407 100644 --- a/xserver/test/xi1/protocol-xchangedevicecontrol.c +++ b/xserver/test/xi1/protocol-xchangedevicecontrol.c @@ -37,6 +37,7 @@ #include "protocol-common.h" +ClientRec client_window; static ClientRec client_request; static void @@ -112,7 +113,7 @@ test_ChangeDeviceControl(void) } int -main(int argc, char **argv) +protocol_xchangedevicecontrol_test(void) { init_simple(); diff --git a/xserver/test/xi2/Makefile.am b/xserver/test/xi2/Makefile.am deleted file mode 100644 index bfddfef13..000000000 --- a/xserver/test/xi2/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -if ENABLE_UNIT_TESTS -if HAVE_LD_WRAP -noinst_PROGRAMS = \ - protocol-xiqueryversion \ - protocol-xiquerydevice \ - protocol-xiselectevents \ - protocol-xigetselectedevents \ - protocol-xisetclientpointer \ - protocol-xigetclientpointer \ - protocol-xipassivegrabdevice \ - protocol-xiquerypointer \ - protocol-xiwarppointer \ - protocol-eventconvert \ - xi2 - -TESTS=$(noinst_PROGRAMS) -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) - -AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -AM_CPPFLAGS = @XORG_INCS@ -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) -COMMON_SOURCES=protocol-common.h protocol-common.c - -if SPECIAL_DTRACE_OBJECTS -TEST_LDADD += $(OS_LIB) $(DIX_LIB) -endif - -protocol_xiqueryversion_LDADD=$(TEST_LDADD) -protocol_xiquerydevice_LDADD=$(TEST_LDADD) -protocol_xiselectevents_LDADD=$(TEST_LDADD) -protocol_xigetselectedevents_LDADD=$(TEST_LDADD) -protocol_xisetclientpointer_LDADD=$(TEST_LDADD) -protocol_xigetclientpointer_LDADD=$(TEST_LDADD) -protocol_xiquerypointer_LDADD=$(TEST_LDADD) -protocol_xipassivegrabdevice_LDADD=$(TEST_LDADD) -protocol_xiwarppointer_LDADD=$(TEST_LDADD) -protocol_eventconvert_LDADD=$(TEST_LDADD) -xi2_LDADD=$(TEST_LDADD) - -protocol_xiqueryversion_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -protocol_xiquerydevice_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -protocol_xiselectevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wrap,XISetEventMask -protocol_xigetselectedevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource -protocol_xisetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupClient -protocol_xigetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient -protocol_xipassivegrabdevice_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,GrabButton -Wl,-wrap,dixLookupWindow -Wl,-wrap,WriteToClient -protocol_xiquerypointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -protocol_xiwarppointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -xi2_LDFLAGS=$(AM_LDFLAGS) - -protocol_xiqueryversion_SOURCES=$(COMMON_SOURCES) protocol-xiqueryversion.c -protocol_xiquerydevice_SOURCES=$(COMMON_SOURCES) protocol-xiquerydevice.c -protocol_xiselectevents_SOURCES=$(COMMON_SOURCES) protocol-xiselectevents.c -protocol_xigetselectedevents_SOURCES=$(COMMON_SOURCES) protocol-xigetselectedevents.c -protocol_xisetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xisetclientpointer.c -protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointer.c -protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c -protocol_xipassivegrabdevice_SOURCES=$(COMMON_SOURCES) protocol-xipassivegrabdevice.c -protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c -else -# Print that xi2-tests were skipped (exit code 77 for automake test harness) -TESTS = xi2-tests -CLEANFILES = $(TESTS) - -xi2-tests: - @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ - @echo 'exit 77' >> $@ - $(AM_V_GEN)chmod +x $@ -endif -endif diff --git a/xserver/test/xi2/protocol-common.c b/xserver/test/xi2/protocol-common.c index 9265ba390..8cd85dd05 100644 --- a/xserver/test/xi2/protocol-common.c +++ b/xserver/test/xi2/protocol-common.c @@ -34,6 +34,7 @@ #include "syncsrv.h" #include +#define INSIDE_PROTOCOL_COMMON #include "protocol-common.h" struct devices devices; @@ -44,6 +45,9 @@ static ClientRec server_client; void *global_userdata; +int enable_GrabButton_wrap = 1; +int enable_XISetEventMask_wrap = 1; + static void fake_init_sprite(DeviceIntPtr dev) { @@ -255,6 +259,7 @@ init_simple(void) screen.DeviceCursorInitialize = device_cursor_init; screen.DeviceCursorCleanup = device_cursor_cleanup; screen.SetCursorPosition = set_cursor_pos; + screen.root = &root; dixResetPrivates(); InitAtoms(); @@ -284,3 +289,40 @@ __wrap_WriteToClient(ClientPtr client, int len, void *data) (*reply_handler) (client, len, data, global_userdata); } + +/* dixLookupWindow requires a lot of setup not necessary for this test. + * Simple wrapper that returns either one of the fake root window or the + * fake client window. If the requested ID is neither of those wanted, + * return whatever the real dixLookupWindow does. + */ +int +__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) +{ + if (id == root.drawable.id) { + *win = &root; + return Success; + } + else if (id == window.drawable.id) { + *win = &window; + return Success; + } + + return __real_dixLookupWindow(win, id, client, access); +} + +extern ClientRec client_window; + +int +__wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, + Mask access) +{ + if (rid == ROOT_WINDOW_ID) + return BadWindow; + + if (rid == CLIENT_WINDOW_ID) { + *pClient = &client_window; + return Success; + } + + return __real_dixLookupClient(pClient, rid, client, access); +} diff --git a/xserver/test/xi2/protocol-common.h b/xserver/test/xi2/protocol-common.h index f8504787f..8490529ad 100644 --- a/xserver/test/xi2/protocol-common.h +++ b/xserver/test/xi2/protocol-common.h @@ -30,6 +30,8 @@ #include "exevents.h" #include +#include "tests.h" + #ifndef PROTOCOL_COMMON_H #define PROTOCOL_COMMON_H @@ -142,8 +144,8 @@ void init_simple(void); /* Declarations for various overrides in the test files. */ void __wrap_WriteToClient(ClientPtr client, int len, void *data); -int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, - unsigned char *mask); +int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, + int len, unsigned char *mask); int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access); int __real_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, diff --git a/xserver/test/xi2/protocol-eventconvert.c b/xserver/test/xi2/protocol-eventconvert.c index aea380ed5..8d19d5339 100644 --- a/xserver/test/xi2/protocol-eventconvert.c +++ b/xserver/test/xi2/protocol-eventconvert.c @@ -33,6 +33,8 @@ #include "inpututils.h" #include +#include "protocol-common.h" + static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent * out, BOOL swap) { @@ -1200,7 +1202,7 @@ test_convert_XIBarrierEvent(void) } int -main(int argc, char **argv) +protocol_eventconvert_test(void) { test_convert_XIRawEvent(); test_convert_XIFocusEvent(); diff --git a/xserver/test/xi2/protocol-xigetclientpointer.c b/xserver/test/xi2/protocol-xigetclientpointer.c index 570c53e06..9c38bd720 100644 --- a/xserver/test/xi2/protocol-xigetclientpointer.c +++ b/xserver/test/xi2/protocol-xigetclientpointer.c @@ -40,30 +40,15 @@ #include "protocol-common.h" -struct { +static struct { int cp_is_set; DeviceIntPtr dev; int win; } test_data; -static ClientRec client_window; +ClientRec client_window; static ClientRec client_request; -int -__wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, - Mask access) -{ - if (rid == ROOT_WINDOW_ID) - return BadWindow; - - if (rid == CLIENT_WINDOW_ID) { - *pClient = &client_window; - return Success; - } - - return __real_dixLookupClient(pClient, rid, client, access); -} - static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void *userdata) { @@ -157,7 +142,7 @@ test_XIGetClientPointer(void) } int -main(int argc, char **argv) +protocol_xigetclientpointer_test(void) { init_simple(); client_window = init_client(0, NULL); diff --git a/xserver/test/xi2/protocol-xigetselectedevents.c b/xserver/test/xi2/protocol-xigetselectedevents.c index bedc217b1..9a0fac5d4 100644 --- a/xserver/test/xi2/protocol-xigetselectedevents.c +++ b/xserver/test/xi2/protocol-xigetselectedevents.c @@ -54,31 +54,13 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata); -struct { +static struct { int num_masks_expected; unsigned char mask[MAXDEVICES][XI2LASTEVENT]; /* intentionally bigger */ int mask_len; } test_data; -/* dixLookupWindow requires a lot of setup not necessary for this test. - * Simple wrapper that returns either one of the fake root window or the - * fake client window. If the requested ID is neither of those wanted, - * return whatever the real dixLookupWindow does. - */ -int -__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) -{ - if (id == root.drawable.id) { - *win = &root; - return Success; - } - else if (id == window.drawable.id) { - *win = &window; - return Success; - } - - return __real_dixLookupWindow(win, id, client, access); -} +ClientRec client_window; /* AddResource is called from XISetSEventMask, we don't need this */ Bool @@ -224,9 +206,11 @@ test_XIGetSelectedEvents(void) } int -main(int argc, char **argv) +protocol_xigetselectedevents_test(void) { init_simple(); + enable_GrabButton_wrap = 0; + enable_XISetEventMask_wrap = 0; test_XIGetSelectedEvents(); diff --git a/xserver/test/xi2/protocol-xipassivegrabdevice.c b/xserver/test/xi2/protocol-xipassivegrabdevice.c index 95d8ebf2b..c703a1ee8 100644 --- a/xserver/test/xi2/protocol-xipassivegrabdevice.c +++ b/xserver/test/xi2/protocol-xipassivegrabdevice.c @@ -41,12 +41,13 @@ #include "protocol-common.h" +ClientRec client_window; static ClientRec client_request; #define N_MODS 7 static uint32_t modifiers[N_MODS] = { 1, 2, 3, 4, 5, 6, 7 }; -struct test_data { +static struct test_data { int num_modifiers; } testdata; @@ -54,30 +55,22 @@ int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask); +int __real_GrabButton(ClientPtr client, DeviceIntPtr dev, + DeviceIntPtr modifier_device, int button, + GrabParameters *param, enum InputLevel grabtype, + GrabMask *mask); static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *closure); -int -__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) -{ - if (id == root.drawable.id) { - *win = &root; - return Success; - } - else if (id == window.drawable.id) { - *win = &window; - return Success; - } - - return __real_dixLookupWindow(win, id, client, access); -} - int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { + if (!enable_GrabButton_wrap) + __real_GrabButton(client, dev, modifier_device, button, param, grabtype, mask); + /* Fail every odd modifier */ if (param->modifiers % 2) return BadAccess; @@ -252,7 +245,7 @@ test_XIPassiveGrabDevice(void) } int -main(int argc, char **argv) +protocol_xipassivegrabdevice_test(void) { init_simple(); diff --git a/xserver/test/xi2/protocol-xiquerydevice.c b/xserver/test/xi2/protocol-xiquerydevice.c index deef1f180..a068038fd 100644 --- a/xserver/test/xi2/protocol-xiquerydevice.c +++ b/xserver/test/xi2/protocol-xiquerydevice.c @@ -54,6 +54,8 @@ struct test_data { int num_devices_in_reply; }; +ClientRec client_window; + static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure); static void reply_XIQueryDevice(ClientPtr client, int len, char *data, @@ -333,7 +335,7 @@ test_XIQueryDevice(void) } int -main(int argc, char **argv) +protocol_xiquerydevice_test(void) { init_simple(); diff --git a/xserver/test/xi2/protocol-xiquerypointer.c b/xserver/test/xi2/protocol-xiquerypointer.c index 2bf18fadc..ed75d7910 100644 --- a/xserver/test/xi2/protocol-xiquerypointer.c +++ b/xserver/test/xi2/protocol-xiquerypointer.c @@ -41,6 +41,7 @@ #include "protocol-common.h" +ClientRec client_window; static ClientRec client_request; static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *closure); @@ -50,26 +51,6 @@ static struct { WindowPtr win; } test_data; -/* dixLookupWindow requires a lot of setup not necessary for this test. - * Simple wrapper that returns either one of the fake root window or the - * fake client window. If the requested ID is neither of those wanted, - * return whatever the real dixLookupWindow does. - */ -int -__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) -{ - if (id == root.drawable.id) { - *win = &root; - return Success; - } - else if (id == window.drawable.id) { - *win = &window; - return Success; - } - - return __real_dixLookupWindow(win, id, client, access); -} - static void reply_XIQueryPointer(ClientPtr client, int len, char *data, void *closure) { @@ -209,7 +190,7 @@ test_XIQueryPointer(void) } int -main(int argc, char **argv) +protocol_xiquerypointer_test(void) { init_simple(); diff --git a/xserver/test/xi2/protocol-xiqueryversion.c b/xserver/test/xi2/protocol-xiqueryversion.c index 3749b3041..3ce758faa 100644 --- a/xserver/test/xi2/protocol-xiqueryversion.c +++ b/xserver/test/xi2/protocol-xiqueryversion.c @@ -58,6 +58,8 @@ struct test_data { int minor_expected; }; +ClientRec client_window; + static void reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure) { @@ -286,7 +288,7 @@ test_XIQueryVersion_multiple(void) } int -main(int argc, char **argv) +protocol_xiqueryversion_test(void) { init_simple(); diff --git a/xserver/test/xi2/protocol-xiselectevents.c b/xserver/test/xi2/protocol-xiselectevents.c index 183746f98..f136c23d0 100644 --- a/xserver/test/xi2/protocol-xiselectevents.c +++ b/xserver/test/xi2/protocol-xiselectevents.c @@ -62,33 +62,22 @@ static unsigned char *data[4096 * 20]; /* the request data buffer */ +ClientRec client_window; + int -__wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, - unsigned char *mask) +__real_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, + int len, unsigned char *mask); + +int +__wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, + int len, unsigned char *mask) { + if (!enable_XISetEventMask_wrap) + return __real_XISetEventMask(dev, win, client, len, mask); + return Success; } -/* dixLookupWindow requires a lot of setup not necessary for this test. - * Simple wrapper that returns either one of the fake root window or the - * fake client window. If the requested ID is neither of those wanted, - * return whatever the real dixLookupWindow does. - */ -int -__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) -{ - if (id == root.drawable.id) { - *win = &root; - return Success; - } - else if (id == window.drawable.id) { - *win = &window; - return Success; - } - - return __real_dixLookupWindow(win, id, client, access); -} - static void request_XISelectEvent(xXISelectEventsReq * req, int error) { @@ -342,7 +331,7 @@ test_XISelectEvents(void) } int -main(int argc, char **argv) +protocol_xiselectevents_test(void) { init_simple(); diff --git a/xserver/test/xi2/protocol-xisetclientpointer.c b/xserver/test/xi2/protocol-xisetclientpointer.c index 90f1b94c3..6584bb9cc 100644 --- a/xserver/test/xi2/protocol-xisetclientpointer.c +++ b/xserver/test/xi2/protocol-xisetclientpointer.c @@ -48,24 +48,9 @@ #include "protocol-common.h" -static ClientRec client_window; +ClientRec client_window; static ClientRec client_request; -int -__wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, - Mask access) -{ - if (rid == ROOT_WINDOW_ID) - return BadWindow; - - if (rid == CLIENT_WINDOW_ID) { - *pClient = &client_window; - return Success; - } - - return __real_dixLookupClient(pClient, rid, client, access); -} - static void request_XISetClientPointer(xXISetClientPointerReq * req, int error) { @@ -137,7 +122,7 @@ test_XISetClientPointer(void) } int -main(int argc, char **argv) +protocol_xisetclientpointer_test(void) { init_simple(); client_window = init_client(0, NULL); diff --git a/xserver/test/xi2/protocol-xiwarppointer.c b/xserver/test/xi2/protocol-xiwarppointer.c index 3aaaae6f9..8484d54e5 100644 --- a/xserver/test/xi2/protocol-xiwarppointer.c +++ b/xserver/test/xi2/protocol-xiwarppointer.c @@ -44,25 +44,7 @@ static int expected_x = SPRITE_X; static int expected_y = SPRITE_Y; -/* dixLookupWindow requires a lot of setup not necessary for this test. - * Simple wrapper that returns either one of the fake root window or the - * fake client window. If the requested ID is neither of those wanted, - * return whatever the real dixLookupWindow does. - */ -int -__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) -{ - if (id == root.drawable.id) { - *win = &root; - return Success; - } - else if (id == window.drawable.id) { - *win = &window; - return Success; - } - - return __real_dixLookupWindow(win, id, client, access); -} +ClientRec client_window; /** * This function overrides the one in the screen rec. @@ -204,7 +186,7 @@ test_XIWarpPointer(void) } int -main(int argc, char **argv) +protocol_xiwarppointer_test(void) { init_simple(); screen.SetCursorPosition = ScreenSetCursorPosition; diff --git a/xserver/test/xi2/xi2.c b/xserver/test/xi2/xi2.c index 1cdad1dbd..6ed4c7f4f 100644 --- a/xserver/test/xi2/xi2.c +++ b/xserver/test/xi2/xi2.c @@ -30,6 +30,10 @@ #include "inputstr.h" #include "assert.h" +#include "protocol-common.h" + +ClientRec client_window; + static void xi2mask_test(void) { @@ -133,7 +137,7 @@ xi2mask_test(void) } int -main(int argc, char **argv) +xi2_test(void) { xi2mask_test(); diff --git a/xserver/test/xtest.c b/xserver/test/xtest.c index e9fabfbb9..fc5e43368 100644 --- a/xserver/test/xtest.c +++ b/xserver/test/xtest.c @@ -29,12 +29,15 @@ #include "input.h" #include "inputstr.h" #include "scrnintstr.h" +#include "windowstr.h" #include "exevents.h" #include "extinit.h" #include "xkbsrv.h" #include "xserver-properties.h" #include "syncsrv.h" +#include "tests-common.h" + /** */ @@ -56,11 +59,15 @@ device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen) static void xtest_init_devices(void) { - ScreenRec screen; - ClientRec server_client; + ScreenRec screen = {0}; + ClientRec server_client = {0}; + WindowRec root = {0}; + WindowOptRec optional = {0}; /* random stuff that needs initialization */ - memset(&screen, 0, sizeof(screen)); + root.drawable.id = 0xab; + root.optional = &optional; + screen.root = &root; screenInfo.numScreens = 1; screenInfo.screens[0] = &screen; screen.myNum = 0; @@ -123,7 +130,7 @@ xtest_properties(void) } int -main(int argc, char **argv) +xtest_test(void) { xtest_init_devices(); xtest_properties(); diff --git a/xserver/xfixes/Makefile.in b/xserver/xfixes/Makefile.in index 84aef216d..d74cdb634 100644 --- a/xserver/xfixes/Makefile.in +++ b/xserver/xfixes/Makefile.in @@ -68,7 +68,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -308,6 +308,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -326,15 +327,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -342,6 +346,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -413,8 +419,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c index a150f450b..d4b68f3af 100644 --- a/xserver/xfixes/cursor.c +++ b/xserver/xfixes/cursor.c @@ -134,8 +134,11 @@ Bool EnableCursor = TRUE; static CursorPtr CursorForDevice(DeviceIntPtr pDev) { - if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) + if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) { + if (pDev->spriteInfo->anim.pCursor) + return pDev->spriteInfo->anim.pCursor; return pDev->spriteInfo->sprite->current; + } return NULL; } @@ -291,7 +294,7 @@ GetBit(unsigned char *line, int x) return 0; } -int +int _X_COLD SProcXFixesSelectCursorInput(ClientPtr client) { REQUEST(xXFixesSelectCursorInputReq); @@ -303,7 +306,7 @@ SProcXFixesSelectCursorInput(ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } -void +void _X_COLD SXFixesCursorNotifyEvent(xXFixesCursorNotifyEvent * from, xXFixesCursorNotifyEvent * to) { @@ -412,7 +415,7 @@ ProcXFixesGetCursorImage(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesGetCursorImage(ClientPtr client) { REQUEST(xXFixesGetCursorImageReq); @@ -440,7 +443,7 @@ ProcXFixesSetCursorName(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesSetCursorName(ClientPtr client) { REQUEST(xXFixesSetCursorNameReq); @@ -489,7 +492,7 @@ ProcXFixesGetCursorName(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesGetCursorName(ClientPtr client) { REQUEST(xXFixesGetCursorNameReq); @@ -569,7 +572,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesGetCursorImageAndName(ClientPtr client) { REQUEST(xXFixesGetCursorImageAndNameReq); @@ -595,8 +598,6 @@ static const RESTYPE CursorRestypes[] = { RT_WINDOW, RT_PASSIVEGRAB, RT_CURSOR }; -#define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) - static Bool ReplaceCursorLookup(void *value, XID id, void *closure) { @@ -659,7 +660,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) for (clientIndex = 0; clientIndex < currentMaxClients; clientIndex++) { if (!clients[clientIndex]) continue; - for (resIndex = 0; resIndex < NUM_CURSOR_RESTYPES; resIndex++) { + for (resIndex = 0; resIndex < ARRAY_SIZE(CursorRestypes); resIndex++) { rcl.type = CursorRestypes[resIndex]; /* * This function walks the entire client resource database @@ -696,7 +697,7 @@ ProcXFixesChangeCursor(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesChangeCursor(ClientPtr client) { REQUEST(xXFixesChangeCursorReq); @@ -735,7 +736,7 @@ ProcXFixesChangeCursorByName(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesChangeCursorByName(ClientPtr client) { REQUEST(xXFixesChangeCursorByNameReq); @@ -895,7 +896,7 @@ ProcXFixesHideCursor(ClientPtr client) return ret; } -int +int _X_COLD SProcXFixesHideCursor(ClientPtr client) { REQUEST(xXFixesHideCursorReq); @@ -946,7 +947,7 @@ ProcXFixesShowCursor(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesShowCursor(ClientPtr client) { REQUEST(xXFixesShowCursorReq); @@ -1015,7 +1016,7 @@ ProcXFixesCreatePointerBarrier(ClientPtr client) return XICreatePointerBarrier(client, stuff); } -int +int _X_COLD SProcXFixesCreatePointerBarrier(ClientPtr client) { REQUEST(xXFixesCreatePointerBarrierReq); @@ -1052,7 +1053,7 @@ ProcXFixesDestroyPointerBarrier(ClientPtr client) return XIDestroyPointerBarrier(client, stuff); } -int +int _X_COLD SProcXFixesDestroyPointerBarrier(ClientPtr client) { REQUEST(xXFixesDestroyPointerBarrierReq); diff --git a/xserver/xfixes/region.c b/xserver/xfixes/region.c index f300d2b6e..7c0a7d2fe 100644 --- a/xserver/xfixes/region.c +++ b/xserver/xfixes/region.c @@ -91,7 +91,7 @@ ProcXFixesCreateRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCreateRegion(ClientPtr client) { REQUEST(xXFixesCreateRegionReq); @@ -135,7 +135,7 @@ ProcXFixesCreateRegionFromBitmap(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCreateRegionFromBitmap(ClientPtr client) { REQUEST(xXFixesCreateRegionFromBitmapReq); @@ -194,7 +194,7 @@ ProcXFixesCreateRegionFromWindow(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCreateRegionFromWindow(ClientPtr client) { REQUEST(xXFixesCreateRegionFromWindowReq); @@ -237,7 +237,7 @@ ProcXFixesCreateRegionFromGC(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCreateRegionFromGC(ClientPtr client) { REQUEST(xXFixesCreateRegionFromGCReq); @@ -279,7 +279,7 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCreateRegionFromPicture(ClientPtr client) { REQUEST(xXFixesCreateRegionFromPictureReq); @@ -303,7 +303,7 @@ ProcXFixesDestroyRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesDestroyRegion(ClientPtr client) { REQUEST(xXFixesDestroyRegionReq); @@ -341,7 +341,7 @@ ProcXFixesSetRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesSetRegion(ClientPtr client) { REQUEST(xXFixesSetRegionReq); @@ -370,7 +370,7 @@ ProcXFixesCopyRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCopyRegion(ClientPtr client) { REQUEST(xXFixesCopyRegionReq); @@ -412,7 +412,7 @@ ProcXFixesCombineRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesCombineRegion(ClientPtr client) { REQUEST(xXFixesCombineRegionReq); @@ -456,7 +456,7 @@ ProcXFixesInvertRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesInvertRegion(ClientPtr client) { REQUEST(xXFixesInvertRegionReq); @@ -486,7 +486,7 @@ ProcXFixesTranslateRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesTranslateRegion(ClientPtr client) { REQUEST(xXFixesTranslateRegionReq); @@ -515,7 +515,7 @@ ProcXFixesRegionExtents(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesRegionExtents(ClientPtr client) { REQUEST(xXFixesRegionExtentsReq); @@ -580,7 +580,7 @@ ProcXFixesFetchRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesFetchRegion(ClientPtr client) { REQUEST(xXFixesFetchRegionReq); @@ -623,7 +623,7 @@ ProcXFixesSetGCClipRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesSetGCClipRegion(ClientPtr client) { REQUEST(xXFixesSetGCClipRegionReq); @@ -713,7 +713,7 @@ ProcXFixesSetWindowShapeRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesSetWindowShapeRegion(ClientPtr client) { REQUEST(xXFixesSetWindowShapeRegionReq); @@ -746,7 +746,7 @@ ProcXFixesSetPictureClipRegion(ClientPtr client) pRegion); } -int +int _X_COLD SProcXFixesSetPictureClipRegion(ClientPtr client) { REQUEST(xXFixesSetPictureClipRegionReq); @@ -799,7 +799,7 @@ ProcXFixesExpandRegion(ClientPtr client) return Success; } -int +int _X_COLD SProcXFixesExpandRegion(ClientPtr client) { REQUEST(xXFixesExpandRegionReq); diff --git a/xserver/xfixes/saveset.c b/xserver/xfixes/saveset.c index aa365cfe5..fd9c7a124 100644 --- a/xserver/xfixes/saveset.c +++ b/xserver/xfixes/saveset.c @@ -58,7 +58,7 @@ ProcXFixesChangeSaveSet(ClientPtr client) return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map); } -int +int _X_COLD SProcXFixesChangeSaveSet(ClientPtr client) { REQUEST(xXFixesChangeSaveSetReq); diff --git a/xserver/xfixes/select.c b/xserver/xfixes/select.c index 87a3ad777..19b2c7324 100644 --- a/xserver/xfixes/select.c +++ b/xserver/xfixes/select.c @@ -197,7 +197,7 @@ ProcXFixesSelectSelectionInput(ClientPtr client) pWin, stuff->eventMask); } -int +int _X_COLD SProcXFixesSelectSelectionInput(ClientPtr client) { REQUEST(xXFixesSelectSelectionInputReq); @@ -210,7 +210,7 @@ SProcXFixesSelectSelectionInput(ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } -void +void _X_COLD SXFixesSelectionNotifyEvent(xXFixesSelectionNotifyEvent * from, xXFixesSelectionNotifyEvent * to) { diff --git a/xserver/xfixes/xfixes.c b/xserver/xfixes/xfixes.c index 8b45c5349..53a6bd62f 100644 --- a/xserver/xfixes/xfixes.c +++ b/xserver/xfixes/xfixes.c @@ -105,8 +105,6 @@ static const int version_requests[] = { X_XFixesDestroyPointerBarrier, /* Version 5 */ }; -#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) - int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr) = { /*************** Version 1 ******************/ ProcXFixesQueryVersion, @@ -149,14 +147,14 @@ ProcXFixesDispatch(ClientPtr client) REQUEST(xXFixesReq); XFixesClientPtr pXFixesClient = GetXFixesClient(client); - if (pXFixesClient->major_version >= NUM_VERSION_REQUESTS) + if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests)) return BadRequest; if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version]) return BadRequest; return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } -static int +static _X_COLD int SProcXFixesQueryVersion(ClientPtr client) { REQUEST(xXFixesQueryVersionReq); @@ -204,7 +202,7 @@ static int (*SProcXFixesVector[XFixesNumberRequests]) (ClientPtr) = { /*************** Version 5 ****************/ SProcXFixesCreatePointerBarrier, SProcXFixesDestroyPointerBarrier,}; -static int +static _X_COLD int SProcXFixesDispatch(ClientPtr client) { REQUEST(xXFixesReq); diff --git a/xserver/xkb/Makefile.in b/xserver/xkb/Makefile.in index f2405efaa..38fd61f9d 100644 --- a/xserver/xkb/Makefile.in +++ b/xserver/xkb/Makefile.in @@ -69,7 +69,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/xwayland-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -347,6 +347,7 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RELEASE_DATE = @RELEASE_DATE@ +SCANNER_ARG = @SCANNER_ARG@ SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ @@ -365,15 +366,18 @@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_EGLSTREAM_CFLAGS = @WAYLAND_EGLSTREAM_CFLAGS@ +WAYLAND_EGLSTREAM_DATADIR = @WAYLAND_EGLSTREAM_DATADIR@ +WAYLAND_EGLSTREAM_LIBS = @WAYLAND_EGLSTREAM_LIBS@ WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ +WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ @@ -381,6 +385,8 @@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XCONFIGDIR = @XCONFIGDIR@ +XCONFIGFILE = @XCONFIGFILE@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ @@ -452,8 +458,6 @@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ diff --git a/xserver/xkb/XKBGAlloc.c b/xserver/xkb/XKBGAlloc.c index e9f55fa43..8958b0c52 100644 --- a/xserver/xkb/XKBGAlloc.c +++ b/xserver/xkb/XKBGAlloc.c @@ -588,7 +588,8 @@ XkbAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr) i++, alias++) { if (strncmp(alias->alias, aliasStr, XkbKeyNameLength) == 0) { memset(alias->real, 0, XkbKeyNameLength); - strncpy(alias->real, realStr, XkbKeyNameLength); + memcpy(alias->real, realStr, + min(XkbKeyNameLength, strlen(realStr))); return alias; } } @@ -598,8 +599,8 @@ XkbAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr) } alias = &geom->key_aliases[geom->num_key_aliases]; memset(alias, 0, sizeof(XkbKeyAliasRec)); - strncpy(alias->alias, aliasStr, XkbKeyNameLength); - strncpy(alias->real, realStr, XkbKeyNameLength); + memcpy(alias->alias, aliasStr, min(XkbKeyNameLength, strlen(aliasStr))); + memcpy(alias->real, realStr, min(XkbKeyNameLength, strlen(realStr))); geom->num_key_aliases++; return alias; } @@ -814,8 +815,8 @@ XkbAddGeomOverlayKey(XkbOverlayPtr overlay, (_XkbAllocOverlayKeys(row, 1) != Success)) return NULL; key = &row->keys[row->num_keys]; - strncpy(key->under.name, under, XkbKeyNameLength); - strncpy(key->over.name, over, XkbKeyNameLength); + memcpy(key->under.name, under, min(XkbKeyNameLength, strlen(under))); + memcpy(key->over.name, over, min(XkbKeyNameLength, strlen(over))); row->num_keys++; return key; } diff --git a/xserver/xkb/XKBMAlloc.c b/xserver/xkb/XKBMAlloc.c index dbc1389e6..3e380a8ea 100644 --- a/xserver/xkb/XKBMAlloc.c +++ b/xserver/xkb/XKBMAlloc.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_DIX_CONFIG_H #include -#elif defined(HAVE_CONFIG_H) -#include #endif #include diff --git a/xserver/xkb/XKBMisc.c b/xserver/xkb/XKBMisc.c index df268b583..f17194528 100644 --- a/xserver/xkb/XKBMisc.c +++ b/xserver/xkb/XKBMisc.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_DIX_CONFIG_H #include -#elif defined(HAVE_CONFIG_H) -#include #endif #include diff --git a/xserver/xkb/ddxLoad.c b/xserver/xkb/ddxLoad.c index bbe395245..a8b8368a6 100644 --- a/xserver/xkb/ddxLoad.c +++ b/xserver/xkb/ddxLoad.c @@ -45,18 +45,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" - /* - * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is - * relative to the top-level XKB configuration directory. - * Making the server write to a subdirectory of that directory - * requires some work in the general case (install procedure - * has to create links to /var or somesuch on many machines), - * so we just compile into /usr/tmp for now. - */ -#ifndef XKM_OUTPUT_DIR -#define XKM_OUTPUT_DIR "compiled/" -#endif - #define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" #define ERROR_PREFIX "\"> \"" #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" diff --git a/xserver/xkb/xkb.c b/xserver/xkb/xkb.c index 678f82368..764079506 100644 --- a/xserver/xkb/xkb.c +++ b/xserver/xkb/xkb.c @@ -172,8 +172,8 @@ ProcXkbUseExtension(ClientPtr client) if ((supported) && (!(client->xkbClientFlags & _XkbClientInitialized))) { client->xkbClientFlags = _XkbClientInitialized; - client->vMajor = stuff->wantedMajor; - client->vMinor = stuff->wantedMinor; + if (stuff->wantedMajor == 0) + client->xkbClientFlags |= _XkbClientIsAncient; } else if (xkbDebugFlags & 0x1) { ErrorF @@ -2388,7 +2388,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, if ((xkb->min_key_code != req->minKeyCode) || (xkb->max_key_code != req->maxKeyCode)) { - if (client->vMajor != 1) { /* pre 1.0 versions of Xlib have a bug */ + if (client->xkbClientFlags & _XkbClientIsAncient) { + /* pre 1.0 versions of Xlib have a bug */ req->minKeyCode = xkb->min_key_code; req->maxKeyCode = xkb->max_key_code; } @@ -2569,7 +2570,7 @@ _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, char *values) first = last = 0; if (change.map.num_modmap_keys > 0) { firstMM = change.map.first_modmap_key; - lastMM = first + change.map.num_modmap_keys - 1; + lastMM = firstMM + change.map.num_modmap_keys - 1; } else firstMM = lastMM = 0; @@ -2626,6 +2627,8 @@ ProcXkbSetMap(ClientPtr client) if (rc != Success) return rc; + DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD); + if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; @@ -2641,9 +2644,21 @@ ProcXkbSetMap(ClientPtr client) } } } + } else { + DeviceIntPtr other; + + for (other = inputInfo.devices; other; other = other->next) { + if (other != dev && GetMaster(other, MASTER_KEYBOARD) != dev && + (other != master || dev != master->lastSlave)) + continue; + + rc = _XkbSetMapChecks(client, other, stuff, tmp); + if (rc != Success) + return rc; + } } - /* We know now that we will succed with the SetMap. In theory anyway. */ + /* We know now that we will succeed with the SetMap. In theory anyway. */ rc = _XkbSetMap(client, dev, stuff, tmp); if (rc != Success) return rc; @@ -2664,6 +2679,16 @@ ProcXkbSetMap(ClientPtr client) sync. */ } } + } else { + DeviceIntPtr other; + + for (other = inputInfo.devices; other; other = other->next) { + if (other != dev && GetMaster(other, MASTER_KEYBOARD) != dev && + (other != master || dev != master->lastSlave)) + continue; + + _XkbSetMap(client, other, stuff, tmp); //ignore rc + } } return Success; diff --git a/xserver/xkb/xkbDflts.h b/xserver/xkb/xkbDflts.h index 994726c0f..b02dff9de 100644 --- a/xserver/xkb/xkbDflts.h +++ b/xserver/xkb/xkbDflts.h @@ -131,7 +131,7 @@ static XkbKeyTypeRec dflt_types[] = { None, lnames_SHIFT_ALT} }; -#define num_dflt_types (sizeof(dflt_types)/sizeof(XkbKeyTypeRec)) +#define num_dflt_types ARRAY_SIZE(dflt_types) static void initTypeNames(DPYTYPE dpy) @@ -445,7 +445,7 @@ static XkbSymInterpretRec dfltSI[69] = { {XkbSA_SetMods, {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}} }; -#define num_dfltSI (sizeof(dfltSI)/sizeof(XkbSymInterpretRec)) +#define num_dfltSI ARRAY_SIZE(dfltSI) static XkbCompatMapRec compatMap = { dfltSI, diff --git a/xserver/xkb/xkbInit.c b/xserver/xkb/xkbInit.c index 9c772f549..9e45b4b71 100644 --- a/xserver/xkb/xkbInit.c +++ b/xserver/xkb/xkbInit.c @@ -505,6 +505,13 @@ XkbInitControls(DeviceIntPtr pXDev, XkbSrvInfoPtr xkbi) return Success; } +static Status +XkbInitOverlayState(XkbSrvInfoPtr xkbi) +{ + memset(xkbi->overlay_perkey_state, 0, sizeof(xkbi->overlay_perkey_state)); + return Success; +} + static Bool InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, const char *keymap, int keymap_length, @@ -608,6 +615,8 @@ InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, XkbInitIndicatorMap(xkbi); + XkbInitOverlayState(xkbi); + XkbUpdateActions(dev, xkb->min_key_code, XkbNumKeys(xkb), &changes, &check, &cause); @@ -728,7 +737,7 @@ extern int XkbDfltRepeatInterval; extern unsigned short XkbDfltAccessXTimeout; extern unsigned int XkbDfltAccessXTimeoutMask; extern unsigned int XkbDfltAccessXFeedback; -extern unsigned char XkbDfltAccessXOptions; +extern unsigned short XkbDfltAccessXOptions; int XkbProcessArguments(int argc, char *argv[], int i) @@ -789,7 +798,7 @@ XkbProcessArguments(int argc, char *argv[], int i) j++; } if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { - XkbDfltAccessXOptions = (unsigned char) + XkbDfltAccessXOptions = (unsigned short) strtol(argv[++i], NULL, 16); j++; } diff --git a/xserver/xkb/xkbPrKeyEv.c b/xserver/xkb/xkbPrKeyEv.c index f7a6b4b14..d2c7e33f4 100644 --- a/xserver/xkb/xkbPrKeyEv.c +++ b/xserver/xkb/xkbPrKeyEv.c @@ -121,20 +121,33 @@ XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd) case XkbKB_Overlay2: { unsigned which; + unsigned overlay_active_now; + unsigned is_keyrelease = (event->type == ET_KeyRelease) ? 1 : 0; + /* Remembers whether the key was pressed while overlay was down, + * for when overlay is already released, but the key is not. */ + unsigned key_was_overlaid = 0; if (behavior.type == XkbKB_Overlay1) which = XkbOverlay1Mask; else which = XkbOverlay2Mask; - if ((xkbi->desc->ctrls->enabled_ctrls & which) == 0) - break; - if ((behavior.data >= xkbi->desc->min_key_code) && - (behavior.data <= xkbi->desc->max_key_code)) { + overlay_active_now = (xkbi->desc->ctrls->enabled_ctrls & which) ? 1 : 0; + + if ((unsigned char)key == key) { + key_was_overlaid = BitIsOn(xkbi->overlay_perkey_state, key); + if (!is_keyrelease) { + if (overlay_active_now) + SetBit(xkbi->overlay_perkey_state, key); + } else { + if (key_was_overlaid) + ClearBit(xkbi->overlay_perkey_state, key); + } + } + + if ((overlay_active_now || key_was_overlaid) && + (behavior.data >= xkbi->desc->min_key_code) && + (behavior.data <= xkbi->desc->max_key_code)) { event->detail.key = behavior.data; - /* 9/11/94 (ef) -- XXX! need to match release with */ - /* press even if the state of the */ - /* corresponding overlay control */ - /* changes while the key is down */ } } break; diff --git a/xserver/xkb/xkbSwap.c b/xserver/xkb/xkbSwap.c index ecec63ee2..1c1ed5ff4 100644 --- a/xserver/xkb/xkbSwap.c +++ b/xserver/xkb/xkbSwap.c @@ -41,7 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /* * REQUEST SWAPPING */ -static int +static int _X_COLD SProcXkbUseExtension(ClientPtr client) { REQUEST(xkbUseExtensionReq); @@ -53,7 +53,7 @@ SProcXkbUseExtension(ClientPtr client) return ProcXkbUseExtension(client); } -static int +static int _X_COLD SProcXkbSelectEvents(ClientPtr client) { REQUEST(xkbSelectEventsReq); @@ -131,7 +131,7 @@ SProcXkbSelectEvents(ClientPtr client) return ProcXkbSelectEvents(client); } -static int +static int _X_COLD SProcXkbBell(ClientPtr client) { REQUEST(xkbBellReq); @@ -148,7 +148,7 @@ SProcXkbBell(ClientPtr client) return ProcXkbBell(client); } -static int +static int _X_COLD SProcXkbGetState(ClientPtr client) { REQUEST(xkbGetStateReq); @@ -159,7 +159,7 @@ SProcXkbGetState(ClientPtr client) return ProcXkbGetState(client); } -static int +static int _X_COLD SProcXkbLatchLockState(ClientPtr client) { REQUEST(xkbLatchLockStateReq); @@ -171,7 +171,7 @@ SProcXkbLatchLockState(ClientPtr client) return ProcXkbLatchLockState(client); } -static int +static int _X_COLD SProcXkbGetControls(ClientPtr client) { REQUEST(xkbGetControlsReq); @@ -182,7 +182,7 @@ SProcXkbGetControls(ClientPtr client) return ProcXkbGetControls(client); } -static int +static int _X_COLD SProcXkbSetControls(ClientPtr client) { REQUEST(xkbSetControlsReq); @@ -215,7 +215,7 @@ SProcXkbSetControls(ClientPtr client) return ProcXkbSetControls(client); } -static int +static int _X_COLD SProcXkbGetMap(ClientPtr client) { REQUEST(xkbGetMapReq); @@ -229,7 +229,7 @@ SProcXkbGetMap(ClientPtr client) return ProcXkbGetMap(client); } -static int +static int _X_COLD SProcXkbSetMap(ClientPtr client) { REQUEST(xkbSetMapReq); @@ -245,7 +245,7 @@ SProcXkbSetMap(ClientPtr client) return ProcXkbSetMap(client); } -static int +static int _X_COLD SProcXkbGetCompatMap(ClientPtr client) { REQUEST(xkbGetCompatMapReq); @@ -258,7 +258,7 @@ SProcXkbGetCompatMap(ClientPtr client) return ProcXkbGetCompatMap(client); } -static int +static int _X_COLD SProcXkbSetCompatMap(ClientPtr client) { REQUEST(xkbSetCompatMapReq); @@ -271,7 +271,7 @@ SProcXkbSetCompatMap(ClientPtr client) return ProcXkbSetCompatMap(client); } -static int +static int _X_COLD SProcXkbGetIndicatorState(ClientPtr client) { REQUEST(xkbGetIndicatorStateReq); @@ -282,7 +282,7 @@ SProcXkbGetIndicatorState(ClientPtr client) return ProcXkbGetIndicatorState(client); } -static int +static int _X_COLD SProcXkbGetIndicatorMap(ClientPtr client) { REQUEST(xkbGetIndicatorMapReq); @@ -294,7 +294,7 @@ SProcXkbGetIndicatorMap(ClientPtr client) return ProcXkbGetIndicatorMap(client); } -static int +static int _X_COLD SProcXkbSetIndicatorMap(ClientPtr client) { REQUEST(xkbSetIndicatorMapReq); @@ -306,7 +306,7 @@ SProcXkbSetIndicatorMap(ClientPtr client) return ProcXkbSetIndicatorMap(client); } -static int +static int _X_COLD SProcXkbGetNamedIndicator(ClientPtr client) { REQUEST(xkbGetNamedIndicatorReq); @@ -320,7 +320,7 @@ SProcXkbGetNamedIndicator(ClientPtr client) return ProcXkbGetNamedIndicator(client); } -static int +static int _X_COLD SProcXkbSetNamedIndicator(ClientPtr client) { REQUEST(xkbSetNamedIndicatorReq); @@ -336,7 +336,7 @@ SProcXkbSetNamedIndicator(ClientPtr client) return ProcXkbSetNamedIndicator(client); } -static int +static int _X_COLD SProcXkbGetNames(ClientPtr client) { REQUEST(xkbGetNamesReq); @@ -348,7 +348,7 @@ SProcXkbGetNames(ClientPtr client) return ProcXkbGetNames(client); } -static int +static int _X_COLD SProcXkbSetNames(ClientPtr client) { REQUEST(xkbSetNamesReq); @@ -363,7 +363,7 @@ SProcXkbSetNames(ClientPtr client) return ProcXkbSetNames(client); } -static int +static int _X_COLD SProcXkbGetGeometry(ClientPtr client) { REQUEST(xkbGetGeometryReq); @@ -375,7 +375,7 @@ SProcXkbGetGeometry(ClientPtr client) return ProcXkbGetGeometry(client); } -static int +static int _X_COLD SProcXkbSetGeometry(ClientPtr client) { REQUEST(xkbSetGeometryReq); @@ -393,7 +393,7 @@ SProcXkbSetGeometry(ClientPtr client) return ProcXkbSetGeometry(client); } -static int +static int _X_COLD SProcXkbPerClientFlags(ClientPtr client) { REQUEST(xkbPerClientFlagsReq); @@ -409,7 +409,7 @@ SProcXkbPerClientFlags(ClientPtr client) return ProcXkbPerClientFlags(client); } -static int +static int _X_COLD SProcXkbListComponents(ClientPtr client) { REQUEST(xkbListComponentsReq); @@ -421,7 +421,7 @@ SProcXkbListComponents(ClientPtr client) return ProcXkbListComponents(client); } -static int +static int _X_COLD SProcXkbGetKbdByName(ClientPtr client) { REQUEST(xkbGetKbdByNameReq); @@ -434,7 +434,7 @@ SProcXkbGetKbdByName(ClientPtr client) return ProcXkbGetKbdByName(client); } -static int +static int _X_COLD SProcXkbGetDeviceInfo(ClientPtr client) { REQUEST(xkbGetDeviceInfoReq); @@ -448,7 +448,7 @@ SProcXkbGetDeviceInfo(ClientPtr client) return ProcXkbGetDeviceInfo(client); } -static int +static int _X_COLD SProcXkbSetDeviceInfo(ClientPtr client) { REQUEST(xkbSetDeviceInfoReq); @@ -461,7 +461,7 @@ SProcXkbSetDeviceInfo(ClientPtr client) return ProcXkbSetDeviceInfo(client); } -static int +static int _X_COLD SProcXkbSetDebuggingFlags(ClientPtr client) { REQUEST(xkbSetDebuggingFlagsReq); @@ -476,7 +476,7 @@ SProcXkbSetDebuggingFlags(ClientPtr client) return ProcXkbSetDebuggingFlags(client); } -int +int _X_COLD SProcXkbDispatch(ClientPtr client) { REQUEST(xReq);