diff --git a/xserver/ChangeLog b/xserver/ChangeLog index a14ffe982..57a978eb2 100644 --- a/xserver/ChangeLog +++ b/xserver/ChangeLog @@ -1,3 +1,271 @@ +commit 489f4191f3c881c6c8acce97ec612167a4ae0f33 +Author: Matt Turner +Date: Mon Jan 13 14:47:48 2020 -0800 + + xserver 1.20.7 + + Signed-off-by: Matt Turner + +commit 279789183ed377127073955d21d44ee3b01ac763 +Author: Alan Coopersmith +Date: Mon Sep 23 15:12:01 2019 -0700 + + ospoll: Fix Solaris ports implementation to build on Solaris 11.4 + + Wrong version got committed, but wasn't noticed since it only builds + with meson, not autoconf. + + Signed-off-by: Alan Coopersmith + (cherry picked from commit 0e8c0d2f238e5d50daaf4672bd80ad519673b5e3) + +commit cc503031c32496efb28ed81d32a547ded46a0815 +Author: Alan Coopersmith +Date: Thu Feb 21 15:38:07 2019 -0800 + + os-support/solaris: Set IOPL for input thread too + + Since the Solaris kernel tracks IOPL per thread, and doesn't inherit + raised IOPL levels when creating a new thread, we need to turn it on + in the input thread for input drivers like vmmouse that need register + access to work correctly. + + Signed-off-by: Alan Coopersmith + (cherry picked from commit 12769c516d9356bd92f90e2f53a4853dbfdc4aed) + +commit f778e76eb4bc6b9219a8b1a903a2fb1a30c2c92a +Author: Alan Coopersmith +Date: Thu Feb 21 15:35:38 2019 -0800 + + Add xf86OSInputThreadInit call from common layer into os-support layer + + Allows os backends to run additional code as necessary to set up the + input thread. + + Signed-off-by: Alan Coopersmith + (cherry picked from commit ea1527a8a662dcc5ac3ed49135740aa5f24f74bc) + +commit e3f26605d85d987da434640f52646d728f1fe919 +Author: Alan Coopersmith +Date: Thu Feb 21 15:22:57 2019 -0800 + + Add ddxInputThread call from os layer into ddx layer + + Allows ddx's to run additional code as necessary to set up the + input thread. + + Signed-off-by: Alan Coopersmith + (cherry picked from commit 4ad21c3247d98ac6c5ad71fa36be60ed04f7c92c) + +commit bb405cdc85b6e31c0beef60a07a2cfe5b87dcde6 +Author: Alan Coopersmith +Date: Thu Feb 21 14:51:22 2019 -0800 + + os-support/solaris: Drop ExtendedEnabled global variable + + Keeping track of kernel state in user space doesn't buy us anything, + and introduces bugs, as we were keeping global state but the Solaris + kernel tracks IOPL per thread. + + Signed-off-by: Alan Coopersmith + (cherry picked from commit 7533fa9bd5a4a0f7743d553be186514d684308c8) + +commit 977f3acfceb91f1dd10c8bf84b9d7515b2a59457 +Author: Michel Dänzer +Date: Fri Dec 20 15:51:00 2019 +0100 + + glamor: Only use dual blending with GLSL >= 1.30 + + It can't be used with older GLSL. Fixes a crash when attempting to + anyway. + + Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/97 + Fixes: e7308b6c7756 "glamor: Add support for CA rendering in a single pass." + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + (Cherry picked from commit 5bfca0038e92d61e58d4dc1a54748faef8273023) + +commit cfc5e5040c93486323165196550dbe18aec46402 +Author: Aaron Plattner +Date: Thu Dec 26 13:40:17 2019 -0800 + + modesetting: Check whether RandR was initialized before calling rrGetScrPriv + + Calling rrGetScrPriv when RandR isn't initialized causes an assertion + failure that aborts the server: + + Xorg: ../include/privates.h:121: dixGetPrivateAddr: Assertion `key->initialized' failed. + + Thread 1 "Xorg" received signal SIGABRT, Aborted. + 0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6 + (gdb) bt + #0 0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6 + #1 0x00007ffff7892897 in abort () from /usr/lib/libc.so.6 + #2 0x00007ffff7892767 in __assert_fail_base.cold () from /usr/lib/libc.so.6 + #3 0x00007ffff78a1526 in __assert_fail () from /usr/lib/libc.so.6 + #4 0x00007ffff7fb57c1 in dixGetPrivateAddr (privates=0x555555ab1b60, key=0x555555855720 ) at ../include/privates.h:121 + #5 0x00007ffff7fb5822 in dixGetPrivate (privates=0x555555ab1b60, key=0x555555855720 ) at ../include/privates.h:136 + #6 0x00007ffff7fb586a in dixLookupPrivate (privates=0x555555ab1b60, key=0x555555855720 ) at ../include/privates.h:166 + #7 0x00007ffff7fb8445 in CreateScreenResources (pScreen=0x555555ab1790) at ../hw/xfree86/drivers/modesetting/driver.c:1335 + #8 0x000055555576c5e4 in xf86CrtcCreateScreenResources (screen=0x555555ab1790) at ../hw/xfree86/modes/xf86Crtc.c:744 + #9 0x00005555555d8bb6 in dix_main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/main.c:214 + #10 0x00005555557a4f0b in main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/stubmain.c:34 + + This can happen, for example, if the server is configured with Xinerama + and there is more than one X screen: + + Section "ServerLayout" + Identifier "crash" + Screen 0 "modesetting" + Screen 1 "dummy" RightOf "modesetting" + Option "Xinerama" + EndSection + + Section "Device" + Identifier "modesetting" + Driver "modesetting" + EndSection + + Section "Screen" + Identifier "modesetting" + Device "modesetting" + EndSection + + Section "Device" + Identifier "dummy" + Driver "dummy" + EndSection + + Section "Screen" + Identifier "dummy" + Device "dummy" + EndSection + + The problem does not reproduce if there is only one X screen because of + this code in xf86RandR12Init: + + #ifdef PANORAMIX + /* XXX disable RandR when using Xinerama */ + if (!noPanoramiXExtension) { + if (xf86NumScreens == 1) + noPanoramiXExtension = TRUE; + else + return TRUE; + } + #endif + + Fix the problem by checking dixPrivateKeyRegistered(rrPrivKey) before + calling rrGetScrPriv. This is similar to what the xf86-video-amdgpu + driver does: + https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/blob/fd66f5c0bea2b7c22a47bfd5eb1f22d32d166d9c/src/amdgpu_kms.c#L388 + + Signed-off-by: Aaron Plattner + Reviewed-by: Michel Dänzer + (cherry picked from commit 4226c6d0329df440551b7b91ae573a82c64a1ac9) + +commit fb2540648a293def46bf0afa183e0884fa4496be +Author: Peter Hutterer +Date: Wed May 29 16:19:55 2019 +1000 + + Xi: return AlreadyGrabbed for key grabs > 255 + + We can't have high keycodes because everything in XKB relies on 8 bits. XI2's + API allows for 32-bit keycodes so we have to take those but nothing in the + server is really ready for this. The effect of this right now is that any high + keycode grab is clipped to 255 and thus ends up grabbing a different key + instead. + + https://bugzilla.redhat.com/show_bug.cgi?id=1697804 + + Signed-off-by: Peter Hutterer + (cherry picked from commit f4cdbf640b6440df4af784ca35e1b1340965cc10) + +commit 87ca1bdf6935c4b11b41ca071f1f4b8d8347fee9 +Author: Michel Dänzer +Date: Tue Dec 3 18:39:40 2019 +0100 + + xwayland: Do flush GPU work in xwl_present_flush + + The Present code sends the idle notification event to the client after + xwl_present_flush returns. If we don't flush our GPU work here, the + client may race to draw another frame to the same buffer, so we may end + up copying (parts of) that new frame instead of the one we meant to. + + Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/835 + + Reviewed-by: Olivier Fourdan + (Cherry picked from commit 2a2234ad1a0fe88400c1511fea67741e4ad09f7f) + Reviewed-by: Kenneth Graunke + +commit 8aad09dd79f0504715edac56e21439809a5d529e +Author: Michel Dänzer +Date: Tue Nov 26 17:17:12 2019 +0100 + + modesetting: Clear new screen pixmap storage on RandR resize + + Fixes random garbage being visible intermittently. + + Reviewed-by: Adam Jackson + (Cherry picked from commit 9ba13bac9dd076f166ff0d063fc144b904a40d12) + Reviewed-by: Kenneth Graunke + +commit 094f42cdfe5d4c0b8e329445c529ee1e59278999 +Author: Michel Dänzer +Date: Tue Nov 26 17:16:37 2019 +0100 + + xfree86/modes: Call xf86RotateRedisplay from xf86CrtcRotate + + If a new rotate buffer was allocated. This makes sure the new buffer + has valid transformed contents when it starts being displayed. + + Reviewed-by: Adam Jackson + (Cherry picked from commit 327df450ffcf5bda5b4254db0208d355860d1010) + Reviewed-by: Kenneth Graunke + +commit b50175fe867ae067888049318264824524c0616a +Author: Michel Dänzer +Date: Tue Nov 26 17:14:46 2019 +0100 + + modesetting: Call glamor_finish from drmmode_crtc_set_mode + + This makes sure any pending drawing to a new scanout buffer will be + visible from the start. + + This makes the finish call in drmmode_copy_fb superfluous, so remove it. + + Reviewed-by: Adam Jackson + (Cherry picked from commit c66c548eabf06835cb0cb906598fb87c7bb30cf4) + Reviewed-by: Kenneth Graunke + +commit 255d8c3c36a9d52b3acc5e016efa0ef0f2371f79 +Author: Kenneth Graunke +Date: Thu Nov 21 23:03:50 2019 -0800 + + modesetting: Use EGL_MESA_query_driver to select DRI driver if possible + + We now ask Glamor to use EGL_MESA_query_driver to obtain the DRI driver + name; if successful, we use that as the DRI driver name. Following the + existing dri2.c logic, we also use the same name for the VDPAU driver, + except for i965 (and now iris), where we switch to the "va_gl" fallback. + + This allows us to bypass the PCI ID lists in xserver and centralize the + driver selection mechanism inside Mesa. The hope is that we no longer + have to update these lists for any future hardware. + + (backported from commit 8d4be7f6c4f7c673d7ec1a6bfdef944907a3916e) + + Acked-by: Michel Dänzer + +commit 2a1a96d956f4023796737d26a32354e940c8e6cf +Author: Kenneth Graunke +Date: Thu Nov 21 23:01:28 2019 -0800 + + glamor: Add a function to get the driver name via EGL_MESA_query_driver + + This maps to eglGetDisplayDriverName if EGL_MESA_query_render is + supported, otherwise it returns NULL. + + (cherry picked from commit 195c2ef8f9f07b9bdabc0f554a9033b7857b99c7) + commit 6b3fafa9bfa94b9b04a1a44dc52afb7c4bc250ce Author: Matt Turner Date: Fri Nov 22 17:52:04 2019 -0500 diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index 65d5870f6..d30f51f3c 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client) ¶m, XI2, &mask); break; case XIGrabtypeKeycode: - status = GrabKey(client, dev, mod_dev, stuff->detail, - ¶m, XI2, &mask); + /* XI2 allows 32-bit keycodes but thanks to XKB we can never + * implement this. Just return an error for all keycodes that + * cannot work anyway */ + if (stuff->detail > 255) + status = XIAlreadyGrabbed; + else + status = GrabKey(client, dev, mod_dev, stuff->detail, + ¶m, XI2, &mask); break; case XIGrabtypeEnter: case XIGrabtypeFocusIn: diff --git a/xserver/aclocal.m4 b/xserver/aclocal.m4 index 8d238a646..fa54ecdac 100644 --- a/xserver/aclocal.m4 +++ b/xserver/aclocal.m4 @@ -1345,7 +1345,7 @@ m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) dnl fontutil.m4. Generated from fontutil.m4.in by configure. dnl -dnl This file comes from X.Org's font-util 1.3.1 +dnl This file comes from X.Org's font-util 1.3.2 dnl dnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. dnl @@ -1410,7 +1410,7 @@ dnl from the copyright holders. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_FONT_MACROS_VERSION],[ -m4_define([vers_have], [1.3.1]) +m4_define([vers_have], [1.3.2]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, diff --git a/xserver/configure b/xserver/configure index 588c7a670..5c1814afe 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.20.6. +# Generated by GNU Autoconf 2.69 for xorg-server 1.20.7. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.20.6' -PACKAGE_STRING='xorg-server 1.20.6' +PACKAGE_VERSION='1.20.7' +PACKAGE_STRING='xorg-server 1.20.7' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/xserver/issues' PACKAGE_URL='' @@ -2045,7 +2045,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.20.6 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.20.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2115,7 +2115,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.20.6:";; + short | recursive ) echo "Configuration of xorg-server 1.20.7:";; esac cat <<\_ACEOF @@ -2310,10 +2310,10 @@ Optional Packages: org.x) --with-bundle-version=VERSION Version to use for X11.app's CFBundleVersion - (default: 1.20.6) + (default: 1.20.7) --with-bundle-version-string=VERSION Version to use for X11.app's - CFBundleShortVersionString (default: 1.20.6) + CFBundleShortVersionString (default: 1.20.7) --with-sparkle-feed-url=URL URL for the Sparkle feed (default: https://www.xquartz.org/releases/sparkle/release.xml) @@ -2568,7 +2568,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.20.6 +xorg-server configure 1.20.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3277,7 +3277,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.20.6, which was +It was created by xorg-server $as_me 1.20.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3625,8 +3625,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-11-22" -RELEASE_NAME="Enchiladas de Queso" +RELEASE_DATE="2020-01-13" +RELEASE_NAME="Stuffed French Toast" am__api_version='1.12' @@ -4105,7 +4105,7 @@ fi # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.20.6' + VERSION='1.20.7' cat >>confdefs.h <<_ACEOF @@ -23034,7 +23034,7 @@ _ACEOF if test "${with_bundle_version+set}" = set; then : withval=$with_bundle_version; BUNDLE_VERSION="${withval}" else - BUNDLE_VERSION="1.20.6" + BUNDLE_VERSION="1.20.7" fi @@ -29335,6 +29335,17 @@ fi $as_echo "#define GLAMOR_HAS_EGL_QUERY_DMABUF 1" >>confdefs.h +fi + + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"epoxy >= 1.5.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "epoxy >= 1.5.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_DRIVER 1" >>confdefs.h + fi @@ -32950,7 +32961,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.20.6, which was +This file was extended by xorg-server $as_me 1.20.7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33016,7 +33027,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.20.6 +xorg-server config.status 1.20.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/xserver/configure.ac b/xserver/configure.ac index 5259cce79..9cb37eaae 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.20.6, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server) -RELEASE_DATE="2019-11-22" -RELEASE_NAME="Enchiladas de Queso" +AC_INIT([xorg-server], 1.20.7, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server) +RELEASE_DATE="2020-01-13" +RELEASE_NAME="Stuffed French Toast" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -2122,6 +2122,10 @@ if test "x$GLAMOR" = xyes; then [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])], []) + PKG_CHECK_EXISTS(epoxy >= 1.5.4, + [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])], + []) + PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) if test "x$GBM" = xyes; then AC_DEFINE(GLAMOR_HAS_GBM, 1, diff --git a/xserver/glamor/glamor.c b/xserver/glamor/glamor.c index b1c7d9f13..a6cc798f8 100644 --- a/xserver/glamor/glamor.c +++ b/xserver/glamor/glamor.c @@ -624,6 +624,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) epoxy_gl_version() >= 30 || epoxy_has_gl_extension("GL_NV_pack_subimage"); glamor_priv->has_dual_blend = + glamor_priv->glsl_version >= 130 && epoxy_has_gl_extension("GL_ARB_blend_func_extended"); glamor_priv->can_copyplane = (gl_version >= 30); diff --git a/xserver/glamor/glamor.h b/xserver/glamor/glamor.h index 09e9c895c..3f9d265db 100644 --- a/xserver/glamor/glamor.h +++ b/xserver/glamor/glamor.h @@ -395,6 +395,8 @@ extern _X_EXPORT Bool struct gbm_bo *bo, Bool used_modifiers); +extern _X_EXPORT const char *glamor_egl_get_driver_name(ScreenPtr screen); + #endif extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen, diff --git a/xserver/glamor/glamor_egl.c b/xserver/glamor/glamor_egl.c index 366991d2c..b77f676da 100644 --- a/xserver/glamor/glamor_egl.c +++ b/xserver/glamor/glamor_egl.c @@ -688,6 +688,22 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format, #endif } +_X_EXPORT const char * +glamor_egl_get_driver_name(ScreenPtr screen) +{ +#ifdef GLAMOR_HAS_EGL_QUERY_DRIVER + struct glamor_egl_screen_private *glamor_egl; + + glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + + if (epoxy_has_egl_extension(glamor_egl->display, "EGL_MESA_query_driver")) + return eglGetDisplayDriverName(glamor_egl->display); +#endif + + return NULL; +} + + static Bool glamor_egl_destroy_pixmap(PixmapPtr pixmap) { diff --git a/xserver/hw/dmx/dmxinit.c b/xserver/hw/dmx/dmxinit.c index 07154d648..ddb331090 100644 --- a/xserver/hw/dmx/dmxinit.c +++ b/xserver/hw/dmx/dmxinit.c @@ -838,6 +838,15 @@ ddxGiveUp(enum ExitCode error) AbortDDX(error); } +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + /** This function is called in Xserver/os/osinit.c from \a OsInit(). */ void OsVendorInit(void) diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c index abc35dfca..47bd97ade 100644 --- a/xserver/hw/kdrive/ephyr/ephyrinit.c +++ b/xserver/hw/kdrive/ephyr/ephyrinit.c @@ -100,6 +100,15 @@ CloseInput(void) KdCloseInput(); } +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + #ifdef DDXBEFORERESET void ddxBeforeReset(void) diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c index 407f2afcd..d9f23f360 100644 --- a/xserver/hw/vfb/InitOutput.c +++ b/xserver/hw/vfb/InitOutput.c @@ -232,6 +232,15 @@ ddxBeforeReset(void) } #endif +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + void ddxUseMsg(void) { diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index b18d8b4c9..92d75bbc2 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -1463,3 +1463,13 @@ ddxBeforeReset(void) { } #endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ + xf86OSInputThreadInit(); +} +#endif diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h index dd4d5f958..00aa84ae2 100644 --- a/xserver/hw/xfree86/common/xf86Module.h +++ b/xserver/hw/xfree86/common/xf86Module.h @@ -74,7 +74,7 @@ * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(24, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(24, 1) #define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 1) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) diff --git a/xserver/hw/xfree86/drivers/modesetting/dri2.c b/xserver/hw/xfree86/drivers/modesetting/dri2.c index 96eaaaaf7..167814015 100644 --- a/xserver/hw/xfree86/drivers/modesetting/dri2.c +++ b/xserver/hw/xfree86/drivers/modesetting/dri2.c @@ -1033,6 +1033,7 @@ ms_dri2_screen_init(ScreenPtr screen) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); DRI2InfoRec info; + const char *driver_names[2] = { NULL, NULL }; if (!glamor_supports_pixmap_import_export(screen)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -1071,9 +1072,30 @@ ms_dri2_screen_init(ScreenPtr screen) info.DestroyBuffer2 = ms_dri2_destroy_buffer2; info.CopyRegion2 = ms_dri2_copy_region2; - /* These two will be filled in by dri2.c */ - info.numDrivers = 0; - info.driverNames = NULL; + /* Ask Glamor to obtain the DRI driver name via EGL_MESA_query_driver. */ + driver_names[0] = glamor_egl_get_driver_name(screen); + + if (driver_names[0]) { + /* There is no VDPAU driver for Intel, fallback to the generic + * OpenGL/VAAPI va_gl backend to emulate VDPAU. Otherwise, + * guess that the DRI and VDPAU drivers have the same name. + */ + if (strcmp(driver_names[0], "i965") == 0 || + strcmp(driver_names[0], "iris") == 0) { + driver_names[1] = "va_gl"; + } else { + driver_names[1] = driver_names[0]; + } + + info.numDrivers = 2; + info.driverNames = driver_names; + } else { + /* EGL_MESA_query_driver was unavailable; let dri2.c select the + * driver and fill in these fields for us. + */ + info.numDrivers = 0; + info.driverNames = NULL; + } return DRI2ScreenInit(screen, &info); } diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.c b/xserver/hw/xfree86/drivers/modesetting/driver.c index da140095d..361d129eb 100644 --- a/xserver/hw/xfree86/drivers/modesetting/driver.c +++ b/xserver/hw/xfree86/drivers/modesetting/driver.c @@ -1338,7 +1338,6 @@ static Bool CreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); modesettingPtr ms = modesettingPTR(pScrn); PixmapPtr rootPixmap; Bool ret; @@ -1404,10 +1403,14 @@ CreateScreenResources(ScreenPtr pScreen) } } - pScrPriv->rrEnableSharedPixmapFlipping = msEnableSharedPixmapFlipping; - pScrPriv->rrDisableSharedPixmapFlipping = msDisableSharedPixmapFlipping; + if (dixPrivateKeyRegistered(rrPrivKey)) { + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); - pScrPriv->rrStartFlippingPixmapTracking = msStartFlippingPixmapTracking; + pScrPriv->rrEnableSharedPixmapFlipping = msEnableSharedPixmapFlipping; + pScrPriv->rrDisableSharedPixmapFlipping = msDisableSharedPixmapFlipping; + + pScrPriv->rrStartFlippingPixmapTracking = msStartFlippingPixmapTracking; + } return ret; } diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c index 676b855ec..2bc19dcf4 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -39,6 +39,7 @@ #include "dumb_bo.h" #include "xf86str.h" #include "X11/Xatom.h" +#include "mi.h" #include "micmap.h" #include "xf86cmap.h" #include "xf86DDC.h" @@ -757,6 +758,7 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; + ScreenPtr screen = crtc->scrn->pScreen; drmModeModeInfo kmode; int output_count = 0; uint32_t *output_ids = NULL; @@ -767,6 +769,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) return 1; +#ifdef GLAMOR_HAS_GBM + /* Make sure any pending drawing will be visible in a new scanout buffer */ + if (drmmode->glamor) + glamor_finish(screen); +#endif + if (ms->atomic_modeset) { drmModeAtomicReq *req = drmModeAtomicAlloc(); Bool active; @@ -1455,8 +1463,6 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) FreeScratchGC(gc); - glamor_finish(pScreen); - pScreen->canDoBGNoneRoot = TRUE; if (drmmode->fbcon_pixmap) @@ -1793,6 +1799,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) &drmmode_crtc->prime_pixmap); } +static void +drmmode_clear_pixmap(PixmapPtr pixmap) +{ + ScreenPtr screen = pixmap->drawable.pScreen; + GCPtr gc; + + gc = GetScratchGC(pixmap->drawable.depth, screen); + if (gc) { + miClearDrawable(&pixmap->drawable, gc); + FreeScratchGC(gc); + } +} + static void * drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { @@ -3223,6 +3242,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) goto fail; + drmmode_clear_pixmap(ppix); + for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; @@ -3255,13 +3276,19 @@ static void drmmode_validate_leases(ScrnInfoPtr scrn) { ScreenPtr screen = scrn->pScreen; - rrScrPrivPtr scr_priv = rrGetScrPriv(screen); + rrScrPrivPtr scr_priv; modesettingPtr ms = modesettingPTR(scrn); drmmode_ptr drmmode = &ms->drmmode; drmModeLesseeListPtr lessees; RRLeasePtr lease, next; int l; + /* Bail out if RandR wasn't initialized. */ + if (!dixPrivateKeyRegistered(rrPrivKey)) + return; + + scr_priv = rrGetScrPriv(screen); + /* We can't talk to the kernel about leases when VT switched */ if (!scrn->vtSema) return; diff --git a/xserver/hw/xfree86/drivers/modesetting/vblank.c b/xserver/hw/xfree86/drivers/modesetting/vblank.c index 31ff244ad..50d2fd3a4 100644 --- a/xserver/hw/xfree86/drivers/modesetting/vblank.c +++ b/xserver/hw/xfree86/drivers/modesetting/vblank.c @@ -220,7 +220,7 @@ static RRCrtcPtr ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); - rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); + rrScrPrivPtr pScrPriv; RRCrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; @@ -230,6 +230,11 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms) best_crtc = NULL; best_coverage = 0; + if (!dixPrivateKeyRegistered(rrPrivKey)) + return NULL; + + pScrPriv = rrGetScrPriv(pScreen); + if (!pScrPriv) return NULL; diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c index a8f1e615c..05944cfcb 100644 --- a/xserver/hw/xfree86/modes/xf86Rotate.c +++ b/xserver/hw/xfree86/modes/xf86Rotate.c @@ -485,6 +485,9 @@ xf86CrtcRotate(xf86CrtcPtr crtc) if (damage) xf86CrtcDamageShadow(crtc); + else if (crtc->rotatedData && !crtc->rotatedPixmap) + /* Make sure the new rotate buffer has valid transformed contents */ + xf86RotateRedisplay(pScreen); /* All done */ return TRUE; diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index 1b33cef7c..8909a1439 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -779,6 +779,12 @@ xf86UseMsg(void) return; } +void +xf86OSInputThreadInit() +{ + return; +} + #ifdef X_PRIVSEP /* * Revoke privileges after init. diff --git a/xserver/hw/xfree86/os-support/hurd/hurd_init.c b/xserver/hw/xfree86/os-support/hurd/hurd_init.c index fe1a76413..ee8fe92c0 100644 --- a/xserver/hw/xfree86/os-support/hurd/hurd_init.c +++ b/xserver/hw/xfree86/os-support/hurd/hurd_init.c @@ -87,3 +87,9 @@ xf86CloseConsole() close(xf86Info.consoleFd); return; } + +void +xf86OSInputThreadInit() +{ + return; +} diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c index 039dc4a4d..5c0367c6f 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_init.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c @@ -397,3 +397,9 @@ xf86UseMsg(void) 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"); } + +void +xf86OSInputThreadInit() +{ + return; +} diff --git a/xserver/hw/xfree86/os-support/solaris/sun_vid.c b/xserver/hw/xfree86/os-support/solaris/sun_vid.c index 25f76181c..edb0a1172 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_vid.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_vid.c @@ -73,22 +73,24 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) /* I/O Permissions section */ /***************************************************************************/ -#if defined(__i386__) || defined(__i386) || defined(__x86) -static Bool ExtendedEnabled = FALSE; -#endif +void +xf86OSInputThreadInit() +{ + /* + * Need to enable in input thread as well, as Solaris kernel tracks + * IOPL per-thread and doesn't inherit when creating a new thread. + */ + xf86EnableIO(); +} Bool xf86EnableIO(void) { #if defined(__i386__) || defined(__i386) || defined(__x86) - if (ExtendedEnabled) - return TRUE; - if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) { xf86Msg(X_WARNING, "xf86EnableIOPorts: Failed to set IOPL for I/O\n"); return FALSE; } - ExtendedEnabled = TRUE; #endif /* i386 */ return TRUE; } @@ -97,11 +99,6 @@ void xf86DisableIO(void) { #if defined(__i386__) || defined(__i386) || defined(__x86) - if (!ExtendedEnabled) - return; - sysi86(SI86V86, V86SC_IOPL, 0); - - ExtendedEnabled = FALSE; #endif /* i386 */ } diff --git a/xserver/hw/xfree86/os-support/xf86_OSproc.h b/xserver/hw/xfree86/os-support/xf86_OSproc.h index fd8d4bdeb..49e91d586 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSproc.h +++ b/xserver/hw/xfree86/os-support/xf86_OSproc.h @@ -136,6 +136,7 @@ extern _X_EXPORT int xf86GetSerialModemState(int fd); extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits); extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits); extern _X_EXPORT int xf86LoadKernelModule(const char *pathname); +extern _X_EXPORT void xf86OSInputThreadInit(void); /* AGP GART interface */ diff --git a/xserver/hw/xnest/Init.c b/xserver/hw/xnest/Init.c index b45685216..c3afadf8c 100644 --- a/xserver/hw/xnest/Init.c +++ b/xserver/hw/xnest/Init.c @@ -169,3 +169,12 @@ ddxBeforeReset(void) return; } #endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif diff --git a/xserver/hw/xwayland/xwayland-present.c b/xserver/hw/xwayland/xwayland-present.c index 2937d9c97..31c276623 100644 --- a/xserver/hw/xwayland/xwayland-present.c +++ b/xserver/hw/xwayland/xwayland-present.c @@ -24,6 +24,7 @@ */ #include "xwayland.h" +#include "glamor.h" #include @@ -412,9 +413,7 @@ xwl_present_abort_vblank(WindowPtr present_window, 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. - */ + glamor_block_handler(window->drawable.pScreen); } static Bool diff --git a/xserver/hw/xwayland/xwayland.c b/xserver/hw/xwayland/xwayland.c index baa08d87b..324c68ccf 100644 --- a/xserver/hw/xwayland/xwayland.c +++ b/xserver/hw/xwayland/xwayland.c @@ -72,6 +72,15 @@ ddxBeforeReset(void) { return; } +#endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} #endif _X_NORETURN diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c index 9560c5684..1c6fa9fd9 100644 --- a/xserver/hw/xwin/InitOutput.c +++ b/xserver/hw/xwin/InitOutput.c @@ -151,6 +151,15 @@ ddxBeforeReset(void) } #endif +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + int main(int argc, char *argv[], char *envp[]) { diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index 27c2764d6..c9cca7cc1 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -494,6 +494,9 @@ /* Glamor can use eglQueryDmaBuf* functions */ #undef GLAMOR_HAS_EGL_QUERY_DMABUF +/* Glamor can use EGL_MESA_query_driver functions */ +#undef GLAMOR_HAS_EGL_QUERY_DRIVER + /* byte order */ #undef X_BYTE_ORDER diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index 920230709..ce348ec41 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -120,6 +120,9 @@ /* Have GLAMOR_HAS_EGL_QUERY_DMABUF */ #undef GLAMOR_HAS_EGL_QUERY_DMABUF +/* Have GLAMOR_HAS_EGL_QUERY_DRIVER */ +#undef GLAMOR_HAS_EGL_QUERY_DRIVER + /* Build glamor with GBM-based EGL support */ #undef GLAMOR_HAS_GBM diff --git a/xserver/include/os.h b/xserver/include/os.h index d15bfb4f9..0cf9b9fa8 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -563,6 +563,8 @@ extern _X_EXPORT void AbortDDX(enum ExitCode error); extern _X_EXPORT void ddxGiveUp(enum ExitCode error); +extern _X_EXPORT void +ddxInputThreadInit(void); extern _X_EXPORT int TimeSinceLastInputEvent(void); diff --git a/xserver/os/inputthread.c b/xserver/os/inputthread.c index 97e59d21f..e6694afda 100644 --- a/xserver/os/inputthread.c +++ b/xserver/os/inputthread.c @@ -318,6 +318,8 @@ InputThreadDoWork(void *arg) sigfillset(&set); pthread_sigmask(SIG_BLOCK, &set, NULL); + ddxInputThreadInit(); + inputThreadInfo->running = TRUE; #if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) diff --git a/xserver/os/ospoll.c b/xserver/os/ospoll.c index db9e73811..c68aabc87 100644 --- a/xserver/os/ospoll.c +++ b/xserver/os/ospoll.c @@ -40,6 +40,7 @@ #if !HAVE_OSPOLL && defined(HAVE_PORT_CREATE) #include +#include #define PORT 1 #define HAVE_OSPOLL 1 #endif @@ -78,7 +79,6 @@ struct ospoll { #endif #if EPOLL || PORT -#include /* epoll-based implementation */ struct ospollfd { @@ -468,10 +468,10 @@ epoll_mod(struct ospoll *ospoll, struct ospollfd *osfd) { int events = 0; if (osfd->xevents & X_NOTIFY_READ) - events |= EPOLLIN; + events |= POLLIN; if (osfd->xevents & X_NOTIFY_WRITE) - events |= EPOLLOUT; - port_associate(ospool->epoll_fd, PORT_SOURCE_FD, osfd->fd, events, osfd); + events |= POLLOUT; + port_associate(ospoll->epoll_fd, PORT_SOURCE_FD, osfd->fd, events, osfd); } #endif @@ -601,9 +601,14 @@ ospoll_wait(struct ospoll *ospoll, int timeout) #define MAX_EVENTS 256 port_event_t events[MAX_EVENTS]; uint_t nget = 1; + timespec_t port_timeout = { + .tv_sec = timeout / 1000, + .tv_nsec = (timeout % 1000) * 1000000 + }; nready = 0; - if (port_getn(ospoll->epoll_fd, events, MAX_EVENTS, &nget, &timeout) == 0) { + if (port_getn(ospoll->epoll_fd, events, MAX_EVENTS, &nget, &port_timeout) + == 0) { nready = nget; } for (int i = 0; i < nready; i++) { @@ -612,17 +617,18 @@ ospoll_wait(struct ospoll *ospoll, int timeout) uint32_t revents = ev->portev_events; int xevents = 0; - if (revents & EPOLLIN) + if (revents & POLLIN) xevents |= X_NOTIFY_READ; - if (revents & EPOLLOUT) + if (revents & POLLOUT) xevents |= X_NOTIFY_WRITE; - if (revents & (~(EPOLLIN|EPOLLOUT))) + if (revents & (~(POLLIN|POLLOUT))) xevents |= X_NOTIFY_ERROR; if (osfd->callback) osfd->callback(osfd->fd, xevents, osfd->data); - if (osfd->trigger == ospoll_trigger_level && !osfd->deleted) { + if (osfd->trigger == ospoll_trigger_level && + !xorg_list_is_empty(&osfd->deleted)) { epoll_mod(ospoll, osfd); } }