diff -Nru xorg-server-hwe-16.04-1.18.4/aclocal.m4 xorg-server-hwe-16.04-1.19.3/aclocal.m4 --- xorg-server-hwe-16.04-1.18.4/aclocal.m4 2016-07-19 17:27:24.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/aclocal.m4 2017-03-15 18:05:38.000000000 +0000 @@ -411,7 +411,7 @@ AC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) +dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -453,7 +453,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) +[m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -688,7 +688,7 @@ dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), @@ -725,7 +725,7 @@ # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.19.0]) +m4_define([vers_have], [1.19.1]) 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,, @@ -818,8 +818,9 @@ if test x$FILE_MAN_SUFFIX = x ; then case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[[01]]) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -828,8 +829,9 @@ if test x$MISC_MAN_SUFFIX = x ; then case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[[01]]) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -838,8 +840,9 @@ if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[[01]]) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -848,8 +851,9 @@ if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[[01]]) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -1110,13 +1114,24 @@ fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], - [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], + [have_xmlto_text=yes], + [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) @@ -3904,6 +3919,7 @@ ]) # _AM_PROG_TAR m4_include([m4/ac_define_dir.m4]) +m4_include([m4/ax_pthread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff -Nru xorg-server-hwe-16.04-1.18.4/ChangeLog xorg-server-hwe-16.04-1.19.3/ChangeLog --- xorg-server-hwe-16.04-1.18.4/ChangeLog 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/ChangeLog 2017-03-15 18:06:10.000000000 +0000 @@ -1,3 +1,12459 @@ +commit d88937ba8354d6a4e0be2a398037443146701ddc +Author: Adam Jackson +Date: Wed Mar 15 13:44:05 2017 -0400 + + xserver 1.19.3 + + Signed-off-by: Adam Jackson + +commit b258ed457d8f22cfba8a45b35a9be9b53fd37e1e +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 + (cherry picked from commit acdb5bf2de57c0080d2a6e730c788a0a428e13dc) + +commit 7c4fab2f1f411b6f7d7adc76271fca7c29365ac4 +Author: Tobias Stoeckmann +Date: Mon Mar 13 19:13:14 2017 +0100 + + render: Fix out of boundary heap access + + ProcRenderCreateRadialGradient and ProcRenderCreateConicalGradient must + be protected against an integer overflow during length check. This is + already included in ProcRenderCreateLinearGradient since the fix for + CVE-2008-2362. + + This can only be successfully exploited on a 32 bit system for an + 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 + + 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 + + [1.19: Squash in Michel's typo fix from 0c1574d9] + + Tested-by: Stefan Dirsch + Reviewed-by: Adam Jackson + (cherry picked from commit d8161aeb50891ae10c5656487ce8f982deed5f9f) + (cherry picked from commit 0c1574d9882a91b2c1a046bf4ac5a9b138a37965) + +commit 18fcb66688057f5676952e2535d4bb9942371199 +Author: Olivier Fourdan +Date: Thu Mar 2 10:19:26 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. + + 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 +Author: Olivier Fourdan +Date: Tue Mar 7 10:28:35 2017 +0100 + + xwayland: clear cursor frame callback + + After an X cursor is unrealized, the seat's corresponding x_cursor is + cleared, but if a frame callback was pending at the time, it will + remain and thus prevent any further cursor update, leaving the window + with no cursor. + + Make sure to destroy the frame callback, if any, when that occurs, so + that next time a cursor needs to be set, it won't be ignored for a frame + callback that will never be triggered. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389327 + 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 + + 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. + + [1.19: Also fix DMX_LIBS= in configure.ac so it still links - ajax] + + 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 + Reviewed-by: Adam Jackson + +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 +Author: Adam Jackson +Date: Thu Mar 2 17:20:30 2017 -0500 + + os: Squash missing declaration warning for timingsafe_memcmp + + timingsafe_memcmp.c:21:1: warning: no previous prototype for ‘timingsafe_memcmp’ [-Wmissing-prototypes] + timingsafe_memcmp(const void *b1, const void *b2, size_t len) + + Signed-off-by: Adam Jackson + (cherry picked from commit 5c44169caed811e59a65ba346de1cadb46d266ec) + +commit 1aa40b96e2f099eabfeef66e77fff36dbd377aa0 +Author: Adam Jackson +Date: Thu Mar 2 15:43:15 2017 -0500 + + Revert "xserver 1.19.2" + + Apparently I need to fight make distcheck some more, so let's not + pretend this is released yet. + + This reverts commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211. + +commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211 +Author: Adam Jackson +Date: Thu Mar 2 15:07:00 2017 -0500 + + xserver 1.19.2 + + Signed-off-by: Adam Jackson + +commit e4dd73b242522942d9a5f1c9cada92321710a682 +Author: Olivier Fourdan +Date: Wed Mar 1 08:51:31 2017 +0100 + + xwayland: do not set checkRepeat on master kbd + + keyboard_check_repeat() fetches the XWayland seat from the + dev->public.devicePrivate do do its thing. + + If a key event is sent programmatically through Xtest, our device is the + virtual core keyboard and that has a dev->public.devicePrivate of NULL, + leading to a segfault in keyboard_check_repeat(). + + This is the case with "antimicro" which sends key events based on the + joystick buttons. + + Don't set the checkRepeat handler on the VCK since it cannot possibly work + anyway and it has no effect on the actual checkRepeat intended functionality. + + Bugzilla: https://bugzilla.redhat.com/1416244 + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit fe5c340046c8cf755b92763a49b2dc475e856a76) + +commit c84f5c3dd19ae114da4eb3441b3e4e3a29f195df +Author: Olivier Fourdan +Date: Tue Feb 28 14:27:52 2017 +0100 + + xwayland: Make sure we have a focus window + + During the InitInput() phase, the wayland events get dequeued so we + can possibly end up calling dispatch_pointer_motion_event(). + + If this occurs before xwl_seat->focus_window is set, it leads to a NULL + pointer derefence and a segfault. + + Check for xwl_seat->focus_window in both pointer_handle_frame() and + relative_pointer_handle_relative_motion() prior to calling + dispatch_pointer_motion_event() like it's done in + pointer_handle_motion(). + + Bugzilla: https://bugzilla.redhat.com/1410804 + 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 + + 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 + (cherry picked from commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e) + +commit b0298c02f0383760be899448fa666d0ea56f5d79 +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:56 2017 +0100 + + auth: remove AuthToIDFunc and associated functions. Not used anymore. + + And the current code for MitToId has a use-after-free() issue. + + [Also remove the actual implementations - ajax] + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + (cherry picked from commit 2855f759b1e7bf7f5e57cac36c1f0d0e5ac1a683) + +commit ab15f65fe5d6d50e705c1064a6a5c1a0c2a8e045 +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:43 2017 +0100 + + Use arc4random_buf(3) if available to generate cookies. + + Reviewed-by: Adam Jackson + Signed-off-by: Matthieu Herrb + (cherry picked from commit 957e8db38f27932d353e86e9aa69cf16778b18f1) + +commit 3f61c7a09b220805ee6778f4bf2f429e3df8e37a +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:25 2017 +0100 + + Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624 + + Provide the function definition for systems that don't have it. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + (cherry picked from commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c) + +commit b5c98aa6779b97882246b03c5dea646bd1355991 +Author: Peter Hutterer +Date: Thu Feb 23 10:21:49 2017 +1000 + + os: log a bug whenever WriteToClient is called from the input thread + + The input thread should generate events, not send them. Make it easier to + find the instances where it's doing so. + + 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 + + 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 + (cherry picked from commit 38696ea56854e055c31bd2730adfc7c39aa115b0) + +commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9 +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 + (cherry picked from commit 542d9f6807ac06b70f564ccab10af69fa21a1221) + +commit 10f8cf3572297764c6b50ac1f01b3ee195b1a453 +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. + + [1.19: Squashed in a6566f9e to avoid intermediate regression - ajax] + + Reviewed-by: Alex Deucher + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + (cherry picked from commit b5b292896f647c85f03f53b20b2f03c0e94de428) + (cherry picked from commit a6566f9e4dbf9ea9568a14e22cb5d004e10dbd4d) + +commit e2243e5b805df387cb3881b2298bffaac4f02942 +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 + (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) + +commit fd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df +Author: Olivier Fourdan +Date: Wed Feb 8 09:23:20 2017 +0100 + + xwayland: Apply output rotation for screen size + + Previously, we would swap the width/height of the Xwayland output based + on the output rotation, so that the overall screen size would match the + actual rotation of each output. + + Problem is the RandR's ConstrainCursorHarder() handler will also apply + the output rotation, meaning that when the output is rotated, the + pointer will be constrained within the wrong dimension. + + Moreover, XRandR assumes the original output width/height are unchanged + when the output is rotated, so by changing the Xwayland output width and + height based on rotation, Xwayland causes XRandr to report the wrong + output sizes (an output of size 1024x768 rotated left or right should + remain 1024x768, not 768x1024). + + So to avoid this issue and keep things consistent between Wayland and + Xwayland outputs, leave the actual width/height unchanged but apply the + rotation when computing the screen size. This fixes both the output size + being wrong in "xrandr -q" and the pointer being constrained in the + wrong dimension with rotated with weston. + + 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 +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 +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 +Author: Chris Wilson +Date: Mon Jan 16 22:17:36 2017 +0000 + + xfree86: Take the input lock for xf86RecolorCursor + + xf86RecolorCursor() may be called directly from XRecolorCursor as well + as from xf86ScreenSetCursor(). In the latter case, the input lock is + already held, but not for the former and so we need to add a wrapper + function that acquires the input lock before performing + 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 + + xserver 1.19.1 + + Signed-off-by: Adam Jackson + +commit 82dcb68a8782d0cce6e6ce1a375cda05c91fe8c3 +Author: Keith Packard +Date: Mon Jan 9 18:10:21 2017 -0800 + + AttendClient of grab-pervious client must queue to saved_ready_clients [v2] + + A client which is attended while a grab is blocking execution of its + requests needs to be placed in the saved_ready_clients list so that it + will get scheduled once the grab terminates. Otherwise, if the client + never sends another request, there is no way for it to be placed in + the ready_clients list. + + v2: Wrap comment above mark_client_saved_ready. + Remove test for OS_COMM_IGNORED which will always be true. + + 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 +Author: Qiang Yu +Date: Tue Jan 10 18:51:55 2017 +0800 + + randr: fix xserver crash when xrandr setprovideroutputsource + + xrandr --setprovideroutputsource + Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU: + Assertion `new->isGPU' failed. + + GPUScreen is not allowed to be sink output. + + Signed-off-by: Qiang Yu + Reviewed-by: Hans de Goede + Signed-off-by: Peter Hutterer + (cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6) + +commit 3381e2c26b2ac40b1dd909439bf72559b80d0d86 +Author: Qiang Yu +Date: Tue Jan 10 18:51:54 2017 +0800 + + xfree86: fix wrong usage of xf86optionListMerge + + Signed-off-by: Qiang Yu + Reviewed-by: Hans de Goede + Signed-off-by: Peter Hutterer + (cherry picked from commit 1012510620de7dadd0ab18b19a8e11facd884601) + +commit 27a2772cf3a1bcd656efdf653a7504597911dbc4 +Author: Michel Dänzer +Date: Fri Nov 25 17:34:05 2016 +0900 + + present: Only call present_flip_notify if vblank->queued == FALSE + + We are no longer using the present_flip_queue list only for presents + which have already been submitted to the driver for page flipping, but + also for those which we are queueing up to be flipped later, marked + with vblank->queued == TRUE. We were incorrectly calling + present_flip_notify for such entries, failing the assertion in + present_flip_notify (or presumably resulting in other undesirable + behaviour with assertions disabled). + + Reproduction recipe: Run the JavaFX test case referenced by + https://bugs.freedesktop.org/show_bug.cgi?id=98831#c6 and alt-tab out + of it while it's fullscreen. May take a few attempts to hit the + assertion failure. + + 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 +Author: Kai-Heng Feng +Date: Thu Dec 15 13:56:38 2016 +0800 + + edid: Add quirk for ADA 1024x600 7" display. + + Detailed mode reports 108 mm x 68 mm which is for smaller display. + Maximum image size reports 15 cm x 10 cm which aligns with its physical + size, use this size instead. + + Signed-off-by: Kai-Heng Feng + Acked-by: Alex Deucher + (cherry picked from commit 9874f73e88678c9eacbcba05e52336fc63a32712) + +commit cb3057da2254f9b6434a9c40486c72865cd1ab5e +Author: Peter Hutterer +Date: Thu Dec 8 14:32:06 2016 +1000 + + os: return 0 from check_timers if we touched any of them + + Fixes a regression introduced in 0b2f30834b1a9f. If a driver posts input + events during a timer function (wacom and synaptics do this during tap + timeouts), ProcessInputEvents() is not called for these events. There are no + new events on any fds, so the events just sit in the queue waiting for + something else to happen. + + Fix this by simply returning 0 from check_timers if we ran at least one of + them or reset them all. This way the callers ospoll_wait will exit and + continue with normal processing. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit db03742cd33d6d54834bb138886a4f84bc452a85 +Author: Michal Srb +Date: Mon Dec 12 17:45:22 2016 +0200 + + xinerama: Swap the response in RRXineramaWriteMonitor + + Reviewed-by: Adam Jackson + +commit 862c1c43c10eda955db1440cc72ff0387e24a35f +Author: Hans De Goede +Date: Tue Dec 20 13:00:43 2016 +0100 + + glamor: Trust eglGetPlatformDisplayEXT if it exists + + If the libEGL we are using has eglGetPlatformDisplayEXT, yet it still + returns NULL, then this very likely means that it does not support the + type (e.g. EGL_PLATFORM_GBM_MESA) passed in, and then returning NULL is + the right thing to do. + + This avoids falling back to an eglGetDisplay() implementation which does + not understands the passed in gbm handle, treats it as a pointer to + something else completely, followed by a crash sooner or later. + + Specifically this fixes using the nvidia binary driver, with nvidia's + 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 +Author: Mihail Konev +Date: Thu Dec 29 12:37:18 2016 +0500 + + os,dix: Depend custom libs on libs, not objects + + The custom os/os.O library reuses *.o files of os/libos.la. + + The current rule assumes automake puts all the objects into per-target + am__*_la_OBJECTS variable. At least with AC_REPLACE_FUNCS, this no + longer holds (as wanted objects are put into LTLIBOBJS instead). + + Depend on automake's result, the *.la library instead, to express demand + of any its dependencies being built. + + Should be fixing randomly occuring "undefined reference to `strlcpy'" + errors when linking Xvfb and other DDX-es that could use os.O. + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + (cherry picked from commit 5b74e260e009d8bdf26433724495802b85cce7c3) + +commit 8cf47472bff1d5ca3de6ff83a80f0d2820c3fb93 +Author: Ben Crocker +Date: Tue Nov 15 16:34:38 2016 -0500 + + Fix a segfault that occurs if xorg.conf.d is absent: + + In InitOutput, if xf86HandleConfigFile returns CONFIG_NOFILE + (which it does if no config file or directory is present), the + autoconfig flag is set, causing xf86AutoConfig to be called + later on. + + xf86AutoConfig calls xf86OutputClassDriverList via the + call tree: + + xf86AutoConfig => + listPossibleVideoDrivers => + xf86PlatformMatchDriver => + xf86OutputClassDriverList + + and xf86OutputClassDriverList attempts to traverse a linked list + that is a member of the XF86ConfigRec struct pointed to by the + global xf86configptr, which is NULL at this point because the + XF86ConfigRec struct is only allocated (by xf86readConfigFile) + AFTER the config file and directory have been successfully + opened; the CONFIG_NOFILE return from xf86HandleConfigFile + occurs BEFORE the call to xf86readConfigFile which allocates + the XF86ConfigRec struct. + + Rx: In read.c (for symmetry with xf86freeConfig, which already + appears in this file), add a new function xf86allocateConfig + which tests the value of xf86configptr and, if it's NULL, + allocates the XF86ConfigRec struct and deposits the pointer + in xf86configptr. In xf86Parser.h, add a prototype for the + new xf86allocateConfig function. + + Back in read.c, #include "xf86Config.h". In xf86readConfigFile, + change the open-code call to calloc to a call to the new + xf86allocateConfig function. + + In xf86AutoConfig.c, add a call to the new xf86allocateConfig function + to the beginning of xf86AutoConfig to make sure the XF86ConfigRec struct + is allocated. + + Reviewed-by: Adam Jackson + Signed-off-by: Ben Crocker + (cherry picked from commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5) + +commit 06a3e7ef3bf9a907f1fba84a3601870a5697f657 +Author: Pekka Paalanen +Date: Wed Dec 7 15:43:06 2016 +0200 + + test: fix distributing scripts + + Fix the following error on 'make distcheck': + + make[6]: *** No rule to make target 'scripts/xvfb-piglit.sh', needed by 'scripts/xvfb-piglit.sh.log'. Stop. + make[6]: Leaving directory '/home/pq/git/xserver/xorg-server-1.19.99.1/_build/sub/test' + Makefile:1367: recipe for target 'check-TESTS' failed + + The setup to trigger this is: + $ ./configure --prefix=/home/pq/local --disable-docs + --disable-devel-docs --enable-xwayland --disable-xorg --disable-xvfb + --disable-xnest --disable-xquartz --disable-xwin --enable-debug + + SCRIPT_TESTS is populated conditionally, but we should distribute the + scripts in any case. + + Reviewed-by: Adam Jackson + Signed-off-by: Pekka Paalanen + (cherry picked from commit b365c5d16894a259dbf29db4ca2640d8ed768063) + +commit 543287e60af5e9d91b5fc7e4a42e51eafa63db21 +Author: Adam Jackson +Date: Tue Dec 6 14:11:11 2016 -0500 + + composite: Fix repaint of borders (v2) + + When going from border width zero to a non-zero border width, the + Composite extension is informed via the ConfigNotify callback. The + call-chain looks like this: compConfigNotify -> compReallocPixmap -> + compSetPixmap -> TraverseTree -> compSetPixmapVisitWindow. However, at + this time, pWindow->borderWidth was not yet updated. Thus, HasBorder() + is false and the window border will not be repainted. + + To fix this, thread the new bw through to the window visitor, and + inspect that rather than HasBorder(). For the other callers of + compSetPixmap the border does not change size, so we can pass + pWin->borderWidth instead. + + 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 +Author: Hans de Goede +Date: Tue Nov 22 14:53:20 2016 +0100 + + randr: rrCheckPixmapBounding: do not shrink the screen_pixmap + + The purpose of rrCheckPixmapBounding is to make sure that the + screen_pixmap is *large* enough for the slave-output which crtc is + being configured. + + However until now rrCheckPixmapBounding would also shrink the + screen_pixmap in certain scenarios leading to various problems. + + For example: Take a laptop with its internalscreen on a slave-output and + currently disabled and an external monitor at 1920x1080+0+0. + Now lets say that we want to drive the external monitor at its native + resolution of 2560x1440 and have the internal screen mirror the top left + part of the external monitor, so we run: + + $ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \ + --mode 2560x1440 --pos 0x0 + + Here xrandr utility first calls RRSetScreenSize to 2560x1440, then it + calls RRSetCrtc 1920x1080+0+0 on the eDP, since this is a slave output, + rrCheckPixmapBounding gets called and resizes the screen_pixmap to + 1920x1080, undoing the RRSetScreenSize. Then RRSetCrtc 2560x1440+0+0 + gets called on the HDMI, depending on crtc->transforms this will + either result in a BadValue error from ProcRRSetCrtcConfig; or + it will succeed, but the monitor ends up running at 2560x1440 + while showing a 1920x1080 screen_pixmap + black borders on the right + and bottom. Neither of which is what we want. + + This commit removes the troublesome shrinking behavior, fixing this. + + Note: + + 1) One could argue that this will leave us with a too large screen_pixmap + in some cases, but rrCheckPixmapBounding only gets called for slave + outputs, so xrandr clients already must manually shrink the screen_pixmap + after disabling crtcs in normal setups. + + 2) An alternative approach would be to also call rrCheckPixmapBounding + on RRSetCrtc on normal (non-slave) outputs, but that would result in + 2 unnecessary resizes of the screen_pixmap in the above example, which + seems undesirable. + + Cc: Nikhil Mahale + Cc: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + (cherry picked from commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c) + +commit 26132f57ee6fae9376955e7990ac2fbad5b49fac +Author: Hans de Goede +Date: Tue Nov 22 14:48:14 2016 +0100 + + randr: rrCheckPixmapBounding: Do not substract crtc non 0 x,y from screen size + + The purpose of rrCheckPixmapBounding is to make sure that the + screen_pixmap is large enough for the slave-output which crtc is + being configured. + + This should include crtc->x and crtc->y, otherwise the crtc might + still end up scanning out an area outside of the screen-pixmap. + + For example: Take a laptop with an external monitor on a slave-output at + 1920x1080+0+0 and its internal-screen at 3840x2160+1920+0 and in + gnome-settings-daemon move the external monitor to be on the ri ght of + the internal screen rather then on the left. First g-s-d will do a + RRSetScreenSize to 5760*2160 (which is a nop), then it calls RRSetCrtc + to move the slave output to 1920x1080+3840+0, since this is a slave + output, rrCheckPixmapBounding gets called, since the 2 crtcs now overlap + the code before this commit would shrinks the screen_pixmap to 3180*2160. + Then g-s-d calls RRSetCrtc to move the internal screen to 3180*2160+0+0. + + And we end up with the slave-output configured to scan-out an area + which completely falls outside of the screen-pixmap (and end up with + a black display on the external monitor). + + This commit fixes this by not substracting the x1 and y1 coordinates + of the union-ed region when determining the new screen_pixmap size. + + Cc: Nikhil Mahale + Cc: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + (cherry picked from commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1) + +commit 6c51845e6b0f313a90e4375f2821f1da9cc53014 +Author: Olivier Fourdan +Date: Wed Nov 30 09:42:43 2016 +0100 + + xwayland: Fix use after free of cursors + + Sometimes, Xwayland will try to use a cursor that has just been freed, + leading to a crash when trying to access that cursor data either in + miPointerUpdateSprite() or AnimCurTimerNotify(). + + CheckMotion() updates the pointer's cursor based on which xwindow + XYToWindow() returns, and Xwayland implements its own xwl_xy_to_window() + to fake a crossing to the root window when the pointer has left the + Wayland surface but is still within the xwindow. + + But after an xwindow is unrealized, the last xwindow used to match the + xwindows is cleared so two consecutive calls to xwl_xy_to_window() may + not return the same xwindow. + + To avoid this issue, update the last_xwindow based on enter and leave + notifications instead of xwl_xy_to_window(), and check if the xwindow + found by the regular miXYToWindow() is a child of the known last + xwindow, so that multiple consecutive calls to xwl_xy_to_window() + return the same xwindow, being either the one found by miXYToWindow() + or the root window. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1385258 + Signed-off-by: Olivier Fourdan + Tested-by: Vít Ondruch + Tested-by: Satish Balay + Reviewed-by: Jonas Ådahl + (cherry picked from commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b) + +commit b711efb05714bf3d0a102c717a05cde4fefdae3f +Author: Olivier Fourdan +Date: Thu Nov 3 09:59:30 2016 +0100 + + glamor: restore vfunc handlers on init failure + + In glamor_init(), if the minimum requirements are not met, glamor may + fail after setting up its own CloseScreen() and DestroyPixmap() + routines, leading to a crash when either of the two routines is called + if glamor failed to complete its initialization, e.g: + + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler+0x29) + (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) + (EE) 2: Xwayland (glamor_sync_close+0x2a) + (EE) 3: Xwayland (glamor_close_screen+0x52) + (EE) 4: Xwayland (CursorCloseScreen+0x88) + (EE) 5: Xwayland (AnimCurCloseScreen+0xa4) + (EE) 6: Xwayland (present_close_screen+0x42) + (EE) 7: Xwayland (dix_main+0x4f9) + (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf1) + (EE) 9: Xwayland (_start+0x2a) + + Restore the previous CloseScreen() and DestroyPixmap() vfunc handlers in + case of failure when checking for the minimum requirements, so that if + any of the requirement is not met we don't leave the CloseScreen() and + DestroyPixmap() from glamor handlers in place. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1390018 + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + Reviewed-by: Eric Anholt + (cherry picked from commit f43207c1c4a8487600cf3ea116c10437417c861b) + +commit 201ff45c2d7e6c7d73fd29d28871bb8b944074be +Author: Peter Hutterer +Date: Fri Nov 11 15:28:50 2016 +1000 + + Xi: when creating a new master device, update barries for all clients + + The previous code only worked when the barrier was created by the same client + as the one calling XIChangeDeviceHierarchy. + + http://bugzilla.redhat.com/show_bug.cgi?id=1384432 + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + (cherry picked from commit d6a6e1d6abb110ff00ad31b94cd29d92ca7c71a5) + +commit 738c17b7ef4c70ad00c7bc01cf64edb770dda840 +Author: Rui Matos +Date: Thu Nov 24 19:56:18 2016 +0100 + + xwayland: Don't send KeyRelease events on wl_keyboard::leave + + Commits 816015648ffe660ddaa0f7d4d192e555b723c372 and + fee0827a9a695600765f3d04376fc9babe497401 made it so that + wl_keyboard::enter doesn't result in X clients getting KeyPress events + while still updating our internal xkb state to be in sync with the + host compositor. + + wl_keyboard::leave needs to be handled in the same way as its + semantics from an X client POV should be the same as an X grab getting + triggered, i.e. X clients shouldn't get KeyRelease events for keys + that are still down at that point. + + This patch uses LeaveNotify for these events on wl_keyboard::leave and + changes the current use of KeymapNotify to EnterNotify instead just to + keep some symmetry between both cases. + + On ProcessDeviceEvent() we still need to deactivate X grabs if needed + for KeyReleases. + + Signed-off-by: Rui Matos + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 5611585b87ce48428a66f98ece319a083f55d205) + +commit cd8f43e1b06aee8500548a94e3743cf153591683 +Author: Rhys Kidd +Date: Fri Oct 28 22:44:30 2016 -0400 + + test: Fix stray Makefile reference to removed os test + + Fixes the following warning: + + test/Makefile.am:69: warning: variable 'os_LDADD' is defined but no program or + test/Makefile.am:69: library has 'os' as canonical name (possible typo) + + Introduced upon the removal of test/os in: + + commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 + Author: Keith Packard + Date: Tue Dec 8 14:39:46 2015 -0800 + + Remove SIGIO support for input [v5] + + This removes all of the SIGIO handling support used for input + throughout the X server, preparing the way for using threads for input + handling instead. + + Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls + to stub functions input_lock/input_unlock so that we don't lose this + information. + + xfree86 SIGIO support is reworked to use internal versions of + OsBlockSIGIO and OsReleaseSIGIO. + + v2: Don't change locking order (Peter Hutterer) + v3: Comment weird && FALSE in xf86Helper.c + Leave errno save/restore in xf86ReadInput + Squash with stub adding patch (Peter Hutterer) + v4: Leave UseSIGIO config parameter so that + existing config files don't break (Peter Hutterer) + v5: Split a couple of independent patch bits out + of kinput.c (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + + 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 + + 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 + (cherry picked from commit 32e632e85894eddc3ace83f16f1e973b1be478fe) + +commit 7e5c9bdf73e4185ac4cf7f044da0793a5cc3e62c +Author: Keith Packard +Date: Tue Nov 15 08:12:05 2016 -0800 + + Bump version to 1.19.0 + + Signed-off-by: Keith Packard + +commit ea8efb3a997e15d27d362762e6c85d59487f9864 +Author: Keith Packard +Date: Wed Nov 2 13:25:33 2016 -0700 + + dix: Make sure client is not in output_pending chain after closed (RH 1382444) + + I think it is possible that output could get queued to a client during + CloseDownClient. After it is removed from the pending queue, active + grabs are released, the client is awoken if sleeping and any work + queue entries related to the client are processed. + + To fix this, move the call removing it from the output_pending chain + until after clientGone has been set and then check clientGone in + output_pending_mark. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1382444 + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 7513da40a656317ad3aa101651d29373de99c798 +Author: Timo Aaltonen +Date: Wed Nov 2 17:18:11 2016 +0200 + + dri2: Sync i965_pci_ids.h from mesa + + Import changes from these mesa commits: + 85ea8deb26da420 i965: Removing PCI IDs that are no longer listed as Kabylake. + bdff2e554735ed9 i956: Add more Kabylake PCI IDs. + f1fa8b4a1ca73fa i965/bxt: Add 2x6 variant + d1ab544bb883d04 i965/chv: Display proper branding + 20e8ee36627f874 i965/skl: Update Skylake renderer strings + 644c8a515192d28 i965/skl: Add two missing device IDs + + Reviewed-by: Adam Jackson + Signed-off-by: Timo Aaltonen + +commit 4cfee398726adf89db4b632ade7d6cab8b78282e +Author: Ian Ray +Date: Wed May 25 10:41:53 2016 +0300 + + xwayland-shm: block signals during fallocate + + posix_fallocate() does an explicit rollback if it gets EINTR, and + this is a problem on slow systems because when the allocation size + is sufficiently large posix_fallocate() will always be interrupted + by the smart scheduler's SIGALRM. + + Changes since v1 - big comment in the code to explain what is going on + + Reviewed-by: Adam Jackson + Signed-off-by: Ian Ray + Acked-by: Pekka Paalanen + Acked-by: Daniel Stone + +commit 512e75a23b7f6339593c3ae6942f0c420a975fd3 +Author: Keith Packard +Date: Fri Oct 28 09:32:42 2016 -0700 + + Bump to 1.18.99.902 (1.19 RC2) + + Signed-off-by: Keith Packard + +commit c85f81825e196e96337347e0ce3a538fb2e38f16 +Author: Keith Packard +Date: Fri Oct 28 09:28:32 2016 -0700 + + dix: Bump MAXHASHSIZE for the resource db [v2] + + [This was originally a workaround for a client-side resource leak: + + http://lists.freedesktop.org/archives/xorg-devel/2012-November/034555.html + + Obviously that's a broken app, but the performance problem it + illustrates - that walking the linked list ends up burning all your CPU + time - is real enough. - ajax] + + v2: Replace with a shorter code sequence which computes the same + results for all but numBits == 7 + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 356db2340f5b473a7191c7969586ca5b0396c48f +Merge: 9ed5b26 03d99ef +Author: Keith Packard +Date: Fri Oct 28 09:05:54 2016 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 9ed5b263542e5245317927828f0515db6c0a54c8 +Author: Keith Packard +Date: Fri Oct 28 08:04:43 2016 -0700 + + os: Recompute whether any clients are ready after ProcessWorkQueue() (bug 98030) + + If a work proc wakes up a sleeping client and it is ready to execute, + we need to re-compute the local 'are_ready' value before deciding + what timeout value to use in WaitForSomething. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98030 + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 2c91f3235a4e1655e18cb014922529161051ffbb +Author: Keith Packard +Date: Wed Oct 5 09:41:44 2016 -0700 + + ephyr: Leave window unmapped for -glamor-skip-present [v2] + + If we're never painting anything in the window, we probably don't need + to map it. + + v2: Drop ephyr_glamor_gles2 from hostx.c + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit cba5a10fd93310702cad9dbe1e6d48da99f5552f +Author: Alex Goins +Date: Wed Oct 26 11:03:49 2016 -0700 + + ramdac: Check sPriv != NULL in xf86CheckHWCursor() + + xf86CheckHWCursor() would dereference sPriv without NULL checking it. If Option + "SWCursor" is specified, sPriv == NULL. In this case we should assume that HW + cursors are not supported. + + Signed-off-by: Alex Goins + Reviewed-by: Andy Ritger + Signed-off-by: Keith Packard + +commit 03d99ef729178dd99268f185fb45320a29382091 +Author: Jon Turney +Date: Thu Oct 6 22:13:07 2016 +0100 + + glx/dri2: Don't build DRI loader if DRI2 isn't enabled + + This partially reverts 501d8e2b. + + Signed-off-by: Jon Turney + Reviewed-by: Emil Velikov + +commit 5cb328338684d8e5b03913c47475bfcd7acffec4 +Author: Peter Hutterer +Date: Wed Oct 26 12:21:16 2016 +0200 + + inputthread: On Linux leave the main thread's name as-is + + On Linux, setting the main thread's name changes the program name + (/proc/self/comm). Setting it to MainThread breaks scripts that rely on + the command name, e.g. ps -C Xorg. + + Signed-off-by: Peter Hutterer + Signed-off-by: Hans de Goede + +commit 007f8ee61a35ceda36b43e772a9a1074b8e27a06 +Author: Olivier Fourdan +Date: Fri Oct 21 10:11:45 2016 +0200 + + xwayland: Activate and enable touch devices + + On some random condition, a touch event may trigger a crash in Xwayland + in GetTouchEvents(). + + The (simplified) backtrace goes as follow: + + (gdb) bt + #0 GetTouchEvents() at getevents.c:1892 + #1 QueueTouchEvents() at getevents.c:1866 + #2 xwl_touch_send_event() at xwayland-input.c:652 + #5 wl_closure_invoke() from libwayland-client.so.0 + #6 dispatch_event() from libwayland-client.so.0 + #7 wl_display_dispatch_queue_pending() from libwayland-client.so.0 + #8 xwl_read_events() at xwayland.c:483 + #9 ospoll_wait() at ospoll.c:412 + #10 WaitForSomething() at WaitFor.c:222 + #11 Dispatch() at dispatch.c:412 + #12 dix_main() at main.c:287 + #13 __libc_start_main() at libc-start.c:289 + #14 _start () + + The crash occurs when trying to access the sprite associated with the + touch device, which appears to be NULL. Reason being the device itself + is more a keyboard device than a touch device. + + Moreover, it appears the device is neither enabled nor activated + (inited=0, enabled=0) which doesn't seem right, but matches the code in + init_touch() from xwayland-input.c which would enable the device if it + was previously existing and otherwise would create the device but not + activate it. + + Make sure we do activate and enable touch devices just like we do for + other input devices such as keyboard and pointer. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + +commit f68ba7b81ffe765380664fccc92f3e689c6c48c2 +Author: Rui Matos +Date: Tue Oct 25 19:24:49 2016 +0200 + + xwayland: Transform pointer enter event coordinates + + Pointer enter event coordinates are surface relative and we need them to + be screen relative for pScreen->SetCursorPosition(). + + https://bugzilla.gnome.org/show_bug.cgi?id=758283 + + Signed-off-by: Rui Matos + Reviewed-by: Eric Engestrom + Reviewed-by: Jonas Ådahl + Signed-off-by: Hans de Goede + +commit f5c6d751d08c6de77c2ca49ba2a48f8023758cef +Author: Nikhil Mahale +Date: Sat Oct 22 17:40:51 2016 +0530 + + modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT + + Commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 had already unifdef + MODESETTING_OUTPUT_SLAVE_SUPPORT but commit + 9257b1252da9092ddc676fec9aabe2b33dfad272 didn't notice that. + + Signed-off-by: Nikhil Mahale + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 4aaeeda4774397dd6d80aa240ca623ae795ec5dc +Author: Hans de Goede +Date: Tue Oct 18 16:10:19 2016 +0200 + + xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputs + + Prior to this commit the Xorg.wrap code to detect if root rights are + necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and* + reporting more then 0 output connectors. + + DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate + between old drm only cards (which need ums and thus root) and kms capable + cards. + + Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs, + resulting in Xorg needlessly running as root. This commits removes the + res.count_connectors > 0 check, fixing this. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 7d91063aca4e4d326c294e246bc2dc36cb05318e +Author: Michel Dänzer +Date: Mon Oct 17 18:48:44 2016 +0900 + + 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. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede + +commit f6ff2e974c5de3071c899eba828789f1d4d8645a +Author: Mihail Konev +Date: Sat Oct 15 04:13:43 2016 +0000 + + modesetting: fix glamor ifdef + + Add a missing ifdef needed for --disable-glamor. + + Signed-off-by: Mihail Konev + Reviewed-by: Jon Turney + Signed-off-by: Hans de Goede + +commit 8fee6a917b6468e1b116d922f86484498874fb5c +Author: Mihail Konev +Date: Fri Oct 14 02:40:59 2016 +0000 + + xwin: make glx optional again + + Commit 501d8e2b removed --enable-aiglx, but made xwin always be + --enable-glx. + + Signed-off-by: Mihail Konev + Reviewed-by: Emil Velikov + Reviewed-by: Jon Turney + Signed-off-by: Hans de Goede + +commit d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 +Author: Peter Hutterer +Date: Fri Oct 21 06:27:57 2016 +1000 + + ddx: add new call to purge input devices that weren't added + + Special case for the systemd-logind case in xfree86: when we're vt-switched + away and a device is plugged in, we get a paused fd from logind. Since we + can't probe the device or do anything with it, we store that device in the + xfree86 and handle it later when we vt-switch back. The device is not added to + inputInfo.devices until that time. + + When the device is removed while still vt-switched away, the the config system + never notifies the DDX. It only runs through inputInfo.devices and our device + was never added to that. + + When a device is plugged in, removed, and plugged in again while vt-switched + away, we have two entries in the xfree86-specific list that refer to the same + device node, both pending for addition later. On VT switch back, the first one + (the already removed one) will be added successfully, the second one (the + still plugged-in one) fails. Since the fd is correct, the device works until + it is removed again. The removed devices' config_info (i.e. the syspath) + doesn't match the actual device we addded tough (the input number increases + with each plug), it doesn't get removed, the fd remains open and we lose track + of the fd count. Plugging the device in again leads to a dead device. + + Fix this by adding a call to notify the DDX to purge any remainders of devices + with the given config_info, that's the only identifiable bit we have at this + point. + + https://bugs.freedesktop.org/show_bug.cgi?id=97928 + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 8fcf2fa78f09257933b17e7dc9a03a2034e3076f +Author: Peter Hutterer +Date: Thu Oct 20 15:45:46 2016 +1000 + + xfree86: swap the list of paused devices to an xorg_list + + No functional changes but it makes it easier to remove elements from the + middle of the list (future patch). + + We don't have an init call into this file, so the list is manually + initialized. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 28d8855cd4e3be8831fb1c17bf1d205bd8465d1e +Author: Peter Hutterer +Date: Thu Oct 20 15:25:51 2016 +1000 + + xfree86: use the right option traversal list to search for an option + + They're identically laid-out structs but let's use the right type to search + for our desired value. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 7fc96fb02dade4a86f2fc038f3cf5f2d9c0cda00 +Author: Emil Velikov +Date: Fri Oct 21 19:06:00 2016 +0100 + + glamor: don't look for non-existing EGL_KHR_platform_base + + The extension does not exist in the registry, thus needs to know they're + using EGL 1.5 in order to determine the eglGetPlatformDisplay function + pointer is valid. + + Thus brings us into some lovely circular dependency. + + Since mesa won't be able (in the foreseeable future) to export the KHR + flavour of extension (another way one could assume that EGL 1.5 is + available) just drop all the heuristics and use the + EGL_EXT_platform_base extension. + + In practise (checked with the Mali driver) any EGL 1.5 driver will + advertise support for EGL_EXT_platform_base. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 5dcb0666b82f5ab00f3d22e86f05ac14b0d5341e +Author: Mihail Konev +Date: Sat Oct 15 17:59:05 2016 +0000 + + os/inputthread: Ensure pollfd refreshing + + When putting a device node into a poll-request list, do not overwrite a + "please-remove" element with the same fd, so that a closed device file + is ospoll_remove'd prior to being ospoll_add'ed. + + Before, the opposite order was possible, resulting in ospoll_add + considering the newly opened file being already polled, should it have a + fd for which the "please-remove" has not been procesed yet. In this + case, no further events would be seen from the device. + + Signed-off-by: Mihail Konev + Regressed-in: 52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97880 + Patchwork: https://patchwork.freedesktop.org/patch/113763/ + Hit-and-Reduced-by: Hans de Goede + Reviewed-and-Reduced-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 9cf0bd4d4507dca6234024605b14724713f2109e +Author: Michel Dänzer +Date: Wed Oct 5 18:28:45 2016 +0900 + + xf86Cursor: Take the input lock in xf86Set/MoveCursor + + Prevents the HW cursor from intermittently jumping around when the + cursor image is changed while the cursor is being moved. This is hardly + noticeable in normal operation but can be quite confusing when stepping + through these codepaths in a debugger. + + Reviewed-by: Hans de Goede + +commit 011ce3297d924e78ef0254b0451561946bd8be8d +Author: Michel Dänzer +Date: Wed Oct 5 18:01:29 2016 +0900 + + xf86Cursor: Use PRIME master xf86CursorScreenRec::HotX/Y for slaves + + xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens. + + Fixes incorrect HW cursor position on PRIME slave screens. + + Also hoist the hotspot translation out from xf86ScreenSet/MoveCursor to + xf86Set/MoveCursor, since the hotspot position is a property of the + cursor, not the screen. + + v2: + * Squash patches 1 & 2 of the v1 series, since it's basically the same + problem + * Use the master screen's xf86CursorScreenRec::HotX/Y instead of + CursorRec::bits->x/yhot, since CursorRec::bits can be NULL (Hans de + Goede) + + Reviewed-by: Hans de Goede + +commit e3f53aa3a8dfc323c75837cd41e35b8e895d547e +Author: Adam Jackson +Date: Thu Oct 6 14:42:34 2016 -0400 + + glx/dri2: Don't include drm headers + + They're not needed, and they won't be present on win32. + + Signed-off-by: Adam Jackson + Reviewed-by: Emil Velikov + +commit 97a8353ec1192d8d3bd2ebb99e5687cb91427e09 +Author: Peter Harris +Date: Thu Sep 29 11:17:48 2016 -0400 + + Fix id in error when resource does not exist + + Always set client->errorValue before returning an error. + + Test program: + + int main(int argc, char *argv[]) { + int screen = 0; + xcb_connection_t *c = xcb_connect(NULL, &screen); + if (!c) { + printf("Cannot connect\n"); + return 1; + } + + xcb_void_cookie_t tok = xcb_free_gc_checked(c, BAD_VALUE); + xcb_g_context_error_t *err = (xcb_g_context_error_t *)xcb_request_check(c, tok); + if (!err) { + printf("Unexpected request success\n"); + return 1; + } + if (err->bad_value != BAD_VALUE) { + printf("Error: Got 0x%X, expected 0x%X\n", err->bad_value, BAD_VALUE); + return 1; + } + printf("Success! Got expected bad value of 0x%X\n", BAD_VALUE); + return 0; + } + + Reviewed-by: Adam Jackson + Signed-off-by: Peter Harris + +commit f4a41155479e68bf55740c1dfffafc78e4c02087 +Author: Adam Jackson +Date: Wed Oct 5 12:34:34 2016 -0400 + + glamor: Use eglGetPlatformDisplay{,EXT} if we can + + eglGetDisplay forces the implementation to guess which kind of display + it's been handed. glvnd does something different from Mesa, and in + general it's impossible for the library to get this right. Add a new + inline that gets the logic right, and works around a quirk in epoxy. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 95d3980c7c991b2cc8dcadac173635641ae15865 +Author: Michel Dänzer +Date: Wed Oct 5 17:29:36 2016 +0900 + + test: Use $XSERVER_BUILDDIR for Xvfb executable path + + Fixes make check with out-of-tree builds. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Reviewed-by: Eric Anholt + +commit cc69d4f110bd8a87b9e6c238ebebf8d85cbd93ec +Author: Emil Velikov +Date: Thu Sep 29 18:35:04 2016 +0100 + + xfree86/dri: remove libdrm runtime checks + + As of last commit all the places in our configure.ac require version + 2.3.1 (released back in 2007) or later. With the latter introducing the + 1.3.0 version, as returned by drmGetLibVersion. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 962962e978e5cededc20e577a36f77eb24d14bda +Author: Emil Velikov +Date: Thu Sep 29 18:35:03 2016 +0100 + + configure.ac: bump the required libdrm version to 2.3.1 + + It fixes a bug where the version reported by drmGetLibVersion() was + 'wrong'. See libdrm commit 79038751ffe("libdrm: add support for server + side functionality in libdrm") for details. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 74a8b320fa5068cd86d8b8b8e73fa92caae9a8a6 +Author: Emil Velikov +Date: Thu Sep 29 18:35:02 2016 +0100 + + configure.ac: use $LIBDRM over libdrm when using pkg-config + + The former contains the minimum required version which is required. + Strictly speaking Xephyr/Xwayland may require version greater than the + current 2.3.0, although I've personally haven't checked the specifics. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 45e1220486139c483a69366323f8f590beffa19d +Author: Emil Velikov +Date: Thu Sep 29 18:35:01 2016 +0100 + + configure.ac: default to DRI=yes on solaris platforms + + Afaict there's little-to-no reason/way one would want xserver without + DRI support on Solaris platforms. + + This will allow us to simplify/fix all the libdrm detection in the next + commit. + + Cc: Alan Coopersmith + Signed-off-by: Emil Velikov + Reviewed-by: Alan Coopersmith + Reviewed-by: Adam Jackson + +commit 501d8e2beb337e072c93c9310fcd927a099b9c3b +Author: Emil Velikov +Date: Thu Sep 29 18:41:19 2016 +0100 + + configure.ac: remove --enable-aiglx option + + Presently the option guards both direct and accelerated indirect GLX. As + such when one toggles it off they end up without any acceleration. + + Remove the option all together until we have the time to split/rework + things. + + Cc: Jon Turney + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 7ec350ddd42479595f0ea88f86085af941913617 +Author: Emil Velikov +Date: Thu Sep 29 18:41:18 2016 +0100 + + xfree86: remove aiglx cmd/xorg.conf option + + The option is misleading and using it leads to disabling both direct and + accelerated indirect GLX. In such cases the xserver GLX attempts to + match DRISW (IGLX) configs with the DRI2/3 ones (direct GLX) leading to + all sorts of fun experience. + + Remove the option until we get a clear split and control over direct vs + indirect GLX. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 04ef8558a731bf070abf1b40c7e6b54aad8f5f31 +Author: Emil Velikov +Date: Thu Sep 29 18:41:17 2016 +0100 + + glx: drisw is not accelerated IGLX, reflect that in log messages + + The messages from glxdricommon.c (used by drisw) still have the A, but + at least we're don't have it locally. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 1c2fcb95484777ca9aa80b3f814ad64e81f825f1 +Author: Olivier Fourdan +Date: Wed Oct 5 08:36:21 2016 +0200 + + glamor: Fix pixmap offset for bitplane in glamor_copy_fbo_cpu + + Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu" + introduced a regression as the computed pixmap offset would not match + the actual coordinates and write data elsewhere in memory causing a + segfault in fbBltOne(). + + Translate the pixmap coordinates so that the data is read and written at + the correct location. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97974 + Signed-off-by: Olivier Fourdan + Reviewed-and-Tested-by: Michel Dänzer + +commit a6e85e6330adcdcbcd939c0963daaecc96d41a2a +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:08 2016 +0800 + + xwayland: Add pointer warp emulator + + Emulate pointer warps by locking the pointer and sending relative + motion events instead of absolute. X will keep track of the "fake" + pointer cursor position given the relative motion events, and the + client warping the cursor will warp the faked cursor position. + + Various requirements need to be met for the pointer warp emulator to + enable: + + The cursor must be invisible: since it would not be acceptable that a + fake cursor position would be different from the visual representation + of the cursor, emulation can only be done when there is no visual + representation done by the Wayland compositor. Thus, for the emulator + to enable, the cursor must be hidden, and would the cursor be displayed + while the emulator is active, the emulator would be destroyed. + + The window that is warped within must be likely to have pointer focus. + For example, warping outside of the window region will be ignored. + + The pointer warp emulator will disable itself once the fake cursor + position leaves the window region, or the cursor is made visible. + + This makes various games depending on pointer warping (such as 3D + first-person shooters and stategy games using click-to-drag-map like + things) work. + + Signed-off-by: Jonas Ådahl + +commit 467ab142fff926e1475440dd5f649a49f45808fa +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:07 2016 +0800 + + xwayland: Translate a pointer grab with confineTo to pointer confinement + + Translate grabbing a pointer device with confineTo set to a window into + confining the Wayland pointer using the pointer constraints protocol. + This makes clients that depend on the pointer not going outside of the + window region, such as certain games and virtual machines viewers, to + function more properly. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit ca7b593fbe54bc9a0b44037e62e4b4401cbd375e +Author: Jonas Ådahl +Date: Thu Sep 29 10:42:13 2016 +0800 + + xwayland: Bind pointer constraints global + + Will be used by the pointer warp emulator. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit c14a8c6cc0fcd56c380d1220c2a8f04b74edee93 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:05 2016 +0800 + + xwayland: Put getting a xwl_window from a Window in a helper + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit b4644ce8d3420447a8e5a2339238968da0a59de7 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:04 2016 +0800 + + xwayland: Set unaccelerated pointer motion delta if available + + If there was an relative pointer motion within the same frame as an + absolute pointer motion, provide both the absolute coordinate and the + unaccelerated delta when setting the valuator mask. + + If a frame contained only a relative motion, queue an absolute motion + with an unchanged position, but still pass the unaccelerated motion + event. + + If the wl_seat advertised by the compositor is not new enough, assume + each relative and absolute pointer motion arrives within their own + separate frames. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit aa9634d03bc2434dfd25476529eccb14e46fcfdc +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:03 2016 +0800 + + xwayland: Dispatch pointer motion events on wl_pointer.frame if possible + + Wait until wl_pointer.frame with dispatching the pointer motion event, + if wl_pointer.frame is supported by the compositor. This will later be + used to combine unaccelerated motion deltas with the absolute motion + delta. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 42e8902395cb27af5c28306abd577a92c467a62d +Author: Krzysztof Sobiecki +Date: Tue Sep 13 22:23:49 2016 +0800 + + xwayland: Add a new input device used for pointer warping/locking + + Generating relative and absolute movement events from the same input + device is problematic, because an absolute pointer device doesn't + expect to see any relative motion events. To be able to generate + relative pointer motion events including unaccelerated deltas, create a + secondary pointer device 'xwayland-relative-pointer', and use that for + emitting relative motion events. + + Signed-off-by: Krzysztof Sobiecki + Signed-off-by: Jonas Ådahl + +commit 011ada724afdba8955f1d4844b306e61390eead8 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:01 2016 +0800 + + xwayland: Move pointer button initialization into helper + + We'll later use this for initializing buttons for the relative pointer + since they need to be the same. + + Signed-off-by: Jonas Ådahl + +commit a77d0715c6272cc1778a54dccd8cb68dc28cd761 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:00 2016 +0800 + + xwayland: Split up device class init/release into functions + + Put device class initialization in init_[device_class](xwl_seat) and + releasing in release_[device class](xwl_seat). The purpose is to make + it easier to add more type of initialization here later, without making + the function too large. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 9037ba736a0424feee2fb6ac20cf7687613dc452 +Author: Jonas Ådahl +Date: Thu Sep 29 10:40:01 2016 +0800 + + xwayland: Bind the relative pointer manager + + Will be used for getting unaccelerated motion events and later for + relative motions used by a pointer warp emulator. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 0fae3be0686cae746e03d6e4592f97278cc2275d +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:57 2016 +0800 + + dix: Add valuator_mask_set_absolute_unaccelerated + + Add a valuator mask setter for setting absolute coordinate combined + with unaccelerated motion deltas. This will later be used by Xwayland + to combine a wl_pointer.motion() event with the unaccelerated delta of + a wp_relative_pointer.relative_motion() event. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit bbd4854f81ebba1119202c5f6ff4679c62afec1f +Author: Carlos Garnacho +Date: Tue Sep 27 19:03:26 2016 +0200 + + xwayland: Apply touch abs axes transformation before posting events + + The way we map the touch absolute device to screen coordinates can't + work across wl_output mode and geometry events. Instead, set up + a fixed coordinate space, and transform touch events according to + the screen coordinate space as they happen. + + Reviewed-by: Adam Jackson + Signed-off-by: Carlos Garnacho + +commit ee526285882995289846648f3122c4295e3e8284 +Author: Carlos Garnacho +Date: Wed Sep 28 12:35:36 2016 +0200 + + xwayland: Apply "last pointer window" check only to the pointer device + + The checks in xwayland's XYToWindow handler pretty much assumes that the + sprite is managed by the wl_pointer, which is not entirely right, given + 1) The Virtual Core Pointer may be controlled from other interfaces, and + 2) there may be other SpriteRecs than the VCP's. + + This makes XYToWindow calls return a sprite trace with just the root + window if any of those two assumptions are broken, eg. on touch events. + + So turn the check upside down, first assume that the default XYToWindow + proc behavior is right, and later cut down the spriteTrace if the + current device happens to be the pointer and is out of focus. We work + our way to the device's lastSlave here so as not to break assumption #1 + above. + + Reviewed-by: Adam Jackson + Signed-off-by: Carlos Garnacho + Acked-by: Olivier Fourdan + +commit 2b6a068d21997ca812e665ed058e72eb4626c129 +Author: Keith Packard +Date: Mon Oct 3 15:37:03 2016 -0700 + + fb: XYPixmap format PutImage includes all planes in depth + + Unlike GetImage, for which the provided planemask restricts the data + delivered, for PutImage in XYPixmap format, all of the planes in the + drawable depth are sent and those outside the plane mask are simply + ignored. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c9b8ce73927a43ed82b267d1c1985445f24827cc +Author: Mark Yao +Date: Fri Sep 30 16:42:35 2016 +0800 + + glamor: spans: fixup wrong count on glDrawArrays + + In commit 9e9fcf5 (glamor: Add a helper function for the common + GL_QUADS fallback pattern.), the glDrawArrays count change was + accidentally changed to nbox. + + Fixes xlogo with MESA_GL_VERSION_OVERRIDE=2.1 and + MESA_GLSL_VERSION_OVERRIDE=120 + + Signed-off-by: Mark Yao + Reviewed-by: Eric Anholt + +commit 2aca2dadda4cc9c378049457885d33a4eede9768 +Author: Eric Anholt +Date: Sat Sep 24 14:42:28 2016 -0700 + + glamor: Fix link failure on GLES2. + + Current Mesa requires that the precision qualifier on uniforms matches + between stages, even if (as in this case) the uniform isn't used in + one of the stages. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 20fcdfcf39497fe44d2a3200338523effb8e2bc6 +Author: Eric Anholt +Date: Sat Sep 24 14:30:27 2016 -0700 + + glamor: Remove #if 0-ed picture dumping code. + + I don't think anybody has run this code since it was pulled into the + server. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 4b5326aeba539249fcded91bf7806a708eeca651 +Author: Eric Anholt +Date: Sat Sep 24 14:04:14 2016 -0700 + + glamor: Remove many unused glamor util functions. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 117d614d1ba324bdb02c50a430c2e0d22a384f03 +Author: Eric Anholt +Date: Sat Sep 24 22:26:17 2016 +0300 + + glamor: Require GL_OES_texture_border_clamp for GLES2. + + The extension came out in 2000, and all Mesa-supported hardware that + can do glamor supports it. We were already relying on the ARB version + being present on desktop. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 7a5ddf8da5ed817aa2dd6f7af1b9197a5ceec60b +Author: Adam Jackson +Date: Wed Sep 28 15:27:20 2016 -0400 + + test: Re-enable a couple of GetImage tests + + Fixed in 6c6f09aac. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit c7a9161da5eb80ef0444601621b52314255b0ce5 +Author: Francois Tigeot +Date: Fri Sep 23 11:36:49 2016 +0200 + + Enable XTRANS_SEND_FDS on FreeBSD, DragonFly and OpenBSD + + This code is based on local patches which had been sitting in + FreeBSD and OpenBSD ports. + + Reviewed-by: Matthieu Herrb + Signed-off-by: François Tigeot + +commit 6c6f09aac7f1d1367a042087b7681c7fdf1d1e0f +Author: Keith Packard +Date: Sun Sep 25 14:19:08 2016 +0300 + + xace: Don't censor window borders + + GetImage is allowed to return window border contents, so don't remove + that from the returned image. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 380c2ca25ec4dd330f938e382ff4af60bc253785 +Author: Hans de Goede +Date: Fri Sep 23 14:11:52 2016 +0300 + + XF86VidMode: Fix free() on walked pointer + + Based on: https://patchwork.freedesktop.org/patch/85636/ + + Rewritten to just not walk the pointer. + + Signed-off-by: Hans de Goede + Reviewed-by: Emi Velikov + +commit 220d327ee00ec1278d50d4ba8cd20612e8b77c8f +Author: Hans de Goede +Date: Fri Sep 23 14:06:52 2016 +0300 + + Xext: Fix a memory leak + + Based on: https://patchwork.freedesktop.org/patch/85636/ + + Rewritten to also free the resources allocated by + panoramix_setup_ids(). + + Signed-off-by: Hans de Goede + Reviewed-by: Emi Velikov + +commit 3abf791ab82cb3dc7eacd0317fe0262a71340753 +Author: Michael Thayer +Date: Fri Sep 16 17:51:25 2016 +0200 + + modesetting: only fall back to drmModeSetCursor() on -EINVAL + + This change effectively reverts commit 074cf58. We were falling back from + drmModeSetCursor2() to drmModeSetCursor() whenever the first failed. This + fall-back only makes sense on pre-mid-2013 kernels which implemented the + cursor_set hook but not cursor_set2, and in this case the call to + drmModeSetCursor2() will always return -EINVAL. Specifically, a return + value of -ENXIO usually means that neither are supported. + + Signed-off-by: Michael Thayer + [hdegoede@redhat.com: initialize ret to -EINVAL] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8 +Author: Daniel Martin +Date: Fri Dec 11 12:05:22 2015 +0100 + + modesetting: Consume all available udev events at once + + We get multiple udev events for actions like docking a laptop into its + station or plugging a monitor to the station. By consuming as much + events as we can, we reduce the number of output re-evalutions. + + I.e. having a Lenovo X250 in a ThinkPad Ultra Dock and plugging a + monitor to the station generates 5 udev events. Or having 2 monitors + attached to the station and docking the laptop generates 7 events. + + It depends on the timing how many events can consumed at once. + + Signed-off-by: Daniel Martin + [hdegoede@redhat.com: Keep goto out so that we always call RRGetInfo()] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit ea91db4b83312e791dcae935b8720f49a3861d72 +Author: Qiang Yu +Date: Thu Sep 8 21:24:58 2016 +0800 + + config: fix GPUDevice fail when AutoAddGPU off + BusID + + This fix is for the following xorg.conf can work: + + Section "ServerFlags" + Option "AutoAddGPU" "off" + EndSection + + Section "Device" + Identifier "Amd" + Driver "ati" + BusID "PCI:1:0:0" + EndSection + + Section "Device" + Identifier "Intel" + Driver "modesetting" + BusID "pci:0:2:0" + EndSection + + Section "Screen" + Identifier "Screen0" + Device "Intel" + GPUDevice "Amd" + EndSection + + Without AutoAddGPU off, modesetting DDX will also be loaded + for GPUDevice. + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + Signed-off-by: Hans de Goede + +commit ca8d88e50310a0d440a127c22a0a383cc149f408 +Author: Laszlo Ersek +Date: Wed Sep 7 15:08:06 2016 +0200 + + xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform() + + The new platform bus code and the old PCI bus code overlap. Platform bus + can handle any type of device, including PCI devices, whereas the PCI code + can only handle PCI devices. Some drivers only support the old style + PCI-probe methods, but the primary device detection code is server based, + not driver based; so we might end up with a primary device which only has + a PCI bus-capable driver, but was detected as primary by the platform + code, or the other way around. + + (The above paragraph was shamelessly stolen from Hans de Goede, and + customized.) + + The latter case applies to QEMU's virtio-gpu-pci device: it is detected as + a BUS_PCI primary device, but we actually probe it first (with the + modesetting driver) through xf86platformProbeDev(). The + xf86IsPrimaryPlatform() function doesn't recognize the device as primary + (it bails out as soon as it sees BUS_PCI); instead, we add the device as a + secondary graphics card under "autoAddGPU". In turn, the success of this + automatic probing-as-GPU prevents xf86CallDriverProbe() from proceeding to + the PCI probing. + + The result is that the server exits with no primary devices detected. + + Commit cf66471353ac ("xfree86: use udev to provide device enumeration for + kms devices (v10)") added "cross-bus" matching to xf86IsPrimaryPci(). Port + that now to xf86IsPrimaryPlatform(), so that we can probe virtio-gpu-pci + as a primary card in platform bus code. + + Cc: Adam Jackson + Cc: Dave Airlie + Cc: Hans de Goede + Cc: Keith Packard + Cc: Marcin Juszkiewicz + Signed-off-by: Laszlo Ersek + Tested-By: Marcin Juszkiewicz + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 44968da376c880e096225f149f78673aa4c6e5e0 +Author: Kyle Guinn +Date: Fri Sep 23 15:03:34 2016 +0300 + + xfree86: Fix null pointer dereference + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93675 + Signed-off-by: Kyle Guinn + [hdegoede@redhat.com: Simplify by adding 2 if conds together with &&] + Signed-off-by: Hans de Goede + +commit 127e0569ca8dbf774df8f83d4c59bbbbf2e25a20 +Author: David CARLIER +Date: Fri Sep 23 14:17:12 2016 +0300 + + xfree86: small memory leaks fixes + + A couple of memory leaks fixes and avoiding bit shifting on an + unitialized value. + + [hdegoede@redhat.com: Split out some non free fixes in separate patches] + [hdegoede@redhat.com: Don't touch ancient (and weird) os/rpcauth.c code] + Signed-off-by: Hans de Goede + +commit d51cce7992508f366758fa13dd93be24df0947ed +Author: Adam Jackson +Date: Tue Jul 5 13:07:09 2016 -0400 + + xephyr: Don't crash if the server advertises zero xv adaptors + + Useless as an XVideo implementation with zero adaptors might be, it's + apparently a thing in the wild. Catch this case and bail out of xv init + if it happens. + + Signed-off-by: Adam Jackson + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 445271ec00f25405fa5ed0e149dd4a9d9f6098d4 +Author: Hans de Goede +Date: Fri Jul 1 17:36:02 2016 +0200 + + glx: Always enable EXT_texture_from_pixmap for DRI swrast glx + + Prior to commit f95645c6f700 ("glx: Don't enable EXT_texture_from_pixmap + unconditionally") DRI glx would always advertise EXT_texture_from_pixmap. + + That commit moved the setting of the extension in the extension bits from + __glXInitExtensionEnableBits to its callers so that + __glXInitExtensionEnableBits can be used more generally, but at the same + time made the setting of EXT_texture_from_pixmap conditionally on + __DRI_TEX_BUFFER being present. + + This has result in an unintended behavior change which breaks e.g. + compositors running on llvmpipe. This commit makes the DRI swrast glx code + advertise EXT_texture_from_pixmap unconditionally again fixing this. + + Fixes: f95645c6f700 ("glx: Don't enable EXT_texture_from_pixmap unconditionally") + Signed-off-by: Hans de Goede + --- + Changes in v2: + -Only add unconditional advertising of GLX_EXT_texture_from_pixmap + to glxdriswrast.c, do not also add it to glxdri2.c + +commit 02ff0a5d7e32ce8460d6d0669f532d65ad212fcd +Author: Hans de Goede +Date: Sat Sep 17 11:33:13 2016 +0200 + + xf86RandR12: Fix XF86VidModeSetGamma triggering a BadImplementation error + + Commit b4e46c0444bb ("xfree86: Hook up colormaps and RandR 1.2 gamma code") + dropped the providing of a pScrn->ChangeGamma callback from the xf86RandR12 + code. Leaving pScrn->ChangeGamma NULL in most cases. + + This triggers the BadImplementation error in xf86ChangeGamma() : + + if (pScrn->ChangeGamma) + return (*pScrn->ChangeGamma) (pScrn, gamma); + + return BadImplementation; + + Which causes X-apps using XF86VidModeSetGamma to crash with a + X protocol error. + + This commit fixes this by re-introducing the xf86RandR12ChangeGamma + helper removed by the commit and adjusting it to work with the new + combined palette / gamma code. + + Fixes: b4e46c0444bb ("xfree86: Hook up colormaps and RandR 1.2 gamma code") + Signed-off-by: Hans de Goede + Reviewed-by: Alex Deucher + +commit a58dd678bf952560e5422845e186d80a189953fe +Author: Hans de Goede +Date: Sat Sep 17 11:42:09 2016 +0200 + + xf86RandR12: Move calculating of shift inside init_one_component + + This is a preparation patch to allow easier usage of init_one_component + outside of xf86RandR12CrtcInitGamma. + + Signed-off-by: Hans de Goede + Reviewed-by: Alex Deucher + +commit 299cbb92670fdb83c24c3ef6327eb9d66b8be92a +Author: Hans de Goede +Date: Thu Sep 15 14:35:52 2016 +0200 + + modesetting: Fix reverse prime update lagging on secondary GPU outputs + + When using secondary GPU outputs the primary GPU's blockhandler + will copy changes from its framebuffer to a pixmap shared with the + secondary GPU. + + In reverse prime setups the secondary GPU's blockhandler will do another + copy from the shared pixmap to its own framebuffer. + + Before this commit, if the primary GPU's blockhandler would run after + the secondary GPU's blockhandler and no events were pending, then the + secondary GPU's blockhandler would not run until some events came in + (WaitForSomething() would block in the poll call), resulting in the + secondary GPU output sometimes showing stale contents (e.g. a just closed + window) for easily up to 10 seconds. + + This commit fixes this by setting the timeout passed into the + blockhandler to 0 if any shared pixmaps were updated by the primary GPU, + forcing an immediate re-run of all blockhandlers. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit e8695100b17b758359fc4897dbe995231ed224fc +Author: Hans de Goede +Date: Thu Sep 15 14:28:35 2016 +0200 + + modesetting: Fix reverse prime partial update issues on secondary GPU outputs + + When using reverse prime we do 2 copies, 1 from the primary GPU's + framebuffer to a shared pixmap and 1 from the shared pixmap to the + secondary GPU's framebuffer. + + This means that on the primary GPU side the copy MUST be finished, + before we start the second copy (before the secondary GPU's driver + starts processing the damage on the shared pixmap). + + This fixes secondary outputs sometimes showning (some) old fb contents, + because of the 2 copies racing with each other, for an example of + what this looks like see: + + https://fedorapeople.org/~jwrdegoede/IMG_20160915_130555.jpg + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 862a3dab287b5186a958d0131d70779468348e3e +Author: Olivier Fourdan +Date: Thu Sep 22 09:38:50 2016 +0200 + + xwayland: Clear up x_cursor on UnrealizeCursor() + + In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only + when a device value is provided to the UnrealizeCursor() routine, but + if the device is NULL as called from FreeCursor(), the corresponding + x_cursor for the xwl_seat is left untouched. + + This might cause a segfault when trying to access the unrealized + cursor's devPrivates in xwl_seat_set_cursor(). + + A possible occurrence of this is the client changing the cursor, the + Xserver calling FreeCursor() which does UnrealizeCursor() and then + the Wayland server sending a pointer enter event, which invokes + xwl_seat_set_cursor() while the seat's x_cursor has just been + unrealized. + + To avoid this, walk through all the xwl_seats and clear up all x_cursor + matching the cursor being unrealized. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Jonas Ådahl + Reviewed-by: Hans de Goede + +commit b79eaf1184f6514ede9dcd9baaa24a40ef724a15 +Author: Olivier Fourdan +Date: Thu Sep 15 15:59:07 2016 +0200 + + xwayland: handle EAGAIN on Wayland fd + + wl_display_flush() can fail with EAGAIN and Xwayland would make this a + fatal error. + + When this happens, it means that Xwayland has flooded the Wayland file + descriptor, either because the Wayland compositor cannot cope or more + likely because of a deadlock situation where the Wayland compositor is + blocking, waiting for an X reply while Xwayland tries to write data to + the Wayland file descriptor. + + The general consensus to avoid the deadlock is for the Wayland + compositor to never issue blocking X11 roundtrips, but in practice + blocking rountrips can occur in various places, including Xlib calls + themselves so this is not always achievable without major surgery in the + Wayland compositor/Window manager. + + What this patch does is to avoid dispatching to the Wayland file + descriptor until it becomes available for writing again, while at the + same time continue processing X11 requests to release the deadlock. + + This is not perfect, as there is still the possibility of another X + client hammering the connection and we'll still fail writing to the + Wayland connection eventually, but this improves things enough to avoid + a 100% repeatable crash with vlc and gtkperf. + + Also, it is worth considering that window managers and Wayland + compositors such as mutter already have a higher priority than other + regular X clients thanks to XSyncSetPriority(), mitigating the risk. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1278159 + Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=763400 + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 36e1a058c5826398ceea9dba6c166ae40c75646e +Author: Rui Matos +Date: Fri Feb 5 14:44:29 2016 +0100 + + xwayland: Close the shm fd as early as possible + + Keeping the shm fd open beyond pixmap creation means we can easily + reach the open file descriptor limit if an X client asks us to create + that many pixmaps. Instead, let's get the wl_buffer immediatly so that + we can destroy the shm pool and close the fd before being asked to + create more. + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + +commit fd4a6dc06fcf8671d616af52025e19200c79e404 +Author: Adam Jackson +Date: Tue Sep 27 17:15:12 2016 -0400 + + glamor: Fall back to software for CopyPlane if we need to + + glUniform4ui is available starting in GL{,ES} 3.0. Technically it's + also in EXT_gpu_shader4, but that's not worth supporting. There was also + a MESA_shading_language_130 spec proposed at one point; if that ever + gets finished, we can update epoxy to know about it and fix up the + feature check. + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit c49e820f796c27cbd2907709576a3fb672acd453 +Author: Eric Anholt +Date: Sun Sep 25 13:30:22 2016 -0700 + + test: Run xts against Xephyr -glamor when present + + v2: Drop x8r8g8b8 skip, now that it's fixed. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 5392ea5525082ceeb3aad50d9168baee2abc860e +Author: Eric Anholt +Date: Sun Sep 25 13:30:21 2016 -0700 + + test: Switch our testing X server to being spawned with simple-xinit + + Once I introduced a second X server being tested, I found that startx + hit races in choosing a display. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 283840c295c69aa3729f3f0aa2bf3ef83b1c220f +Author: Eric Anholt +Date: Sun Sep 25 13:30:20 2016 -0700 + + test: Update piglit HTML even when tests all pass + + I was confused by the behavior I'd written before. keithp and + mattst88 responded with shock that I would have made it so surprising, + as well. + + v2: Point to index.html instead of problems.html, which won't exist if + we had no problems. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 022fea767cd29d256fb99159df89cc25d339e787 +Author: Eric Anholt +Date: Sun Sep 25 13:30:19 2016 -0700 + + test: Fix parsing of piglit results + + The "dmesg-fail" line was matching our "fail" regex, so if you didn't + have those we would ignore fails. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 7fe5b9c02cf90b81532cb6dee3ec75c90c72c27c +Author: Eric Anholt +Date: Sun Sep 25 13:30:18 2016 -0700 + + test: Make the piglit-running script callable with an arbitrary server + + v2: Check that SERVER_COMMAND is set. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 7ac130a0664b43b6ba5324548c8f7ab8230f7199 +Author: Eric Anholt +Date: Sun Sep 25 13:30:17 2016 -0700 + + test: Add a little xinit-like program for starting servers for testing + + The normal xinit is racy because it doesn't use -displayfd. This + implements the bare minimum for testing purposes, using -displayfd to + sequence starting the client, and avoids adding yet another dependency + to the server. + + v2: Fix asprintf error checks. + v3: Add error checking for fork(), clarify calloc() arg. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 8d5e0c07b965d545c925c34be95d41c29135a63a +Author: Eric Anholt +Date: Sun Sep 25 13:30:16 2016 -0700 + + test: Handle srcdir != builddir in Xvfb testing + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit add49792608171feef8090f7520cfa02d2daae9c +Author: Eric Anholt +Date: Sun Sep 25 13:30:15 2016 -0700 + + ephyr: Add a mode for skipping redisplay in glamor + + This speeds up headless testing of Xephyr -glamor with softpipe from + "a test per minute or so" to "a test every few seconds". + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 453f813bb4afd39eb5b6b3c4a822894e04b6b11b +Author: Eric Anholt +Date: Sat Sep 24 14:37:28 2016 +0300 + + glamor: Properly handle mask formats without alpha. + + Even if the pixmap's storage has alpha, it may have been uploaded with + garbage in the alpha channel, so we need to force the shader to set + alpha to 1. This was broken way back in + 355334fcd99e4dce62e2be1e27290c9a74ea944f. + + Fixes rendercheck -t composite -f x8r8g8b8. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 905c877f094eb6cfe905d64e34fdd01a72dd8103 +Author: Eric Anholt +Date: Tue Sep 20 12:24:38 2016 +0100 + + glamor: Require that pixmap depths match for Render copies. + + The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd + replicated a bug from last time we did a copy optimization: CopyArea + is only defined for matching depths. This is only a problem at 15 vs + 16 depth right now (24 vs 32 would also have matching Render formats, + but they should work) but be strict in case we store other depths + differently in the future. + + Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4 + + v2: Drop excessive src->depth == dst->depth check that snuck in. + v3: Switch back to src->depth == dst->depth + v4: Touch up commit message (s/bpp/depth). + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit b87a07567421af05622197eec91a71e4fca4f79e +Author: Eric Anholt +Date: Tue Sep 20 12:14:36 2016 +0100 + + glamor: Fix some awful formatting of some fallback debug code. + + This was clearly x-indent.sh damage. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit ba199cb90157cefab01183f2e2c909895df73321 +Author: Mark Kettenis +Date: Tue Nov 17 22:31:21 2015 +0100 + + glamor: Make glamor_sync_init work with --disable-xshmfence + + Signed-off-by: Mark Kettenis + Signed-off-by: Eric Anholt + Reviewed-by: Hans de Goede + +commit 8bb4b11298c285d2cd1eb28e65729933ec386829 +Author: Matthieu Herrb +Date: Fri Sep 23 16:56:06 2016 +0300 + + glamor: Make glamor_name_from_pixmap work without DRI3 + + This function is used by the modesetting driver to implement DRI2 and + shouldn't fail on systems that don't support DRI3. + + v2: Drop stale commit message wording, fix compiler warning (by anholt) + + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit 128d40b2dd0a26a075a67854455d4208afaa01ca +Author: Eric Engestrom +Date: Sat Apr 2 19:53:18 2016 +0100 + + glamor: fix spelling mistakes + + v2: Fix "orignal" too (review feedback by ajax, change by anholt)_ + + Signed-off-by: Eric Engestrom + Reviewed-by: Eric Anholt + +commit ade315386cee9a65a3885c65e96256880ac6f00a +Author: Keith Packard +Date: Fri Sep 23 09:52:21 2016 +0300 + + Require xproto 7.0.31 + + xproto 7.0.30 had a typo which caused compiles to fail on anything + other than clang + + Signed-off-by: Keith Packard + +commit f72ff1f7ac784f3911fe2f8d746f62f7709f0edc +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 09:34:50 2016 -0700 + + XQuartz: Silence an expected TSan warning + + This code is safe. If the data race fails, the result is that we take the + lock and recheck. + + ================== + WARNING: ThreadSanitizer: data race (pid=31401) + Read of size 1 at 0x00010f5d2500 by thread T11: + #0 wait_for_mieq_init darwinEvents.c:102 (X11.bin+0x00010003155a) + #1 -[X11Application(Private) sendX11NSEvent:] X11Application.m:1330 (X11.bin+0x00010001d652) + #2 __28-[X11Application sendEvent:]_block_invoke X11Application.m:476 (X11.bin+0x00010001887f) + #3 __tsan::invoke_and_release_block(void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x00000005d97b) + #4 _dispatch_client_callout :33 (libdispatch.dylib+0x0000000020ef) + + Previous write of size 1 at 0x00010f5d2500 by thread T8: + [failed to restore the stack] + + Location is global 'mieqInitialized' at 0x00010f5d2500 (X11.bin+0x000100599500) + + Thread T11 (tid=4367138, running) created by thread T-1 + [failed to restore the stack] + + Thread T8 (tid=4367130, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039d2d) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039b96) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cd54) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5b2) + #5 server_main quartzStartup.c:136 (X11.bin+0x000100039fbb) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e25) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e09) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056a4) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race darwinEvents.c:102 in wait_for_mieq_init + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 7d6ebf3f4e4d517bb846d15a5deb131da19a267c +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 00:21:44 2016 -0700 + + XQuartz: Adopt input_lock() and input_unlock() + + This allows us to remove darwinEvents_lock() and darwinEvents_unlock() + and remove the serverRunning hack from dix + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 8bc4727f475321a8adcbbd859f3f8dd9eeb64aa4 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 23:17:19 2016 -0700 + + XQuartz: pbproxy shouldn't need to wait for server initialization. + + Just block on the socket like every other client does. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 81493d30981d7deb38f57bca2a35487add5ea509 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 23:13:20 2016 -0700 + + XQuartz: Remove X11ApplicationFatalError + + AppKit handles crashes on app launch with their own dialog now, so we shouldn't need to do this ourselves. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 9153ec8464336c280f2a6e79ffa443104bbeb98c +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 22:45:16 2016 -0700 + + XQuartz: Don't respond to SIGALRM on the AppKit thread + + ================== + WARNING: ThreadSanitizer: data race (pid=69627) + Write of size 8 at 0x00010dae73f8 by main thread (mutexes: write M262): + #0 SmartScheduleTimer utils.c:1245 (X11.bin+0x0001004b21f9) + #1 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, bool, int, my_siginfo_t*, void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000279f6) + #2 __CFRunLoopRun :77 (CoreFoundation+0x000000087e17) + #3 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #4 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #5 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #6 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #7 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #8 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #9 start :29 (libdyld.dylib+0x000000005254) + + Previous read of size 8 at 0x00010dae73f8 by thread T7: + [failed to restore the stack] + + Location is global 'SmartScheduleTime' at 0x00010dae73f8 (X11.bin+0x0001005b03f8) + + Mutex M262 (0x7d300000bd10) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 __CFRunLoopCreate :77 (CoreFoundation+0x000000054e63) + #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #8 start :29 (libdyld.dylib+0x000000005254) + + Thread T7 (tid=4051693, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x0001000398dd) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039813) + #3 X11ApplicationMain X11Application.m:1286 (X11.bin+0x00010001c804) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #5 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race utils.c:1245 in SmartScheduleTimer + ================== + ================== + WARNING: ThreadSanitizer: signal handler spoils errno (pid=69627) + #0 SmartScheduleTimer utils.c:1244 (X11.bin+0x0001004b21a0) + #1 __CFRunLoopRun :77 (CoreFoundation+0x000000087e17) + #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #8 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: signal handler spoils errno utils.c:1244 in SmartScheduleTimer + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2740dc1937e8ab32b4930f4086c302e6602a7bad +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 01:25:13 2016 -0700 + + dix: Silence TSan warnings when checking for pending input + + V2: Moves InputCheckPending() into dix.h + + Bumps required version of xproto to 7.0.30 + + ================== + WARNING: ThreadSanitizer: data race (pid=4943) + Read of size 4 at 0x00010c4e3854 by thread T8: + #0 WaitForSomething WaitFor.c:237 (X11.bin+0x00010049216c) + #1 Dispatch dispatch.c:413 (X11.bin+0x000100352ed9) + #2 dix_main main.c:287 (X11.bin+0x00010036e894) + #3 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + Previous write of size 4 at 0x00010c4e3854 by thread T12 (mutexes: write M856, write M1976): + #0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448d14) + #1 DarwinSendDDXEvent darwinEvents.c:641 (X11.bin+0x000100033613) + #2 DarwinProcessFDAdditionQueue_thread darwinEvents.c:338 (X11.bin+0x000100032039) + + Location is global 'miEventQueue' at 0x00010c4e3850 (X11.bin+0x0001005ab854) + + Mutex M856 (0x00010c4c8c80) created at: + #0 pthread_mutex_lock :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000321fe) + #1 DarwinListenOnOpenFD darwinEvents.c:300 (X11.bin+0x000100031607) + #2 socket_handoff bundle-main.c:288 (X11.bin+0x000100002b40) + #3 __do_request_fd_handoff_socket_block_invoke bundle-main.c:379 (X11.bin+0x0001000029ba) + #4 __tsan::invoke_and_release_block(void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x00000005d97b) + #5 _dispatch_client_callout :33 (libdispatch.dylib+0x0000000020ef) + + Mutex M1976 (0x00010c4e3d68) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 input_lock inputthread.c:103 (X11.bin+0x00010049fd10) + #2 TimerSet WaitFor.c:343 (X11.bin+0x0001004926c2) + #3 RootlessQueueRedisplay rootlessScreen.c:594 (X11.bin+0x000100065d7f) + #4 RootlessInstallColormap rootlessScreen.c:514 (X11.bin+0x000100069f1a) + #5 miSpriteInstallColormap misprite.c:562 (X11.bin+0x000100467095) + #6 miCreateDefColormap micmap.c:270 (X11.bin+0x000100440399) + #7 DarwinScreenInit darwin.c:285 (X11.bin+0x0001000303bb) + #8 AddScreen dispatch.c:3908 (X11.bin+0x00010036c417) + #9 InitOutput darwin.c:671 (X11.bin+0x00010002fdeb) + #10 dix_main main.c:197 (X11.bin+0x00010036e228) + #11 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + Thread T8 (tid=4198779, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039dad) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039c16) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cde4) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a642) + #5 server_main quartzStartup.c:136 (X11.bin+0x00010003a03b) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002eb5) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e99) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100005734) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + Thread T12 (tid=4198797, running) created by thread T8 at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread darwinEvents.c:121 (X11.bin+0x000100031ecf) + #2 DarwinEQInit darwinEvents.c:365 (X11.bin+0x000100031860) + #3 InitInput darwin.c:571 (X11.bin+0x00010002ea09) + #4 dix_main main.c:261 (X11.bin+0x00010036e7ce) + #5 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + SUMMARY: ThreadSanitizer: data race WaitFor.c:237 in WaitForSomething + ================== + ================== + WARNING: ThreadSanitizer: data race (pid=22841) + Write of size 4 at 0x000105bbd864 by main thread (mutexes: write M1945): + #0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448cf4) + #1 DarwinSendDDXEvent darwinEvents.c:642 (X11.bin+0x000100033693) + #2 -[X11Controller set_window_menu:] X11Controller.m:275 (X11.bin+0x0001000222fd) + #3 -[X11Application set_window_menu:] X11Application.m:486 (X11.bin+0x000100018b44) + #4 -[X11Application handleMachMessage:] X11Application.m:177 (X11.bin+0x000100016678) + #5 __NSFireMachPort :69 (Foundation+0x00000009b62b) + #6 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5f2) + #7 server_main quartzStartup.c:136 (X11.bin+0x000100039ffb) + #8 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e65) + #9 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e49) + #10 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056e4) + #11 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #12 start :29 (libdyld.dylib+0x000000005254) + + Previous read of size 4 at 0x000105bbd864 by thread T7: + #0 Dispatch dispatch.c:434 (X11.bin+0x000100352fc8) + #1 dix_main main.c:287 (X11.bin+0x00010036e874) + #2 server_thread quartzStartup.c:66 (X11.bin+0x000100039e23) + + Location is global 'miEventQueue' at 0x000105bbd860 (X11.bin+0x0001005ab864) + + Mutex M1945 (0x000105bbdd78) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 input_lock inputthread.c:103 (X11.bin+0x00010049fd10) + #2 TimerSet WaitFor.c:348 (X11.bin+0x0001004926c2) + #3 RootlessQueueRedisplay rootlessScreen.c:594 (X11.bin+0x000100065d3f) + #4 RootlessInstallColormap rootlessScreen.c:514 (X11.bin+0x000100069eda) + #5 miSpriteInstallColormap misprite.c:562 (X11.bin+0x000100467075) + #6 miCreateDefColormap micmap.c:270 (X11.bin+0x000100440379) + #7 DarwinScreenInit darwin.c:285 (X11.bin+0x00010003036b) + #8 AddScreen dispatch.c:3914 (X11.bin+0x00010036c3f7) + #9 InitOutput darwin.c:671 (X11.bin+0x00010002fd9b) + #10 dix_main main.c:197 (X11.bin+0x00010036e208) + #11 server_thread quartzStartup.c:66 (X11.bin+0x000100039e23) + + Thread T7 (tid=4257217, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039d6d) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039bd6) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cd94) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5f2) + #5 server_main quartzStartup.c:136 (X11.bin+0x000100039ffb) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e65) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e49) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056e4) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race mieq.c:263 in mieqEnqueue + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Keith Packard + +commit 7ff8a74945c0cb525a2d197e28426fd098a407cf +Author: Keith Packard +Date: Thu Sep 22 02:53:46 2016 +0300 + + os: Clear saved poll events in listen so that edge triggering works + + When a client is marked as write blocked, clear any old 'write ready' + bit in the osfds structure so that a new indication of write ready + (which is marked as edge trigggered) will trigger the callback. + + Signed-off-by: Keith Packard + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + Tested-by: Matthieu Herrb + +commit 1d365f1ffe0362732b64e565db6ae8af718758f2 +Author: Keith Packard +Date: Thu Sep 22 02:53:45 2016 +0300 + + os: Ready clients with pending output aren't flushed, so set NewOutputPending + + When a client with pending output is ready (has request data pending), + FlushAllOutput will skip it to get all of the requests processed + before sending any queued output. That means FlushAllOutput is going + to return with some output pending to a client which isn't known to be + write blocked. And that means NewOutputPending needs to be set so that + FlushAllOutput will get called again to actually go flush this client. + + It might be interesting to try just flushing the client to send any + queued data along the way. This patch just restores the server + behavior to what it was before the ospoll changes. + + Signed-off-by: Keith Packard + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + Tested-by: Matthieu Herrb + +commit d0c5d205a919fc1d2eb599356090b58b1bf0176d +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 01:13:02 2016 -0700 + + dix: Make InitCoreDevices() failures more verbose. + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 5794bdd52821463acf691c4230741f6b4289669b +Author: Mihail Konev +Date: Wed Sep 14 11:47:15 2016 +0100 + + xkb: fix turbo-repeat of RedirectKey-ed keysyms + + RedirectKey() action had been broken by commit 2e6190. + A dropped check caused over-intense autorepeat of keysyms enriched + with the action. + + Previous to this commit, the check wrapped the entire switch() block, + which was dropped with the move to a separate function. + + Restore the checking. + + Signed-off-by: Mihail Konev + Reviewed-by: Daniel Stone + Signed-off-by: Peter Hutterer + +commit fc1c358b955258ce675e49490de7c3b8ddee2b76 +Author: Keith Packard +Date: Mon Sep 19 09:02:57 2016 -0700 + + Bump to 1.18.99.901 (1.19 RC1) + + Signed-off-by: Keith Packard + +commit 5998da7855750dd947288349a0b14e65db1e3c8c +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:56 2016 +0800 + + dix: Incroduce CursorConfinedTo vfunc in Screen + + This function will be called when a pointer is grabbed non-root window + set as the 'confineTo'. This will enable the ddx to handle the + confinement their own way. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit daf48a3aba7d5c42d7156f0d0e2b1d8aae423303 +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:55 2016 +0800 + + dix: Introduce CursorWarpedTo vfunc in Screen + + This new vfunc will be called, if set, after a client has issued a + WarpPointer request. This is necessary for implementing pointer warp + emulation in Xwayland. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 3ef51c5c74297937002668b0c507fa88550db67e +Author: Keith Packard +Date: Fri Sep 16 10:03:49 2016 -0700 + + Bump version to 1.18.99.2 + + Prepare for 1.19 RC1 + + Signed-off-by: Keith Packard + +commit 86038dfd42d6f6da9646ef2f87b2ab8ccba98e02 +Author: Keith Packard +Date: Fri Sep 16 10:56:15 2016 -0700 + + os: Add 'ospoll.h' to Makefile.am + + Distribute this source file. + + Signed-off-by: Keith Packard + +commit 56972d007dcde93693cb9e39931978b744942e5b +Author: Keith Packard +Date: Fri Sep 16 10:55:27 2016 -0700 + + include: Add 'xserver_poll.h' to Makefile.am + + Make sure this file is included in the tarball. + + Signed-off-by: Keith Packard + +commit 61b159f5a79130a9661064d3f0143e5d6107985a +Author: Keith Packard +Date: Fri Sep 16 10:54:37 2016 -0700 + + hw/xwin: Add 'dri' to DIST_SUBDIRS + + This creates the needed Makefile.in files during 'make dist' or 'make + distcheck' + + Signed-off-by: Keith Packard + +commit 93f474e49b24abc673cb9cf5ea16fac296dce312 +Author: Keith Packard +Date: Fri Sep 16 10:43:09 2016 -0700 + + Remove 'dixfontstubs.h' from include EXTRA_DIST + + This file was removed when moving to the new libXfont API, but + accidentally left in EXTRA_DIST. + + Signed-off-by: Keith Packard + +commit 5b9f3ea2501a886fb74e5248e82a95e76443f1e8 +Author: Michel Dänzer +Date: Thu Jan 14 18:09:44 2016 +0900 + + xfree86/modes: Set RandR primary output from CreateScreenResources + + Fixes XRRGetOutputPrimary and xrandr not reporting a primary output after + startup. This was especially confusing when an output was explicitly + marked as primary using Option "Primary" in Section "Monitor". + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit bd8ecd9be1568b59258b6d2f78530ede345b7c7a +Author: Michel Dänzer +Date: Fri Sep 16 09:51:31 2016 -0700 + + Add SyncSharedPixmap ScreenRec hook + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 7f6fa4e449f5a7215bbf60ce8c874e163a7453a9 +Author: Qiang Yu +Date: Mon Sep 5 18:05:42 2016 +0800 + + modesetting: fix compile error when --disable-glamor + + Move ms_flush_drm_events out of GLAMOR ifdef. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97586 + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + Signed-off-by: Keith Packard + +commit d81f9ce12aa4ac54b9c2b8c74c2f827c1f3e739a +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 03:07:44 2016 -0700 + + dix/dispatch: Fix SmartScheduleClient interval adjustment to use best rather than pClient + + pClient does not contain a live value after the transition to lists + + https://bugs.freedesktop.org/show_bug.cgi?id=97765 + + Application Specific Information: + X.Org X Server 1.18.99.1 Build Date: 20160910 + ================================================================= + ==16921==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000108ce3834 at pc 0x000108880766 bp 0x7000045f76c0 sp 0x7000045f76b8 + READ of size 4 at 0x000108ce3834 thread T6 + #0 0x108880765 in SmartScheduleClient dispatch.c:365 + #1 0x10887ecc5 in Dispatch dispatch.c:422 + #2 0x1088c05f1 in dix_main main.c:301 + #3 0x1082aabba in server_thread quartzStartup.c:66 + #4 0x7fffc5f16aaa in _pthread_body (libsystem_pthread.dylib+0x3aaa) + #5 0x7fffc5f169f6 in _pthread_start (libsystem_pthread.dylib+0x39f6) + #6 0x7fffc5f161fc in thread_start (libsystem_pthread.dylib+0x31fc) + + Regressed-in: 8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 265c4e66533243b60d92cffc7769ecadb0292c8d +Merge: 3caf671 f5f4d32 +Author: Keith Packard +Date: Thu Sep 15 21:32:46 2016 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 3caf671ed2a8a79856409a109355fc0f393d7aed +Author: Keith Packard +Date: Wed Sep 14 22:40:32 2016 -0700 + + config/dbus: Initialize dbus fd to -1 so teardown doesn't use fd 0 + + The dbus teardown code is called when the server fatal errors even if + that is before dbus has ever been initialized. By statically + initializing the value of bus_info.fd, we avoid calling RemoveNotifyFd + on stdin. + + Signed-off-by: Keith Packard + Reviewed-by: Julien Cristau + Reviewed-by: Peter Hutterer + +commit f5f4d32ac7c250cfbfb94883ce7d7e46151e89f0 +Author: Jon Turney +Date: Thu Jul 24 12:29:41 2014 +0100 + + Add Windows-DRI extension + + If windowsdriproto headers are available, build a Windows-DRI extension, + which supports requests to enable local clients to directly render GL to a + Windows drawable: + + - a query to check if WGL is being used on a screen + - a query to map a fbconfigID to a native pixelformatindex + - a query to map a drawable to a native handle + + Windows-DRI can only be useful if we are using WGL, so make an note if WGL + is active on a screen. + + Make validGlxDrawable() public + + Adjust glxWinSetPixelFormat() so it doesn't require a context, just a + screen and config. + + That enables factoring out the deferred drawable creation code as + glxWinDeferredCreateDrawable() + + Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a + file mapping, so they exist in memory which can be shared with the direct + rendering process. + + Currently, this file mapping is accessed by a name generated from the XID. + This will not be unique across multiple server instances. It would perhaps + be better, although more complicated, to use an anonymous file mapping, and + then duplicate the handle for the direct rendering process. + + Use glxWinDeferredCreateDrawable() to ensure the native handle exists for + the Windows-DRI query to map a drawable to native handle. + + v2: + Various printf format warning fixes + + v3: + Fix format warnings on x86 + Move some uninteresting windows-dri output to debug log level + + v4: + check for windowsdriproto when --enable-windowsdri + use windowsdriproto_CFLAGS + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 +Author: Keith Packard +Date: Thu Sep 8 11:02:30 2016 -0600 + + Hold input lock for deviceProc + + This ensures that the deviceProc is never called while the input + thread is processing data from the device. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit dfc91f0f630f9e0500fc28b18e3f2851024d719f +Author: Keith Packard +Date: Thu Sep 8 11:02:31 2016 -0600 + + Hold input lock while calling input device SetProperty callback + + This keeps the input driver SetProperty function from being called + while input events are being processed. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c4799f186b31e579721f5874c897f3f46db6ad0a +Author: Alan Coopersmith +Date: Sat Sep 10 21:14:19 2016 -0700 + + os: Use pthread_setname_np to set thread names if available + + Autoconf logic borrowed from glib + + Signed-off-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + +commit 75c1d04650f63464263c159d2e95364482be724f +Author: Alan Coopersmith +Date: Sat Sep 10 21:08:01 2016 -0700 + + os: OsSigHandler should not show rtld errors for unrelated signals + + If RTLD_DI_SETSIGNAL is set to let us turn runtime linker/loader errors + into catchable signals, then we should only show the errors when catching + that signal, instead of tossing out red herrings to distract people with + unrelated crashes long after their last failed symbol lookup (especially + when using drivers built to support multiple API's by checking which + symbols are available before calling them). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Reviewed-by: Aaron Plattner + +commit 065eb6612492bacf4d7caaad90e35dafc2cbf7ea +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 19:56:52 2016 -0700 + + os/inputthread: Fix setting of cloexec on file descriptors + + O_CLOEXEC is not a file bit. It is not setable with F_SETFL. One must + use it when calling open(2). To set it cloexec on an existing fd, + F_SETFD and FD_CLOEXEC must be used. + + This also fixes a build failure regression on configurations that don't + have O_CLOEXEC defined. + + cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html + Regressed-in: 30ac7567980a1eb79d084a63e0e74e1d9a3af673 + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + +commit a5769de0f5399053e9864b753fa9755220d65ae0 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 19:47:47 2016 -0700 + + Xext/shm: Fix usage of F_GETFD to match standard + + flags = fcntl(fd, F_GETFD) is compliant. + + fcntl(fd, F_GETFD, &flags) is non-compliant (Linux extension?) + + cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + +commit 7def2fea30060d47780dc1eedc91fada5ae1934f +Author: Jeremy Huddleston Sequoia +Date: Sat Sep 10 23:37:46 2016 -0700 + + Xquartz: Update for removal of AddEnabledDevice and RemoveEnabledDevice + + Regressed-in: be5a513fee6cbf29ef7570e57eb0436d70fbd88c + Signed-off-by: Jeremy Huddleston Sequoia + +commit 4f4ecd0f41cf1c710d3ef1626b747847e6184f4c +Author: Jeremy Huddleston Sequoia +Date: Sat Sep 10 22:16:11 2016 -0700 + + XQuartz: Cleanup CPPFLAGS that are no longer necessary on darwin + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 33d595255d4206df0d136014de33100817cbe344 +Author: Jeremy Huddleston Sequoia +Date: Sun May 29 14:01:38 2016 -0700 + + XQuartz: Fix the issue where the h key could be come "stuck" after hiding XQuartz with cmd-h + + The issue was that we set a flag to ignore the k key's up event when sent + the cmd-h down event, but because the cmd-h keycode hides XQuartz, we + became !_x_active by the time the event is delivered which caused us to + go down a differnet codepath rather than getting a chance to ignore it. + We then incorrectly ignored the next h up key. + + https://bugs.freedesktop.org/show_bug.cgi?id=92648 + + Signed-off-by: Jeremy Huddleston Sequoia + +commit d8e05c04758cbcd7b5c11362cb28ce017d50098b +Author: Hans de Goede +Date: Wed Aug 24 15:00:13 2016 +0200 + + modesetting: Fall back to primary crtc for vblank for drawables on slave outputs + + This fixes glxgears running at 1 fps when fully covering a slave-output + and the modesetting driver is used for the master gpu. + + Reported-by: Peter Wu + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 7ade8ba10e1e767bb510343c86573bc5d4804b92 +Author: Hans de Goede +Date: Wed Aug 24 14:55:27 2016 +0200 + + modesetting: ms_covering_crtc: Allow calling on non modesetting Screens + + 99% of the code in ms_covering_crtc is video-driver agnostic. Add a + screen_is_ms parameter when when FALSE skips the one ms specific check, + this will allow calling ms_covering_crtc on slave GPUs. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 238248d67e6a422f31e8864c0b15d693a658cdac +Author: Hans de Goede +Date: Mon Aug 15 12:02:54 2016 +0200 + + modesetting: Implement DRI2InfoRec version 9 callbacks + + Implement the CreateBuffer2 / DestroyBuffer2 / CopyRegion2 DRI2InfoRec + version 9 callbacks, this is necessary for being an offload source + provider with DRI2. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 03a7c50202f61030830ff639fccf52091e02156c +Author: Hans de Goede +Date: Mon Aug 15 10:44:57 2016 +0200 + + modesetting: ms_dri2_create_buffer: check screen of existing front buffers + + If a frontbuffer drawable already has a pixmap, make sure it was created + on the right screen. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 35c4e96ed1d372dd161480be8cddcd2d4549e449 +Author: Hans de Goede +Date: Mon Sep 12 12:47:59 2016 +0200 + + randr: Fix crtc_bounds when using rotation combined with reflection + + Before this commit crtc_bounds() did not take reflection into account, + when using reflection with 0 / 180 degree rotation this was not an + issue because of the default in the switch-case doing the right thing. + + But when using 90 / 270 degree rotation we would also end up in the + default which is wrong in this case. This would lead to the cursor + being constrained to a height x height area of the monitor. + + This commit masks out the reflection bits for the switch-case, + making crtc_bounds return the correct bounds and fixing the + problematic cursor constraining. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 7b634067c13045671685a9f00bfbac626ed68f94 +Author: Dave Airlie +Date: Wed Jul 15 10:15:51 2015 +1000 + + xf86Cursor: Add hw cursor support for prime + + Currently with PRIME if we detect a secondary GPU, + we switch to using SW cursors, this isn't optimal, + esp for the intel/nvidia combinations, we have + no choice for the USB offload devices. + + This patch checks on each slave screen if hw + cursors are enabled, and also calls set cursor + and move cursor on all screens. + + Cc: Aaron Plattner + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + Reviewed-by: Keith Packard + +commit df88008f92f85ef96d9fe48ac509d027570424eb +Author: Hans de Goede +Date: Tue Sep 6 11:48:31 2016 +0200 + + xf86Cursor: Deal with rotation on GPU screens using a hw-cursor + + When a slave-output is rotated the transformation is done on the blit + from master to slave GPU, so crtc->transform_in_use is not set, but we + still need to adjust the mouse position for things to work. + + This commit modifies xf86_crtc_transform_cursor_position to not rely + on crtc->f_framebuffer_to_crtc, so that it can be used with GPU screens + too and always calls it for crtcs with any form of rotation. + + Note not using crtc->f_framebuffer_to_crtc means that crtc->transform + will not be taken into account, that is ok, because when we've a transform + active hw-cursors are not used and xf86_crtc_transform_cursor_position + will never get called. + + Signed-off-by: Hans de Goede + Reviewed-and-Tested-by: Michel Dänzer + +commit f82fd47016628e8bcdcba3aab506a919fe8c49d8 +Author: Hans de Goede +Date: Tue Sep 6 11:50:50 2016 +0200 + + xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly + + xf86_crtc_rotate_coord should be the exact inverse operation of + xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270 + degrees rotation it was using height to calculate x / width to calculate y, + instead of the otherway around. + + This was likely not noticed before since xf86_crtc_rotate_coord + until now was only used with cursor_info->MaxWidth and + cursor_info->MaxHeight, which are usally the same. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit b0b04cb266a62675dd7cde97111ebe7c1552db9a +Author: Hans de Goede +Date: Tue Sep 6 13:14:35 2016 +0200 + + xf86Cursor: Fix xf86CurrentCursor to work on slave GPU Screens + + The CurrentCursor is always attached to the master GPU. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 71fecc84e9ceb11ff61c912bdaa3fc959ec36bef +Author: Dave Airlie +Date: Tue Sep 6 13:02:32 2016 +0200 + + xf86Cursor: Add xf86CheckHWCursor() helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 2eefb53f58854ef9d34859583207ec37d3c3047a +Author: Hans de Goede +Date: Tue Sep 6 13:15:36 2016 +0200 + + randr: Add RRHasScanoutPixmap helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit a52530a655438f03919d47f6edd11287efff47bb +Author: Dave Airlie +Date: Tue Sep 6 12:50:14 2016 +0200 + + dix: Add dixPrivatesCreated helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit 3fe4107643ba029dd48e3d12ec9bc97d07112300 +Author: Hans de Goede +Date: Thu Sep 8 09:30:31 2016 +0200 + + glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged + + When a GPU gets hotplugged while X is already running, glamor_egl_init() + gets called and changes the current egl context, without updating + lastGLContext, potentially causing the next glamor call on another GPU to + run in the wrong context. + + This causes glamor to e.g. crash in the next glamor_create_pixmap() call + (called through the master's screen->CreatePixmap), note this is not the + only troublesome entry point I've seen other backtraces when using a + compositing window manager. + + Set lastGLContext to NULL to force the next glamor_make_current() call + to set the right context. + + Note that we cannot use glamor_make_current() here to replace the + eglMakeCurrent() call and update lastGLContext for us because + glamor_make_current takes a glamor_priv struct as argument and that + has not been created yet when glamor_egl_init() gets called. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit 1075af8a6c26009c04db30a6d6d1f10070568ab1 +Author: Hans de Goede +Date: Mon Aug 15 11:10:15 2016 +0200 + + modesetting: Remove some dead code + + The "if (pixmap) ..." block this commit removes is inside an + "if (pixmap == NULL) ..." block, so it will never execute. + + Signed-off-by: Hans de Goede + Reviewed-by: Aaron Plattner + +commit dfa295b29c20b174f80ab823eef41e5211a6a921 +Author: Hans de Goede +Date: Wed Aug 24 14:13:19 2016 +0200 + + modesetting: ms_covering_crtc: Remove unused arguments, make static + + Remove unused arguments from ms_covering_crtc, make it static as it is + only used in vblank.c. + + While at it also change its first argument from a ScrnInfoPtr to a + ScreenPtr, this makes the next patch in this patch-set cleaner. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit cb7b145a25452de8b549e8c8e9ec3bcc752e55dc +Author: Hans de Goede +Date: Wed Aug 17 12:03:41 2016 +0200 + + modesetting: Fix msSharePixmapBacking returning a non-linear bo + + glamor_fd_from_pixmap() may return a tiled bo, which is not suitable + for sharing with another GPU as tiling usually is GPU specific. + + Switch to glamor_shareable_fd_from_pixmap(), which always returns a + linear bo. This fixes mis-rendering when running the mode setting + driver on the master gpu in a dual-gpu setup and running an opengl + app with DRI_PRIME=1. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit a74d553cb97d545148bd2f81b7bd021cca94e076 +Author: Hans de Goede +Date: Tue Aug 23 12:18:56 2016 +0200 + + glamor: Add glamor_shareable_fd_from_pixmap() + + Add glamor_shareable_fd_from_pixmap function to get dma-buf fds suitable + for sharing across GPUs (not using GPU specific tiling). + + This is necessary for the modesetting driver to correctly implement + the DRI2 SharePixmapBacking callback. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit 527c6baa294d17c5eca1d87ac941844872e90dac +Author: Ran Benita +Date: Wed Aug 29 12:33:34 2012 +0300 + + xkb: fix check for appending '|' character when applying rules + + There are two ways to separate multiple files in XKB include statements: + '+' will cause the later file to override the first in case of conflict, + while '|' will cause it augment it (this is done by xkbcomp). '!' is + unrelated here. + Currently, if someone tries to use '|' in a rule instead of '+', it + won't have any effect. Since '|' is practically never used, this wasn't + noticed. + + Signed-off-by: Ran Benita + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 392da389d7b0e9dd970741dcd5321a4e0fd3aef5 +Author: Adam Jackson +Date: Wed Mar 30 14:04:04 2016 -0400 + + glx: Fix computation of GLX_X_RENDERABLE fbconfig attribute + + >From the GLX spec: + + "GLX_X_RENDERABLE is a boolean indicating whether X can be used to + render into a drawable created with the GLXFBConfig. This attribute + is True if the GLXFBConfig supports GLX windows and/or pixmaps." + + Every backend was setting this to true unconditionally, and then the + core ignored that value and sent true unconditionally on its own. This + is broken for ARB_fbconfig_float and EXT_fbconfig_packed_float, which + only apply to pbuffers, which are not renderable from non-GLX APIs. + + Instead compute GLX_X_RENDERABLE from the supported drawable types. The + dri backends were getting _that_ wrong too, so fix that as well. + + This is not a functional change, as there are no mesa drivers that claim + to support __DRI_ATTRIB_{UNSIGNED_,}FLOAT_BIT yet. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 589f42e9830e66a7e26475fc9a8b91034b5aad86 +Author: Rui Matos +Date: Sun Jun 26 19:48:23 2016 +0200 + + xwayland: Process queued events before making wayland mods effective + + Since xwayland's initial commit we have had a check to not process + wayland modifier events while one of our surfaces has keyboard focus + since the normal xkb event processing keeps our internal modifier + state up to date and if we use the modifiers we get from the + compositor we mess up that state. + + This was slightly changed in commit + 10e9116b3f709bec6d6a50446c1341441a0564e4 to allow the xkb group to be + set from the wayland event while we have focus in case the compositor + triggers a group switch. + + There's a better solution to the original problem though. Processing + queued events before overriding the xkb state with the compositor's + allows those events to be sent properly modified to X clients while + any further events will be modified with the wayland modifiers as + intended. + + This allows us to fully take in the wayland modifiers, including + depressed ones, which fixes an issue where we wouldn't be aware of + already pressed modifiers on enter. + + Signed-off-by: Rui Matos + Tested-by: Olivier Fourdan + Reviewed-by: Daniel Stone + Signed-off-by: Peter Hutterer + +commit deae9c7e846e244e5d62b2dcfb6663fde0e12cbb +Author: Eric Anholt +Date: Wed Aug 31 17:00:00 2016 -0700 + + test: Run some XTS5 integration tests against Xvfb if possible. + + By default the tests will be skipped. However, if you set XTEST_DIR + to the repo of a built X Test Suite and PIGLIT_DIR to a piglit repo + (no build necessary), make check will run piglit's xts-render tests + against Xvfb. + + We could run more of XTS5, but I haven't spent the time identifying + what additional subset would be worth running, since much of it is + only really testing the client libraries. We want to make sure that + we keep the runtime down, and this subset of the test suite took 92 + seconds according to piglit. + + Reviewed-by: Adam Jackson + +commit f06aef31c0b2ab62d915a469a399d82a1a73ac28 +Author: Qiang Yu +Date: Mon Aug 22 18:14:18 2016 +0800 + + modesetting: add DRI2 page flip support + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 4a839da6274b76424ee7cbc2deba2693e97e8186 +Author: Qiang Yu +Date: Mon Aug 22 18:14:17 2016 +0800 + + modesetting: move common page flip handle to pageflip.c + + The common page flip handle framework can be shared with DRI2 + page flip. + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 4f1eb7864b61d0c992c5eff3339085e887792048 +Author: Qiang Yu +Date: Mon Aug 22 18:14:16 2016 +0800 + + modesetting: move ms_do_pageflip to pageflip.c + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit a586bf9ccf60b2cc66953555e82eeb6a8e0b4ca9 +Author: Qiang Yu +Date: Mon Aug 22 18:14:15 2016 +0800 + + modesetting: make ms_do_pageflip generic for share with DRI2 + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 7d33ab0f8c7958b205076f71e4b47c24aace77fd +Author: Adam Jackson +Date: Tue Jun 28 15:54:44 2016 -0400 + + dri2: Don't make reference to noClientException + + noClientException is now never filled in with a meaningful value, it's + always -1. The sole caller of this function disregards the error value + in any case. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit dff435568b40286df2bf7a66e870f9ae5f4eb9bd +Author: Adam Jackson +Date: Tue Jun 28 15:54:43 2016 -0400 + + dri3: Don't do return client->noClientException + + Hasn't been necessary since: + + commit 92ed75ac59e2d3af149cddb962efd05fc8487750 + Author: Jamey Sharp + Date: Mon May 10 20:22:05 2010 -0700 + + Eliminate boilerplate around client->noClientException. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 65493c0b73f6ee65b2a8fcaa4a15b0c453ff72b1 +Author: Adam Jackson +Date: Tue Jun 28 15:54:42 2016 -0400 + + sync: Don't do return client->noClientException + + Hasn't been necessary since: + + commit 92ed75ac59e2d3af149cddb962efd05fc8487750 + Author: Jamey Sharp + Date: Mon May 10 20:22:05 2010 -0700 + + Eliminate boilerplate around client->noClientException. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit bc3eed379ee5b4176db848708799fb2d5db16531 +Author: Hans De Goede +Date: Wed Aug 31 15:37:20 2016 +0200 + + modesetting: Hide cursor when initializing crtc + + When Xorg gets started directly from a wayland-gdm the crtc still has the + wayland hw cursor set. Combine this with Xorg immediately falling back to + a sw cursor because a slave-output has a monitor attached at startup; and + we end up with the wayland hardware cursor overlay fixed in its last + position + the Xorg sw cursor resulting in 2 cursors. + + This commit fixes this by hiding any left-over cursors when initializing + the crtc. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 6c984ac9a737304ab5e26de90c76a79d970b6e33 +Author: Hans De Goede +Date: Wed Aug 31 16:11:11 2016 +0200 + + modesetting: Do not use function local static variables + + The modesetting driver may be driving 2 screens (slave and master + gpu), which may have different behavior wrt hardware cursor support. + + So stop using static variables and instead store the hw-cursor support + related data in a per screen struct. While at it actually make it per + crtc data as in theory different crtc's could have different hw-cursor + support. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit d8c288ec371a853bcd023217f34893a0efae65ea +Author: Michael Thayer +Date: Wed Aug 24 08:48:13 2016 +1000 + + xi2: fix FocusIn grabs + + Fix a couple of copy-and-paste errors preventing FocusIn grabs from working. + Perhaps the extension version should be bumped though to distinguish between + working and non-working extension versions. + + Signed-off-by: Michael Thayer + Reviewed-by: Peter Hutterer + +commit 25e4f9ee68b99c2810efdb6cd8c56affa45e1fea +Author: Peter Hutterer +Date: Tue Aug 23 13:43:42 2016 +1000 + + xfree86: print the module name together with the load failure message + + We're happily printing the error to stdout but not which module caused it... + That's in the Xorg.log but that's at least one click away. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit be334f42a198a25e817e6dab43dd0e30aa1cd4f8 +Author: Michel Dänzer +Date: Thu Aug 18 09:40:34 2016 +0900 + + glamor: Declare "pos" in the composite glyph GLSL 1.20 vertex shader + + Fixes shader compile failure: + + 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 + + Program source: + #define ATLAS_DIM_INV 0.000976562500000000 + attribute vec2 primitive; + attribute vec2 source; + varying vec2 glyph_pos; + uniform vec2 fill_offset; + uniform vec2 fill_size_inv; + varying vec2 fill_pos; + uniform vec4 v_matrix; + void main() { + gl_Position.xy = primitive.xy * v_matrix.xz + v_matrix.yw; + gl_Position.zw = vec2(0.0,1.0); + glyph_pos = source.xy * ATLAS_DIM_INV; + fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv; + } + (EE) Fatal server error: + (EE) GLSL compile failure + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97300 + Reviewed-by: Keith Packard + +commit cba28d572ac799391beacd89d57e69d0d7ed70e7 +Author: Michel Dänzer +Date: Tue Jul 12 12:25:13 2016 +0900 + + glamor: Handle bitplane in glamor_copy_fbo_cpu + + This can significantly speed up at least some CopyPlane cases, e.g. + indirectly for stippled fills. + + v2: + * Make temporary pixmap the same size as the destination pixmap + (instead of the destination drawable size), and fix coordinate + parameters passed to fbCopyXtoX and glamor_upload_boxes. Fixes + incorrect rendering with x11perf -copyplane* and crashes with the + xscreensaver phosphor hack. + v3: + * Make the change a bit more compact and hopefully more readable by + re-using the existing src_* locals in the bitplane case as well. + + Reported-by: Keith Raghubar + Reviewed-by: Alex Deucher + Acked-by: Eric Anholt + +commit 6e5bec261c3f7af069b57618d6c82b070dc4579d +Author: Olivier Fourdan +Date: Thu Jun 23 15:31:30 2016 +0200 + + wayland: Emulate crossing for native window + + Emitting a LeaveNotify event every time the pointer leaves an X11 window + may confuse focus follow mouse mode in window managers such as + mutter/gnome-shell. + + Keep the previously found X window and compare against the new one, and + if they match then it means the pointer has left an Xwayland window for + a native Wayland surface, only in this case fake the crossing to the + root window. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 48c5c23a1b250c7f9d7a1747c76e4669ebf752cf +Author: Hans De Goede +Date: Mon Aug 8 14:53:59 2016 +0200 + + Fix Xorg -configure not working anymore + + Xorg -configure relies on the bus implementation, e.g. + xf86pciBus.c to call xf86AddBusDeviceToConfigure(). The new + xf86platformBus code does not have support for this. + + Almost all drivers support both the xf86platformBus and xf86pciBus + nowadays, and the generic xf86Bus xf86CallDriverProbe() function + prefers the new xf86platformBus probe method when available. + + Since the platformBus paths do not call xf86AddBusDeviceToConfigure() + this results in Xorg -configure failing with the following error: + "No devices to configure. Configuration failed.". + + Adding support for the xf86Configure code to xf86platformBus.c + is non trivial and since we advise users to normally run without + any Xorg.conf at all not worth the trouble. + + However some users still want to use Xorg -configure to generate a + template config file, this commit implements a minimal fix to make + things work again for PCI devices by skipping the platform + probe method when xf86DoConfigure is set. + + This has been tested on a system with integrated intel graphics, + with both the intel and modesetting drivers and restores Xorg -configure + functionality on both cases. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 6acd0d098add5a14f23d326ac6ee8cebab14b86a +Author: Adam Jackson +Date: Wed Aug 17 10:32:28 2016 -0400 + + test: Remember to swap the window argument to XIQueryPointer + + Before 5c69cb60 this wouldn't matter, because ProcXIQueryPointer + manually emitted its own error before (bogusly) returning Success to the + main loop. Since these tests only look at the return value of the + dispatch function we'd think things succeeded even when we'd generated + an error. + + With that fixed, the test code's failure to swap the window id would + make dixLookupWindow (rightly) throw BadWindow. + + Reviewed-and-Tested-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 5c69cb604a144bdced7d066eaca574aa44e8cb36 +Author: Adam Jackson +Date: Mon Jun 20 12:57:12 2016 -0400 + + xinput: Let top-level dispatch generate the error + + ... instead of calling SendErrorToClient ourselves. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 2f981c06a5b9b9eab5e8a9b1d0a18281c0d1033f +Author: Adam Jackson +Date: Mon Jun 20 12:57:11 2016 -0400 + + xv: Remove some dumb calls SendErrorToClient + + We already generate errors from the top level when non-Success is + returned from a dispatch function, so really we were emitting errors + twice. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 0bfa6bf9def43fd14bc79a302b912454e82999b1 +Author: Adam Jackson +Date: Mon Jun 20 12:57:10 2016 -0400 + + xwayland: Fix relinking when dix changes + + Without this a change in eg Xext/ wouldn't relink Xwayland, making you + wonder why your changes didn't have any effect. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit bf2ca502b9cd07044cba56499d5c092deb9d73f5 +Author: Keith Packard +Date: Mon Aug 15 22:25:56 2016 -0700 + + config: Hold input lock across udev socket handling + + This avoids having the server running inside libudev from two threads + at once, which it appears to not like. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit de5291c04b05772e6da599a475baa1b19dcae07a +Author: Olivier Fourdan +Date: Mon Aug 8 17:25:35 2016 +0200 + + present: Free the fake_present OsTimerPtr + + Plug a leak in present_fake_queue_vblank() where the OsTimer would not + be freed. + + 492,608 (482,816 direct, 9,792 indirect) bytes in 15,088 blocks + are definitely lost in loss record 3,954 of 3,954 + at 0x4C2ABDE: malloc (in vgpreload_memcheck-amd64-linux.so) + by 0x586B19: TimerSet (WaitFor.c:433) + by 0x4F1AA9: present_fake_queue_vblank (present_fake.c:108) + by 0x4F15E0: present_pixmap (present.c:954) + by 0x4F23B4: proc_present_pixmap (present_request.c:138) + by 0x552BCE: Dispatch (dispatch.c:430) + by 0x556C22: dix_main (main.c:300) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065 + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + +commit d21b53673b9de052004e761fd1299d2e788b44b8 +Author: Michel Dänzer +Date: Wed Aug 3 10:19:20 2016 +0900 + + present: Call set_abort_flip / restore_screen_pixmap in clear_window_flip + + We were asserting that these were called before from other places, but + that isn't always the case, e.g. during server shutdown. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96951 + Reported-and-Tested-by: Tod Jackson + Reviewed-by: Hans de Goede + Signed-off-by: Michel Dänzer + +commit 9f04fa3babaaabe0ed5bf4aa2563755bc6c45723 +Author: Michel Dänzer +Date: Wed Aug 3 10:19:19 2016 +0900 + + present: Make present_restore_screen_pixmap handle screen->root == NULL + + Easier than dealing with it in all paths that can end up here during + server shutdown. + + Signed-off-by: Michel Dänzer + Reviewed-by: Hans de Goede + +commit 4cbf1fb1f978ecd975770cebbb330dc10f712b77 +Author: Olivier Fourdan +Date: Mon Aug 8 17:57:57 2016 +0200 + + xwayland: Avoid double free of RRCrtc and RROutput + + At shutdown, the Xserver will free all its resources which includes the + RRCrtc and RROutput created. + + Xwayland would do the same in its xwl_output_destroy() called from + xwl_close_screen(), leading to a double free of existing RRCrtc + RROutput: + + Invalid read of size 4 + at 0x4CDA10: RRCrtcDestroy (rrcrtc.c:689) + by 0x426E75: xwl_output_destroy (xwayland-output.c:301) + by 0x424144: xwl_close_screen (xwayland.c:117) + by 0x460E17: CursorCloseScreen (cursor.c:187) + by 0x4EB5A3: AnimCurCloseScreen (animcur.c:106) + by 0x4EF431: present_close_screen (present_screen.c:64) + by 0x556D40: dix_main (main.c:354) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + Address 0xbb1fc30 is 0 bytes inside a block of size 728 free'd + at 0x4C2BDB0: free (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + by 0x4CCE5F: RRCrtcDestroyResource (rrcrtc.c:719) + by 0x577541: doFreeResource (resource.c:895) + by 0x5787B5: FreeClientResources (resource.c:1161) + by 0x578862: FreeAllResources (resource.c:1176) + by 0x556C54: dix_main (main.c:323) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + Block was alloc'd at + at 0x4C2CA6A: calloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + by 0x4CC6DB: RRCrtcCreate (rrcrtc.c:76) + by 0x426D1C: xwl_output_create (xwayland-output.c:264) + by 0x4232EC: registry_global (xwayland.c:431) + by 0x76CB1C7: ffi_call_unix64 (in /usr/lib/libffi.so.6.0.4) + by 0x76CAC29: ffi_call (in /usr/lib/libffi.so.6.0.4) + by 0x556CEFD: wl_closure_invoke (connection.c:935) + by 0x5569CBF: dispatch_event.isra.4 (wayland-client.c:1310) + by 0x556AF13: dispatch_queue (wayland-client.c:1456) + by 0x556AF13: wl_display_dispatch_queue_pending + (wayland-client.c:1698) + by 0x556B33A: wl_display_roundtrip_queue (wayland-client.c:1121) + by 0x42371C: xwl_screen_init (xwayland.c:631) + by 0x552F60: AddScreen (dispatch.c:3864) + + And: + + Invalid read of size 4 + at 0x522890: RROutputDestroy (rroutput.c:348) + by 0x42684E: xwl_output_destroy (xwayland-output.c:302) + by 0x423CF4: xwl_close_screen (xwayland.c:118) + by 0x4B6377: CursorCloseScreen (cursor.c:187) + by 0x539503: AnimCurCloseScreen (animcur.c:106) + by 0x53D081: present_close_screen (present_screen.c:64) + by 0x43DBF0: dix_main (main.c:354) + by 0x7068730: (below main) (libc-start.c:289) + Address 0xc403190 is 0 bytes inside a block of size 154 free'd + at 0x4C2CD5A: free (vg_replace_malloc.c:530) + by 0x521DF3: RROutputDestroyResource (rroutput.c:389) + by 0x45DA61: doFreeResource (resource.c:895) + by 0x45ECFD: FreeClientResources (resource.c:1161) + by 0x45EDC2: FreeAllResources (resource.c:1176) + by 0x43DB04: dix_main (main.c:323) + by 0x7068730: (below main) (libc-start.c:289) + Block was alloc'd at + at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) + by 0x52206B: RROutputCreate (rroutput.c:84) + by 0x426763: xwl_output_create (xwayland-output.c:270) + by 0x422EDC: registry_global (xwayland.c:432) + by 0x740FC57: ffi_call_unix64 (unix64.S:76) + by 0x740F6B9: ffi_call (ffi64.c:525) + by 0x5495A9D: wl_closure_invoke (connection.c:949) + by 0x549283F: dispatch_event.isra.4 (wayland-client.c:1274) + by 0x5493A13: dispatch_queue (wayland-client.c:1420) + by 0x5493A13: wl_display_dispatch_queue_pending + (wayland-client.c:1662) + by 0x5493D2E: wl_display_roundtrip_queue (wayland-client.c:1085) + by 0x4232EC: xwl_screen_init (xwayland.c:632) + by 0x439F50: AddScreen (dispatch.c:3864) + + Split xwl_output_destroy() into xwl_output_destroy() which frees the + wl_output and the xwl_output structure, and xwl_output_remove() which + does the RRCrtcDestroy() and RROutputDestroy() and call the latter only + when an output is effectively removed. + + An additional benefit, on top of avoiding a double free, is to avoid + updating the screen size at shutdown. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + +commit b380f3ac51f40ffefcde7d3db5c4c149f274246d +Author: Michel Dänzer +Date: Tue Aug 2 17:53:01 2016 +0900 + + dix: Pass ClientPtr to FlushCallback + + This change has two effects: + + 1. Only calls FlushCallbacks when we're actually flushing data to a + client. The unnecessary FlushCallback calls could cause significant + performance degradation with compositing, which is significantly + reduced even without any driver changes. + + 2. By passing the ClientPtr to FlushCallbacks, drivers can completely + eliminate unnecessary flushing of GPU commands by keeping track of + whether we're flushing any XDamageNotify events to the client for + which the corresponding rendering commands haven't been flushed to + the GPU yet. + + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 92b3cd32066aa5befa67a408cc079cd2ce4c077e +Author: Aaron Plattner +Date: Tue Aug 2 10:34:07 2016 -0700 + + xace: Fix XaceCensorImage to actually censor the right part of the image + + The caller passes arguments into XaceCensorImage that are in + window-relative coordinates. However, the pBuf that it uses to construct + a temporary pixmap has its origin at (x, y) relative to the window in + question. The code to convert the censor region into boxes adjusts for + the Y coordinate, but leaves the X coordinate alone. The result is that + if x is not zero, it censors the wrong part of the image. + + Fix this by just translating censorRegion into pixmap-relative + coordinates and using the resulting boxes as-is. + + Reported-by: Fabien Lelaquais + Link: https://lists.x.org/archives/xorg/2016-August/058165.html + Reviewed-by: Adam Jackson + Signed-off-by: Aaron Plattner + +commit 4d586118c113f3c0a6e95ed2d3fc7f9d03a4e362 +Author: Olivier Fourdan +Date: Tue Aug 2 11:24:41 2016 +0200 + + xwayland: Plug memleak in frame callbacks + + The frame callback set up via wl_surface_frame() needs to be freed with + wl_callback_destroy() or we'll leak memory. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065 + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 611b3b1d40f58035582480a3d7cfa77cb288cbc6 +Author: Matthieu Herrb +Date: Sun Jul 31 12:13:03 2016 +0200 + + Autoconfig: Fix the loop adding dectected drivers to the list of screens + + This loop was written in a buggy style, causing a NULL driver ptr to be + passed to copyScreen(). copyScreen() only uses that to generate an + identifier string, so this is mostly harmless on systems that accept + NULL for asprintf() "%s" format. (the generated identifiers are off + by one wrt the driver names and the last one contains NULL. + + For systems that don't accept NULL for '%s' this would cause a + segmentation fault when this code is used (no xorg.conf, but partial + config in xorg.conf.d for instance). + + Signed-off-by: Matthieu Herrb + Reviewed-by: Keith Packard + +commit 88820f1c7b66cbc98d3f19efca24c9f52410d9f9 +Author: Emily Deng +Date: Mon Jul 25 16:12:53 2016 +0800 + + xfree86: vgaarb: Initialize local variable rsrc_decodes + + In function xf86VGAarbiterScrnInit when the "pEnt->bus.type" is + BUS_PLATFORM, the "pScrn->vgaDev" won't be set, so the "pScrn->vgaDev" is + equal to zero. + + The variable "rsrc_decodes" in function "xf86VGAarbiterAllowDRI" is not + initialized. So it will occur error when "pScrn->vgaDev == 0", and + "vga_count > 1". For this case, as "pScrn->vgaDev == 0", the function + "pci_device_vgaarb_get_info" will only set the value of "vga_count", + but won't set the value of "rsrc_decodes", so it will has two different + return values for function "xf86VGAarbiterAllowDRI" in different + platforms. One platform will return TRUE, as the "rsrc_decodes" 's + default value is 0, but another platform will return FALSE, as the + "rsrc_decodes" 's default value is "32767", this will cause disable + direct rendering. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96937 + + Signed-off-by: Emily Deng + Reviewed-by: Michel Dänzer + +commit fa2bc06407665ee074f5914d0f83d4114b20fc8e +Author: Keith Packard +Date: Fri Aug 12 17:40:55 2016 -0700 + + dix: Avoid writing uninitialized bytes in deliverPropertyNotifyEvent + + Make sure the whole event is initialized, instead of leaving the pad + bytes unset. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 67fc5d68f967d19236221b2c0c2e0fe45acf560f +Author: Keith Packard +Date: Sat Aug 13 09:02:15 2016 -0700 + + os: Abandon loop after poll call when array of fds has changed + + If a file descriptor is added or removed from an ospoll callback, then + the arrays containing file descriptor information will have all of + their indices changed, so the loop state is no longer consistent. Just + bail out and let the caller come back around to try again. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 7d6fffb6013cfc718d884cc549d7a8fef37240cf +Author: Keith Packard +Date: Fri Aug 12 15:23:55 2016 -0700 + + os: Delay freeing of epoll_wait return pointers until epoll is idle. + + Instead of freeing the struct ospollfd elements when the fd is + removed by the user, delay that until epoll is idle so that we are + sure no epoll_event structures could contain the stale pointer. This + handles cases where an fd is removed from the ospoll callback + interface, and also in case the OS keeps stale pointers around after + the call to epoll_ctl with EPOLL_CTL_DEL. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 69b782aa75bc06f11b8f9b532d5213f252c4c6c4 +Author: Keith Packard +Date: Fri Jul 29 17:45:45 2016 -0700 + + xfree86: Set pScrn->pScreen before driver ScreenInit is called + + Any code called from the driver ScreenInit may want to refer to + pScrn->pScreen. As the function passed to AddScreen is the first place + the DDX sees a new screen, the generic code needs to make sure that + value is set before passing control to the video driver's + initialization code. + + This was found by running a driver which didn't bother to set this + value when the initial colormap was installed; xf86RandR12LoadPalette + tried to use pScrn->pScreen and crashed. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97124 + Signed-off-by: Keith Packard + Reviewed-and-Tested-by: Michel Dänzer + +commit 387d6b5df3e11de5cb88db8a559128fcb62e4e5a +Merge: d2558f0 8bb9d46 +Author: Keith Packard +Date: Sat Aug 13 09:12:19 2016 -0700 + + Merge remote-tracking branch 'daenzer/for-master' + +commit d2558f063a034a827247b66b4c5adbffe79dc0e7 +Author: Keith Packard +Date: Thu Aug 11 17:28:38 2016 -0700 + + Build glamor when Xorg or Xephyr are built. + + Requires gbm when building Xorg so that xf86-video-modesetting will + work. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + Reviewed-by: Eric Anholt + +commit 2b9f8ae98602d2abda7c363900f39a5bd3768a4c +Author: Keith Packard +Date: Thu Aug 11 21:32:59 2016 -0700 + + mi: Remove spurious call to OsReleaseSignals from mieqGrowQueue + + This call wasn't converted to 'input_unlock()' when the SIGIO code was + removed from the server, and so when the queue growing was reworked to + be done from the input thread, it got left sitting here. As the caller + now manages the lock, we don't need to switch this to input_unlock at + this point. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f399919e13c994452f7219163b2a4b1fa015242e +Author: Peter Hutterer +Date: Fri Aug 12 13:59:56 2016 +1000 + + xfree86: lock input during PreInit + + This is a problem for the libinput driver that uses the same context across + multiple devices. The driver may be halfway through setting up an input device + (and the only way to do so is to add it to libinput) when the input thread + comes in an reads events. This then causes mayhem when data is dereferenced + that hasn't been set up yet. + + In my case the cause was the call to libinput_path_remove_device() inside + preinit racing with evdev_dispatch_device() handling of ENODEV. The sequence + was: + - thread 2 gets an event and calls evdev_dispatch_device() + - thread 1 calls libinput_path_remove_device() which sets the device->source + to NULL + - thread 2 reads from the fd, gets ENODEV and now removes the device->source, + dereferencing the null-pointer + + This is the one I could reproduce the most, but there are other potential + pitfalls that affect any driver that uses the same fd for multiple devices. + Avoid all this and wrap PreInit into the lock. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit dd4e21cb3a6e692e834ec34bec42944202b3e085 +Author: Peter Hutterer +Date: Fri Aug 12 12:06:18 2016 +1000 + + xfree86: fix unbalanced input_lock/unlock in xf86NewInputDevice() + + If a device couldn't be enabled we left the lock hanging. + + This patch also removes the leftover OsReleaseSignals() call, now unnecessary. + Note that input_unlock() is later than previously OsReleaseSignals(). + RemoveDevice() manipulates the input device and its file descriptors, it's + safer to put the input_unlock() call after RemoveDevice() to avoid events + coming in while the device is being removed. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit bf31d6f43e5ce04891a96b226a975379e2e2ba71 +Author: Keith Packard +Date: Thu Aug 11 12:34:54 2016 -0700 + + os: Allow re-registering fd with InputThreadRegisterDev + + Calling InputThreadRegisterDev twice with the same fd should replace + the existing function and args instead of creating a new entry with + the same fd. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 2df2815d6ae0c2ffb9e0a084d61ee3585f5116df +Author: Peter Hutterer +Date: Tue Aug 9 17:35:58 2016 +1000 + + os: append, rather than prepend, any new input thread fds + + xf86AddEnabledDevice() prepends the new fd to the list, + xf86RemoveEnabledDevice() then searches for a matching fd and removes that + entry. If this is done for the same fd (and since we lose all information but + the actual fd) we usually unregister virtual devices in reverse order, causing + a dereference of already released memory. + + Case in point: + - the wacom driver calls xf86AddEnabledDevice() once for the physical device, + then multiple times for the virtual subdevices + - when the physical device is unplugged, the driver calls + xf86RemoveEnabledDevice() for the physical device + - all we have is the fd, so we end up removing the last virtual device from + the fd set + - xf86DeleteInput() frees the physical device's pInfo + - the fd goes crazy with ENODEV, but a read_input() now passes the already + freed pInfo for the physical device + - boom + + Fix this by appending to the fd list to provide bug-for-bug compatibility with + the old SIGIO code. This needs to be fixed in the driver, but meanwhile not + crashing the server provides for better user experience. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a446ff84de2dd29439521f6e87d75bde3bbf002c +Author: Michel Dänzer +Date: Fri Jul 29 17:38:21 2016 +0900 + + xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGamma + + Just use the RandR gamma ramp directly. + + Fixes random on-monitor colours with drivers which don't call + xf86HandleColormaps, e.g. modesetting. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97154 + + Reviewed-by: Alex Deucher + +commit d3d4ff0ed4d4679b7983b1a3ea267ff945f7643c +Author: Kenneth Graunke +Date: Thu Jul 28 07:28:51 2016 -0700 + + modesetting: Delete dead drmmode_bo_for_pixmap function. + + Embarassingly, it looks like I introduced this dead function in + commit 13c7d53df8dac45ea2a685826cd45a39bcb51657 a year ago. + Nothing ever used it, not even then. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Eric Anholt + +commit 8bb9d460fbc82ee5d6f87e1d11cfa52f4f3072ee +Author: Michel Dänzer +Date: Fri Jul 29 17:38:21 2016 +0900 + + xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGamma + + Just use the RandR gamma ramp directly. + + Fixes random on-monitor colours with drivers which don't call + xf86HandleColormaps, e.g. modesetting. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97154 + + Reviewed-by: Alex Deucher + +commit c833c0866f2f8f829185667efe3d6dfa5979a9e8 +Author: Michel Dänzer +Date: Fri Jul 29 18:41:06 2016 +0900 + + present: Handle event mask updates as specified v2 + + From the Present extension specification: + + An event context is associated with a specific window; using + an existing event context with a different window generates + a Match error. + + If eventContext specifies an existing event context, then if + eventMask is empty, PresentSelectInput deletes the specified + context, otherwise the specified event context is changed to + select a different set of events. + + If eventContext is an unused XID, then if eventMask is empty + no operation is performed. Otherwise, a new event context is + created selecting the specified events. + + Without this change, there's no way for a client to explicitly change + or destroy an existing event mask entry. Trying to do so as specified + above would just result in a protocol error. + + v2: (Keith Packard) + * Use dixLookupResourceByType instead of walking window_priv->events + * Return BadMatch if the existing event context is associated with a + different window or client + * Call LEGAL_NEW_RESOURCE again when creating a new event context + * Drop invalid "leak fix" + + Signed-off-by: Michel Dänzer + Signed-off-by: Keith Packard + Reviewed-by: Keith Packard + Reviewed-by: Kenneth Graunke + +commit 0924ac014d7caadab0b15ba69cd0a09cfe8a01da +Author: Michel Dänzer +Date: Tue Jul 26 17:28:33 2016 +0900 + + present: Only call restore_screen_pixmap once from set_abort_flip + + present_restore_screen_pixmap's work doesn't need to be done several + times for the same pending flip. + + Fixes a crash if the X server quits while a flip is pending, in which + case present_set_abort_flip may be called several times, including when + screen->root is already cleared to NULL. + + Reviewed-by: Hans de Goede + +commit b4e46c0444bb09f4af59d9d13acc939a0fbbc6d6 +Author: Michel Dänzer +Date: Sat Nov 28 16:50:47 2015 +0900 + + xfree86: Hook up colormaps and RandR 1.2 gamma code v6 + + Instead of breaking the former when the driver supports the latter, + hook them up so that the hardware LUTs reflect the combination of the + current colourmap and gamma states. I.e. combine the colourmap, the + global gamma value/ramp and the RandR 1.2 per-CRTC gamma ramps into one + combined LUT per CRTC. + + Fixes e.g. gamma sliders not working in games. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27222 + + v2: + * Initialize palette_size and palette struct members, fixes crash on + server startup. + v3: + * Free randrp->palette in xf86RandR12CloseScreen, fixes memory leak. + v4: + * Call CMapUnwrapScreen if xf86RandR12InitGamma fails (Emil Velikov). + * Still allow xf86HandleColormaps to be called with a NULL loadPalette + parameter in the xf86_crtc_supports_gamma case. + v5: + * Clean up inner loops in xf86RandR12CrtcComputeGamma (Keith Packard) + * Move palette update out of per-CRTC loop in xf86RandR12LoadPalette + (Keith Packard) + v6: + * Handle reallocarray failure in xf86RandR12LoadPalette (Keith Packard) + + Reviewed-by: Keith Packard + +commit 17213b74fd7fc4c4e2fe7a3781e7422dd482a0ab +Author: Michel Dänzer +Date: Tue Jun 21 16:44:20 2016 +0900 + + xfree86/modes: Remove xf86RandR12CrtcGetGamma + + This would normally return the same values the core RandR code passed to + xf86RandR12CrtcSetGamma before, which is rather pointless. The only + possible exception would be if a driver tried initializing + crtc->gamma_red/green/blue to reflect the hardware LUT state on startup, + but that can't work correctly if whatever set the LUT before the server + started was running at a different depth. + + Even the pointless round-trip case will no longer work with the + following change. + + Reviewed-by: Keith Packard + +commit 62f44052573b475a7b4c24f8e2da9bd6a8f1bd70 +Author: Michel Dänzer +Date: Tue Jun 21 15:41:45 2016 +0900 + + xfree86/modes: Move gamma initialization to xf86RandR12Init12 v2 + + RRCrtcGammaSetSize cannot be used yet in xf86InitialConfiguration, + because randr_crtc isn't allocated yet at that point, but a following + change will require RRCrtcGammaSetSize to be called from + xf86RandR12CrtcInitGamma. + + v2: + * Bail from xf86RandR12CrtcInitGamma if !crtc->funcs->gamma_set (Keith + Packard) + + Reviewed-by: Keith Packard + +commit 0b2f30834b1a9f4a03542e25c5f54ae800df57e2 +Author: Keith Packard +Date: Sun May 29 17:47:29 2016 -0700 + + os: Clean up WaitFor.c + + Do all timer stuff before blocking, avoiding a bunch of duplicate code + and merge common code in WaitForSomething. + + The WaitForSomething changes need a bit of explanation to show that + the new code is effectively equivalent to the old. Eliding error + checking and trivial bits we've got: + + Before: + + if (ready clients) + timeout = 0 + else + compute timeout + i = poll + if (i <= 0) { + if (ready clients) + return TRUE; + if (input) + return FALSE; + if (any ready timers) { + run timers + return FALSE; + } + } else { + if (input) + return FALSE; + if (any ready timers) { + run timers + return FALSE; + } + if (ready clients) + return TRUE; + } + + After: + + if (ready clients) + timeout = 0; + else + compute timeout + run_timers + poll + + if (input) + return FALSE; + + if (ready clients) + return TRUE; + + The old code would return TRUE if there were ready clients and input + pending. Dispatch would then schedule that ready client, but before + processing any requests, it would notice that there was input pending + and go process it. The new code just checks for input first, which is + effectively the same. + + If the poll timed out and there weren't clients ready, then timers + would get run. + + If the poll didn't time out, then timers would get run, even if there + were clients now ready. Now, if the timeout interval was zero, that + means that the timers must have been ready *before* poll was + invoked. In this case, we should simply run the timers before calling + poll -- no sense calling poll just to discard any data that it + generates. + + If the timeout interval was non-zero, and poll didn't timeout, then + either there aren't any timers to run, or we got a surprise and hit a + timer exactly as a client became ready to run. This is the one case + where the new code is different from the old; the new code delays the + timer call until the next time WaitForSomething is called. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 2ab8b1dcd37900e5e2f11007d7c0cd0545209482 +Author: Keith Packard +Date: Sun May 29 19:48:25 2016 -0700 + + os: Use xorg_list for struct _OsTimerRec + + No sense having an open-coded linked list here, plus the doubly linked + list is more efficient + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 50779c494d4682103b96db440021e56e44311b6b +Author: Keith Packard +Date: Sun May 29 12:45:53 2016 -0700 + + os: Remove CheckConnections + + poll provides per-fd notification of failure, so we don't need + CheckConnections anymore. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f0275b1e5a4787da1f4d5507165315a000c22b33 +Author: Keith Packard +Date: Thu May 26 00:19:55 2016 -0700 + + os: Leave stdin and stdout open + + There's no reason to close these now that we don't care what file + descriptors we use. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 8217c29d2d8b29bd66bc54fee3fe5cb3385a05c7 +Author: Keith Packard +Date: Wed May 25 23:43:49 2016 -0700 + + Allow 1024 and 2048 for LimitClients + + There's no reason not to offer ridiculous numbers of clients; only a + few static data structures are arrays of this length. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e0edb963fe09582f23a4b55da4f8840173e7a1ee +Author: Keith Packard +Date: Tue May 24 21:04:14 2016 -0700 + + os: eliminate fd value limits for clients + + With no code depending on the range of file descriptors, checking + for that can be eliminated. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 30bc0732f959bbc63f318c06d48de080d495da32 +Author: Keith Packard +Date: Tue May 24 21:12:33 2016 -0700 + + os: Use ospoll for input thread [v2] + + Replace use of select(2) to avoid fd limits. Note that + InputThreadFillPipe used select as well, but none of the files passed + were non-blocking, so there was no need for that code at all. + + v2: Keep ospoll API usage single threaded to avoid re-entrancy issues + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f993091e7db81b0420e23c485378cba112278839 +Author: Keith Packard +Date: Thu May 26 10:40:44 2016 -0700 + + os: Switch server to poll(2) [v3] + + Eliminates all of the fd_set mangling in the server main thread + + v2: Listen for POLLOUT while writes are blocked. + + v3: Only mark client not ready on EAGAIN return from read + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e +Author: Keith Packard +Date: Thu May 19 13:59:54 2016 -0700 + + dix: Use list for ready clients + + This converts the dispatch loop into using a list of ready clients + instead of an array. This changes the WaitForSomething API so that it + notifies DIX when a client becomes ready to read, instead of returning + the set of ready clients. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit d6eff3c31e8289881a3aa9b858e5710d0f741db0 +Author: Keith Packard +Date: Thu May 26 10:20:45 2016 -0700 + + os: Add ospoll interface [v2] + + This provides a wrapper around poll or epoll providing a + callback-based interface for monitoring activity on a large set of + file descriptors. + + v2: use xserver_poll API instead of poll. Don't use WSAPoll as + that is broken. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit d403aca70a07e1401cb93738f1af5961582a2e47 +Author: Keith Packard +Date: Mon Jul 18 15:58:42 2016 -0700 + + Switch poll() users to xserver_poll() + + This uses the wrapper in case we need to emulate poll with select + as we do on Windows. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 711c36558f50943c8342f25ad210281134887a3d +Author: Brian M. Clapper +Date: Mon Jul 11 18:30:05 2016 -0400 + + os: Add poll emulation for mingw [v2] + + v2: rename as 'xserver_poll' to avoid potential library name + collisions. Provide 'xserver_poll.h' which uses the system + poll where available and falls back to this emulation otherwise. + Autodetects when this is required, building the emulation only + then + + Source: https://github.com/bmc/poll + Signed-off-by: Adam Jackson + +commit 2a79be9e4dd1b6ba00b69ff40bc5257ec84d34da +Author: Jon Turney +Date: Tue Jul 19 13:35:37 2016 +0100 + + hw/xwin: Update BlockHandler function signature + + Update for removal of fdset from Block/Wakeup handler API in 9d15912a + + Signed-off-by: Jon Turney + Reviewed-by: Keith Packard + +commit 60a91031d13e4d29c383087120e318f6b528b6e5 +Author: Jon Turney +Date: Tue Jul 19 13:35:36 2016 +0100 + + hw/xwin: Update for removal of AddEnabledDevice + + Update for removal of AddEnabledDevice in be5a513f. Use SetNotifyFd instead. + + Signed-off-by: Jon Turney + Reviewed-by: Keith Packard + +commit 7f2d690725292e7b5a44c813c9456da426256873 +Author: Peter Hutterer +Date: Mon Jun 27 10:17:14 2016 +1000 + + xfree86: if ATTR_KEYBOARD is set, match for keyboards + + ATTR_KEY maps to ID_INPUT_KEY which is set for any device with keys. + ID_INPUT_KEYBOARD and thus ATTR_KEYBOARD is set for devices that are actual + keyboards (and have a set of expected keys). + + Hand-written match rules may only apply ID_INPUT_KEYBOARD, so make sure we + match on that too. + + Arguably we should've been matching on ATTR_KEYBOARD only all along but + changing that likely introduces regressions. + + Reported-by: Marty Plummer + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit 4b311d23e84356bd0e9e736aeed7448dd6382118 +Author: Adam Jackson +Date: Mon Jul 18 12:46:51 2016 -0400 + + modesetting: resubmit dirty rects on EINVAL (v2) + + This error code can mean we're submitting more rects at once than the + driver can handle. If that happens, resubmit one at a time. + + v2: Make the rect submit loop more error-proof (Walter Harms) + + Signed-off-by: Adam Jackson + Reviewed-by: Michael Thayer + +commit 8d3a368d8980e37e7e8c57065dc901ce809887c6 +Author: Keith Packard +Date: Wed Jun 1 22:47:29 2016 -0700 + + os: InputThreadFillPipe doesn't need select or poll + + The file descriptors passed to InputThreadFillPipe are always + blocking, so there's no need to use Select (or poll). + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit ef7ddbe242ed4c461f816663fb88646e41f1c21b +Author: Keith Packard +Date: Wed Jun 1 22:35:09 2016 -0700 + + os: Move ETEST macro from io.c to osdep.h + + This lets other code share this functionality + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 0d294462a5af08ada654c588fad921ed7a22749b +Author: Keith Packard +Date: Sun May 29 15:06:36 2016 -0700 + + os: Add X_NOTIFY_ERROR value + + This provides a way to report errors on file descriptors that is + better defined than "any bits which are not READ or WRITE". + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e6636b438322a9a2f2270ad9d60bf3dfc72be0b3 +Author: Keith Packard +Date: Thu May 26 10:30:56 2016 -0700 + + os: Compute timeout in milliseconds instead of struct timeval + + The timeout resolution offered in the AdjustWaitForDelay call is + only milliseconds, so passing around the timeout as a pointer to a + struct timeval is not helpful. Doing everything in milliseconds up to + the point of the select call simplifies the code without affecting + functionality at all. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a414db021575accff64abad6f1047245e81c7476 +Author: Keith Packard +Date: Thu May 19 15:08:05 2016 -0700 + + dix: Intermediate GrabServer state 'GrabKickout' not needed + + The intermediate grabState, "GrabKickout", was used to trigger + dispatch into going back to WaitForSomething after doing a GrabServer + so that the set of ready clients would be recomputed to match what the + server should be processing. As we only process one client per + WaitForSomething call, we will always hit WaitForSomething after + finishing the current client, and so don't need any special case here. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 7762a602c1dfdd8cfcf2b8c2281cf4d683d05216 +Author: Keith Packard +Date: Thu May 19 15:05:55 2016 -0700 + + dix/os: Merge priority computation into SmartScheduleClient + + Instead of having scheduling done in two places (one in + WaitForSomething, and the other in SmartScheduleClient), just stick + all of the scheduling in SmartScheduleClient. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 4af00242ef1e39499b932d12423fdf449296090a +Author: Keith Packard +Date: Mon May 30 01:49:46 2016 -0700 + + Bump ABI versions to reflect block/wakeup handler API changes + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit be5a513fee6cbf29ef7570e57eb0436d70fbd88c +Author: Keith Packard +Date: Mon Dec 7 15:12:14 2015 -0800 + + Remove AddEnabledDevice and AddGeneralSocket APIs + + All uses of these interfaces should instead be using the NotifyFd API + instead. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 9d15912aa475b733bbb20efc367a67dacad63bf1 +Author: Keith Packard +Date: Tue Sep 1 18:51:14 2015 -0700 + + Remove fd_set from Block/Wakeup handler API + + This removes the last uses of fd_set from the server interfaces + outside of the OS layer itself. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit fb0802113b4c57819cba15d64baf79bf4148607e +Author: Keith Packard +Date: Tue Sep 1 11:20:04 2015 -0700 + + Remove readmask from screen block/wakeup handler + + With no users of the interface needing the readmask anymore, we can + remove it from the argument passed to these functions. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 410bc047480a9f98df678dc850bc6b99c3cfb5bf +Author: Keith Packard +Date: Mon Dec 7 15:03:10 2015 -0800 + + dmx: Eliminate use of AddEnabledDevice [v2] + + Use SetNotifyFd instead, with the hope that someday someone will come + fix this to be more efficient -- right now, the wakeup handler is + doing the event reading, instead of the notify callback. + + v2: no need to patch dmxsigio.c as it has been removed. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 6299ef3d749d6f978d3d38d42f711ac56bf382eb +Author: Keith Packard +Date: Thu Aug 27 11:49:35 2015 -0700 + + modesetting: Use passed-in fd for drm event monitoring NotifyFd callback + + This is a cleanup, proposed by Adam Jackson, but wasn't merged with + the original NotifyFD changes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 6bf7b49f6711c7ed1837283dc04f93f4c1b77ecc +Author: Keith Packard +Date: Thu Aug 27 11:47:26 2015 -0700 + + hw/kdrive: Use passed-in fd for kdrive/linux APM monitoring [v2] + + This is a cleanup, proposed by Adam Jackson, but wasn't merged with + the original NotifyFD changes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 55c2e1a3aa587c58a74066724e11e30b3df267b8 +Author: Keith Packard +Date: Mon Dec 7 15:11:33 2015 -0800 + + xnest: Use SetNotifyFd to receive events + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 24e65bf0db57bf4ac70386c0a0e8275b73edd2fb +Author: Keith Packard +Date: Thu Dec 3 01:02:02 2015 -0600 + + hw/xfree86: Use NotifyFd for other input fd wakeups + + Remove code in xf86Wakeup for dealing with other input and switch to + using the new NotifyFd interface. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit c3fea428aed919826130ef8ebdb2cceb445a845b +Author: Keith Packard +Date: Tue May 24 20:51:31 2016 -0700 + + os: Use NotifyFd for ErrorConnMax + + Instead of open-coding a single FD wait, use NotifyFd to wait for the + FD to become readable before returning the error message. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 559aac2d71250e3137aaa582e2a59a918ddf21b7 +Author: Keith Packard +Date: Tue May 24 21:59:38 2016 -0700 + + dmx: Switch from select(2) to poll(2) for input + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit aa6717ce213e79735c72afc5ec9cc1f9c0297e09 +Author: Keith Packard +Date: Tue May 24 21:36:18 2016 -0700 + + xfree86: Switch from select(2) to poll(2) + + xf86WaitForInput and the xf86 SIGIO handling code. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 81135991a583b3b30a90e82ddc1d5c86d57bf00b +Author: Keith Packard +Date: Tue May 24 21:19:13 2016 -0700 + + kdrive: switch from select(2) to poll(2) + + This avoids fd limits + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 05a793f5b3c40747d5a92a076def7f4fb673c7e7 +Author: Keith Packard +Date: Tue Sep 1 18:50:55 2015 -0700 + + dix: Switch to the libXfont2 API (v2) + + This new libXfont API eliminates exposing internal X server symbols to + the font library, replacing those with a struct full of the entire API + needed to use that library. + + v2: Use libXfont2 instead of libXfont_2 + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 950ffb8d6fd1480f305e38c571bda44f247f1de2 +Author: Eric Anholt +Date: Fri Nov 6 12:27:42 2015 -0800 + + glamor: Remove the FBO cache. + + It is a modest performance improvement (2.7% on Intel), with the + significant downside that it keeps extra pixmap contents laying around + for 1000 BlockHandlers without the ability for the system to purge + them when under memory pressure, and tiled renderers don't know that + we could avoid reading their current contents when beginning to render + again. We could use the FB invalidate functions, but they aren't + always available, aren't hooked up well in Mesa, and would eat into + the performance gains of having the cache. + + [ajax: rebased to master] + + Reviewed-by: Adam Jackson + +commit e8e36755abb17872d669b88d33ca9adc511029a0 +Author: Michel Dänzer +Date: Fri Jul 1 12:34:20 2016 +0900 + + glamor: Translate solid text background region after clipping + + Fixes incorrect clipping for redirected windows which don't happen to be + located at the top left corner of the screen. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96742 + Signed-off-by: Michel Dänzer + Reviewed-by: Adam Jackson + +commit 32a9504c69183485b0b796fa3966cd1e39992365 +Author: Adam Jackson +Date: Tue Jul 12 10:04:18 2016 -0400 + + xfree86: Fix fallback driver sort order for Xorg -configure (v2) + + The intent here was that fallback drivers would be at the end of the + list in order, but if a fallback driver happened to be at the end of the + list already that's not what would happen. Rather than open-code + something smarter, just use qsort. + + Note that qsort puts things in ascending order, so somewhat backwardsly + fallbacks are greater than native drivers, and vesa is greater than + modesetting. + + v2: Use strcmp to compare non-fallback drivers so we get a predictable + result if your libc's qsort isn't stable (Keith Packard) + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 4926845a57fa8b53e18ea7d3434bf5539e9b7782 +Author: Andrew Eikum +Date: Wed Jul 6 14:13:09 2016 -0500 + + shm: Also censor images returned by ShmGetImage + + We currently censor images from dix's GetImage, but not from + ShmGetImage. This is a method to bypass XACE, creating a potential + leak. We should censor in both methods. + + Reviewed-by: Adam Jackson + Signed-off-by: Andrew Eikum + +commit 9fcb554e9bfdf3eed2c2250d89150e3e7b907f01 +Author: Adam Jackson +Date: Fri Jul 8 15:17:05 2016 -0400 + + xwayland: Only force monotonic clock once + + Otherwise on regeneration we get: + + (EE) BUG: triggered 'if (clockid)' + (EE) BUG: utils.c:440 in ForceClockId() + (EE) + (EE) Backtrace: + (EE) 0: ./hw/xwayland/Xwayland (ForceClockId+0x5c) [0x47713c] + (EE) 1: ./hw/xwayland/Xwayland (OsInit+0x25) [0x4763d5] + (EE) 2: ./hw/xwayland/Xwayland (dix_main+0x11c) [0x43e60c] + (EE) 3: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f627b2f9731] + (EE) 4: ./hw/xwayland/Xwayland (_start+0x29) [0x4238e9] + (EE) 5: ? (?+0x29) [0x29] + + Signed-off-by: Adam Jackson + Reviewed-by: Jonas Ådahl + +commit cf6730c503f8090a5d1b80918fe253fc2c5bc090 +Author: Rui Matos +Date: Wed Jul 13 19:19:09 2016 +0200 + + xwayland: Update RR state on wl_output.done instead of wl_output.mode + + Otherwise if the geometry changes but the mode doesn't we end up with + the previous geometry from RR's point of view. + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=768710 + + Reviewed-by: Jonas Ådahl + Signed-off-by: Rui Matos + +commit 401a8d6e1379133863e3271374dc21850d0d3cab +Author: Michel Dänzer +Date: Tue Jun 28 17:22:47 2016 +0900 + + dix: Work around non-premultiplied ARGB cursor data + + Some games incorrectly use non-premultiplied ARGB cursor data, presumably + because that's what Windows uses. On some hardware (and with SWcursor), + this breaks areas of the cursor which are supposed to be transparent + (and presumably also translucent areas, but that's less noticeable). + + This change checks for pixels with alpha == 0 and any non-alpha component + != 0. If any such pixel is found, the data is assumed to be + non-premultiplied and fixed up by multiplying the RGB components with the + alpha component. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92309 + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 033888e7766d226a179357d970223428c19c4b53 +Author: Hans De Goede +Date: Thu Jul 7 10:55:04 2016 +0200 + + linux: Do not try to open /dev/vc/0, fix error msg when /dev/tty0 open fails + + /dev/vc/0 is a devfs thing which is long dead, so stop trying to open + /dev/vc/0, besides being a (small) code cleanup this will also fix the + "parse_vt_settings: Cannot open /dev/tty0 (%s)\n" error message to + display the actual error, rather then the -ENOENT from also trying + /dev/vc/0. + + BugLink: https://patchwork.freedesktop.org/patch/8768/ + Reported-by: Chad Versace + Suggested-by: Julien Cristau + Signed-off-by: Hans de Goede + Reviewed-by: Julien Cristau + Reviewed-by: Chad Versace + +commit ce24f3aa5815e03c2d501d1504f6c0162b219801 +Author: Alex Goins +Date: Thu Jul 7 14:50:03 2016 -0700 + + modesetting: NULL assignment for drmmode_set_target_scanout_target_cpu + + Commit 80e64dae: "modesetting: Implement PRIME syncing as a sink" originally was + supposed to have this line, but it was dropped as part of the merge process. + + Foregoing the NULL assignment causes a ton of problems with dereferencing + uninitialized memory. + + Signed-off-by: Alex Goins + Reviewed-by: Dave Airlie + +commit df8e86931eb19c196ed2afc85d89525ef8cb711b +Author: agoins +Date: Thu Jun 16 20:06:48 2016 -0700 + + randr: Add ability to turn PRIME sync off + + Adds an output parameter to disable PRIME synchronization. + + Output parameter is created when the user calls 'xrandr + --setprovideroutputsource ' to prevent polluting output + parameters of non-PRIME configurations. + + Defaults to on, so if the user wants PRIME synchronization they don't need + to do anything. + + If the user wishes to disable PRIME synchronization when they first set up + PRIME, they can run 'xrandr --output --set "PRIME Synchronization" + 0' after running 'xrandr --setprovideroutputsource ', but + before 'xrandr --auto'. + + If the user wishes to enable or disable PRIME synchronization after PRIME has + already been set up, they can run 'xrandr --output --set "PRIME + Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which + will tear down and setup PRIME in the configuration they requested on CRTCs + associated with that output. + + randrstr.h: + Add central definition of the output property name. + + rrcrtc.c: + Add function rrGetPixmapSharingSyncProp() to query the status of the + output property. + + Add function rrSetPixmapSharingSyncProp() to set the output property. + + Add 'sync' parameter to rrSetupPixmapSharing(), which when false will + use single buffering even if the required ABI functions are supported. + Changes rrSetupPixmapSharing() to only report an error if falling back + to single buffering when the user requested synchronization. + + Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status + of the output property and feed it into rrSetupPixmapSharing() using + the 'sync' parameter. + + rrprovider.c: + Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the + PRIME synchronization output property. + + Add a call to RRInitPrimeSyncProps() in + ProcRRSetProviderOutputSource(), such that the output property is + created when the user requests PRIME. + + Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy(). + + v1: Initial commit + v2: Unchanged + v3: Add /* TODO */ for handling different sources with different outputs + Make rrSetupPixmapSharing() set the output property to 0 if it has to fall + back, to avoid user confusion. + Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a + pending value + v4: Unchanged + v5: Unchanged + v6: Rebase onto ToT + v7: Unchanged + + Signed-off-by: Alex Goins + +commit 60ad701a6a8cb9f1eacb72acfe2cb8d3b7a865dc +Author: Hans de Goede +Date: Tue Jun 14 11:58:01 2016 +0200 + + modesetting: Load on GPU-s with 0 outputs + + In newer laptops with switchable graphics, the GPU may have 0 outputs, + in this case the modesetting driver should still load if the GPU is + SourceOffload capable, so that it can be used as an offload source provider. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 94a1c77259ce39ba59ad87615df39b570ffab435 +Author: Hans de Goede +Date: Thu Jun 16 15:21:03 2016 +0200 + + modesetting: Fix swapping of provider sink / source capabilities + + When a card has import capability it can be an offload _sink_, not + a source and vice versa for export capability. + + This commit fixes the modesetting driver to properly set these + capabilities, this went unnoticed sofar because most gpus have both + import and export capability. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit fcbafdfd79fd03205bc324e23b6d4e4d4f7180e1 +Author: Adam Jackson +Date: Wed Jul 22 12:14:08 2015 -0400 + + modesetting: Implement a double-buffered shadow mode + + Server GPUs often have a VNC feature attached to allow remote console. + The controller implementing this feature is usually not very powerful, + and we can easily swamp it with work. This is made somewhat worse by + damage over-reporting the size of the dirty region, and a whole lot + worse by applications (or shells) that update the screen with identical + pixel content as was already there. + + Fix this by double-buffering the shadow fb, using memcmp to identify + dirty tiles on each update pass. Since both shadows are in host memory + the memcmp is cheap, and worth it given the win in network bandwidth. + The tile size is somewhat arbitrarily chosen to be one cacheline wide at + 32bpp on Intel Core. + + By default we enable this behaviour for (a subset of) known server GPUs; + the heuristic could use work. + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede + +commit 75e660e379d921a53eb7c3bc9c2e412fa58aec02 +Author: Adam Jackson +Date: Wed Jul 22 12:14:07 2015 -0400 + + modesetting: Drop some non-functional triple-buffering variables + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede + +commit 21217d02168d1883b2d1f64399aec494f96a8b9d +Author: Dave Airlie +Date: Wed Jul 22 12:14:06 2015 -0400 + + modesetting: Implement 32->24 bpp conversion in shadow update + + 24bpp front buffers tend to be the least well tested path for client + rendering. On the qemu cirrus emulation, and on some Matrox G200 server + chips, the hardware can't do 32bpp at all. It's better to just allocate + a 32bpp shadow and downconvert in the upload hook than expose a funky + pixmap format to clients. + + [ajax: Ported from RHEL and separate modesetting driver, lifted kbpp + into the drmmode struct, cleaned up commit message, fixed 16bpp] + + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlied + Reviewed-by: Alex Deucher + [hdegoede@redhat.com: rebase, also use kbpp for rotate shadow fb] + Signed-off-by: Hans de Goede + +commit af916477c65a083ec496ac3f088d766b410e8b6e +Author: Takashi Iwai +Date: Mon Feb 16 17:00:55 2015 +0100 + + modesetting: Fix hw cursor check at the first call + + With the previous patch, the modesetting driver can now return whether + the driver supports hw cursor. However, it alone doesn't suffice, + unfortunately. drmmode_load_cursor_argb_check() is called in the + following chain: + + xf86CursorSetCursor() + -> xf86SetCursor() + -> xf86DriverLoadCursorARGB() + -> xf86_load_cursor_argb() + -> xf86_crtc_load_cursor_argb() + -> drmmode_load_cursor_argb_check() + + *but* at first with drmmode_crtc->cursor_up = FALSE. Then the + function doesn't actually set the cursor but returns TRUE + unconditionally. The actual call of drmmode_set_cursor() is done at + first via the show_cursor callback, and there is no check of sw cursor + fallback any longer at this place. Since it's called only once per + cursor setup, so the xserver still thinks as if the hw cursor is + supported. + + This patch is an ad hoc fix to correct the behavior somehow: it does + call drmmode_set_cursor() at the very first time even if cursor_up is + FALSE, then quickly hides again. In that way, whether the hw cursor + is supported is evaluated in the right place at the right time. + + Of course, it might be more elegant if we have a more proper mechanism + to fall back to sw cursor at any call path. But it'd need more + rework, so I leave this workaround as is for now. + + Signed-off-by: Takashi Iwai + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 14c21ea1c9496638b1feb8e6145c440fb4f1d14b +Author: Takashi Iwai +Date: Mon Feb 16 17:00:54 2015 +0100 + + modesetting: Use load_cursor_argb_check for sw cursor fallback + + The modesetting driver still has an everlasting bug of invisible + cursor on cirrus and other KMS drivers where no hardware cursor is + supported. This patch is a part of an attempt to address it. + + This patch particularly converts the current load_cursor_argb callback + of modesetting driver to load_cursor_argb_check so that it can return + whether the driver handles the hw cursor or falls back to the sw + cursor. + + Signed-off-by: Takashi Iwai + Reviewed-by: Kenneth Graunke + [hdegoede@redhat.com: Add extra comment suggested by Kenneth] + Signed-off-by: Hans de Goede + +commit 074cf58769b38550a3f35d5ecb73333330cb2aed +Author: Takashi Iwai +Date: Mon Feb 16 17:00:53 2015 +0100 + + modesetting: Fix the error check from DRM_IOCTL_MODE_CURSOR2 + + The error value isn't always -EINVAL, e.g. the kernel drm core returns + -ENXIO when the corresponding ops doesn't exist. Without this fix, + DRM_IOCTL_MODE_CURSOR2 would be dealt as success even if it + shouldn't. + + Signed-off-by: Takashi Iwai + Reviewed-by: Michel Dänzer + Reviewed-by: Kenneth Graunke + Signed-off-by: Hans de Goede + +commit 3762edded8e6e973f71419937e16bea262a266b8 +Author: Adam Jackson +Date: Wed Jun 29 14:07:32 2016 -0400 + + configure: Tell AC_REPLACE_FUNCS where to find replacements + + Fixes weird link errors of the form: + + CCLD Xvfb + ../../Xext/.libs/libXext.a(xvmc.o): In function `xf86XvMCRegisterDRInfo': + /home/ajax/git/xserver/Xext/xvmc.c:828: undefined reference to `strlcpy' + /home/ajax/git/xserver/Xext/xvmc.c:829: undefined reference to `strlcpy' + ../../os/os.O: In function `siHostnameAddrMatch': + /home/ajax/git/xserver/os/access.c:1821: undefined reference to `strlcpy' + ../../os/os.O: In function `AuthAudit': + /home/ajax/git/xserver/os/connection.c:555: undefined reference to `strlcpy' + /home/ajax/git/xserver/os/connection.c:574: undefined reference to `strlcpy' + ../../os/os.O:/home/ajax/git/xserver/os/log.c:972: more undefined references to `strlcpy' follow + collect2: error: ld returned 1 exit status + Makefile:688: recipe for target 'Xvfb' failed + make[3]: *** [Xvfb] Error 1 + Makefile:749: recipe for target 'all-recursive' failed + make[2]: *** [all-recursive] Error 1 + Makefile:608: recipe for target 'all-recursive' failed + make[1]: *** [all-recursive] Error 1 + Makefile:776: recipe for target 'all-recursive' failed + make: *** [all-recursive] Error 1 + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit d135100d6b17e54262a12aeaebe0fe2fe48da3bb +Author: Peter Hutterer +Date: Tue Jun 28 11:42:41 2016 +1000 + + xkb: add a cause to the xkb indicator update after a keymap change + + Regression introduce by ac164e58870d which calls + XkbUpdateAllDeviceIndicators() with two NULL arguments. A few layers down into + the stack and we triggered a NULL-pointer dereference. In theory a NULL cause + is acceptable since we don't actually change modifier state here. Instead of + updating all places to check for NULL just set the cause to the client + request and go to the pub. + + https://bugs.freedesktop.org/show_bug.cgi?id=96384 + + Signed-off-by: Peter Hutterer + Reviewed-by: Julien Cristau + Reviewed-by: Daniel Stone + +commit b83dede9cb930cf55249ad8e935f3c4d4328e2d9 +Author: Alex Goins +Date: Thu Jun 16 20:06:56 2016 -0700 + + modesetting: Implement PRIME syncing as a source + + Implements (Start/Stop)FlippingPixmapTracking, PresentSharedPixmap, and + RequestSharedPixmapNotifyDamage, the source functions for PRIME + synchronization and double buffering. Allows modesetting driver to be used + as a source with PRIME synchronization. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + v5: Move disabling of reverse PRIME on sink to sink commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 44cb9578c0e5e10568826bc3ecbed97d358bba3c +Author: Alex Goins +Date: Thu Jun 16 20:06:55 2016 -0700 + + modesetting: Disable Reverse PRIME for i915 + + Reverse PRIME seems to be designed with discrete graphics as a sink in + mind, designed to do an extra copy from sysmem to vidmem to prevent a + discrete chip from needing to scan out from sysmem. + + The criteria it used to detect this case is if we are a GPU screen and + Glamor accelerated. It's possible for i915 to fulfill these conditions, + despite the fact that the additional copy doesn't make sense for i915. + + Normally, you could just set AccelMethod = none as an option for the device + and call it a day. However, when running with modesetting as both the sink + and the source, Glamor must be enabled. + + Ideally, you would be able to set AccelMethod individually for devices + using the same driver, but there seems to be a bug in X option parsing that + makes all devices on a driver inherit the options from the first detected + device. Thus, glamor needs to be enabled for all or for none until that bug + (if it's even a bug) is fixed. + + Nonetheless, it probably doesn't make sense to do the extra copy on i915 + even if Glamor is enabled for the device, so this is more user friendly by + not requiring users to disable acceleration for i915. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + v5: Unchanged + v6: Rebase onto ToT + v7: NULL check and free drmVersionPtr + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit f6fef2a171366156c4c6807de7fe086f04f41b7b +Author: Alex Goins +Date: Thu Jun 16 20:06:54 2016 -0700 + + modesetting: Blacklist USB transport devices from PRIME sync + + UDL (USB 2.0 DisplayLink DRM driver) and other drivers for USB transport devices + have strange semantics when it comes to vblank events, due to their inability to + get the actual vblank info. + + When doing a page flip, UDL instantly raises a vblank event without waiting for + vblank. It also has no support for DRM_IOCTL_WAIT_VBLANK, and has some strange + behavior with how it handles damage when page flipping. + + It's possible to get something semi-working by hacking around these issues, + but even then there isn't much value-add vs single buffered PRIME, and it + reduces maintainability and adds additional risks to the modesetting driver + when running with more well-behaved DRM drivers. + + Work needs to be done on UDL in order to properly support synchronized + PRIME. For now, just blacklist it, causing RandR to fall back to + unsynchronized PRIME. + + This patch originally blacklisted UDL by name, but it was pointed out that there + are other USB transport device drivers with similar limitations, so it was + expanded to blacklist all USB transport devices. + + v1: N/A + v2: N/A + v3: Initial commit + v4: Move check to driver.c for consistency/visibility + v5: Refactor to accomodate earlier changes + v6: Rebase onto ToT + v7: Expand to blacklist all USB transport devices, not just UDL + + Signed-off-by: Alex Goins + Reviewed-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 500853086dd5fbfe6d2b3e30923fdc4d8c262cf0 +Author: Alex Goins +Date: Thu Jun 16 20:06:53 2016 -0700 + + modesetting: Suspend and resume flipping with DPMS + + DPMS would prevent page flip / vblank events from being raised, freezing + the screen until PRIME flipping was reinitialized. To handle DPMS cleanly, + suspend PRIME page flipping when DPMS mode is not on, and resume it when + DPMS mode is on. + + v1: Initial commit + v2: Moved flipping_active check from previous commit to here + v3: Unchanged + v4: Unchanged + v5: Move flipping_active check to sink support commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 80e64dae8af1eb3bb225b00fd800c6924883cf46 +Author: Alex Goins +Date: Thu Jun 16 20:06:52 2016 -0700 + + modesetting: Implement PRIME syncing as a sink + + Implements (Enable/Disable)SharedPixmapFlipping and + SharedPixmapNotifyDamage, the sink functions for PRIME synchronization and + double buffering. Allows modesetting driver to be used as a sink with PRIME + synchronization. + + Changes dispatch_slave_dirty to flush damage from both scanout pixmaps. + + Changes drmmode_set_scanout_pixmap*() functions to + drmmode_set_target_scanout_pixmap*() that take an additional parameter + PixmapPtr *target. Then, treat *target as it did prime_pixmap. This allows + me to use it to explicitly set both prime_pixmap and prime_pixmap_back + individually. drmmode_set_scanout_pixmap() without the extra parameter + remains to cover the single-buffered case, but only works if we aren't + already double buffered. + + driver.c: + Add plumbing for rr(Enable/Disable)SharedPixmapFlipping and + SharedPixmapNotifyDamage. + + Change dispatch_dirty_crtc to dispatch_dirty_pixmap, which functions the + same but flushes damage associated with a ppriv instead of the crtc, and + chanage dispatch_slave_dirty to use it on both scanout pixmaps if + applicable. + + drmmode_display.h: + Add flip_seq field to msPixmapPrivRec to keep track of the event handler + associated with a given pixmap, if any. + + Add wait_for_damage field to msPixmapPrivRec to keep track if we have + requested a damage notification from the source. + + Add enable_flipping field to drmmode_crtc_private_rec to keep track if + flipping is enabled or disabled. + + Add prime_pixmap_back to drmmode_crtc_private_rec to keep track of back + buffer internally. + + Add declarations for drmmode_SetupPageFlipFence(), + drmmode_EnableSharedPixmapFlipping(), + drmmode_DisableSharedPixmapFlipping, drmmode_SharedPixmapFlip(), and + drmmode_SharedPixmapPresentOnVBlank(). + + Move slave damage from crtc to ppriv. + + drmmode_display.c: + Change drmmode_set_scanout_pixmap*() functions to + drmmode_set_target_scanout_pixmap*() that take an additional parameter + PixmapPtr *target for explicitly setting different scanout pixmaps. + + Add definitions for functions drmmode_SharedPixmapFlip(), + drmmode_SharedPixmapPresentOnVBlank(), + drmmode_SharedPixmapPresent(), + drmmode_SharedPixmapVBlankEventHandler(), + drmmode_SharedPixmapVBlankEventAbort(), + drmmode_EnableSharedPixmapFlipping(), and + drmmode_DisableSharedPixmapFlipping, + drmmode_InitSharedPixmapFlipping(), and + drmmode_FiniSharedPixmapFlipping, along with struct + vblank_event_args. + + The control flow is as follows: + pScrPriv->rrEnableSharedPixmapFlipping() makes its way to + drmmode_EnableSharedPixmapFlipping(), which sets enable_flipping to + TRUE and sets both scanout pixmaps prime_pixmap and + prime_pixmap_back. + + When setting a mode, if prime_pixmap is defined, modesetting + driver will call drmmode_InitSharedPixmapFlipping(), which if + flipping is enabled will call drmmode_SharedPixmapPresent() on + scanout_pixmap_back. + + drmmode_SharedPixmapPresent() requests that for the source to + present on the given buffer using master->PresentSharedPixmap(). If + it succeeds, it will then attempt to flip to that buffer using + drmmode_SharedPixmapFlip(). Flipping shouldn't fail, but if it + does, it will raise a warning and try drmmode_SharedPixmapPresent() + again on the next vblank using + drmmode_SharedPixmapPresentOnVBlank(). + + master->PresentSharedPixmap() could fail, in most cases because + there is no outstanding damage on the mscreenpix tracked by the + shared pixmap. In this case, drmmode_SharedPixmapPresent() will + attempt to use master->RequestSharedPixmapNotifyDamage() to request + for the source driver to call slave->SharedPixmapNotifyDamage() in + response to damage on mscreenpix. This will ultimately call + into drmmode_SharedPixmapPresentOnVBlank() to retry + drmmode_SharedPixmapPresent() on the next vblank after + accumulating damage. + + drmmode_SharedPixmapFlip() sets up page flip event handler by + packing struct vblank_event_args with the necessary parameters, and + registering drmmode_SharedPixmapVBlankEventHandler() and + drmmode_SharedPixmapVBlankEventAbort() with the modesetting DRM + event handler queue. Then, it uses the drmModePageFlip() to flip on + the next vblank and raise an event. + + drmmode_SharedPixmapPresentOnVBlank() operates similarly to + drmmode_SharedPixmapFlip(), but uses drmWaitVBlank() instead of + drmModePageFlip() to raise the event without flipping. + + On the next vblank, DRM will raise an event that will ultimately be + handled by drmmode_SharedPixmapVBlankEventHandler(). If we flipped, + it will update prime_pixmap and prime_pixmap_back to reflect that + frontTarget is now being displayed, and use + drmmode_SharedPixmapPresent(backTarget) to start the process again + on the now-hidden shared pixmap. If we didn't flip, it will just + use drmmode_SharedPixmapPresent(frontTarget) to start the process + again on the still-hidden shared pixmap. + + Note that presentation generally happens asynchronously, so with + these changes alone tearing is reduced, but we can't always + guarantee that the present will finish before the flip. These + changes are meant to be paired with changes to the sink DRM driver + that makes flips wait on fences attached to dmabuf backed buffers. + The source driver is responsible for attaching the fences and + signaling them when presentation is finished. + + Note that because presentation is requested in response to a + vblank, PRIME sources will now conform to the sink's refresh rate. + + At teardown, pScrPriv->rrDisableSharedPixmapFlipping() will be + called, making its way to drmmode_FiniSharedPixmapFlipping(). + There, the event handlers for prime_pixmap and prime_pixmap_back + are aborted, freeing the left over parameter structure. Then, + prime_pixmap and prime_pixmap back are unset as scanout pixmaps. + + Register and tear down slave damage per-scanout pixmap instead of + per-crtc. + + v1: Initial commit + v2: Renamed PresentTrackedFlippingPixmap to PresentSharedPixmap + Renamed flipSeq to flip_seq + Warn if flip failed + Use SharedPixmapNotifyDamage to retry on next vblank after damage + v3: Refactor to accomodate moving (rr)StartFlippingPixmapTracking and + (rr)(Enable/Disable)SharedPixmapFlipping to rrScrPrivRec from ScreenRec + Do damage tracking on both scanout pixmaps + v4: Tweaks to commit message + v5: Revise for internal storage of prime pixmap ptrs + Move disabling for reverse PRIME from source commit to here + Use drmmode_set_target_scanout_pixmap*() to set scanout pixmaps + internally to EnableSharedPixmapFlipping(). + Don't support flipping if ms->drmmode.pageflip == FALSE. + Move flipping_active check to this commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 378c85a8848679eaa3c2881f3ba8b686e59df25e +Author: Alex Goins +Date: Thu Jun 16 20:06:51 2016 -0700 + + modesetting: Always load ms->drmmode.pageflip + + ms->drmmode.pageflip was only loaded from options if ms->drmmode.glamor was + defined, otherwise it would always assume FALSE. + + PRIME Synchronization requires ms->drmmode.pageflip even if we aren't using + glamor, so load it unconditionally. + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit b773a9c8126222e5fed2904d012fbf917a9f22fd +Author: Alex Goins +Date: Thu Jun 16 20:06:50 2016 -0700 + + modesetting: Always tear down scanout pixmap + + drmmode_set_scanout_pixmap_(cpu/gpu) would only do teardown if ppix == + NULL. This meant that if there were consecutive calls to + SetScanoutPixmap(ppix != NULL) without calls to SetScanoutPixmap(ppix == + NULL) in between, earlier calls would be leaked. RRReplaceScanoutPixmap() + does this today. + + Instead, when setting a scanout pixmap, always do teardown of the existing + scanout pixmap before setting up the new one. Then, if there is no new one + to set up, stop there. + + This maintains the previous behavior in all cases except those with + multiple consecutive calls to SetScanoutPixmap(ppix != NULL). + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit f4c37eeee7953df1fe0e3196eda452acf0078e61 +Author: Alex Goins +Date: Thu Jun 16 20:06:49 2016 -0700 + + modesetting: Internal storage of scanout pixmaps + + modesetting relied on randr_crtc->scanout_pixmap being consistent with + calls to SetScanoutPixmap, which is very fragile and makes a lot of + assumptions about the caller's behavior. + + For example, RRReplaceScanoutPixmap(), when dropping off with !size_fits, + will set randr_crtc->scanout_pixmap = NULL and then call SetScanoutPixmap. + Without this patch, drmmode_set_scanout_pixmap_(cpu/gpu) will think that + there is no scanout pixmap to tear down, because it's already been set to + NULL. + + By keeping track of the scanout pixmap in its internal state, modesetting + can avoid these types of bugs and reduce constraints on calling + conventions. + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 1bdbc7e764ed7bf7c1ae46287dec368aa7c7e80d +Author: Alex Goins +Date: Thu Jun 16 20:06:47 2016 -0700 + + randr/xf86: Add PRIME Synchronization / Double Buffer + + Changes PRIME to use double buffering and synchronization if all required + driver functions are available. + + rrcrtc.c: + Changes rrSetupPixmapSharing() to use double buffering and + synchronization in the case that all required driver functions are + available. Otherwise, falls back to unsynchronized single buffer. + + Changes RRCrtcDetachScanoutPixmap() to properly clean up in the case of + double buffering. + + Moves StopPixmapTracking() from rrDestroySharedPixmap() to + RRCrtcDetachScanoutPixmap(). + + Changes RRReplaceScanoutPixmap() to fail if we are using double buffering, + as it would need a second ppix parameter to function with double buffering, + and AFAICT no driver I've implemented double buffered source support in uses + RRReplaceScanoutPixmap(). + + randrstr.h: + Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME + double buffering. + + xf86Crtc.h: + Adds current_scanout_back to _xf86Crtc to facilitate detection + of changes to it in xf86RandR12CrtcSet(). + + xf86RandR12.c: + Changes xf86RandR12CrtcSet() to detect changes in + scanout_pixmap_back. + + Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME double + buffering. + + v1: Initial commit + v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap + v3: Refactor to accomodate moving (rr)StartFlippingPixmapTracking and + (rr)(Enable/Disable)SharedPixmapFlipping to rrScrPrivRec from ScreenRec + Add fallback if flipping funcs fail + v4: Detach scanout pixmap when destroying scanout_pixmap_back, to avoid + dangling pointers in some drivers + v5: Disable RRReplaceScanoutPixmap for double-buffered PRIME, it would need an + ABI change with support for 2 pixmaps if it were to be supported, but AFAICT + no driver that actually supports double-buffered PRIME uses it. + Refactor to use rrEnableSharedPixmapFlipping() as a substitute for + rrCrtcSetScanoutPixmap() in the flipping case. + Remove extraneous pSlaveScrPriv from DetachScanoutPixmap() + Remove extraneous protopix and pScrPriv from rrSetupPixmapSharing() + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit b601f96a5915a2c486b389483b291797e6fdf617 +Author: Alex Goins +Date: Thu Jun 16 20:06:46 2016 -0700 + + xf86: Add PRIME flipping functions to Screen + + Adds typedefs for (*RRStartFlippingPixmapTrackingProcPtr), + (*RREnableSharedPixmapFlippingProcPtr), + and (*RRDisableSharedPixmapFlippingProcPtr) in randrstr.h. + + Adds typedefs for (*PresentSharedPixmapProcPtr), + (*SharedPixmapNotifyDamageProcPtr), + (*RequestSharedPixmapNotifyDamageProcPtr), and + (*StopFlippingPixmapTrackingProcPtr) in scrnintstr.h. + + Adds RR(Enable/Disable)SharedPixmapFlipping, and + RRStartFlippingPixmapTracking to rrScrnPrivRec. + + Adds StopFlippingPixmapTracking, PresentSharedPixmap, + SharedPixmapNotifyDamage, and RequestSharedPixmapNotifyDamage to ScreenRec. + + rrScrnPrivRec used for functions that use RandR-private data types, and + ScreenRec used for the rest. + + RREnableSharedPixmapFlipping will allow the sink driver to setup for + flipping between two shared pixmaps. + + RRDisableSharedPixmapFlipping will allow the sink driver to do teardown + associated with flipping between two shared pixmaps. + + (RRStart/Stop)FlippingPixmapTracking are merely the double-buffered + equivalents of (Start/Stop)PixmapTracking, allowing the source driver to do + whatever setup and teardown necessary for presenting on the two shared + pixmaps. + + PresentSharedPixmap is a function exposed by the source driver for the X + server or sink driver to call to request a present on a given shared + pixmap. This way, presents can be driven by the sink's vblank instead of a + timer or similar mechanism. + + SharedPixmapNotifyDamage and RequestSharedPixmapNotifyDamage are OPTIONAL + (even for double-buffered PRIME) functions exposed by the sink driver and + the source driver, respectively. By calling + master->RequestSharedPixmapNotifyDamage(ppix), the sink driver can request + for the source driver to call slave->SharedPixmapNotifyDamage(ppix) in + response to damage on the master screen pixmap tracked by ppix. + + v1: Initial commit + v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap + Add SharedPixmapNotifyDamage / RequestSharedPixmapNotifyDamage + v3: Add RRCrtcPtr as a parameter to StartFlippingPixmapTracking + Move functions that use RandR-private data types to rrScrnPrivRec. + v4: Unchanged + v5: Add front and back parameters to RREnableSharedPixmapFlippingProcPtr + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit ef1578e736887aadf209172f48daa9eaec25b3db +Author: Jon Turney +Date: Sun Feb 28 00:53:24 2016 +0000 + + hw/xwin: Fix a typo in "Remove Shadow DirectDraw engine" + + Commit 7a22912e "Remove Shadow DirectDraw engine" contained a typo, changing + the fullscreen && DirectDraw check in WM_DISPLAYCHANGE to fullscreen || + DirectDraw + + This causes disruptive depth changes to be improperly handled + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 0a0c1bd93259c208184d6ad974ba55658191af0c +Author: Jon Turney +Date: Fri Feb 26 18:03:04 2016 +0000 + + hw/xwin: Fix a crash trying to reload window icons when not in multiwindow mode + + ReloadEnumWindowsProc() accesses window privates, which are only valid in + multiwindow mode, but is called in all modes. + + Fix this potential crash by not doing this unless in multiwindow mode. + + Reproduction steps: + 1/ XWin -mwextwm + 2/ Run a client which creates an X window e.g. xterm + 3/ Right click on notification area icon, and choose 'Reload .XWinrc' from the menu + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 91ae2571458c50d9f782190d9f80815b770aefac +Author: Colin Harrison +Date: Fri Feb 26 16:46:15 2016 +0000 + + hw/xwin: Fix a crash which occurs if focus returns to XWin after xkbcomp has failed + + If WM_FOCUS is received while the "core devices failed" fatal error (due to + xkbcomp failing) is displayed, winRestoreModeKeyState() attempts to + dereference a NULL InputInfo.keyboard->key pointer. + + Signed-off-by: Colin Harrison + Reviewed-by: Jon Turney + +commit 4b123e0f61eb55e59d30bf442499cf3b3f621c3b +Author: Jon Turney +Date: Tue Aug 4 16:05:05 2015 +0100 + + hw/xwin: Make window maximizable if a maximium size larger than virtual desktop size is specified + + Firefox 38 has a WM_NORMAL_HINTS with a maximum size of 32767x32767. + + Don't remove the maximize control from the window frame if the maximum size + is bigger than the virtual desktop size, as maximizing the window will not + exceed the maximium size. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 504bf495f9b3adea1ba650469223511f81709714 +Author: Jon Turney +Date: Wed Jul 8 19:12:22 2015 +0100 + + hw/xwin: Detect invalid options in combination with -nodecoration + + Detect invalid options in combination with -nodecoration + + These are particularly problematic as -nodecoration implies a default of + -nomultimonitors, for some reason, which will gives rendering issues with + -multiwindow. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit e1b983b55e4cefcf976c8f92d608af8216a56927 +Author: Jon Turney +Date: Tue Nov 11 11:46:25 2014 +0000 + + hw/xwin: Default to -noresize when -fullscreen is used + + Currently, just using -fullscreen fails in winValidateArgs(), as the default + -resize=randr is incompatible with -fullscreen. + + Set the default resize mode to -noresize if -fullscreen is used. + + Also, rename enum value notAllowed -> resizeNotAllowed for clarity. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 42f7cd5d92f2046e1b5c264b3d76c3afda624a55 +Author: Jon Turney +Date: Sat Oct 11 14:49:16 2014 +0100 + + hw/xwin: Tell LogInit() to backup previous logfile as .old + + Future work: Do we really need to call LogInit() in so many different + places? + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 197419838273eddbd0bd34890771799f4bebbc07 +Author: Jon Turney +Date: Fri Sep 26 13:18:33 2014 +0100 + + hw/xwin: Downgrade some uninformative, always-emitted log output to debug + + Downgrade from error to debug some uninformative, always-emitted log output + about thread synchronization during initialization + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 17c8bf348eea4f12ce7cb4ca7db0d0576e28c982 +Author: Jon Turney +Date: Tue Apr 28 16:04:40 2015 +0100 + + hw/xwin: Check for just the hostname in window title + + When -hostintitle is enabled, only use the hostname, not a FQDN from + WM_CLIENT_MACHINE, when checking if the window title already contains it + + Also restructure GetWindowName() to fix a potential memory leak. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit c05c4360eea245b3ef5f3a355b95dcd63244ef70 +Author: Jon Turney +Date: Mon Sep 22 14:40:41 2014 +0100 + + hw/xwin: Use _NET_WM_NAME for window titles in multiwindow mode + + Use _NET_WM_NAME in preference to WM_NAME for window title + + Update window title when _NET_WM_NAME property changes + + We should always have been doing this, but some qt5 examples only set + _NET_WM_NAME, so now it's become more important... + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 866d8299abc4315d4836292aeac4abe0b686fc10 +Author: Jon Turney +Date: Thu Mar 13 17:53:44 2014 +0000 + + hw/xwin: Remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type windows + + In multiwindow mode, remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type + windows. + + Some programs use _NET_WM_WINDOW_TYPE_SPLASH_SCREEN in error, so also accept + that as equivalent. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 356b9129067dd0e1dc62e893d47a1e9b033885bd +Author: Jon Turney +Date: Thu Apr 7 17:40:56 2016 +0100 + + hw/xwin: Use Bool type in winShowWindowOnTaskbar() prototype + + Use the Bool type from X11/Xdefs.h for winShowWindowOnTaskbar(). + + This is the boolean type we should be using inside the X server, rather than + BOOL, which evaluates to either the Win32 API type, or the Xlib API type, + depending on the context... + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 7397a2191f333a8632109873cc60d13ca4d550b0 +Author: Olivier Fourdan +Date: Tue Jun 21 13:54:35 2016 +0200 + + xwayland-input: Fake crossing to rootwin + + This partially reverts commit c1565f3. + + When the pointer moves from an X11 window to a Wayland native window, + no LeaveNotify event is emitted which can lead to various unexpected + behaviors like tooltips remaining visible after the pointer has left the + window. + + Yet the pointer_handle_leave() is called and so is the DIX CheckMotion() + but since the pointer enters a Wayland native window with no other + Xwayland window matching, DoEnterLeaveEvents() does not get invoked and + therefore no LeaveNotify event is sent to the X11 client at the time the + pointer leaves the window for a Wayland native surface. + + Restore the XYToWindow() handler in xwayland-input that was previously + removed with commit c1565f3 and use that handler to pretend that the + pointer entered the root window in this case so that the LeaveNotify + event is emitted. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96437 + + Signed-off-by: Olivier Fourdan + Acked-by: Daniel Stone + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 111a045dcf0912dc5b178c18acda479b3972876b +Author: Adam Jackson +Date: Tue Jun 21 11:45:17 2016 -0400 + + Revert "XDMCP: For IPv6 add link local addresses to the end of the list" + + This reverts commit fdd448cd39b4ca84a28d73fc628911070437b703. + +commit fdd448cd39b4ca84a28d73fc628911070437b703 +Author: Reinhard Max +Date: Thu Apr 28 15:21:15 2016 +0200 + + XDMCP: For IPv6 add link local addresses to the end of the list + + For link local addresses the XDMCP server would need to either know the + interface thru a scope identifier or try all available interfaces. If + they don't this address will fail in which case the XDMCP server could + still try the other addresses passed - however some only try the first + address and then give up. + + Even if this seems to be the wrong place to fix this it seems to be + easier than fixing all display servers. + + [ajax: Cleaned up commit message] + + Reviewed-by: Adam Jackson + +commit ce82ae1964b2115a780786676c614546297a79c9 +Author: Adam Jackson +Date: Tue Feb 2 14:10:49 2016 -0500 + + res: Account for GLXPixmap references too + + GLX_EXT_tetxure_from_pixmap operates on a GLXPixmap, which takes a + reference on the backing pixmap; that GLXPixmap might be long-lived, so + we should account for it in ResQueryClientPixmapBytes. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 5d6ad0d3a7611c4dff2d79b6af9eb5c0885656ef +Author: Adam Jackson +Date: Tue Feb 2 13:49:37 2016 -0500 + + res: Fix accounting of redirected window pixmaps for Composite + + The previous change removed the special case that matched resources of + CompositeClientWindowType and walked back from that to the window + pixmap. That was intentional, since that logic was broken anyway. CCWTs + don't map 1:1 to references on the backing pixmap; a window redirected + by multiple clients (say, by the server since it's on the synthetic + visual, and then manually by a compositor) would have a window pixmap + refcount of 1, but would have those bytes accounted twice. + + The right thing is to have Composite wrap window accounting, and add the + pixmap bytes once and only once for the redirection reference. + + Note that the view from the client can still be non-intuitive in the + face of Composite. xcompmgr, for example, holds _two_ references to + each window pixmap (one each from CompositeNameWindowPixmap and + RenderCreatePicture), so a synthetic-visual window will have its bytes + split 2/3 to xcompmgr and 1/3 to the server-client. Nothing to be done + about that, and at least this way we're not over-accounting. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 4f8a72034c4a2654bfc16d929e09a69d1cc138ef +Author: Adam Jackson +Date: Tue Feb 2 13:46:42 2016 -0500 + + res: Simplify QueryClientPixmapBytes + + I suspect this code predates the common resource hooks for computing + sizes. It's ugly in any case since the Resource extension shouldn't + need to know which extensions can take a reference on pixmaps. Instead, + let's just walk every resource for the client and sum up all the pixmap + bytes that way. + + This might be slightly slower since we're calling the size func once for + every resource. On the other hand, it might be slightly faster since we + only walk the resource table once instead of 3-5 times. Probably a + wash, and not really a performance path in any case. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 263c5333a54107efac702a54d7e6329ae25ff4e0 +Author: Michel Dänzer +Date: Fri Dec 25 18:32:46 2015 +0900 + + xfree86/modes: Simplify in_range logic in xf86_crtc_set_cursor_position + + Consolidate to a single if/else statement and eliminate the redundant + local variable in_range and assignments to x/y. + + Reviewed-by: Adam Jackson + +commit a991b1ec30344c16d318d2c0640f9e5d380193e0 +Author: Michel Dänzer +Date: Mon Feb 1 16:07:22 2016 +0900 + + xfree86/modes: Disambiguate driverIsPerformingTransform + + The driver can now specify exactly which aspects of the transform it + wants to handle via XF86DriverTransform* flags. + + Since the driver can now choose whether it wants to receive transformed + or untransformed cursor coordinates, xf86CrtcTransformCursorPos no + longer needs to be available to drivers, so make it static. + + Reviewed-by: Adam Jackson + +commit aad96f85005f8eab27df62049d619092865a9b16 +Author: Michel Dänzer +Date: Fri Dec 25 18:28:47 2015 +0900 + + xfree86/modes: Fix HW cursor clipping for driverIsPerformingTransform (v2) + + Even if the driver is handling the transform, we still need to transform + the cursor position for clipping, otherwise we may hide the HW cursor + when the cursor is actually inside the area covered by the CRTC. + + v2: Use crtc_x/y local variables for clarity + + Reviewed-by: Adam Jackson + +commit 828887b6f4a997b6468da565a88b6fe9afcda191 +Author: Keith Packard +Date: Tue Jun 14 13:45:27 2016 -0700 + + ephyr: Process only the last expose or configure available from the server + + Delay expose or configure processing until the event queue is empty so + that we don't end up processing a long series of events one at a + time. Expose events already have a check waiting for the last in a + series, this further improves that by discarding multiple + series of events. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit c17a41794507d6d04c850e9e1bc04fc60c31de18 +Author: Keith Packard +Date: Sat Jun 4 19:55:07 2016 -0700 + + ephyr: Process queued X events before blocking [v2] + + If we end up reading all pending X events in the course of other server + execution, then our notify FD callback won't get invoked and we won't + process them. Fix this by noting that there are queued events in the + block handler, setting the poll timeout to zero and queuing a work + proc to clear the event queue. + + v2: use a work proc to clear the event queue rather than doing it in + the block handler directly. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f3248eba6e2d0c099025f8e9a4874b431246eac7 +Author: Keith Packard +Date: Tue Jun 14 13:19:49 2016 -0700 + + ephyr: Handle window resize when using glamor + + Under glamor, we need to re-create the screen pixmap at the new size + so that we can ask glamor for the associated texture. Fortunately, we + can simply use ephyr_glamor_create_screen_resources to create the new + pixmap. + + Because this is being done after the server has started, we need to + walk the window heirarchy and reset any windows pointing at the old + pixmap. I could easily be convinced that this TraverseTree should be + moved to miSetScreenPixmap. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 235d21670dcff224807ff719c7fa86212058ec46 +Author: Keith Packard +Date: Tue Jun 14 13:16:03 2016 -0700 + + ephyr: Don't configure window while responding to configure events + + This leads to and endless sequence of window resizes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit fb1edccf3c90c626f120b3c399657f24d3f7901e +Author: Keith Packard +Date: Thu May 26 12:11:46 2016 -0700 + + dix: Call screen block/wakeup handlers closest to blocking [v3] + + The screen block and wakeup handlers are the only ones which provide a + well known ordering between the wrapping layers; placing these as + close as possible to the server blocking provides a way for the driver + to control the flow of execution correctly. + + Switch the shadow code to run in the screen block handler so that it + now occurrs just before the server goes to sleep. + + Switch glamor to call down to the driver after it has executed its own + block handler piece, in case the driver needs to perform additional + flushing work after glamor has called glFlush. + + These changes ensure that the following modules update the screen in + the correct order: + + animated cursors (uses RegisterBlockAndWakeupHandlers dynamically) + composite (dynamic wrapping) + misprite (dynamic wrapping) + shadow (static wrapping) + glamor (static wrapping) + driver (static wrapping) + + It looks like there's still a bit of confusion between composite and + misprite; if composite updates after misprite, then it's possible + you'd exit the block handler chain with the cursor left hidden. To fix + that, misprite should be wrapping during ScreenInit time and not + unwrapping. And composite might as well join in that fun, just to make + things consistent. + + [v2] Unwrap BlockHandler in shadowCloseScreen (ajax) + [v3] ephyr: Use screen block handler for flushing changes + + ephyr needs to make sure it calls glXSwapBuffers after glamor finishes + its rendering. As the screen block handler is now called last, we have + to use that instead of a registered block/wakeup handler to make sure + the GL rendering is done before we copy it to the front buffer. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a134d1e7eada0ac90fb622f45833c87b72c9aa06 +Author: Guilherme Quentel Melo +Date: Tue May 10 00:29:58 2016 +0000 + + glx: avoid memory leak when using indirect rendering + + When multiple processes are using GL with indirect rendering a race + condition can make drawables refcount never drop to zero. + + This situation could happen when there are many X clients using indirect + GLX: + + 1 - client1: calls glXMakeCurrent + + 2 - client2: calls glXMakeCurrent + This is the first context switch for this client. So old_context_tag=0 + + 3 - client1: calls glXRender + For the client, its context is already current. + For the server side lastGLContext points to client2's context. + + Reviewed-by: Adam Jackson + Signed-off-by: Guilherme Quentel Melo + +commit 266cf39a8f108e2f365a9772f4ee4d9fca88eb36 +Merge: fa7b70a 848089e +Author: Adam Jackson +Date: Mon Jun 20 11:21:40 2016 -0400 + + Merge remote-tracking branch 'hans/for-master' + +commit fa7b70a9b895789ec57562bbba0bc052fc91d134 +Author: Keith Packard +Date: Tue Jun 14 17:36:16 2016 -0700 + + kdrive: Only enable threaded input if we have input devices + + When there aren't any devices, the input thread is going to be pretty + lonely, so don't bother to even start it. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 6f2a5b8cdf7b1e913a1e0581e65195dd10f04ca3 +Author: Jason Gerecke +Date: Fri Jun 17 08:44:41 2016 -0700 + + xwayland: Expose all NBUTTONS buttons on the pointer + + The call to 'InitButtonClassDeviceStruct' which initializes the pointer + buttons only results in the first three buttons being created due to a + hardcoded '3'. In order to expose all the buttons defined in the + btn_labels array, we subtitute 'NBUTTONS' in its place. + + Signed-off-by: Jason Gerecke + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit 72df6e2a3a5020696902b70fe940934ef0a681c4 +Author: Jason Gerecke +Date: Fri Jun 17 08:44:40 2016 -0700 + + xwayland: Use correct labels when initializing pointer valuators + + Signed-off-by: Jason Gerecke + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit dab5b3922c50f73712a8ea0cb9742c4bc7d7ab1d +Author: Jason Gerecke +Date: Fri Jun 17 08:44:39 2016 -0700 + + xwayland: Fix whitespace errors + + Substitute a few errant tab characters with eight spaces to conform to the + prevailing style. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 848089e0dde38f043c85332785520946103e77c1 +Author: Lyude Paul +Date: Mon Jun 13 15:31:02 2016 -0400 + + modesetting: Clear drmmode->fb_id before unflipping + + [fix copied from 40191d82370e in xf86-video-ati] + + Without this, we end up setting rotated CRTCs back to their previous + framebuffer right after we perform a rotation. Reproducer: + + - Have two monitors connected at the same resolution + - Rotate one monitor from normal straight to inverted + - Watch as the monitor you didn't rotate either freezes or shows intense + flickering + + Signed-off-by: Lyude + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 4313122dea0df9affc280ee698e929489061ccc6 +Author: Hans de Goede +Date: Wed Jun 1 15:14:32 2016 +0200 + + modesetting: Only add main fb if necessary + + If we're doing reverse-prime; or doing rotation the main fb is not used, + and there is no reason to add it in this case. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 877453212166fdc912e0d687cdecee11aba563b5 +Author: Hans de Goede +Date: Wed Jun 1 15:11:05 2016 +0200 + + modesetting: Remove unnecessary fb addition from drmmode_xf86crtc_resize + + drmmode_set_mode_major() is the only user of drmmode->fb_id and will + create it if necessary. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 210d83ad492f0e91889472eaae549106d9b4ebf5 +Author: Hans de Goede +Date: Wed Jun 1 15:07:22 2016 +0200 + + modesetting: Set ppix->fb_id to 0 after removing the fb + + This ensures the fb gets re-added when a shared pixmap is re-used for + a second drmmode_set_scanout_pixmap_cpu call. + + Note currently the xserver never re-uses a shared pixmap in this way, + so this is mostly a sanity fix. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit b8ef71fb07a8ba9587aeaca942b4de20b59266ca +Author: Hans de Goede +Date: Wed Jun 1 14:59:38 2016 +0200 + + modesetting: Properly cleanup fb for reverse-prime-offload + + drmmode_set_scanout_pixmap_gpu(pix) adds drmmod->fb_id through a call + to drmmode_xf86crtc_resize(), but on a subsequent + drmmode_set_scanout_pixmap_gpu(NULL) it would not remove the fb. + + This keeps the crtc marked as busy, which causes the dgpu to not + being able to runtime suspend, after an output attached to the dgpu + has been used once. Which causes burning through an additional 10W + of power and the laptop to run quite hot. + + This commit adds the missing remove fb call, allowing the dgpu to runtime + suspend after an external monitor has been plugged into the laptop. + + Note this also makes drmmode_set_scanout_pixmap_gpu(NULL) match the + behavior of drmmode_set_scanout_pixmap_cpu(NULL) which was already + removing the fb. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 15595d29c2c3992f260a3314f26fa691f1e5cec8 +Author: Nikhil Mahale +Date: Thu May 26 21:50:16 2016 +0530 + + randr: Adjust master's last set time with slaves + + In prime configurations master's last set time may not be latest + and greatest, adjust it with slaves last set time, pick up greatest + one. Otherwise xserver may end with events which has + lastSetTime < lastConfigTime even if that's not + the case and confuse xrandr client. + + [hdegoede: rebase on "xrandrprovider: Do not use separate lists for unbound / + source / offload slaves"] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 5c7af02b103790ac1fb6a71822788892c70290b6 +Author: Hans de Goede +Date: Fri May 13 15:58:10 2016 +0200 + + xrandrprovider: Do not use separate lists for unbound / source / offload slaves + + A single provider can be both a offload and source slave at the same time, + the use of seperate lists breaks in this case e.g. : + + xrandr --listproviders + Providers: number : 2 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting + + xrandr --setprovideroutputsource 1 0x7b + xrandr --listproviders + Providers: number : 2 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting + + xrandr --setprovideroffloadsink 1 0x7b + xrandr --listproviders + Providers: number : 3 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting + Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting + + Not good. The problem is that the provider with id 0x46 now is on both + the output_slave_list and the offload_slave_list of the master screen. + + This commit fixes this by unifying all 3 lists into a single slaves list. + + Note that this does change the struct _Screen definition, so this is an ABI + break. I do not expect any of the drivers to actually use the removed / changed + fields so a recompile should suffice. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit bab0f450a719a11799491043b82c2f293fed27fe +Author: Chris Wilson +Date: Sat Feb 14 09:58:44 2015 +0000 + + present: Fix presentation of flips out of order + + The flip queue currently only holds events submitted to the driver for + flipping, awaiting the completion notifier. It is short. We therefore + can speed up interrupt processing by keeping the small number of events + ready to be flipped on the end of the flip queue. By appending the + events to the flip_queue in the order that they become ready, we also + resolve one issue causing Present to display frames out of order. + + Signed-off-by: Chris Wilson + Reviewed-and-tested-by: Mario Kleiner + Signed-off-by: Hans de Goede + +commit fbe660b7652b945bdd8e3eb0780179d83cc7de96 +Author: Chris Wilson +Date: Sat Feb 14 09:58:43 2015 +0000 + + present: Improve scaling of vblank handler + + With large numbers of queued vblank, the list iteration on every + interupt dominates processing time. If we reorder the list to be in + ascending event order, then not only is also likely to be in order for + notification queries (i.e. the notification will be near the start of + the list), we can also stop iterating when past the target event_id. + + Signed-off-by: Chris Wilson + Reviewed-and-tested-by: Mario Kleiner + Signed-off-by: Hans de Goede + +commit c6511d0142040654140bdedd6f03d43af0abba21 +Author: Maarten Lankhorst +Date: Wed Oct 2 15:47:54 2013 +0200 + + exa: only draw valid trapezoids + + Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484 + + If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly. + A similar fix should also be applied to pixman. + + Signed-off-by: Maarten Lankhorst + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 2d6230e77348e550c90e00c007b113ce38c81d12 +Author: Keith Packard +Date: Tue Jun 14 17:09:07 2016 -0700 + + glamor: Use DestroyPixmap instead of FreePicture for glyph atlas pixmap + + Nice of FreePicture to take a void * instead of a PicturPtr so that + this error wasn't caught by the compiler. + + Noticed when resetting the X server left a dangling pixmap around. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit edd24aa50b17849b904a3ac5429e333bac9bac9c +Author: Olivier Fourdan +Date: Mon Jun 6 09:22:28 2016 +0200 + + wayland: clear resource for pixmap on unrealize + + On cursor unrealize, the associated pixmap is destroyed, make sure we + clear the pointer from the private resource and check for the value + being non-null when setting or destroying the cursor. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96246 + +commit 941aeb3b92e644923bd112eef8023f033a140ee6 +Author: Olivier Fourdan +Date: Fri May 13 08:58:58 2016 +0200 + + randr: Do not update ConnectionInfo if NULL + + RRScreenSizeNotify() will update the connection information block, but + if this occurs during initialization before ConnectionInfo is even + initialized, this will lead to a crash. + + Simply check for ConnectionInfo prior to update it to avoid the crash. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 6a6bbc3b756706bdade01434f1ee8d8cbe7dd854 +Author: Olivier Fourdan +Date: Thu May 12 14:51:51 2016 +0200 + + xwayland: Restore wl_display_roundtrip() in InitInput + + This partially revert commit 984be78 + + The rountrip in Xwayland's InitInput() is unlikely the culprit for the + crash reported in bug 95337, even though it's triggered from + InitInput(). + + Startup goes like this: + + xwl_screen_init() + xwl_output_create() + wl_display_roundtrip() + InitInput() + wl_display_roundtrip() + ConnectionInfo initialized + + What happens in bug 95337 is that some output data is already available + when we reach InitInput()'s wl_display_roundtrip() and therefore we end + up trying to update the ConnectionInfo's data from RR routines before + ConnectionInfo is actually initialized. + + Removing the wl_display_roundtrip() from InitInput() will not fix the + issue (although it would make it less lileky to happen), because + xwl_screen_init() also does a wl_display_roundtrip() after creating the + output, so the race that led to bug 95337 remains. + + However, re-setting the xwl_screen->expecting_event to 0 again in + InitInput() still doesn't seem right. so this part is not restored + (thus a partial revert). + + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + +commit 6cb34816afa95d9214199c363f9b4bb5ecbae77b +Author: Adam Jackson +Date: Fri Apr 29 14:22:52 2016 -0400 + + xace: Remove the audit hooks and tune dispatch + + There are no in-tree consumers of the audit hooks, and they are in any + case redundant with the dtrace dispatch hooks. Neither is there any + in-tree user of the core request dispatch hook. The extension hook is + only used for non-default security cases, but in the absence of LTO we + always have to take the function call into XaceHookDispatch to find out + that there's no callback registered. + + Cc: Eamon Walsh + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit da9fec4eddd554b4b709ba58b4436aef5a76cd51 +Author: Eric Biggers +Date: Thu Jun 9 19:45:15 2016 -0500 + + Allow ConstantDeceleration < 1.0 + + As documented in xorg.conf(5), a value of ConstantDeceleration between 0 + and 1 will speed up the pointer. However, values less than 1 actually + had no effect. Fix this. + + Note that this bug only affected "ConstantDeceleration" as configured + through xorg.conf, not "Device Accel Constant Deceleration" as configured + through xinput. The property handler AccelSetDecelProperty() also did + not need to be changed, as it did not limit the values of the property. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92766 + + Signed-off-by: Eric Biggers + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7cf80b9714864c3c4eb9898ff1b7d657ecd16df7 +Author: Adam Jackson +Date: Wed Jun 1 14:27:23 2016 -0400 + + xfree86: Don't swallow ±iglx command line flag + + We want to notice that it's set, but still pass it through to dix. + Return 0 to indicate this. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit 4653793de3860f2d83a39919af348527bc719794 +Author: Olivier Fourdan +Date: Wed Jun 8 17:10:11 2016 +0200 + + wayland: Remove unused field in xwl_screen + + Can't find any reference of pointer_limbo_window in the code, let's + remove it. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit c69bd15e00aea2610834d05f63777f9bf20eca34 +Author: Peter Hutterer +Date: Wed Jun 1 14:38:54 2016 +1000 + + Allow compile-time selection of a fallback input driver + + A new --with-fallback-input-driver=foo option allows selecting a + fallback driver for the server if the driver configured for the device + is not found. Note that this only applies when the device has a driver + assigned and that module fails to load, devices without a driver are + ignored as usual. + + This avoids the situation where a configuration assigns e.g. the + synaptics driver but that driver is not available on the system, + resulting in a dead device. A fallback driver can at least provides some + functionality. + + This becomes more important as we move towards making other driver true + leaf nodes that can be installed/uninstalled as requested. Specifically, + wacom and synaptics, a config that assigns either driver should be + viable even when the driver itself is not (yet) installed on the system. + + It is up to the distributions to make sure that the fallback driver is + always installed. The fallback driver can be disabled with + --without-fallback-input-driver and is disabled by default on non-Linux + systems because we don't have generic drivers on those platforms. + Default driver on Linux is libinput, evdev is the only other serious + candidate here. + + Sample log output: + [ 3274.421] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event4) + [ 3274.421] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad weird driver" + [ 3274.421] (II) LoadModule: "banana" + [ 3274.422] (WW) Warning, couldn't open module banana + [ 3274.422] (II) UnloadModule: "banana" + [ 3274.422] (II) Unloading banana + [ 3274.422] (EE) Failed to load module "banana" (module does not exist, 0) + [ 3274.422] (EE) No input driver matching `banana' + [ 3274.422] (II) Falling back to input driver `libinput' + .. server proceeds to assign libinput, init the device, world peace and rainbows + everywhere, truly what a sight. Shame about the banana though. + + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit a6b6e8ba026acedef6336b17adf06aebddd5f22f +Author: Dave Airlie +Date: Fri May 6 10:46:14 2016 +1000 + + prime: clean up slave bo properly. (v3) + + This is an ABI break, in that we now pass NULL to a function that hasn't + accepted it before. + + Alex Goins had a different patch for this but it wasn't symmetrical, it + freed something in a very different place than it allocated it, this + attempts to retain symmetry in the releasing of the backing bo. + + v2: use a new toplevel API, though it still passes NULL to something + that wasn't expecting it. + v3: pass -1 instead of 0. + + Signed-off-by: Dave Airlie + Tested-by: Hans de Goede + Reviewed-by: Hans de Goede + Reviewed-by: Alex Goins + +commit aa5390aa83be55f887e3b4f78681b4f3d3386eb5 +Author: Adam Jackson +Date: Mon May 9 14:18:32 2016 -0400 + + xfree86: Remove redundant parse of AIGLX server flag + + Not visible in the patch, but the same stanza is repeated below inside + the #ifdef GLXEXT. There's no reason to bother with checking it if we + built without GLXEXT so remove the unconditional one. + + Reviewed-by: Alan Coopersmith + Signed-off-by: Adam Jackson + +commit 166d4c817897f5aa197f639bf06b5b3e04994496 +Author: Michel Dänzer +Date: Fri Jun 3 10:25:20 2016 +0900 + + xwayland: Call eglBindAPI after eglInitialize + + Current Mesa Git master checks that the EGL display actually supports + the API passed to eglBindAPI, which can only succeed after + eglInitialize. + + Signed-off-by: Michel Dänzer + Reviewed-by: Pekka Paalanen + +commit d798b8318adf298bc23166e74f31e49805f0d881 +Author: Michel Dänzer +Date: Fri Jun 3 10:25:19 2016 +0900 + + glamor: Call eglBindAPI after eglInitialize + + Current Mesa Git master checks that the EGL display actually supports + the API passed to eglBindAPI, which can only succeed after + eglInitialize. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96344 + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 5bcdd1cc753d8e60c249eeacba695653af1a39d8 +Author: Adam Jackson +Date: Tue Jun 7 15:52:15 2016 -0400 + + dix: Update some comments to reflect the new non-SIGIO input model + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 48a9b29b0a09b865492d60e8a7cd2a94864fbb3f +Author: Adam Jackson +Date: Tue Jun 7 15:52:14 2016 -0400 + + xfree86: Undocument UseSIGIO in xorg.conf + + The doc text is wrong at this point, input processing isn't going to + vary based on this, so we shouldn't say it does. The only thing this + _does_ get used for is DRI1 SwapBuffers (on everything but savage), and + if you disable it you're not going to get DRI1 at all, so we really + shouldn't even mention it. + + Still, leave the option wired up to the parser so we don't break any + DRI1-driver-using setup relying on it being disabled, and so we don't + complain about unused options elsewhere. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 2725dd024de33e96555cbf6ff28184a64d515c3c +Author: Adam Jackson +Date: Tue Jun 7 15:52:13 2016 -0400 + + dri1: Hide the SIGIO details from drivers + + Not being used, and not likely to be useful. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 95ce2bccdcdc88355262674a636c342c946914da +Author: Adam Jackson +Date: Tue Jun 7 15:52:12 2016 -0400 + + dmx: Remove SIGIO input support here too + + This code was broken anyway. Note that DEVICE_OFF would make dmx think + _no_ devices were using SIGIO anymore, which means 'xinput disable' on + your mouse would probably do weird things to your keyboard too. Rather + than try to repair that and keep SIGIO working on this one niche DDX, + just rip it out and use the thread model like everyone else. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 6178b1c91cfc9e860914acc6f0be2f2d2e07a124 +Author: Adam Jackson +Date: Tue Jun 7 15:52:11 2016 -0400 + + dix: Use OsSignal() not signal() + + As the man page for the latter states: + + The effects of signal() in a multithreaded process are unspecified. + + We already have an interface to call sigaction() instead, use it. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 8174daa6bd3f0c792425a5ebef63a6a9ce7d00a4 +Author: Keith Packard +Date: Sun Jun 5 12:32:19 2016 -0700 + + os: Do timers under input lock, not blocked signals + + Timer processing can happen on either the main thread or the input + thread. As a result, it must be done under the input lock. + + Signals are unrelated to timers now that SIGIO isn't used for input + processing, so stop blocking signals while processing timers. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 88e981e7088198fabea6c322c58f371d91578b6a +Author: Olivier Fourdan +Date: Wed Mar 9 10:33:50 2016 +0100 + + xwayland: sync event queue to check compositor reply + + Read and dispatch pending Wayland events to make sure we do not miss a + possible reply from the compositor prior to discard a key repeat. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 26ad25a0ed1d99f3cacb711793c830cb5249580e +Author: Olivier Fourdan +Date: Wed Mar 9 11:17:27 2016 +0100 + + xwayland: refactor Wayland event handling + + To be able to reuse some code. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 239705a6feefaddf90be9541a054ebd8c8c10d81 +Author: Olivier Fourdan +Date: Wed Mar 9 10:31:58 2016 +0100 + + xwayland: add a server sync before repeating keys + + Key repeat is handled by the X server, but input events need to be + processed and forwarded by the Wayland compositor first. + + Make sure the Wayland compositor is actually processing events, to + avoid repeating keys in Xwayland while the Wayland compositor cannot + deal with input events for whatever reason, thus not dispatching key + release events, leading to repeated keys while the user has already + released the key. + + Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=762618 + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit fda5675f9d257d583ea0683adf863c5e1e51e30c +Author: Olivier Fourdan +Date: Wed Mar 9 10:31:13 2016 +0100 + + xkb: add hook to allow/deny AccessX key repeat + + The xserver generates the key repeat by itself. + + But when used with another server processing inputs first (e.g. a + Wayland compositor), the other server may be busy dealing with some + other things and not queue up key release events in time. + + Add a vfunc in XkbSrvInfo to possibly add a check before re-emitting a + keypress event in the AccessX timer handler, so that the key repeat has + a chance to be denied if the server processing the input is not ready. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 3735ab965a4642273d070840bda4e827991e5219 +Merge: 7c77c42 43dbc55 +Author: Keith Packard +Date: Thu Jun 2 07:47:16 2016 -0700 + + Merge remote-tracking branch 'daenzer/for-master' + +commit 7c77c42fe87316e5c68611f03b0bda96656c4a4c +Author: Keith Packard +Date: Fri May 27 17:36:57 2016 -0700 + + dix: Don't update current time in the middle of input event processing + + In patch 137ac094e7ab8c871f3b36e40ad826ac797f0e26, Adam moved an + expensive call to UpdateCurrentTime out of the main dispatch + loop. That's a good change as the original fix from Chase was a bit + expensive. However, it breaks grab processing and so a couple of the + calls to UpdateCurrenTime need to be removed. + + Input event processing can generate a stream of events; a button press + that activates a grab will send a press followed by a sequence of + enter/leave events. All of these should have the same time stamp on + the wire as they occur at the 'same' time. + + More importantly, the grab time recorded in the device is pulled from + currentTime after all of the events are delivered, so if currentTime + doesn't match the time in the device event, then future grab + modifications will fail as the time marked in the device will be + 'later' than the grab time known to the client (which is defined as + the timestamp from the activating input event). + + A bit of history here -- it used to be that currentTime was driven + *entirely* by input events; those timestamps didn't even have to be + related to the system time in any way. Then we started doing ICCCM + stuff and people got confused when PropertyNotify events would have + the same timestamp even when delivered minutes apart because no input + events were delivered. + + We added code in the server to go update the time, but only if no + input events were pending (so that the clock "wouldn't" go + backwards). The only places where this is necessary is in request + processing which may generate an event with a timestamp, and there + only at the very top of the request processing code so that the whole + request would be processed at the 'same time', just like events. + + cc: Chase Douglas + cc: Peter Hutterer + cc: Adam Jackson + Signed-off-by: Keith Packard + Tested-by: Michel Dänzer + Acked-by: Peter Hutterer + +commit ce6546337487c052b5dd3c04d3d8d4b09d691c3d +Author: Keith Packard +Date: Tue May 31 09:38:17 2016 -0700 + + os: Initialize NotifyFds earlier in startup + + If the server calls AbortServer during the first-time initialization + (which can happen if you start the server on an already using + DISPLAY), then the dbus code will shut down and call the notify fd + interface. If the notify fd list hasn't been initialized, the server + will crash. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f0756793e4c30278164d7a5cc483ce6a311c58dc +Author: Keith Packard +Date: Tue May 31 09:14:17 2016 -0700 + + os: Lock input while messing with input device list + + The list of input devices may be changed by hotplugging while the + server is active, and those changes may come from either the main + thread or the input thread. That means the list of input devices needs + to be protected by a mutex. + + This prevents input drivers from receiving I/O ready callbacks after + removing a device. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit a779fda224bee0c4d27636503367e55ae93b33c2 +Author: Jonas Ådahl +Date: Tue May 24 18:46:42 2016 +0800 + + xwayland: Use the CLOCK_MONOTONIC clock + + By default the X server will try CLOCK_MONOTONIC_COARSE before + CLOCK_MONOTONIC, while A Wayland compositor may only support getting + their timestamps from the CLOCK_MONOTONIC clock. This causes various + issues since it may happen that a timestamp from CLOCK_MONOTONIC + retrieved before a sending an X request will still be "later" than the + timestamp the X server than gets after receiving the request, due to the + fact that CLOCK_MONOTONIC_COARSE has a lower resolution. + + To avoid these issues, make Xwayland always use CLOCK_MONOTONIC, so + that it becomes possible for Wayland compositor only supporting + CLOCK_MONOTONIC and X server to use the same clock. + + Signed-off-by: Jonas Ådahl + Acked-by: Daniel Stone + Tested-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit 43dbc556f3a4d743b9121d6cfc21961be4a9da56 +Author: Michel Dänzer +Date: Thu Dec 24 16:43:44 2015 +0900 + + xfree86/modes: Remove xf86_reload_cursors v2 + + No longer needed now that xf86CursorResetCursor is getting called for + each CRTC configuration change. + + v2: Keep xf86_reload_cursors as a deprecated empty inline function + until all drivers stop calling it. (Adam Jackson) + + Reviewed-by: Adam Jackson + +commit e156c0ccb530897d3a428255bd5585f7ea7b9b41 +Author: Michel Dänzer +Date: Wed Mar 30 18:23:04 2016 +0900 + + os: Use strtok instead of xstrtokenize in ComputeLocalClient + + Fixes leaking the memory pointed to by the members of the array returned + by xstrtokenize. + + Reviewed-by: Adam Jackson + +commit 5ff75da317539e87cca429185d710d0eeb9d9222 +Author: Michel Dänzer +Date: Thu May 26 19:01:59 2016 +0900 + + glamor: Cannot use copies when accessing outside of composite source + + Commit b64108fa ("glamor: Check for composite operations which are + equivalent to copies") failed to copy conditions from exaComposite which + ensure that the composite operation doesn't access outside of the source + picture. + + This fixes rendercheck regressions from the commit above. + + Reviewed-by: Keith Packard + +commit 84e0d5d63c393fc36e91433cd7897e776e82528c +Author: Michel Dänzer +Date: Fri May 27 16:58:19 2016 +0900 + + xfree86/modes: Assign xf86_config->cursor in xf86_load_cursor_image v2 + + Fixes a crash on startup in the radeon driver's drmmode_show_cursor() + due to xf86_config->cursor == NULL, because no CRTC was enabled yet, so + xf86_crtc_load_cursor_image was never called. + + (Also use scrn->pScreen instead of xf86ScrnToScreen(scrn)) + + v2: Set xf86_config->cursor at the beginning of xf86_load_cursor_image + instead of at the end. + + Reviewed-by: Keith Packard + +commit 28b2c880a9dbfd91e82397a0f22482d258a8b670 +Author: Keith Packard +Date: Sun May 29 19:11:50 2016 -0700 + + xfree86: Provide xf86BlockSIGIO and xf86ReleaseSIGIO as wrappers for input mutex + + Threaded input doesn't use SIGIO anymore, but existing drivers using + xf86BlockSIGIO and xf86ReleaseSIGIO probably want to lock the input + mutex during those operations. Provide inline functions to do this + which are marked as 'deprecated' so that drivers will get warnings + until they are changed. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 2bed654be7001407ae65f7128440340fd3c1f083 +Author: Keith Packard +Date: Sun May 29 19:05:13 2016 -0700 + + dix: Remove bogus input_mutex and input_mutex_count definitions from globals.c + + These are local to inputthread.c; the ones in globals.c aren't + declared in any header file. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 06bdc3bc1aeca2635d0f711ac7eef34796e28339 +Author: Keith Packard +Date: Sun May 29 01:14:59 2016 -0700 + + os: fix input_mutex_count off-by-one in input_force_unlock + + input_force_unlock was mis-using input_mutex_lock and leaving it set + to -1. As this is executed from OsInit at each server generation, on + the second time through, the mutex would be left locked (!) due to the + trylock call. This caused input to fail after the first server reset. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit de3620065945f199a203afb831cac99bb8bff75b +Author: Keith Packard +Date: Fri May 27 17:51:01 2016 -0700 + + xfree86: Remove event reading code from xf86Wakeup + + Oops. This didn't get removed when xfree86 was converted over to use + the input thread. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit c9703007ea77a8aa5aba4e7bc7367814526056fe +Author: Keith Packard +Date: Sat May 28 10:34:07 2016 -0700 + + Add ax_pthread.m4 to m4/ + + Threaded input requires AX_PTHREAD, which is provided by this file. + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit c07b796b47ae7f5a616d5e8e02ab0f84dc438a93 +Author: Keith Packard +Date: Sun May 29 18:38:18 2016 -0700 + + xfree86: Bump ABI versions + + threaded input can affect drivers that use OsBlockSIGIO when dealing + with cursors. + + Signed-off-by: Keith Packard + Requested-by: Peter Hutterer + +commit 24e4c6db25aef7a057f3f384f1e2ce67e66fa40e +Author: Keith Packard +Date: Sun May 29 18:43:00 2016 -0700 + + test: Actually verify that two equivalent touch points are the same + + I typo'd when fixing this at Peter's request and left off the '2' from + the second variable name. + + Signed-off-by: Keith Packard + +commit 1338bfa81c6eddc66f07c15225c3feff062182ce +Author: Keith Packard +Date: Fri May 27 01:56:39 2016 -0700 + + test: Make touch test reflect new ability to realloc touch array [v2] + + Threaded input allows the input code to call malloc while processing + events. In this case, that's in the middle of processing touch events + and needing to resize the touch buffer. + + This test was expecting the old behaviour where touch points would get + dropped if the buffer was full. The fix is to check for the new + behaviour instead. + + [v2] + + * make sure two finding two equivalent touches return the same touch + object + + * check to make sure the queue resizes by the expected amount + + Changes provided by Peter Hutterer + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 8b9b4387e8473810f6174519ee76818fcaae725d +Author: Keith Packard +Date: Fri May 27 10:55:02 2016 -0700 + + glamor: Adjust for drawable x/y in composite's copy optimization + + Patch b64108fa305e956e4edaae9d53071ff0abee268e added a short cut that + identifies composite operations that can be performed with a simple + copy instead. + + glamor_copy works in absolute coordinates, so the dx and dy values + passed in need to be converted from drawable-relative to absolute by + adding the drawable x/y values. + + Signed-off-by: Keith Packard + Reviewed-by: Alex Deucher + +commit 0d16a0c3b95d4ac446a07d8b95e634de5cb8055f +Author: Keith Packard +Date: Thu May 26 10:22:17 2016 -0700 + + os: Increase default client buffer to 16kB + + This matches a change made in xcb and improves performance for a small + increase in memory usage. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 714736124f2bfba9ede076eff3bf017f986ce6c4 +Author: Keith Packard +Date: Fri May 27 02:02:48 2016 -0700 + + modesetting: Use new xf86CurrentCursor API + + Use this instead of the (now deprecated) cursor pointer in the + xf86CrtcConfigRec. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit e69061e605c66084056cf2064dcc5d4c6c8aa0cf +Author: Keith Packard +Date: Tue Dec 8 14:26:50 2015 -0800 + + kdrive: Use threaded input + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit a977c9c4d07a04c0c7b3713a21eefb92a8d3005b +Author: Keith Packard +Date: Tue Dec 8 14:53:08 2015 -0800 + + xfree86: Use threaded input mechanism [v2] + + Switch the XFree86 DDX over to threaded input + + v2: Rewrite comment in xf86Helper about silken mouse + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f84703b50cc908a127f4ad923ebbf56f8f244c0d +Author: Keith Packard +Date: Tue Dec 8 14:20:21 2015 -0800 + + dix: Reallocate touchpoint buffer at input event time [v2] + + Now that input is threaded, malloc can be used at event time to resize + the touchpoint buffer as needed.x + + v2: Remove "Need to grow the queue means dropping events." + from comment as it no longer applies. (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit e2df803fcabd7c2d2fc7991c794856378dcb5489 +Author: Keith Packard +Date: Tue Dec 8 19:53:36 2015 -0800 + + mi: Grow event queue while reading events + + Now that events are read at normal process time, we can use malloc to + grow the event queue instead of discarding events. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 30ac7567980a1eb79d084a63e0e74e1d9a3af673 +Author: Keith Packard +Date: Tue Dec 8 11:37:51 2015 -0800 + + Create a threaded mechanism for input [v7] + + The current SIGIO signal handler method, used at generation of input events, + has a bunch of oddities. This patch introduces an alternative way using a + thread, which is used to select() all input device file descriptors. + + A mutex was used to control the access to input structures by the main and input + threads. Two pipes to emit alert events (such hotplug ones) and guarantee the + proper communication between them was also used. + + Co-authored-by: Fernando Carrijo + Signed-off-by: Tiago Vignatti + + v2: Fix non-Xorg link. Enable where supported by default. + + This also splits out the actual enabling of input threads to + DDX-specific patches which follow + + v3: Make the input lock recursive + + v4: Use regular RECURSIVE_MUTEXes instead of rolling our own + Respect the --disable-input-thread configuration option by + providing stubs that expose the same API/ABI. + + Respond to style comments from Peter Hutterer. + + v5: use __func__ in inputthread debug and error mesages. + + Respond to style comments from Peter Hutterer. + + v6: use AX_PTHREAD instead of inlining pthread tests. + + Suggested by Emil Velikov + + v7: Use pthread_sigmask instead of sigprocmask when using threads + + Suggested by Adam Jackson + + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 728c9570a05f03bd90343ff6f5b1a8fd3988864c +Author: Keith Packard +Date: Wed Dec 9 14:27:05 2015 -0800 + + xkb: Hold input lock across injected key event processing + + This makes the code more consistent with other versions of + out-of-queue event processing + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 05d549d60440126105d5a70272e72ea2319724bd +Author: Keith Packard +Date: Thu Dec 17 22:21:46 2015 -0800 + + xfree86: Remove unnecessary errno save/restore in xf86ReadInput + + When this code was called from SIGIO, saving and restoring errno could + possibly have made sense in some strange environment. Now that this + will not be called from a signal handler, there is no reason to do that. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 0bbb5aabf794720fa99ae5ea3f55138ded159705 +Author: Keith Packard +Date: Mon May 16 21:33:41 2016 -0500 + + kdrive: Don't lock input across read in KdNotifyFd + + We won't need these locks with the new threaded input code as it holds + the input lock across all of the input device I/O operations. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 +Author: Keith Packard +Date: Tue Dec 8 14:39:46 2015 -0800 + + Remove SIGIO support for input [v5] + + This removes all of the SIGIO handling support used for input + throughout the X server, preparing the way for using threads for input + handling instead. + + Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls + to stub functions input_lock/input_unlock so that we don't lose this + information. + + xfree86 SIGIO support is reworked to use internal versions of + OsBlockSIGIO and OsReleaseSIGIO. + + v2: Don't change locking order (Peter Hutterer) + v3: Comment weird && FALSE in xf86Helper.c + Leave errno save/restore in xf86ReadInput + Squash with stub adding patch (Peter Hutterer) + v4: Leave UseSIGIO config parameter so that + existing config files don't break (Peter Hutterer) + v5: Split a couple of independent patch bits out + of kinput.c (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 8cf832c288dec13cbf3c25478a8ccef52d61f3db +Author: Keith Packard +Date: Mon May 16 21:28:48 2016 -0500 + + kdrive: Remove unneeded AddEnabledDevice/RemoveEnabledDevice calls + + kdrive uses the NotifyFd interface, which handles all of the necessary + fd configuration in the OS layer. Having it also use the old + EnableDevice interfaces is incorrect. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 4fca18dc03669bada75175df289fbee41275208e +Author: Adam Jackson +Date: Mon May 9 13:28:08 2016 -0400 + + xfree86: Add IndirectGLX server flag (v2) + + Not all display managers make it easy (or possible) to modify the + command line flags passed to the server, so add a way to get to it from + xorg.conf. + + v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan + Coopersmith) + + Reviewed-by: Alan Coopersmith + Signed-off-by: Adam Jackson + +commit 181a4bd0cc436f89582408196038ff37032f9bac +Author: Keith Packard +Date: Fri May 13 16:19:38 2016 -0700 + + glamor: Preserve GL_RED bits in R channel when destination is GL_RED [v2] + + A1 and A8 pixmaps are usually stored in the Red channel to conform + with more recent GL versions. When using these pixmaps as mask values, + that works great. When using these pixmaps as source values, then the + value we want depends on what the destination looks like. + + For RGBA or RGB destinations, then we want to use the Red channel + for A values and leave RGB all set to zero. + + For A destinations, then we want to leave the R values in the Red + channel so that they end up in the Red channel of the output. + + This patch adds a helper function, glamor_bind_texture, which performs + the glBindTexture call along with setting the swizzle parameter + correctly for the Red channel. The swizzle parameter for the Alpha + channel doesn't depend on the destination as it's safe to leave it + always swizzled from the Red channel. + + This fixes incorrect rendering in firefox for this page: + + https://gfycat.com/HoarseCheapAmericankestrel + + while not breaking rendering for this page: + + https://feedly.com + + v2: Add change accidentally left in patch for missing + glDisable(GL_COLOR_LOGIC_OP). + Found by Emil Velikov + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63397 + Signed-off-by: Keith Packard + Tested-by: Michel Dänzer + +commit b07bc700b3cf2f5c8912fc5b9e0dad2baf395525 +Author: Keith Packard +Date: Sat May 14 08:22:17 2016 -0700 + + glamor: glamor_make_current sooner in glamor_composite_with_shader + + glamor_make_current is supposed to be called before any GL APIs. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit 743b6f231e999d8b2909228412266dc13cc433c5 +Author: Keith Packard +Date: Fri May 13 04:25:43 2016 -0700 + + glamor: Disable logic ops when doing compositing [v4] + + If the logic op gets left enabled, it overrides the blending + operation, causing incorrect contents on the display. + + v2: Disable only on non-ES2, but disable even for PictOpSrc + + v3: Found another place this is needed in + glamor_composite_set_shader_blend + + v4: Remove change dependent on new glamor_set_composite_texture + API. This belongs in a different patch. + Found by Emil Velikov + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit f5670b4a7eb3b43fa20017f89192394930eae6f4 +Author: Keith Packard +Date: Wed Mar 9 11:13:14 2016 -0800 + + xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursor + + This makes the cursor pointer held by xf86Cursors.c get reset to NULL + whenever the cursor isn't displayed, and means that the reference + count held in xf86Cursor.c is sufficient to cover the reference in + xf86Cursors.c. + + As HideCursor may be called in the cursor loading path after + UseHWCursor or UseHWCursorARGB when HARDWARE_CURSOR_UPDATE_UNHIDDEN + isn't set in the Flags field, the setting of the cursor pointer had to + be moved to the LoadCursor paths. + + LoadCursorARGBCheck gets the cursor pointer, but LoadCursorImageCheck + does not. For LoadCursorImageCheck, I added a new function, + xf86CurrentCursor, which returns the current cursor. With this new + function, we can eliminate the cursor pointer from the + xf86CrtcConfigRec, once drivers are converted over to use it. + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit b64108fa305e956e4edaae9d53071ff0abee268e +Author: Michel Dänzer +Date: Wed May 25 19:09:23 2016 +0900 + + glamor: Check for composite operations which are equivalent to copies + + Increases x11perf -compwinwin500 numbers by a factor of 10 for me with + radeonsi. + + Conditions copied from exaComposite(). + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 4711ebc174206b5a50e6ae8a7f974cd835e4ebd3 +Author: Michel Dänzer +Date: Tue May 24 18:12:42 2016 +0900 + + glamor: Fix sampling outside of RGBx source/mask pictures + + RENDER requires that sampling outside of any source/mask picture results + in alpha == 0.0. + + The OpenGL border colour cannot set alpha = 0.0 if the texture format + doesn't have an alpha channel, so we have to use the RepeatFix handling + in that case. + + Also, only force alpha = 1.0 when sampling inside of RGBx source/mask + pictures. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94514 + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 4d649d51770cace4d7c1e51d9a199ac7a056c30a +Author: Keith Packard +Date: Wed May 18 16:03:48 2016 -0500 + + mi: Remove miPointerRec from API + + This moves the definition of miPointerRec from mipointrst.h to + mipointer.c so that it is no longer visible in the API, allowing it to + be changed while the API/ABI is frozen. + + Reviewed-by: Pekka Paalanen + Signed-off-by: Keith Packard + +commit 3f9015b6dc9e7e9c97f8717dea6af9f4d8523f2e +Author: Keith Packard +Date: Wed May 18 16:03:47 2016 -0500 + + xwayland: Move sprite invalidation logic into mipointer + + This creates a function that invalidates the current sprite and forces + a sprite image reload the next time the sprite is checked, moving that + logic out of the xwayland sources and allowing the miPointerRec + structure to be removed from the server API. + + Signed-off-by: Keith Packard + Reviewed-by: Pekka Paalanen + +commit 4e124203f2260daaf54155f4a05fe469733e0b97 +Author: Adam Jackson +Date: Tue May 3 11:24:58 2016 -0400 + + damage: Make damageRegionProcessPending take a damage not a drawable + + In the case where there's no damage monitor on the drawable, we look + that fact up twice: once before rendering to decide whether to compute + damage, and again after to decide whether to append it. This is wasted + effort, as the layer below us is effectively not allowed to change + whether there's a damage monitor for the drawable, but there's no way + the compiler can know that. + + Instead, look it up once up front, and change the check macros and + damageRegionProcessPending to take a damage not a drawable. + + v2: Explicitly pass pDamage to the macros as well (Michel Dänzer) + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 1bb932bf1417ff319a594d7e40f6813a26936784 +Author: Jeremy Huddleston Sequoia +Date: Sat May 7 00:43:33 2016 -0700 + + XQuartz: Fix default CFBundleVersion + + m4/shell variable name collision broke the case when the configure + option was not used + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2fbf5c2f91d33efbda573c4be036248b1d8ed7f1 +Author: Andrew Comminos +Date: Tue Dec 29 23:41:27 2015 -0800 + + Input: Send XI2 FocusOut NotifyPointer events to the pointer window. + + This changes XInput 2's propagation of NotifyPointer focus out events to + include the pointer window as well, similar to core events. This fixes + a potential permanent focus in GDK when the focus moves to PointerRoot. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93539 + + Signed-off-by: Andrew Comminos + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 984be789d5935bc7f695dc61234ef0251ed33679 +Author: Olivier Fourdan +Date: Wed May 11 09:15:19 2016 +0200 + + xwayland: don't check events as early as InitInput + + If data is received during XWayland startup, it will be read early in + InitInput() before the connection data is initialized, causing a crash. + + Remove the wayland rountrips from InitInput() as this is done again in + xwl_screen_init() where it seems more appropriate. + + Signed-off-by: Olivier Fourdan + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + Reviewed-by: Adam Jackson + +commit 3f569435e10df515c6f86289dc986bfc59c6bc18 +Author: Adam Jackson +Date: Thu Mar 31 16:56:44 2016 -0400 + + glx: Stop tracking hasUnflushedCommands + + This is only meaningful for indirect contexts, and all it does is + (maybe) prevent a flush when switching away from an indirect context. + Indirect contexts aren't worth optimizing for, and Mesa tracks whether + a flush is needed anyway. + + Careful readers will note that ReadPixels would reset the flag even + though it doesn't imply a flush! + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 0ebb58f6b6f66afbc3a48bd10693fe190aed8694 +Author: Adam Jackson +Date: Thu Mar 31 16:20:40 2016 -0400 + + glx: Remove some redundant zero-init of GLX context state + + The context is already calloc'd. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d5ba09598210063926aeff55ac58d2b7020d9a03 +Author: Adam Jackson +Date: Thu Mar 31 15:51:39 2016 -0400 + + glx/dri2: Implement dri2FlushFrontBuffer explicitly + + No functional change. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 0ba4e251a1012bd5a2eab83e2c51006ec3805394 +Author: Adam Jackson +Date: Thu Mar 31 15:50:34 2016 -0400 + + glx: Code motion + + No functional change, just rearranging some code to make later commits + more obvious. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit f523ebb5492a2e12b76a8b5b7f1b0e5efd4a8040 +Author: Adam Jackson +Date: Mon Apr 18 12:56:17 2016 -0400 + + dix: Remove pointless client-state callbacks + + Private storage is pre-zeroed by the private system itself. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 140c2f1a54dbc2503311e9a011e841aa1f277cbd +Author: Michel Dänzer +Date: Fri Apr 1 18:24:00 2016 +0900 + + EXA: Honour op parameter to exaGlyphs even if maskFormat == NULL + + Reported-by: Uli Schlachter + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94775 + Signed-off-by: Michel Dänzer + Reviewed-by: Uli Schlachter + +commit 7f0494671f95cfa33f6f2c7c74b20a21f239f8c5 +Author: Dave Airlie +Date: Fri May 6 05:41:58 2016 +1000 + + modesetting: fix build with glamor disabled. + + Fix build without --enable-glamor. + + Caught by the arm tinderbox. + + Signed-off-by: Dave Airlie + Reviewed-by: Mark Kettenis + Tested-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 66fdeb880aac0966be9aa41219047ade0148c35f +Author: Emil Velikov +Date: Mon May 2 23:47:22 2016 +0100 + + xfree86: drop unneeded strdup for modulepath/logfile + + The destination variable is never freed, thus we even plug some memory + leaks. + + v2: Rebase against updated xf86CheckPrivs() helper. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 032b1d79b7d04d47814a5b3a9fdd162249fea74c +Author: Emil Velikov +Date: Mon May 2 23:47:21 2016 +0100 + + xfree86: use the xf86CheckPrivs() helper for modulepath/logfile + + v2: Rebase against updated xf86CheckPrivs() helper. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 0fdd47560468e7b6147c666cc6b9eebcecb68572 +Author: Emil Velikov +Date: Mon May 2 23:47:20 2016 +0100 + + xfree86: factor out the check priviliges and print a big warning + + Current message was quite off "file specified must be a relative path" + and alike. Just factor it out and use "path/file" as needed. + + v2: Rework error message, drop "Using default", print actual arg value. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 2378adde6770385c06f7efcd32f270d00d49ce3f +Author: Dave Airlie +Date: Fri Apr 29 14:01:33 2016 +1000 + + modesetting: set capabilities up after glamor and enable offload caps. + + This moves the capabilites setting to after glamor is initialised, and + enables the offload caps in cases where they work. This enables DRI2 + PRIME support with modesetting. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit 258588224d6b35de12f97d9092efa5cb3e426550 +Author: Dave Airlie +Date: Fri Apr 29 14:01:32 2016 +1000 + + xf86Crtc: don't set the root window property on slave GPUs. + + Slave GPUs don't have a root window to set this on, so don't. + + This fixes some crashes I saw just playing around. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit a41a171bcbae9aeafac2865faa904f15d9b59925 +Author: Dave Airlie +Date: Fri Apr 29 14:01:31 2016 +1000 + + modesetting: set driverPrivate to NULL after closing fd. + + Otherwise ms_ent_priv will return NULL and things will fall apart. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit fc1f61b75c9712e24ff665f95d62771f39eba1c7 +Author: Dave Airlie +Date: Fri Apr 29 14:01:30 2016 +1000 + + randr/provider: only allow slave gpu to be offload sources. + + The other way around makes no sense. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit 2d0f151c6195ba94d0320b55227a108e6301a74c +Author: Alex Goins +Date: Fri Apr 29 14:01:29 2016 +1000 + + modesetting: Consistent whitespace in driver.c + + For some reason a couple of the dirty functions in driver.c used 8 + spaces per tab instead of 4 like the rest of the file. Fix this to make + it more consistent and give me more room to work in ms_dirty_update in + subsequent commits. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + + Signed-off-by: Alex Goins + Reviewed-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit 137ac094e7ab8c871f3b36e40ad826ac797f0e26 +Author: Adam Jackson +Date: Fri Apr 1 22:44:26 2016 -0400 + + dix: Push UpdateCurrentTimeIf down out of the main loop + + This was added in: + + commit 312910b4e34215aaa50fc0c6092684d5878dc32f + Author: Chase Douglas + Date: Wed Apr 18 11:15:40 2012 -0700 + + Update currentTime in dispatch loop + + Unfortunately this is equivalent to calling GetTimeInMillis() once per + request. In the absolute best case (as on Linux) you're only hitting the + vDSO; on other platforms that's a syscall. Either way it puts a pretty + hard ceiling on request throughput. + + Instead, push the call down to the requests that need it; basically, + grab processing and event generation. + + Cc: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit ac164e58870d70640381e68b776eb95578c7fbd3 +Author: Peter Hutterer +Date: Wed May 4 20:36:18 2016 +1000 + + xkb: after changing the keymap, force an indicator update + + When NumLock is on and a new keymap is applied, the next modifier state + change will turn off that LED (but leave the state enabled). The cause + for this is a bit convoluted: + + * the SLI explicitState is copied from the current state in + ProcXkbGetKbdByName. Thus, if NumLock is on, that state is 0x2. + * on the next modifier key press (e.g. Shift), XkbApplyState() calls into + XkbUpdateIndicators() -> XkbUpdateLedAutoState() to update SLIs (if any) + for the currently changed modifier. But it does so with a mask only for + the changed modifier (i.e. for Shift). + * XkbUpdateLedAutoState() calculates the state based on this mask and + ends up with 0 because we don't have a Shift LED and we masked out the + others. + * XkbUpdateLedAutoState() compares that state with the previous state + (which is still 0x2) and then proceeds to turn the LED off + + This doesn't happen in the normal case because either the mask + encompasses all modifiers or the state matches of the masked-out + modifiers matches the old state. + + Avoid this issue by forcing an SLI update after changing the keymap. + This updates the sli->effectiveState and thus restores everything to + happy working order. + + https://bugzilla.redhat.com/show_bug.cgi?id=1047151 + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + +commit 059d5ef30490233f410ca87084c7697b87e5b05e +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:43:06 2016 -0700 + + XQuartz: Update copyright years + + Signed-off-by: Jeremy Huddleston Sequoia + +commit d6ba4f2c52da150a9a92bdb00efe7902d17033bd +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:42:34 2016 -0700 + + XQuartz: Add --with-bundle-version and --with-bundle-version-string configure options + + Signed-off-by: Jeremy Huddleston Sequoia + +commit c1614928c10a8f8400f99acfd1b7f96d503af7ec +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:21:38 2016 -0700 + + XQuartz: Add --with-sparkle-feed-url configure option + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 299b01eabf827a7435b5d6004d50637ac710bbc7 +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:14:24 2016 -0700 + + XQuartz: Update release feed URL to use new https URL + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 16d6733c63727d910eb516d7f6950f4675281f2d +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:24:44 2016 -0700 + + XQuartz: Fix the help text for --with-bundle-id-prefix + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 214a66b661dcb56ebb9776e34049753f65c7510a +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:16:46 2016 -0700 + + XQuartz: Remove --with-launchd-id-prefix + + It's been deprecated for years. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2285fe78c04714561a0d1a164a41a38c48263f89 +Author: Peter Hutterer +Date: Fri Apr 22 15:04:37 2016 +1000 + + xfree86: add support for MatchIsTabletPad + + The tablet pads have been separate kernel devices for a while now and + libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year + now. Add a new MatchIsTabletPad directive to apply configuration options + specifically to the Pad part of a tablet. + + Signed-off-by: Peter Hutterer + Reviewed-by: Adam Jackson + +commit fa02b05645080c285da5972262a8d37403e39d7e +Author: Dave Airlie +Date: Tue May 3 06:54:57 2016 +1000 + + modesetting: port clean start code from amdgpu. (v2) + + Both radeon and amdgpu don't set the mode until the first blockhandler, + this means everything should be rendered on the screen correctly by + then. + + This ports this code, it also removes the tail call of EnterVT from + ScreenInit, it really isn't necessary and causes us to set a dirty mode + with -modesetting always anyways. + + v2: reorder set desired modes vs block handler as done for amdgpu. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit caabc4e85540dcd4225f2780b5616f7d870fbb06 +Author: Dave Airlie +Date: Tue May 3 06:54:56 2016 +1000 + + modesetting: add support for background none. + + This adds support using glamor for background None. + + loosely based off the amdgpu code. relies on the glamor_finish code. + + Acked-by: Eric Anholt + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit c33250945b45adc447154239f0cf48fb9b2d7335 +Author: Adam Jackson +Date: Fri Apr 8 11:26:36 2016 -0400 + + kdrive: Nuke a bunch of dead code + + gcc6 says: + + keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used + + Only referenced by a bunch of long if-0'd code, so chuck it all out. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit a5dd7b890f4f3a5245639591c73303c5a087b38a +Author: Adam Jackson +Date: Fri Apr 8 11:24:50 2016 -0400 + + dix: Squash some new gcc6 warnings + + -Wlogical-op now tells us: + + devices.c:1685:23: warning: logical ‘and’ of equal expressions + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 23dfa017298ceceac818f83779858e490c7757b6 +Author: Andreas Schwab +Date: Thu Apr 28 14:47:33 2016 +0200 + + x86emu: Change include order to avoid conflict with system header + + R_SP is also defined in on m68k. Also remove duplicate + definitions. + + Reviewed-by: Adam Jackson + Signed-off-by: Andreas Schwab + +commit aa4e757130010dd3202f10ec6cb0c306c1dbcfbc +Author: Dave Airlie +Date: Fri Mar 11 09:22:00 2016 +1000 + + glamor: add glamor_finish API + + Some drivers are calling glFinish, they really should be doing this. + + This also is needed for some reverse prime scenarios. + + Signed-off-by: Dave Airlie + Reviewed-by: Michel Dänzer + Reviewed-by: Eric Anholt + +commit f48b0534f110397246809d279225afedb28aa233 +Author: Marek Chalupa +Date: Mon Apr 25 11:33:00 2016 +0200 + + xwayland-shm: fortify fallocate against EINTR + + If posix_fallocate or ftruncate is interrupted by signal while working, + we return -1 as fd and the allocation process returns BadAlloc error. + That causes xwayland clients to abort with 'BadAlloc (insufficient + resources for operation)' even when there's a lot of resources + available. + + Fix it by trying again when we get EINTR. + + Signed-off-by: Marek Chalupa + Reviewed-by: Pekka Paalanen + +commit 4cc32880737c2d3e568fdb4867b2dba10fb3998a +Author: Alexandre Courbot +Date: Wed Mar 23 13:47:37 2016 +0900 + + configure.ac: Keep environment CFLAGS when testing + + DRI2 detection could fail if configure is invoked with a sysroot passed + as CFLAGS. Ideally configure should invoke gcc with the sysroot argument + passed to the configure script, but for some reason this is not done by + AC_COMPILE_IFELSE. + + Fix this by ensuring CFLAGS are preserved when checking for stuff. + + Signed-off-by: Alexandre Courbot + Reviewed-by: Emil Velikov + +commit 16e4bce9e5257c50c80c66efee0d07c2483619e1 +Author: Simon Thum +Date: Fri Apr 8 13:24:39 2016 +0200 + + dix/ptraccel: Remove float literals + + This was fine back when valuators were integer. Device + properties are float (not double), so some instances remain. + + Signed-off-by: Simon Thum + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c8e5fc30575a309c25970fc68b9184c07bb74df4 +Author: Simon Thum +Date: Tue Apr 5 14:29:47 2016 +0200 + + dix/ptraccel: Fix memory leak in InitPredictableAccelerationScheme + + This was quite unlikely except in situations where a proper startup + would have been impossible anyway, but since automated checks don't + grade likelyhood just fix it. + + Detected by Jeremy Huddleston's clang checks. + + Signed-off-by: Simon Thum + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f641ae412287ecb7a3437987e2ba1646a8443aa4 +Author: Peter Hutterer +Date: Wed Mar 9 10:45:48 2016 +1000 + + Xi: don't deliver emulated motion events for non-emulating touches + + The touchpoint knows whether it should be emulating or not and we have a check + for that later. Check for this before we generate the event and try to deliver + it, lest we trigger a bug warning. + + https://bugzilla.redhat.com/show_bug.cgi?id=1282252 + + Signed-off-by: Peter Hutterer + +commit 577bebe2067293bb154068e99a2ef085b066cb67 +Author: Emil Velikov +Date: Sun Apr 17 20:30:46 2016 +0100 + + xfree86/parser: simplify #ifdef ladder + + Rather than 'hacking' around symbol names and providing macros such as + 'Local' just fold things and make the code more readable. + + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit 537276a5b86b7341169ea4eb36d479a503ba5d84 +Author: Emil Velikov +Date: Sun Apr 17 20:30:45 2016 +0100 + + xfree86/parser: reuse StringToToken() in xf86getToken() + + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov + +commit 944ea03d5be2ffe22a3f1c4c287760261c31235f +Author: Emil Velikov +Date: Sun Apr 17 20:30:44 2016 +0100 + + xfree86/parser: move StringToToken() definition further up + + ... so that we can use it without the forward declaration. Plus we're + doing to reuse it in the next commit ;-) + + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov + +commit b93be14b7d339e4e46d941729dad853452fae8c0 +Author: Emil Velikov +Date: Sun Apr 17 20:30:43 2016 +0100 + + xfree86/parser: annotate xf86ConfigSymTabRec as constant data + + Add the const notation to all the static storage as well as the + functions that use it - xf86getToken(), xf86getSubTokenWithTab(), + StringToToken() and xf86getStringToken(). + + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov + +commit 3981dcdd489b60fbf356534a509ca93dcbedf769 +Author: Emil Velikov +Date: Sun Apr 17 20:34:43 2016 +0100 + + dri3: remove unused file dri3int.h + + Copied during the prototyping stage and never used. + + Cc: Keith Packard + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit a1b13cda6169a98d694451fec75e63352e9d90bd +Author: Adam Jackson +Date: Wed Jan 6 09:09:21 2016 -0500 + + xfree86: Remove xf86RegisterRootWindowProperty + + All consumers have been ported to the root window callback, so this can + all be nuked. + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit e89c7f1c2a0ea3480b21446e413073c1427285ae +Author: Adam Jackson +Date: Wed Jan 6 09:04:15 2016 -0500 + + xfree86: Create EDID atom from the root window callback (v2) + + v2: Fix swapped callback args + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 8e3010d7d8e8c49c8859b576de1808ae7b2859be +Author: Adam Jackson +Date: Wed Jan 6 08:54:47 2016 -0500 + + xfree86: Remove a never-hit diagnostic message + + Practically speaking, the EDID major version is never not 1. + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 7961377567f15dfad9d96c5c0a0992b38013d973 +Author: Adam Jackson +Date: Wed Jan 6 08:47:37 2016 -0500 + + xfree86: Make xf86SetDDCproperties work more than once (v2) + + We can call this more than once via xf86OutputSetEDID since hotplug is + actually a thing in RANDR 1.2, but xf86RegisterRootWindowProperty merely + adds the data to a list to be applied to the root at CreateWindow time, + so calls past the first (for a given screen) would have no effect until + server regen. + + Once we've initialised pScrn->pScreen is filled in, so we can just set + the property directly. + + v2: Removed pointless version check, deobfuscate math (Walter Harms) + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 8be83fff04a009109a956837ca983a96fd279711 +Author: Adam Jackson +Date: Wed Jan 6 08:35:43 2016 -0500 + + xfree86: Remove some leftovers from DisplayID support + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 0cd2a24b61ef1583fc6b3fec7d01c7481cc97d52 +Author: Adam Jackson +Date: Wed Jan 6 08:30:07 2016 -0500 + + xfree86: Unexport xf86Initialising, remove xf86ServerIsInitialising + + Neither of these are used from outside the server. + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit e70ee11a39b957141fbc565d79d128a46fac5f34 +Author: Adam Jackson +Date: Tue Jan 5 16:27:41 2016 -0500 + + xfree86: Create VT atoms from the root window callback (v2) + + v2: Fix swapped callback args + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit da9ee1eddd65d00788cef8a3becfad948c0a2168 +Author: Adam Jackson +Date: Tue Jan 5 16:11:42 2016 -0500 + + xfree86: Create seat atom from the root window callback (v2) + + v2: Fix swapped callback args + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 2c3a3afb5104714b637c1c4aea195df73e0fa918 +Author: Adam Jackson +Date: Tue Jan 5 15:56:42 2016 -0500 + + dix: Add RootWindowFinalizeCallback + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 8437955515ad59b0bfcd6598248e7f0ffc706370 +Author: Olivier Fourdan +Date: Thu Mar 17 09:53:58 2016 +0100 + + glamor: fix wrong offset on composite rectangles + + When using PictOpSrc, the destination is wrongly shifted back to (0, 0). + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94568 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit e8e5d839968e22cf42a6e1982a07b02c6f4a4562 +Author: Olivier Fourdan +Date: Fri Apr 1 13:38:11 2016 +0200 + + xwayland: Fix compiler warning in GLAMOR Xv + + XvWindowMask is defined as 0x00020000 and cannot fit in the XvAdaptor + type which is defined as an unsigned char, thus causing a compiler + warning: + + xwayland-glamor-xv.c: In function ‘xwl_glamor_xv_add_adaptors’: + xwayland-glamor-xv.c:339:16: warning: large integer implicitly + truncated to unsigned type [-Woverflow] + + This XvWindowMask value is actually not used for XvAdaptor itself but by + the server in its xf86xv implementation, so we don't even need that mask + in our xwayland-glamor-xv implementation. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit f9b5bbaa3a7fce1a4efb2084b8d9d82b98d4ee83 +Author: Peter Hutterer +Date: Tue Mar 8 15:42:42 2016 +1000 + + xkb: fix SlowKeys release/reject beeps + + Wrong use of the mask here caused a beep whenever a key was rejected but + also when it was released after being accepted. Fix the mask to check + for the correct enabled controls. + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + +commit a6288f0954cf97499e78849a87847062ee962c17 +Author: Jon Turney +Date: Tue Nov 3 19:07:43 2015 +0000 + + hw/xwin: xcbify internal window manager + + Convert the code for the multiwindow mode internal window manager to xcb + + xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type + sizing issues + + v2: Various fixes + v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type + and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND + v4: Fix indentation, add some error handling. + Fix a bug with ConfigureNotify handling + v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8114b8127f01fc81390fc13e3d09bcc50e41a66f +Author: Jon Turney +Date: Wed Jul 1 16:30:36 2015 +0100 + + hw/xwin: In multiwindow mode, do window minimization entirely in the WM + + Remove winMinimizeWindow(), implement as UpdateState() in the WM instead, + which uses getHwnd() to map a Window XID to a HWND (like everything else in + the WM), rather than peering into the servers internal data structures. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 6a64b9d7af70dc7ff2cac8b35a1f7b0797823733 +Author: Jon Turney +Date: Mon Nov 2 17:55:19 2015 +0000 + + hw/xwin: xcbify code for converting X11 icon to Win32 icon + + Convert the code for converting an X11 icon to Win32 icon from Xlib to xcb. + + v2: some warning fixes in winXIconToHICON() + v3: declaration-after-statement warning fixes + v4: printf format fixes + v5: convert in place rather than in a library + + This also avoids the xlib/xserver namespace collision issues, so + winmultiwindowicons.h can be included everywhere it should be, which fixes + compilation with -Werror=implicit-function-declaration + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 0a69c1e2fa0ea63b02fff98e68d9f56a369e882b +Author: Jon Turney +Date: Wed Mar 30 18:31:38 2016 +0100 + + xwin/glx: Build fix for warnings about missing WGL extensioons + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit b08526eecf1e165ed9ec2e6b571a5a616a9b696e +Author: Adam Jackson +Date: Wed Mar 16 11:38:13 2016 -0400 + + glx: Implement GLX_EXT_libglvnd (v2) + + For the dri2 backend, we depend on xfree86 already, so we can walk the + options for the screen looking for a vendor string from xorg.conf. For + the swrast backend we don't have that luxury, so just say mesa. This + extension isn't really meaningful on Windows or OSX yet (since libglvnd + isn't really functional there yet), so on those platforms we don't say + anything and return BadValue for the token from QueryServerString. + + v2: Use xnf* allocators when parsing options (Eric and Emil) + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 2e8781ead3067b195baec2e76a28091575679383 +Author: Adam Jackson +Date: Wed Mar 23 15:41:24 2016 -0400 + + glx: Compute the GLX extension string from __glXScreenInit + + Now that the enable bits are in the screen base class we can compute + this in one place, rather than making every backend do it. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit e21de4bf3c5ff8cbb9c5ea023d04162e5e56b3df +Author: Adam Jackson +Date: Wed Mar 23 15:36:52 2016 -0400 + + glx: Move glx_enable_bits up to the GLX screen base class + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 23cce73221c0b96e7778da34616f8c3f4d6aa819 +Author: Adam Jackson +Date: Wed Mar 23 15:13:51 2016 -0400 + + xquartz/glx: Remove unused fields from the glx screen subclass + + dmt:~/git/xserver% git grep -E '\<(index|num_vis)\>' hw/xquartz/GL + hw/xquartz/GL/indirect.c: int index; + hw/xquartz/GL/indirect.c: int num_vis; + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 36bcbf76dcc7e88cac093f8fb656c525bfeaf65d +Author: Adam Jackson +Date: Wed Mar 23 15:26:23 2016 -0400 + + glx: Enable GLX 1.4 unconditionally + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 2a72789ee8e88f612dff48ebe2ebe9fecda7a95d +Author: Adam Jackson +Date: Wed Mar 16 16:28:13 2016 -0400 + + xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hack + + This doesn't seem very useful, and we're about to implement 1.4 across + the board, so some WGL extensions will become required. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 77bdaa1313aa55191b49ec73c1e377928ca294fe +Author: Adam Jackson +Date: Tue Mar 22 14:40:37 2016 -0400 + + glx: Use __glXInitExtensionEnableBits in all backends (v2) + + On xquartz this enables SGI_make_current_read, which is a mostly + harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which + is fine because no pbuffer-enabled configs are created. + + On xwin this enables SGIX_pbuffer and ARB_multisample in all cases. + Again this is harmless if the backend doesn't support the features, + since no fbconfigs will be created to expose them. + + It also adds SGIX_visual_select_group to both xquartz and xwin. + Amusingly, both were filling in the appropriate field in the fbconfig + already. + + v2: Warn about missing WGL extensions (Emil) + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 15af78fc56569dc3b6a7f2c5a6a49edb602111b7 +Author: Adam Jackson +Date: Wed Mar 23 15:19:15 2016 -0400 + + glx: Enable GLX_SGI_make_current_read in the core + + GLX 1.3 implies equivalent functionality, so this is safe to enable + unconditionally, and bindContext always takes both drawable and readable + arguments in any case. Mesa stopped exporting the __DRI_READ_DRAWABLE + extension in 8.0 (when the DRI1 drivers were removed) so this will + restore the extension string. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 9b2fc6d98691966f1c9186edad956f78c31f3698 +Author: Adam Jackson +Date: Wed Mar 23 14:57:25 2016 -0400 + + xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2) + + This seems to be fairly universal these days, and if it doesn't exist + the only thing you break is separate drawable and readable, which is a + rare feature to use. So pretend it's always there and just throw an + error on MakeCurrent if it isn't, and don't consider it when computing + the GLX version number. + + v2: Fix type-o for glxWinScreen (Jon Turney) + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit b2ef7df476af619903ef7f6b6962b371ae14306c +Author: Adam Jackson +Date: Sat Mar 19 13:44:10 2016 -0400 + + xquartz/glx: Error out for MakeContextCurrent(draw != read) + + CGL doesn't have a way to express this directly, unlike EGL WGL and GLX. + It might be implementable, but it's never actually worked, and it's a + fairly niche feature so we're better off throwing an error if someone + attempts it. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Reviewed-by: Jeremy Huddleston Sequoia + Signed-off-by: Adam Jackson + +commit f95645c6f70019316f8ad77b7beb84530fc0505f +Author: Adam Jackson +Date: Tue Mar 22 14:37:19 2016 -0400 + + glx: Don't enable EXT_texture_from_pixmap unconditionally + + Not all backend servers implement this. Those that don't happen to not + use __glXInitExtensionEnableBits, but we'd like that to change, so fix + it up before we switch them over. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 410aec82556def5395f51299bcefbeb7d0bda604 +Author: Adam Jackson +Date: Tue Mar 22 14:29:06 2016 -0400 + + glx: Remove server-side mention of GLX_MESA_swap_control + + This extension is direct-only and has no GLX protocol. We don't even + track an enable bit for it, trying to turn it on is pointless. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 3a21da59e59cf11a9113d71e3431c4bd394ff1e8 +Author: Adam Jackson +Date: Wed Mar 16 19:05:17 2016 -0400 + + glx: Remove default server glx extension string + + This existed only to be strdup'd and then immediately freed. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 44e1c97ca6fe992bbb6ef9ecb0b82a113adfa57e +Author: Olivier Fourdan +Date: Mon Mar 21 09:53:17 2016 +0100 + + xwayland: Pretend we support viewport in vidmode + + Some games (namely openttd) will raise an XError and fail with a + BadValue if their request to XF86VidModeSetViewPort fails. + + Support only the default zoom and viewport, fail for everything else. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + +commit 6e3a6e30a6ac66942a0756a5d079993181f02e34 +Author: Olivier Fourdan +Date: Thu Mar 17 14:39:45 2016 +0100 + + xwayland: do not include frequency in mode name + + Some applications (e.g. using lwjgl) try to parse the output of the + xrandr command and get confused with the mode name returned by Xwayland, + because it contains "@[frequency]" (e.g. "1024x640@60.0Hz"). + + Remove the @[frequency] part of the mode name to match what is found in + usual mode names on regular X servers to please those applications. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94589 + + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 418fe365b45a143680d3b4143dc60f7cdc5a3507 +Author: Michel Dänzer +Date: Thu Mar 24 17:34:23 2016 +0900 + + xfree86/modes: Make sure the HW cursor is hidden when it should be + + When the HW cursor is hidden (e.g. because xf86CursorResetCursor + triggers a switch from HW cursor to SW cursor), the driver isn't + notified of this for disabled CRTCs. If the HW cursor was shown when the + CRTC was disabled, it may still be displayed when the CRTC is enabled + again. + + Prevent this by explicitly hiding the HW cursor again after setting a + mode if it's currently supposed to be hidden. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94560 + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit adefbaee499b9679c6cac21f52ec6545af2b36b5 +Author: Adam Jackson +Date: Mon Mar 28 18:11:09 2016 +0900 + + os: Treat ssh as a non-local client (v4) + + By the time we get to ComputeLocalClient, we've already done + NextAvailableClient → ReserveClientIds → DetermineClientCmd (assuming + we're built with #define CLIENTIDS), so we can look up the name of the + client process and refuse to treat ssh's X forwarding as if it were + local. + + v2: (Michel Dänzer) + * Only match "ssh" itself, not other executable names starting with + that prefix. + * Ignore executable path for the match. + v3: (Michel Dänzer) + * Use GetClientCmdName (Mark Kettenis) + * Perform check on Windows as well, but only ignore path on Cygwin + (Martin Peres, Emil Velikov, Jon Turney) + v4: (Michel Dänzer) + * Cut of any colon and whatever comes after it. (Adam Jackson) + * Add bugzilla reference. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 + + Signed-off-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 1c90797565385426ad63bd2108085c8466695c0b +Author: Sonny Jiang +Date: Mon Mar 28 16:36:50 2016 +0900 + + DRI2: add Polaris PCI IDs + + Signed-off-by: Sonny Jiang + Reviewed-by: Alex Deucher (Polaris10) + Reviewed-by: Michel Dänzer (Polaris11) + + (Ported from Mesa commit f00c840578a70e479ffb99f6b64c73dc420179fa) + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 3b385105b2d19a1c55e9779ae88d775185eea231 +Author: Michel Dänzer +Date: Thu Mar 24 17:42:47 2016 +0900 + + present: Only requeue for next MSC after flip failure + + This code was added to deal with the driver present hook failing, in + which case we need to wait for the next MSC before executing the + presentation. + + However, it could also take effect in cases where the driver incorrectly + thinks the current MSC matches the target one (e.g. due to the kernel + interface only supporting 32-bit MSC values), in which case it could + result in the presentation getting requeued over and over. + + To prevent such issues, check specifically for the target MSC + immediately following the current MSC. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94596 + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + +commit 8ac0e05cc6c6e87b223ba7cb31d8856771c5d41a +Author: Adam Jackson +Date: Wed Mar 23 14:42:08 2016 -0400 + + vfb: Re-add LD_EXPORT_SYMBOLS_FLAG to LDFLAGS + + Accidentally removed, breaks Xvfb on cygwin. + + Reviewed-by: Yaakov Selkowitz + Signed-off-by: Adam Jackson + +commit a288cf58a0dc0f965a6f964c76bb86bb1989d797 +Author: Dave Airlie +Date: Wed Mar 16 10:45:54 2016 +1000 + + glamor: swizzle RED to 0 for alpha textures + + I'm pretty sure Eric suspected this could cause a problem, and we + couldn't find a test. Well loading feedly in firefox seems to trigger + badness that this solves. + + bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94554 + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + Tested-by: Timo Aaltonen + +commit 4583fa9a6cd3095d7497c075d68e7430ea3c5cb0 +Author: Ángel González +Date: Mon Oct 15 22:04:22 2012 +0200 + + security: Fix reversed comment + + Commit 6045506be0cebca4ebbe943ae77f020aafa703d4 changed back + the behavior to only allow the trusted extensions to the untrusted clients, + but left the 8b5d21cc1d1f4e9d20e5d5eca44cb1e60a419763 + comment intended for Security*Un*trustedExtensions saying that + "untrusted clients shouldn't have access to these". + + Reviewed-by: Adam Jackson + Signed-off-by: Ángel González + +commit b78897d0a04a833720698901fbac9535570875e4 +Author: Evgeny M. Zubok +Date: Thu Apr 8 03:58:21 2010 -0700 + + xfree86: Change VBE version early-out to 1.2. (#22672) + + Reporter has an S3 Trio with DDC and VESA 1.2. + + Signed-off-by: Corbin Simpson + Reviewed-by: Matt Turner + +commit 184fbf7541012090b8716c7eaf00895efd16d0ac +Author: Adam Jackson +Date: Mon Mar 14 11:37:32 2016 -0400 + + xfree86: Finish removing font modules + + Signed-off-by: Adam Jackson + +commit 69d1528bc35073331e281448dfb04eb4240ff472 +Author: Adam Jackson +Date: Thu Apr 26 16:42:20 2012 -0400 + + xfree86: Font modules aren't a real thing + + There are no longer any loadable font modules (not that they ever did + much in the first place), so stop pretending they're a defined ABI + surface. + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + +commit 4f8151c7a4bcf2d55848e70c83b2f9ce458cf316 +Author: Adam Jackson +Date: Mon Mar 14 11:20:39 2016 -0400 + + Fix the typo from the previous patch, d'oh + + Signed-off-by: Adam Jackson + +commit 75eecf28ae3709181a51571132b0accd9cae316e +Author: Chris Wilson +Date: Sun Mar 13 13:54:01 2016 +0000 + + Xext/vidmode: Reduce verbosity of GetModeLine debug messages + + In commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92 + Author: Olivier Fourdan + Date: Wed Feb 10 09:34:34 2016 +0100 + + vidmode: move to a separate library of its own + + the verbosity of some old debug messages (which print the reply to every + GetModeLine client request and others) was increased leading to lots of + log spam. Downgrade the logging back to DebugF. + + [ajax: Fix a typo so it compiles.] + + Reviewed-by: Adam Jackson + References: https://bugs.freedesktop.org/show_bug.cgi?id=94515 + Signed-off-by: Chris Wilson + Cc: Olivier Fourdan + +commit 744c292ae49dd1f9d33b860d2b4f0ae27023809b +Author: Adam Jackson +Date: Fri Mar 11 13:50:32 2016 -0500 + + vidmode: Remove stray vidmodeproc.h from EXTRA_DIST + + Was removed from the tree in: + + commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92 + Author: Olivier Fourdan + Date: Wed Feb 10 09:34:34 2016 +0100 + + vidmode: move to a separate library of its own + + but not removed from the Makefile, which broke 'make dist'. + + Signed-off-by: Adam Jackson + +commit 47bc7fcaa567b0d9e2627b4a21b112e96f81725b +Author: Dave Airlie +Date: Tue Feb 9 16:54:22 2016 +1000 + + present: fail flipping if we have any slave outputs + + Due to the way present currently works, we don't ever check with the + secondary adapters if we can flip at all. + + We shouldn't flip if the secondary adapters are attached to the pixmap + currently, however using the current check_flip callback isn't possible + as it passes the Window to the driver (something we shouldn't be doing), + so the slave driver can never get it's own screen ptr back. + + For now to fix the problem just block flips if we have any slaves + configured. We can fix the ABI up later, but this fix can be backported + to stable. + + Signed-off-by: Dave Airlie + Reviewed-by: Keith Packard + +commit 316948734c2bba72d42c4cf4530932b5862c109f +Author: Michel Dänzer +Date: Fri Mar 11 12:21:06 2016 +0900 + + glamor: Make context current in glamor_pixmap_fbo_cache_put + + Without this, we may be manipulating the context of another screen. + + In a system with two GPUs using glamor, this fixes lots of + + (EE) glamor256: GL error: GL_INVALID_OPERATION in glBindTexture(non-gen name) + + spew since 0b4c0c75 ('glamor: Replace "finish access" shader with texture + swizzling'). + + Signed-off-by: Michel Dänzer + Reviewed-by: Dave Airlie + +commit ef3005da3d5dc92b3ee5a0ee78164e739a3216dc +Author: Adam Jackson +Date: Thu Jan 21 12:47:57 2016 -0500 + + glx: Implement GLX_EXT_fbconfig_packed_float + + The tokens for this are already defined by GLX_ARB_fbconfig_float, which + we already support, so just add the extension to the list and let the + driver provide those configs if it wants. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d15cb654b6ba365dac9a62064e277adebde2fdab +Author: Adam Jackson +Date: Mon May 18 13:00:02 2015 -0400 + + glx: Implement GLX_EXT_stereo_tree + + This is correct as it is, but only because we know no DRI drivers + implement stereo. + + v2: Use new ATTRIB macro + + Reviewed-by: James Jones + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit a18238877bbf9aab95843d849a6f434275e9cd6c +Author: Adam Jackson +Date: Thu Mar 3 16:50:02 2016 -0500 + + glx: Add GLX_SCREEN to the GetDrawableAttributes response + + libglvnd would like to use this to map from drawable to screen, so it + can know which driver to dispatch to. Refer to the spec proposal here: + + https://lists.freedesktop.org/archives/mesa-dev/2016-March/109543.html + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 47c1d6b7abcfb1c6b478367bbc2e869c91485bc0 +Author: Adam Jackson +Date: Thu Mar 10 12:29:34 2016 -0500 + + glx: Macroize building the attribute list in DoGetDrawableAttributes + + No functional change, just a little easier to read and harder to get + wrong. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit c01094c5312fbd84146dd83122e5256a8e57d092 +Author: Eric Anholt +Date: Mon Feb 1 13:58:15 2016 -0800 + + ephyr: Fix redisplay with glamor on GLES. + + glamor_transfer.c is still totally broken, though. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 0b4c0c75d06f3dbe92be1a26a637e9f05529cb3d +Author: Eric Anholt +Date: Mon Feb 1 13:58:14 2016 -0800 + + glamor: Replace "finish access" shader with texture swizzling. + + For pictures without alpha, and for most other formats for GLES2, we + would make a temporary FBO, make another temporary texture, upload our + GLAMOR_MEMORY pixmap to the texture, then run the "finish access" shader + across it to swizzle its values around into the temporary FBO (which we + would use for a single Render operation and then throw away). + + We can simplify everything by using GL_ARB_texture_swizzle (or its + GLES3 counterpart). It's just not worth the complexity to try to + improve the performance of this already low-performance path (SHM + pixmaps + Render) on GLES2. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit b0cc04992ced5d96bb5c52fc1e5c868797cc0a17 +Author: Eric Anholt +Date: Mon Feb 1 13:58:13 2016 -0800 + + glamor: Drop dead large-pixmap handling code in temp picture uploads. + + The glamor_pixmap_ensure_fbo() in glamor_pixmap_upload_prepare() will + always fail on a large pixmap, so we can just be explicit about + bailing out here and then dump the rest of this garbage. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 094b1bea8bd08eec029e4d61ba40d81441c37905 +Author: Eric Anholt +Date: Mon Feb 1 13:58:12 2016 -0800 + + glamor: Drop unused PBO code in temporary picture uploading. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 6112fecc3a4fd7dfb0ef77a98cfd1f7c91ccea0c +Author: Eric Anholt +Date: Mon Feb 1 13:58:11 2016 -0800 + + glamor: Generalize the a1-to-a8 conversion path. + + Pixman is quite qualified to allocate our temporary memory, and all we + need to do is decide what formats to convert from and to. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 8f1411c3847a742f84ff07c4a0bb610801f5bfee +Author: Eric Anholt +Date: Mon Feb 1 13:58:10 2016 -0800 + + glamor: Drop the REVERT_UPLOADING_1_5_5_5 path. + + There was only a pretty special case that could have even worked -- + you've got a GLES2 renderer, you've got a SHM pixmap, it's 1555 (not + the usual 565 for 16-bit), and you're little endian (BE was broken, + since GL's 5_5_5_1 picks the 1 bit from the lowest bit of the short, + and on BE we weren't doing the conversion path that swaps around the + channels). This is just not worth the complexity. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 2cc7a0815e5e2c2b1b1267cae9c348a8e95b1082 +Author: Eric Anholt +Date: Mon Feb 1 13:58:09 2016 -0800 + + glamor: Drop the GLES2 REVERT_UPLOADING_2_10_10_10 paths. + + These just smash your 2_10_10_10 data into 8888, despite what the + comments said. That's not valid rendering, so just ditch this path + and fall back to software. One might also note in the code being + removed here that the REVERT_UPLOADING_10_10_10_2 path wasn't even + connected. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit f667d5177024d3fdfb1b51694bdaeba6cee67962 +Author: Eric Anholt +Date: Mon Feb 1 13:58:08 2016 -0800 + + glamor: Merge the two GL-type-from-pictformat paths. + + It clarifies what the difference is between the two paths, and would + potentially encourage us to handle GLES extensions that expose + additional types. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit c7574c63c618d3a017105c380542eb04341b04a2 +Author: Eric Anholt +Date: Mon Feb 1 13:58:07 2016 -0800 + + glamor: Propagate that is_upload is always true. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 1bed5ef2b80c77c1bb9b62971367bea864fd8f66 +Author: Eric Anholt +Date: Mon Feb 1 13:58:06 2016 -0800 + + glamor: Drop dead fbo handling from GLAMOR_MEMORY pict uploads. + + The previous commit asserts that we don't have one. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit ee7ca670b1695d64bc12cb37302913acc066a569 +Author: Eric Anholt +Date: Mon Feb 1 13:58:05 2016 -0800 + + glamor: Make sure that GLAMOR_MEMORY pixmaps don't retain an FBO. + + glamor_composite_choose_shader() may upload our scratch pixmaps to get + a Render operation completed. We don't want to hang onto GL memory + for our scratch pixmaps, since we'll just have to reallocate them at a + new w/h next time around, and the contents will be updated as well. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit a96c6d4658e3f386002f96eede660af3b01e5209 +Author: Eric Anholt +Date: Mon Feb 1 13:58:04 2016 -0800 + + glamor: Simplify temporary picture uploading call stack. + + glamor_upload_sub_pixmap_to_texture() only had the one caller, so we + can merge it in, fix its silly return value, and propagate a bunch of + constants. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 25ce263fd88684be9370025f93ba3a2bfc72ff1a +Author: Olivier Fourdan +Date: Wed Mar 9 16:45:18 2016 +0100 + + glamor: do not build Xv support when --disable-xv + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit da7724d3d277c6c8a814881785b716896802629a +Author: Olivier Fourdan +Date: Wed Mar 9 16:21:18 2016 +0100 + + xwayland: add glamor Xv adaptor + + This adds an Xv adaptor using glamor. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit d11fdff50c91575e977a63617806a61bca98cd35 +Author: Jon Turney +Date: Fri Jan 3 13:21:40 2014 +0000 + + hw/xwin: Tidy-up of winmsg.h + + - winVMsg() has no uses, so remove + - winMsgVerb() has only one use, with default verbosity, so remove + - winMsg() is identical to LogMessage() + - Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG + - Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 519b98765f0c7d083a744ae7beb641753e4eb751 +Author: Jon Turney +Date: Thu Mar 3 22:32:28 2016 +0000 + + hw/xwin: Remove GC privates, unused since native GDI engine removal + + Unused since native GDI engine removal in commit 8465ee78 + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 9d28ff2a9be86662f56463aa1fd46d12988e30fa +Author: Jon Turney +Date: Fri Jul 31 20:23:59 2015 +0100 + + hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit a309085a56de4d30dfbc44d9ff5302c7d9fdbf73 +Author: Jon Turney +Date: Fri Jul 31 20:20:00 2015 +0100 + + hw/xwin: Remove unused FinishCreateWindowsWindow engine function + + This only ever had an (unused) implementation in the DDNL engine, which was + removed in commit 57bbf6e2. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit fa6f9d06a3d1a90134d9349f5ce4ec5b4eeff5e3 +Author: Jon Turney +Date: Fri Jul 31 20:12:37 2015 +0100 + + hw/xwin: Remove unused HotKeyAltTab engine function + + This was only ever used by the primaryfb engine, removed in commit c79f824b + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 7bd25aa8437ec410e7a7de1b0636ba33298fc8d6 +Author: Jon Turney +Date: Fri Jul 31 19:44:34 2015 +0100 + + hw/xwin: Return FALSE to indicate failure in winSetEngine() + + Return FALSE to indicate failure in winSetEngine(), if it couldn't find a + drawing engine to use + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 52e05b9282f0f220d7c762793ce0b8f606a45deb +Author: Jon Turney +Date: Tue Feb 23 23:09:43 2016 +0000 + + hw/xwin: Remove WM_WM_MAP message, which is now unused + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit c42217aa3d372acaa5ca7c64895edbfbd20c8475 +Author: Jon Turney +Date: Mon Nov 2 20:24:33 2015 +0000 + + hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent + + Remove fAnotherWMRunning which tracks this message (although since it was + never initialized, I doubt this worked reliably), and the only use of that, + which was to prevent winMWExtWMRestackWindows() from being used when the + internalwm is running + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit b6bdf368420355332e41c604c523584bd39933f9 +Author: Jon Turney +Date: Mon Nov 2 20:51:51 2015 +0000 + + hw/xwin: Remove allowOtherWM, which is now always FALSE + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8407d3096287868b5c5e50ca5a98d470918c85a9 +Author: Jon Turney +Date: Mon Nov 2 20:34:09 2015 +0000 + + hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE + + Also remove then unused variables and IsRaiseonClick() + + v2: + Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame() + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 2779a28a86a13831b334e8678cd4e838b3b38472 +Author: Jon Turney +Date: Mon Nov 2 20:07:04 2015 +0000 + + hw/xwin: Remove fInternalWM flag + + Remove the fInternalWM flag as it is now always FALSE after removing the + -internalwm option + + v2: + Also remove then unused pRLWinPriv local from pRLWinPriv() + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 98238ece5756801a8a67b9235e42cb9ab2318633 +Author: Jon Turney +Date: Mon Nov 2 19:37:40 2015 +0000 + + hw/xwin: Ignore the obsolete, undocumented -internalwm option + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit cdeaebad9889d81d2698b8a10fec5e55d8dec7a1 +Author: Jon Turney +Date: Tue Mar 1 21:37:05 2016 +0000 + + hw/xwin: Remove the long-broken -silent-dup-error option + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 24042b4e367803dd64f3fcdc1bef7b2bf36c4145 +Author: Michel Dänzer +Date: Mon Dec 21 17:54:08 2015 +0900 + + modesetting: Allow CRTC transforms to actually take effect + + Setting crtc->transformPresent to FALSE was preventing the transform + from actually taking effect and putting RandR into a confused state. + + Now that the RandR 1.2 cursor code handles transforms correctly, we can + allow them to properly take effect. + + Reviewed-by: Keith Packard + +commit b04767c84deafc44993723add4b1c5163fc11711 +Author: Michel Dänzer +Date: Wed Oct 21 18:33:46 2015 +0900 + + xfree86: Re-set current cursor after RandR 1.2 CRTC configuration change + + Add xf86CursorResetCursor, which allows switching between HW and SW + cursor depending on the current state. + + Call it from xf86DisableUnusedFunctions, which is called after any CRTC + configuration change such as setting a mode or disabling a CRTC. This + makes sure that SW cursor is used e.g. while a transform is in use on + any CRTC or while there are active PRIME output slaves, and enables HW + cursor again once none of those conditions are true anymore. + + Reviewed-by: Keith Packard + +commit a4ffa8721debb34bd36fd4624890d9c26886c618 +Author: Michel Dänzer +Date: Thu Dec 24 12:56:03 2015 +0900 + + xfree86/modes: Check for CRTC transforms in xf86_use_hw_cursor(_argb) (v2) + + We currently don't handle transforms for the HW cursor image, so return + FALSE to signal a software cursor must be used if a transform is in use + on any CRTC. + + v2: Check crtc->transformPresent instead of crtc->transform_in_use. The + latter is TRUE for rotation as well, which we handle correctly. + + Reviewed-by: Keith Packard + +commit c3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce +Author: Michel Dänzer +Date: Thu Dec 24 16:20:49 2015 +0900 + + xfree86/modes: Refactor xf86_use_hw_cursor_argb to use xf86_use_hw_cursor (v2) + + This reduces code duplication. + + v2: No functional change this time. + + Reviewed-by: Keith Packard + +commit a3e681eafa5355b8bb3b099d47983f14f0d5e197 +Author: Michel Dänzer +Date: Tue Feb 23 17:19:03 2016 +0900 + + glamor: Source pictures are always depth 32 + + We were using the destination pixmap depth to determine the source + picture format. + + Fixes incorrect text rendering with some MATE desktop GTK3 themes. + + Reviewed-by: Adam Jackson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94246 + Signed-off-by: Michel Dänzer + +commit b05ae79ee3bebef9790c97eedc033d1ffb3ec39a +Author: Michel Dänzer +Date: Tue Feb 23 17:19:02 2016 +0900 + + glamor: Factor out glamor_set_color_depth from glamor_set_color + + The former takes explicit screen and depth parameters instead of + deriving them from a pixmap. + + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 947e94a341fa153258e9e86060b83af95934672b +Author: Hans de Goede +Date: Wed Feb 10 16:40:43 2016 +0100 + + glamor: Fix XvPutImage when src_y != 0 + + We already take src_y into account when uploading the src data by + starting at the top line of the src data when uploading. + + Adjust src_y accordingly when rendering. + + Signed-off-by: Hans de Goede + +commit 40a164b8f4e720b0d6ebf228ee175eb397ffeec2 +Author: Rui Matos +Date: Fri Mar 4 16:24:48 2016 +0100 + + build: Enable vidmode independently from Xorg + + This allows building Xwayland without Xorg and still include the + vidmode extension. + + v2: Use PKG_CHECK_EXISTS instead of PKG_CHECK_MODULES + + Signed-off-by: Rui Matos + Reviewed-by: Emil Velikov + +commit 2be527b1d4ce2b0412c4484539a8c9607645ec6d +Author: Julien Cristau +Date: Mon Mar 7 23:20:34 2016 +0100 + + xfixes: avoid double free if AddResource fails + + pChc is already freed through CursorFreeHideCount → + deleteCursorHideCount. + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 4217db89ecd480fda2ee74fecba06c6713c2a0f0 +Author: Julien Cristau +Date: Mon Mar 7 23:20:33 2016 +0100 + + render: free already allocated formats in PictureInit failure case + + Probably pointless, if this fails you're not likely to get far... + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 054f80717812d4781741cd05393623fe6f6c627f +Author: Julien Cristau +Date: Mon Mar 7 23:20:32 2016 +0100 + + record: don't call RecordDeleteContext when AddResource fails + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit d0c1a5bc61a3d151f2234aa3820862f16c0f00c7 +Author: Julien Cristau +Date: Mon Mar 7 23:20:31 2016 +0100 + + xwin: no need to free auth data if AddResource fails + + This is taken care of by SecurityDeleteAuthorization + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit acf263df81ad6813e0233033610fb44521cab1b4 +Author: Julien Cristau +Date: Mon Mar 7 23:20:30 2016 +0100 + + modesetting: avoid double free if AddResource fails + + ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone + already free the resource. + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 164753f158e78f615f903467bfd234d7c58244ef +Author: Julien Cristau +Date: Mon Mar 7 23:20:29 2016 +0100 + + dmx/glxProxy: don't free the glx pixmap twice if AddResource fails + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 59b9c3d5e4bf05aeaaac2ee4ea12c301a67aae2c +Author: Julien Cristau +Date: Mon Mar 7 23:20:28 2016 +0100 + + glx: don't call pGlxDraw->destroy() if AddResource fails + + AddResource will have called DrawableGone, which takes care of the + destruction. + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit ac97fb2b804809c39b12fe0032d96fb076657258 +Author: Julien Cristau +Date: Mon Mar 7 23:20:27 2016 +0100 + + dri3: return an error if AddResource fails + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 119d5c0e2f800737c949ef760c5fe25d963200bf +Author: Julien Cristau +Date: Mon Mar 7 23:20:26 2016 +0100 + + xvmc: Fix unchecked AddResource + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit a2c3c34b44b866440a152511e682c98879ee13b7 +Author: Jonas Ådahl +Date: Tue Mar 8 20:05:33 2016 +0800 + + xwayland: Correctly detect whether posix_fallocate exists + + We had HAVE_POSIX_FALLOCATE checks, but no such macros were ever + defined anywhere. This commit makes it so that this macro is defined if + the posix_fallocate is detected during configure. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Julien Cristau + +commit 939ce0bae68b682b57675f65c901653c1a094ebb +Author: Julien Cristau +Date: Tue Mar 1 21:39:01 2016 +0100 + + xv: fix double free in AddResource failure case + + XvdiDestroyVideoNotifyList already frees the list if AddResource fails, + so don't do it twice. And set tpn->client to NULL explicitly to avoid + confusing uninitialized memory with a valid value. + + Reviewed-by: Adam Jackson + Signed-off-by: Julien Cristau + +commit 05e1bcf56e1c511a1ef539acfe11e37727e1179e +Author: Adam Jackson +Date: Tue Mar 1 14:09:30 2016 -0500 + + dri1: Fix unchecked AddResource + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + +commit 093f9505c12565cc19bdf6e33b263f31d104c3ef +Author: Adam Jackson +Date: Tue Mar 1 14:09:29 2016 -0500 + + xv: Fix unchecked AddResource + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit ac4d8c7cee13947b688ebb26035f06f7744db201 +Author: Olivier Fourdan +Date: Tue Mar 1 17:03:44 2016 +0100 + + vidmode: build without xf86vidmodeproto + + git commit f175cf45: + + vidmode: move to a separate library of its own + + introduced a regression where the xserver would not build when + xf86vidmodeproto is not installed even if the configure option + "--disable-xf86vidmode" is specified. + + Fix build failure when xf86vidmodeproto is not installed. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 9c88cb9b059111e0531852f3fa8fa571c0306f57 +Author: Laércio de Sousa +Date: Thu Feb 25 16:37:57 2016 -0300 + + kdrive/ephyr: map host X server's keymap into Xephyr, if supported + + Currently Xephyr doesn't inherit host X server's keymap, which + may lead to keymap mismatches when using a non-US keyboard in a + window inside Xephyr. This patch makes Xephyr change its keymap + to match host X server's one (unless XKB support is disabled), + using xcb-xkb to retrieve the needed XKB controls. + This implementation is analogous to Xnest one at commit 83fef4235. + + Supersedes: https://patchwork.freedesktop.org/patch/67504 + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit daa6d2d58f65b9301b1b1f3c6df07719ecb5c03d +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:02 2016 -0200 + + config/udev: distinguish between real keyboards and other key devices + + This patch introduces a new flag ATTR_KEY for hotplugged input devices, + so we can better distinguish between real keyboards (i.e. devices with + udev property ID_INPUT_KEYBOARD="1") and other key input devices like + lid switches, power buttons, etc. + + All supported hotplug backends (udev, hal, and wscons) will set both + flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend + will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input + devices (hal and wscons will set both flags in any case). With this + distinction, kdrive input hotplugging mechanism will be allowed to only + grab real keyboards, as other key input devices are currently not + supported. + + In order to don't break current behaviour, this patch will replace all + ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c. + + [ajax: Just add ATTR_KEY, don't re-number the other attributes] + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 851ff9ec04b73412c7dbad7b4911a1feac21f354 +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:01 2016 -0200 + + ephyr: enable option -sw-cursor by default in multi-seat mode + + Option -seat passed to Xephyr requires -sw-cursor to be passed as well, + otherwise the mouse cursor will remain invisible for the given seat. + This patch takes care of enabling -sw-cursor if -seat is passed. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 40e32e9fc9f3a1bd8287ee03dd399d8161cb98dd +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:00 2016 -0200 + + kdrive: add options to set default XKB properties + + This patch introduces convenient command-line options -xkb-rules, + -xkb-model, -xkb-layout, -xkb-variant, and -xkb-options, to set default + values for these properties. + + These options can be handful for cases in which compile-time default + values don't match user locale, since kdrive doesn't support InputClass + matching rules yet and not all Linux distros provide default rules to + store these values in udev properties (which by the way is a discouraged + practice). + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 0cf3d72be6bd99cd2c66b7885339322c7e5bf73d +Author: Laércio de Sousa +Date: Fri Feb 12 14:17:59 2016 -0200 + + kdrive: introduce input hot-plugging support for udev and hal backends (#33140) + + This patch introduces input hot-plugging support for kdrive-based + applications in multi-seat context. This feature is enabled by passing + -seat option with desired seat name. All keyboard/mouse devices assigned + to that seat will be automatically grabbed by kdrive. + + It supports udev and hal backends for input hot-plugging support. + Another patches may be required for wscons backend. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33140 + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 2116f03be04240e961649ca750a7aa5438b8446c +Author: Olivier Fourdan +Date: Mon Feb 8 17:48:26 2016 +0100 + + xwayland: fix a crash on output removal + + On output removal, the CRTC that was added in xwl_output_create() + is not removed in xwl_output_destroy() and would cause a segmentation + fault later on in ProcRRGetMonitors(): + + (EE) Segmentation fault at address 0x100000001 + (EE) + (EE) 10: ? (?+0x29) [0x29] + (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299] + (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580] + (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3] + (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e] + (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b] + (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9] + (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198] + (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710] + (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f] + (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9] + + Remove the output CRTC in xwl_output_destroy() to avoid the crash. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 1bee4e254ca0305cb23e574b4c8b250d276ee998 +Author: Michel Dänzer +Date: Thu Feb 18 17:33:19 2016 +0900 + + present: Call present_restore_screen_pixmap from present_set_abort_flip + + After present_set_abort_flip, the screen pixmap will be used for all + screen drawing, so we need to restore the current flip pixmap contents + to the screen pixmap here as well. + + Improves flashing / stutter e.g. when something like a popup menu appears + on top of a flipping fullscreen window or when switching out of + fullscreen. + + Note that this means present_set_abort_flip now relies on screen->root + being non-NULL, but that's already the case in other present code. + + Reviewed-by: Keith Packard + Reviewed-by: Chris Wilson + +commit 4611e902c291b8a789f374cff3300f74645bc2b2 +Author: Michel Dänzer +Date: Thu Feb 18 17:20:45 2016 +0900 + + present: Factor code for restoring screen pixmap out of present_unflip (v2) + + The following fix will use the refactored function. + + The logic in the refactored function is slightly simplified, exploiting + the fact that this function is only ever called with a valid flip + pixmap. + + v2: Assert that flip_pixmap is non-NULL instead of testing and bailing + on NULL, preserve test for flip_window being non-NULL before calling + present_set_tree_pixmap for it (Keith Packard) + + Reviewed-by: Chris Wilson (v1) + Reviewed-by: Keith Packard + +commit 72328e5eb98a3f27e1f0a0e17beae6db447bd87c +Author: Michel Dänzer +Date: Thu Feb 18 18:23:47 2016 +0900 + + present: Only update screen pixmap from flip pixmap once per unflip + + present_unflip may be called several times from present_check_flip_window + during the same unflip. We can only copy to the screen pixmap the first + time, otherwise we may scribble over other windows. The flip pixmap + contents don't get updated after the first time anyway. + + Fixes at least the following problems, which were introduced by commit + 806470b9 ("present: Copy unflip contents back to the Screen Pixmap"): + + On xfwm4 without compositing, run glxgears and put its window into + fullscreen mode to start flipping. While in fullscreen, open the xfwm4 + window menu by pressing Alt-Space. The window menu was invisible most + of the time because it was getting scribbled over by a repeated unflip + copy. + + When switching a flipping window out of fullscreen, a repeated unflip + copy could leave artifacts of the flip pixmap on the desktop. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325 + + Reviewed-by: Keith Packard + Reviewed-by: Chris Wilson + +commit 43eb5b6047c9b35c337e553ec054f08bdc835abb +Author: Michel Dänzer +Date: Tue Dec 8 12:52:17 2015 +0900 + + dri3: Refuse to work for remote clients (v2) + + Prevents clients forwarded via SSH from hanging while waiting for the + reply from the DRI3Open request. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 + + v2: Return BadMatch instead of BadRequest (Keith Packard) + + Reviewed-by: Keith Packard + +commit 6070a749d953951bacbfb149c5c36451293aad35 +Author: Olivier Fourdan +Date: Wed Feb 10 09:35:39 2016 +0100 + + xwayland: add partial xvidmode extension support + + Older games (mostly those based on SDL 1.x) rely on the XVidMode + extension and would refuse to run without. + + Add a simple, limited and read-only xvidmode support that reports the + current mode used so that games that rely on xvidmode extension can run + on XWayland. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit b430f53bb753f9b064ab62d014820c1c3c76a841 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:25 2016 +0100 + + vidmode: remove redundant DIX function + + The API signature of the DIX xf86VidModeGetGammaRampSize() is now + identical to the xf86cmap's xf86GetGammaRampSize() and all it does is + actually call xf86GetGammaRampSize() so we can save one vfunc. + + Remove uneeded xf86VidModeGetGammaRampSize() function. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 48fccde2bfb60efdbf45a96fa53bcd9a6570bf89 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:24 2016 +0100 + + vidmode: remove redundant check + + The DIX already checks for VidModePrivateKey to get the vfunc, so + checking for this again in the DDX is redundant. + + Remove the redundant function xf86VidModeAvailable() from the DDX. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92 +Author: Olivier Fourdan +Date: Wed Feb 10 09:34:34 2016 +0100 + + vidmode: move to a separate library of its own + + XVidMode extension might be useful to non hardware servers as well (e.g. + Xwayand) so that applications that rely on it (e.g. lot of older games) + can at least have read access to XVidMode. + + But the implementation is very XFree86 centric, so the idea is to add + a bunch of vfunc that other non-XFree86 servers can hook up into to + provide a similar functionality. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 17097e083b2392c8989474f6e0da8cc234329e9c +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:22 2016 +0100 + + vidmode: rename DDX functions + + To avoid confusion as to what belongs on the DDX and what not. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit ddfb8c009ac651209eb0087aaf86b54e1446e8b2 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:21 2016 +0100 + + vidmode: move display mode definitions + + To be able to reuse the VidMode extension in a non-hardware server, the + display mode definitions need to be accessible from DIX. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit e29a64de662112b8ebcd3f20c89df0e8c51890ef +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:20 2016 +0100 + + vidmode: remove mode access from public API + + The mode access functions (namely VidModeCreateMode(), + VidModeCopyMode(), VidModeGetModeValue() and VidModeSetModeValue()) are + used only in xf86VidMode code and do not need to be available anywhere + else. + + Remove these functions from the public VidMode API and move them as + static where they are used. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit b7962ade5265a21ac7c60da6cc07ece15ef7e648 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:19 2016 +0100 + + vidmode: use appropriate DisplayModePtr type + + The API uses an untyped pointer (void *) where a DisplayModePtr is + expected. + + Clean up the API to use the appropriate type, as DisplayModePtr is + really all that will be passed there. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 12f714fd95dc9d912c0bf2524005a73ec6e8ee4f +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:18 2016 +0100 + + vidmode: remove VidModeGetMonitor() + + VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to + get a untyped monitor pointer that is passed back straight again to + VidModeGetMonitorValue(). + + This is actually useless as VidModeGetMonitorValue() could as well get + the monitor from the ScreenPtr just like VidModeGetMonitor() does. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit f6f7e21133c13c34f306a191137d566e83b40929 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:17 2016 +0100 + + vidmode: use ScreenPtr instead of screen index + + New code passes ScreenPtr instead of the screen index. + + Change the VidMode functions to take a ScreenPtr. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 6e898ef080df93e885ead9d6fee8854b34e0216f +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:16 2016 +0100 + + vidmode: get rid of the CloseScreen wrapper + + As we rely on dixRegisterPrivateKey() to allocate the memory for us that + will be free automatically, we do not need the CloseScreen wrapper + anymore. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 341f3bccafde71754a9ed2303df9908e509c6d31 +Author: Olivier Fourdan +Date: Fri Feb 5 09:48:15 2016 +0100 + + vidmode: use appropriate API + + dixRegisterPrivateKey() can allocate memory that will be freed when the + screen is teared down. + + No need to calloc() and free the memory ourself using a broken ref + counting method. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit d8882954570aba656d5a7be7d357feaba21cb099 +Author: Chris Wilson +Date: Fri Feb 12 11:59:53 2016 +0000 + + dri2: Allow many blocked clients per-drawable + + This patch was motivated by the need to fix the use-after-free in + dri2ClientWake, but in doing so removes an arbitrary restriction that + limits DRI2 to only blocking the first client on each drawable. In order + to fix the use-after-free, we need to avoid touching our privates in the + ClientSleep callback and so we want to only use that external list as + our means of controlling sleeps and wakeups. We thus have a list of + sleeping clients at our disposal and can manage multiple events and + sources. + + Reviewed-by: Adam Jackson + Signed-off-by: Chris Wilson + +commit bc3634010c096dffd1935c0c6cf8ba37534ae3d8 +Author: Chris Wilson +Date: Fri Feb 12 11:59:52 2016 +0000 + + dix: Add ClientSignalAll() + + This is a variant of ClientSignal() that signals all clients with an + optional matching sleeping client, function and closure. + + Reviewed-by: Adam Jackson + Signed-off-by: Chris Wilson + +commit 9fecc4cd571641f8920f25473ce5abb3fdca8b40 +Author: Jon Turney +Date: Tue Jan 12 16:18:35 2016 +0000 + + xwin: Remove unhelpful debug about WM message queue size + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit f7d1e5acdf5ed4ab4ed5c18727aa6f3d379ef560 +Author: Jon Turney +Date: Tue Aug 11 15:45:57 2015 +0100 + + xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windows + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684 +Author: Jon Turney +Date: Thu Jul 2 19:21:11 2015 +0100 + + xwin: In multiwindow mode, look up the HWND for the parent window + + Rather than only looking at the foreground window to see if it matches + the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from + the window privates. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 856a28f63739bffe32f5a8156fd2680e5c5259a1 +Author: Jon Turney +Date: Thu Jul 2 13:32:40 2015 +0100 + + xwin: Factor out MessageName() debug helper + + Factor out the MessageName() debug helper for message id -> text, and + use it on message queue and dequeue. + + Reorder in numerical order to match winwindow.h + + Add missing WM_WM_ICON_EVENT + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8c2006ddc5abbd4ac374dabf1cfdd3df8fc88779 +Author: Jon Turney +Date: Mon Feb 22 17:41:14 2016 +0000 + + xwin: Keyboard layout updates + + layout zh_TW doesn't exist (anymore), try something else for that. + + layout it variant mac doesn't seem to exist anymore, try to handle + Macintosh keyboards (running under Parallels on Mac) and other oddities + in a more generic way, by falling back to matching only on the language + identifer part of the input locale identifer. + + v2: + Fix typo of 0xa0000 for 0xa000 + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8c97a0078e7fe22e6159fa53490dfca2f4d267a9 +Author: Colin Harrison +Date: Wed Nov 19 22:33:39 2014 +0000 + + xwin: Add a tentative entry for the Korean keyboard to the list of known keyboard layouts + + Signed-off-by: Colin Harrison + Reviewed-by: Jon Turney + +commit a4d8a64c4ba467964476c4a1486da698bd6aed9e +Author: Jon Turney +Date: Tue Feb 10 14:36:37 2015 +0000 + + xwin: Update to XRANDR 1.2 internal interface to ensure an output is reported by XRANDR + + If using the X server internal XRANDR 1.0 interface, it seems we must + register a display size with RRRegisterSize() in order to make + RRGetInfo() call RRScanOldConfig() to generate an output and crtc for + us. + + Without this, the following GDM bug means that an XDMCP session to GDM + cannot be started. + + https://bugzilla.gnome.org/show_bug.cgi?id=736054 + + Instead, use the more recent XRANDR 1.2 internal interface to explicitly + create the output and crtc, and maintain a single mode which represents + the current display size. + + Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done + which has no effect, this seems to throw the GDM greeter into a loop... + + v2: Maintain reference count for the mode we maintain more correctly, to + avoid double free causing a crash on shutdown + + Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't + change anything, so we don't fail due to our lack of rrSetConfig or + rrCrtcSet hooks. + + See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html + + v3: + Raise limit on X display size from 4Kx4K to 32Kx32K + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 008efebda801b9b80e2ab3f2c95aeef8c82102ee +Author: Jon Turney +Date: Sat Oct 18 17:31:57 2014 +0100 + + xwin: Use WM_CLIPBOARDUPDATE clipboard API + + Windows Vista and later have a saner clipboard API where the clipboard + viewer linked list is no longer maintained by applications. Use it + where available. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit de7f1fd6f8f10f07b366ae5428a8c65a224bda98 +Author: Jon Turney +Date: Wed Jul 9 14:26:54 2014 +0100 + + xwin: Check that window position is visible on non-rectangular virtual desktops + + Improve the check that window position is visible to work correctly for + non-rectangular virtual desktops + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit a9e73131b6453e0fa2da5360e84af7a2eae3b205 +Author: Jon Turney +Date: Thu May 8 11:40:39 2014 +0100 + + xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64 + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit d7cef6fbe23381b31c163468f349feee2f1b1eba +Author: Jon Turney +Date: Thu Mar 13 18:04:17 2014 +0000 + + xwin: Improve handling of no-decoration motif hint + + When motif decoration hint asks for no decoration, don't add sysmenu, + mimimize or maximimize controls. + + (This fixes a problem with e.g. fbpanel having a minimize control, but + gtk's panel_configure_event() doesn't like the state we put the window + into when we minimize it, causing it to spin) + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit f75404be3ad94c8da493688397712c65ea66cb90 +Author: Jon Turney +Date: Fri Mar 28 16:57:48 2014 +0000 + + xwin: XGetWMNormalHints() returns non-zero on success + + XGetWMNormalHints() doesn't actually return a Status value. On success + it returns a non-zero value, not Success. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 9dc32746f2cd161b512cce8f39c95287bdf1a3a3 +Author: Jon Turney +Date: Tue Nov 10 10:27:07 2015 +0000 + + xwin: Fix format warnings when ./configured --enable-debug --enable-windowswm + + Fix format warnings (mainly pointer format fixes) which show up when + ./configured --enable-debug --enable-windowswm + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit b4ac7b142fa3c536e9b283cfd34b94d82c03aac6 +Author: Michel Dänzer +Date: Wed Feb 24 16:52:59 2016 +0900 + + present: Only requeue if target MSC is not reached after an unflip + + While present_pixmap decrements target_msc by 1 for present_queue_vblank, + it leaves the original vblank->target_msc intact. So incrementing the + latter for requeueing resulted in the requeued presentation being + executed too late. + + Also, no need to requeue if the target MSC is already reached. + + This further reduces stutter when a popup menu appears on top of a + flipping fullscreen window. + + Reviewed-by: Chris Wilson + Signed-off-by: Michel Dänzer + +commit e7a35b9e16aa12970908f5d55371bb1b862f8f24 +Author: Michel Dänzer +Date: Wed Feb 24 16:52:58 2016 +0900 + + present: Requeue if flip driver hook fails and target MSC not reached + + For flipping, we wait for the MSC before the target MSC and then call + the driver flip hook. If the latter fails, we have to wait for the + target MSC before falling back to a copy, or else it's executed too + early. + + Fixes glxgears running at unbounded framerate (not synchronized to the + refresh rate) in fullscreen if the driver flip hook fails. + + Reviewed-by: Chris Wilson + Signed-off-by: Michel Dänzer + +commit 1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a +Author: Michel Dänzer +Date: Wed Feb 24 16:52:57 2016 +0900 + + present: Move msc_is_(equal_or_)after to the top of present.c + + To make them usable from any other function in the file. No functional + change. + + Reviewed-by: Chris Wilson + Signed-off-by: Michel Dänzer + +commit 0461bca0cb2f7918c77ed45d2cbc756cf65021be +Author: Laércio de Sousa +Date: Mon Feb 22 16:04:12 2016 -0300 + + kdrive/evdev: update keyboard LEDs (#22302) + + Implement missing parts in kdrive evdev driver for + correct update of evdev keyboard LEDs. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22302 + + [ajax: Fixed deref-before-null-check bug] + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7 +Author: Jon TURNEY +Date: Mon Feb 22 16:20:00 2016 +0000 + + Fix build on Cygwin by ensuring WIN32 check triggers only on MinGW + + The type of fd_mask was changed in Cygwin 2.4.0 headers from 'long' to + 'unsigned long'. This exposes an existing problem with winauth.c, which + includes Xwindows.h (which includes windows.h, which defines WIN32), + before including osdep.h, which causes the now conflicting definition of + fd_mask in osdep.h to be exposed: + + In file included from ../os/osdep.h:198:18: error: conflicting types for + ‘fd_mask’ typedef long int fd_mask; /usr/include/sys/select.h:46:23: + note: previous declaration of ‘fd_mask’ was here typedef unsigned long + fd_mask; + + Adjust the include guards in osdep.h to make sure we only use WIN32 + guarded code when not compiling for Cygwin (i.e. WIN32 && !__CYGWIN__) + + This isn't a very elegant, but unfortunately appears to be the best + solution, since it doesn't seem to be possible to write the test in a + positive form. + + Future work: Should also audit of all the other uses of WIN32 in + xserver, and make sure they are correct. + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit 544b4149268561d3d794aa540172831fa7550a20 +Author: Jonas Ådahl +Date: Fri Feb 19 15:08:12 2016 +0800 + + xwayland: Prefix shm tmp file names with xwayland + + Prefix the temporary file names used for allocating pixmaps with + "xwayland-" instead of "weston-". This makes it less confusing while + looking at the file names of the currently open fds of the Xwayland + process. + + Reviewed-by: Adam Jackson + Signed-off-by: Jonas Ådahl + +commit 5627708e5f447d0e360bbc9eb8d1c4e58c5046d0 +Author: Marc-Andre Lureau +Date: Fri Feb 12 22:52:07 2016 +0100 + + dri2: add virtio-gpu pci ids + + Add virtio-gpu legacy + 1.0 pci ids, allowing them to use + modesetting + glamor with dri2. + + Signed-off-by: Marc-André Lureau + Reviewed-by: Dave Airlie + +commit e957a2e5dd288f515f3e93724823542c20333f6a +Author: Daniel Stone +Date: Fri Feb 12 16:36:59 2016 +0000 + + dix: Add hybrid full-size/empty-clip mode to SetRootClip + + 216bdbc735 removed the SetRootClip call in the XWayland output-hotplug + handler when running rootless (e.g. as a part of Weston/Mutter), since + the root window has no storage, so generating exposures will result in + writes to invalid memory. + + Unfortunately, preventing the segfault also breaks sprite confinement. + SetRootClip updates winSize and borderSize for the root window, which + when combined with RRScreenSizeChanged calling ScreenRestructured, + generates a new sprite-confinment area to update it to the whole screen. + + Removing this call results in the window geometry being reported + correctly, but winSize/borderSize never changing from their values at + startup, i.e. out of sync with the root window geometry / screen + information in the connection info / XRandR. + + This patch introduces a hybrid mode, where we update winSize and + borderSize for the root window, enabling sprite confinement to work + correctly, but keep the clip emptied so exposures are never generated. + + Signed-off-by: Daniel Stone + Tested-by: Olivier Fourdan + Reviewed-by: Adam Jackson + +commit dbe8d03c42f01332b3dc41fe9290aed142f1436f +Author: Keith Packard +Date: Tue Feb 16 20:03:57 2016 -0800 + + randr: Send ConfigNotify when manual monitor list changes + + This lets clients know that the layout of the monitors on the screen + has changed so they can adapt appropriately. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit eddf848c44349c7ebc7da9957bffb3630f3faaa9 +Author: Adam Jackson +Date: Wed Feb 10 11:13:04 2016 -0500 + + dri2: Use the work queue to manage client sleeps + + In commit e43abdce964f5ed9689cf908af8c305b39a5dd36 + Author: Chris Wilson + Date: Wed Feb 3 09:54:46 2016 +0000 + + dri2: Unblock Clients on Drawable release + + we try to wake up any blocked clients at drawable destruction. But by + the time we get there, CloseDownConnection has already torn down state + that AttendClient wants to modify. + + Using ClientSleep instead of IgnoreClient puts a wakeup function on a + workqueue, and the queue will be cleared for us in CloseDownClient + before (non-neverretain) resource teardown. + + Tested-by: Chris Wilson + Reviewed-by: Chris Wilson + Signed-off-by: Adam Jackson + +commit b3e9c534e2b0dc2c9acd2fe9b942e1fc5227339b +Author: Adam Jackson +Date: Mon Feb 8 17:36:03 2016 -0500 + + os: unifdef STREAMSCONN + + Removed from xtrans in 2012, and never wired up in the modular build + anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit e43abdce964f5ed9689cf908af8c305b39a5dd36 +Author: Chris Wilson +Date: Wed Feb 3 09:54:46 2016 +0000 + + dri2: Unblock Clients on Drawable release + + If the Window is destroyed by another client, such as the window + manager, the original client may be blocked by DRI2 awaiting a vblank + event. When this happens, DRI2DrawableGone forgets to unblock that + client and so the wait never completes. + + Note Present/xshmfence is also suspectible to this race. + + Testcase: dri2-race/manager + Signed-off-by: Chris Wilson + Cc: Ville Syrjälä + Reviewed-by: Ville Syrjälä + +commit a722d617a092f08f69086630f5cfb598d4a21cc7 +Author: Adam Jackson +Date: Wed Dec 9 09:10:13 2015 -0500 + + autogen: Set a default subject prefix for patches + + Per discussion at XDC2015, we want this so we can easily distinguish + which module a patch is for. There's no way to set this in the + server-side config, so setting a default at autogen time is about the + best we can do. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 7bb64d8c1de9659f11da7917772919b071e9db82 +Author: Jan Burgmeier +Date: Thu Feb 4 14:06:43 2016 +0100 + + Fix XineramaQueryScreens for reverse prime + + Make sure we account for slave CRTCs when building the monitor list, + since that's what rrxinerama uses to fake Xinerama geometry. + + [ajax: Slightly more informative commit message.] + + Bugzilla: https://bugs.freedesktop.org/92313 + Reviewed-by: Dave Airlie + +commit 87d5534f701242d7c23aa20545a6292a0779c89c +Author: Rui Matos +Date: Wed Feb 3 16:14:09 2016 +0100 + + xwayland: Clear pending cursor frame callbacks on pointer enter + + The last cursor frame we commited before the pointer left one 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. + + Signed-off-by: Rui Matos + Reviewed-by: Bryce Harrington + Acked-by: Pekka Paalanen + Reviewed-by: Daniel Stone + Reviewed-by: Jonas Ådahl + +commit b7d392931a309d0fe754869efb456ccd0385f3aa +Author: Chris Wilson +Date: Wed Feb 3 09:54:43 2016 +0000 + + dri2: Only invalidate the immediate Window upon SetWindowPixmap + + All callers of SetWindowPixmap will themselves be traversing the Window + heirarchy updating the backing Pixmap of each child and so we can forgo + doing the identical traversal inside the DRI2SetWindowPixmap handler. + + Reported-by: Loïc Yhuel + Link: http://lists.x.org/archives/xorg-devel/2015-February/045638.html + Signed-off-by: Chris Wilson + Cc: Ville Syrjälä + Reviewed-by: Ville Syrjälä + +commit da69f2f15a9917c3ed04e305061683c41338126e +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:14 2015 -0200 + + ephyr: don't load ephyr input driver if -seat option is passed + + When used for single-GPU multi-seat purposes, there's no need to enable + ephyr virtual input devices, since Xephyr is supposed to handle its own + hardware devices. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 7213e99cbc38a60f0076bc2115b144798ea4c3ba +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:13 2015 -0200 + + ephyr: ignore Xorg multiseat command line options + + Multi-seat-capable display managers commonly pass command-line options + like "-novtswitch", "-sharevts", or "-layout seatXXXX" to Xorg server, + but Xephyr currently refuses to start if these options are passed to it, + which may break Xephyr-based single-GPU multiseat setups. + + [ajax: shortened summary] + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit edd443f69ea385a957b8eae0b066ad8e77fb947b +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:11 2015 -0200 + + kdrive: don't let evdev driver overwrite existing device names + + KDrive evdev driver deliberately name grabbed devices as "Evdev mouse" + or "Evdev keyboard". This patch will make it skip this step if grabbed + devices are already named (i.e. from udev). + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 0b80da0d18713df4712c05973388b6226bb0227f +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:07 2015 -0200 + + kdrive: set "evdev" driver for input devices automatically, if available. + + If kdrive input driver "evdev" is available, no other driver was + explicitly set for a given input device, and its kernel device node is + /dev/input/event*, this patch will make kdrive set "evdev" driver + automatically for such device. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 6d6fd688ecf95f2e84f2af276d681ff42f9d5610 +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:06 2015 -0200 + + kdrive: fix up NewInputDeviceRequest() implementation + + This patch simplifies NewInputDeviceRequest() implementation in + kinput.c, making use of improved KdParseKbdOptions() / + KdParsePointerOptions() and merging several "if (ki)"/"if (pi)" clauses. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 2c3e8768443caa66d78775ea79bb16a5faae3a3c +Author: Eric Anholt +Date: Wed Jan 27 11:26:16 2016 -0800 + + glamor: Flip around conditionals in RepeatNone fixups. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit e82c8c81df80de487aa795d69e874a0811c537ea +Author: Eric Anholt +Date: Wed Jan 27 11:21:05 2016 -0800 + + glamor: Cut down a bunch of conditional handling for RepeatFix. + + For hardware that doesn't do actual jumps for conditionals (i915, + current vc4 driver), this reduces the number of texture fetches + performed (assuming the driver isn't really smart about noticing that + the same sampler is used on each side of an if just with different + coordinates). + + No performance difference on i965 with x11perf -magpixwin100 (n=40). + Improves -magpixwin100 by 12.9174% +/- 0.405272% (n=5) on vc4. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 2c3273861cdf874b165ce5a1953102187f71b48e +Author: Eric Anholt +Date: Wed Jan 27 11:15:27 2016 -0800 + + glamor: Clarify how the repeat values being passed around work. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 990a8ee01324332ee9b4a4bb124ce8f73be24349 +Author: Eric Anholt +Date: Wed Jan 27 11:10:14 2016 -0800 + + glamor: Clean up formatting of RepeatFix shader code. + + All sorts of weird indentation, and some cuddled conditional + statements deep in the if tree. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 20cb5b2d65ce63ea7934b77f1520387550c778a8 +Author: Eric Anholt +Date: Wed Jan 27 10:24:17 2016 -0800 + + glamor: Clarify some logic in RepeatFix handling. + + wh ratios are != 1.0 only when large, so with that we can simplify + down how we end up with RepeatFix being used. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 07f0d90e4a8b05ef968b1ef47acda7c9f4580340 +Author: Eric Anholt +Date: Tue Jan 26 17:29:48 2016 -0800 + + glamor: Simplify the pixmap box looping. + + We had a double loop across h and w, and passed the current x and y + out to callers who then used w to multiply/add to an index. Instead, + just single loop across w * h. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 0dbce65b08f4812dcaa4b77cd37aebac334c47a2 +Author: Eric Anholt +Date: Tue Jan 26 15:56:27 2016 -0800 + + glamor: Reuse the glamor_program_alpha_* enums for Render. + + This is a step toward using glamor_program.c for Render acceleration. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 9b676786de32f06aedf9d4c9535c10fda247335a +Author: Eric Anholt +Date: Tue Jan 26 15:47:01 2016 -0800 + + glamor: Drop extra SHADER_IN type for no mask present. + + We can just hand in a constant mask and the driver will optimize away + the multiplication for us. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 03f34f85563c81e1655626e10f75fd7e21393c92 +Author: Eric Anholt +Date: Tue Jan 26 15:19:50 2016 -0800 + + glamor: Convert XV to using glamor_program.c. + + One less custom path! By following the common glamor_program.c use + pattern, we get the ability to handle large pixmaps as the + destination. It's also one less place where glamor_utils.h coordinate + transformation happens. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit f368a0ba3aa58e5260d839d11d2f3aef75feaeaf +Author: Eric Anholt +Date: Tue Jan 26 14:52:08 2016 -0800 + + glamor: Simplify XV vertex setup. + + We were clipping the drawn rectangle to each clip box, then expanding + the box to a big triangle to avoid tearing, then drawing each triangle + to the destination through a scissor. If we're using a scissor for + clipping, though, then we don't need to clip the drawn primitive on + the CPU in the first place. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 294e45b60d99cf7d11c657288bbe2670b56775f3 +Author: Eric Anholt +Date: Tue Jan 26 14:18:48 2016 -0800 + + glamor: Set up XV sampler uniforms once at program build time. + + No sense doing it on every draw. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 5d7bef2eedfd965359dd4eebb6ab806cdad5b83f +Author: Eric Anholt +Date: Tue Jan 26 13:39:18 2016 -0800 + + glamor: Drop dead glamor_pict_format_is_compatible(). + + This hasn't been used since 2f80c7791bb0b11f261cb1e3e0d89163dcdd0342 + (GLAMOR_SEPARATE_TEXTURE removal). + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 4494a450405cf539743cbcfe6907bf5bdd2d80cb +Author: Eric Anholt +Date: Tue Jan 26 15:08:17 2016 -0800 + + glamor: Drop comment about dead yInverted flag. + + Wait long enough, and you don't need to think about it at all. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit f7c24e6ac345aab91df5fc959f239a33f37113b1 +Author: Eric Anholt +Date: Tue Jan 26 13:34:00 2016 -0800 + + glamor: Rename the *y_inverted helpers to not say "inverted". + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 1fcb6f4cbf3d6514716435a0e79c0e6d53c31a3a +Author: Eric Anholt +Date: Tue Jan 26 13:31:59 2016 -0800 + + glamor: Drop dead *_from_x_coord_y() functions. + + They've been dead since the yInverted removal + (e310387f443b6333edf02c8980daa303505382b4). + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 9ef11f13af7f552dadb4a90c248e525a257e0a2c +Author: Eric Anholt +Date: Thu Jan 21 16:01:14 2016 -0800 + + glamor: Clarify when Render fallbacks happen due to an unsupported op. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit b8229cc5f5298a37a4735dd002b0e0ebfc8bc75a +Author: Eric Anholt +Date: Wed Jan 27 11:35:03 2016 -0800 + + glamor: Label programs before linking them. + + i965 does most of its compiling at link time, so our debug output for + its shaders didn't have the name on. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 68f236ebd4b268a9e525d623986999d230feb453 +Author: Eric Anholt +Date: Wed Jan 27 16:11:17 2016 -0800 + + ephyr: Make sure we have GLX_ARB_create_context before calling it. + + This should fix aborts()s from epoxy on old software stacks. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + Reviewed-by: Kenneth Graunke + +commit 623ff251dd025929f5bb6174ca86580c5e707261 +Author: Adam Jackson +Date: Tue Dec 8 17:41:38 2015 -0500 + + xephyr: Remove DRI1 + + This only worked if the backend server supported DRI1, which is + stunningly unlikely these days. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 953b71270cf12c59c8a836c9be403d07fb01fa22 +Author: Adam Jackson +Date: Tue Dec 8 17:41:37 2015 -0500 + + xfree86: Build parser for DRI config file subsection unconditionally + + This applies regardless of which DRI you're asking for. Worse, leaving + it out means breaking the config file syntax in a pointless way, since + non-DRI servers can safely just parse it and ignore it. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 1a48a5863e4bceee6b99c1feda1b2c584ff3657c +Author: Adam Jackson +Date: Tue Dec 8 17:41:36 2015 -0500 + + xfree86: Remove ancient DRI build instructions + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d8ecbe563991cc689e95a8cb9d510e920eaceea0 +Author: Dave Airlie +Date: Wed Jan 27 16:46:06 2016 -0800 + + ephyr: catch X errors if we try to create a core context and fail. + + This stops Xephyr failing on GLXBadFBConfig. + + Signed-off-by: Dave Airlie + Reviewed-by: Dave Airlie + +commit 50ca286d79f6304b972ea74487308e7794a170fb +Author: Timo Aaltonen +Date: Wed Jan 27 14:18:50 2016 +0200 + + dri2: Sync i915_pci_ids.h and i965_pci_ids.h from mesa + + Adds Skylake, Kabylake and Broxton allowing them to use + modesetting + glamor with dri2. + + Signed-off-by: Timo Aaltonen + Reviewed-by: Andreas Boll + +commit bf23db42a4e5943129501223a47b48884cdeb62f +Author: Adam Jackson +Date: Wed Jan 27 11:50:13 2016 -0500 + + modesetting: Require sufficiently new libdrm + + Bugzilla: https://bugs.freedesktop.org/93883 + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Reviewed-by: Julien Cristau + +commit 6978c8ee666a9224213173e7680e2d71b1094bab +Author: Dave Airlie +Date: Tue Jan 19 08:06:25 2016 +1000 + + xwayland: add support for use core profile for glamor. (v2) + + This adds support to Xwayland to try and use OpenGL core + profile for glamor first. + + v1.1: use version defines. + v2: let glamor work out core profile itself. + + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 79c3925532bc0d098c9a4da6d5117bdada56e0af +Author: Dave Airlie +Date: Tue Jan 19 07:59:59 2016 +1000 + + glamor: add core profile support to EGL glamor. (v2) + + v1.1: use version defines. + v2: let glamor work it out itself + + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 98c3504dcfcec227b9c7798a0bd287941cec0691 +Author: Keith Packard +Date: Wed Sep 10 19:05:08 2014 -0700 + + ephyr: Create 3.1 core profile context if possible (v3) + + On desktop GL, ask for a 3.1 core profile context if that's available, + otherwise create a generic context. + + v2: tell glamor the profile is a core one. + v2.1: add/use GL version defines + v3: let glamor work out core itself + + Signed-off-by: Keith Packard + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 564d9f0f8c17bb3c13aa3ca36da7825454dc5de3 +Author: Dave Airlie +Date: Mon Jan 11 14:00:35 2016 +1000 + + glamor: add core profile support. (v2) + + Glamor works out from the profile if it is + core. + + This flag is used to disable quads for rendering. + + v1.1: split long line + make whitespace conform (Michel) + v1.2: add GL 3.1 version defines + v2: move to having glamor work out the profile. + + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit e6754dcb59ee21abb42421a28f4e467295584f67 +Author: Keith Packard +Date: Wed Sep 10 19:02:55 2014 -0700 + + glamor: Use GL_RED instead of GL_ALPHA if we have texture_swizzle (v3) + + GL_RED is supported by core profiles while GL_ALPHA is not; use GL_RED + for one channel objects (depth 1 to 8), and then swizzle them into the + alpha channel when used as a mask. + + [airlied: updated to master, add swizzle to composited glyphs and xv paths] + + v2: consolidate setting swizzle into the texture creation code, it + should work fine there. Handle swizzle when setting color as well. + v3: Fix drawing to a8 with Render (changes by anholt, reviewed by airlied). + + Signed-off-by: Keith Packard + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 5042b0652b9fe5fed57a233880c3429ba390d86d +Author: Eric Anholt +Date: Wed Jan 20 12:33:25 2016 -0800 + + glamor: Drop duplicated GLAMOR_DEFAULT_PRECISIONs in render accel. + + We only need it once at the top of the shader, so just put it + there. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + +commit 1fd82c764d5b24107e60f2173e30e5d24a2f2667 +Author: Dave Airlie +Date: Tue Jan 19 02:01:09 2016 +0000 + + glamor: don't do copy if we have 0 boxes to copy. + + This happens if you run twm + mplayer + xclock and drag + the clock over the mplayer. If we don't catch it, we cause + an illegal draw elements command to be passed to GL. + + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit e7308b6c77561df44c04f81509f8ada678705d94 +Author: Dave Airlie +Date: Tue Jan 12 18:13:46 2016 +1000 + + glamor: Add support for CA rendering in a single pass. + + It's been on the list to add dual source blending support to avoid the + two pass componentAlpha code. Radeon has done this for a while in + EXA, so let's add support to bring glamor up to using it. + + This adds dual blend to both render and composite glyphs paths. + + Initial results show close to doubling of speed of x11perf -rgb10text. + + v2: Fix breakage of all of CA acceleration for systems without + GL_ARB_blend_func_extended. Add CA support for all the ops we + support in non-CA mode when blend_func_extended is present. Clean + up some comments and formatting. (changes by anholt) + + Signed-off-by: Dave Airlie + Signed-off-by: Eric Anholt + +commit cab14a9a08ff06bc4cbef79c7be8f1d07c07ebf9 +Author: Eric Anholt +Date: Thu Jan 21 12:01:02 2016 -0800 + + glamor: Drop the composite_with_copy path entirely. + + I originally inherited this from the EXA code, without determining + whether it was really needed. Regular composite should end up doing + the same thing, since it's all just shaders anyway. To the extent + that it doesn't, we should fix composite. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + +commit 510c8605641803f1f5b5d2de6d3bb422b148e0e7 +Author: Eric Anholt +Date: Thu Jan 21 11:30:15 2016 -0800 + + glamor: Fix copy-like Render operations between 15 and 16 depth. + + Reading and writing to 16-depth pixmaps using PICT_x1r5g5b5 ends up + failing, unless you're doing a straight copy at the same bpp where the + misinterpretation matches on both sides. + + Fixes rendercheck/blend/over and renderhceck/blend/src in piglit. + + Please cherry-pick this to active stable branches. + + Signed-off-by: Eric Anholt + Reviewed-by: Dave Airlie + +commit bc415fb1e0031ad23bda6e9c3f4664532876a0e5 +Author: Adam Jackson +Date: Wed Jan 20 15:43:10 2016 -0500 + + glx: Fix GLX_EXT_create_context_es2_profile support + + As of v4 of this extension, any GLES version number may be requested (to + enable GLES3 and later). To comply with this, simply remove the API + version checks and leave it to the DRI driver to validate. This happens + to also enable using GLES1 in direct contexts, so if that's the dire + situation you find yourself in, your client driver at least stands a + chance of working. + + v4 also specifies that both extension strings should be advertised for + compatibility with clients written against v1 of the extension spec, so + add the es_profile bit to the extension list and enable it whenever we + would enable es2_profile. + + Reviewed-by: Ilia Mirkin + Signed-off-by: Adam Jackson + +commit 49aa5e3ea4eecea0562c05a4e52962985a56e510 +Author: Keith Packard +Date: Wed Sep 10 16:17:52 2014 -0700 + + glamor: Use vertex array objects + + Core contexts require the use of vertex array objects, so switch both glamor + and ephyr/glamor over. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit d99204fb5e09ce7be36485d4226f7ad6d6eb24cc +Author: Dave Airlie +Date: Tue Jan 19 10:34:14 2016 +1000 + + glamor/xv: add vbo support (v2.1) + + This converts the Xv code to using VBOs instead of + client ptrs. This is necessary to move towards using + the core profile later. + + v2: put all boxes into single vbo, use draw arrays + to offset things. (Eric) + v2.1: brown paper bag with releasing vbo. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit 5582ad1b9b29934498cf3fef305d3a988130cd52 +Author: Dave Airlie +Date: Mon Jan 11 14:00:04 2016 +1000 + + glamor: use vbos in gradient/picture code. + + This converts two client arrays users to using vbos, + this is necessary to move to using core profile later. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit 25eca80265654cfbf8768024e027426fedeb0918 +Author: Michel Dänzer +Date: Fri Jan 15 18:22:21 2016 +0900 + + present: Handle wraparound when comparing MSC values + + When a window moves from one CRTC to another, present_window_to_crtc_msc + updates window_priv->msc_offset according to the delta between the + current MSC values of the old and new CRTC: + + window_priv->msc_offset += new_msc - old_msc; + + window_priv->msc_offset is initially 0, so if new_msc < old_msc, + window_priv->msc_offset wraps around and becomes a large number. If the + window_msc parameter passed in is small (in particular if it's 0, such as + is the case when the client just wants to know the current window MSC + value), the returned CRTC MSC value may still be a large number. In that + case, the existing MSC comparisons in pixmap_present weren't working as + intended, resulting in scheduling a wait far into the future when the + target MSC had actually already passed. This would result in the client + (e.g. the Chromium browser) hanging when moving its window between CRTCs. + + In order to fix this, introduce msc_is_(equal_or_)after helper functions + which take the wraparound into account for comparing two MSC values. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Reviewed-by: Martin Peres + Signed-off-by: Keith Packard + +commit 1db6de7b6a6ee240eb50a13fe1fa1e135d7cb93b +Author: Michel Dänzer +Date: Tue Jan 12 15:42:47 2016 +0900 + + glamor: Disable debugging messages other than GL API errors + + According to Nicolai Hähnle, the relevant specification says "All + messages are initially enabled unless their assigned severity is + DEBUG_SEVERITY_LOW", so we need to explicitly disable the messages we + don't want to get. Failing that, we were accidentally logging e.g. + shader stats intended for shader-db. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93659 + Tested-by: Laurent Carlier + Reviewed-by: Emil Velikov + Signed-off-by: Michel Dänzer + Reviewed-by: Eric Anholt + +commit 8116fd8a760b5935645def1b2c3b155c05927850 +Author: Dave Airlie +Date: Tue Jan 12 14:19:24 2016 +1000 + + glamor: store old fonts in double width textures. + + There is a problem with some fonts that the height necessary + to store the font is greater than the max texture size, which + causes a fallback to occur. We can avoid this by storing two + macro columns side-by-side in the texture and adjusting + the calculations to suit. + + This fixes + xfd -fn -*-*-*-*-*-*-*-*-*-*-*-*-*-* + falling back here, when it picks + -arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1 + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 64081d0eacf3e53a029b8e8b63096cc153e98549 +Author: Dave Airlie +Date: Mon Jan 11 17:02:57 2016 +1000 + + glamor: fallback if font is too large for FBO size. + + running xfontsel on haswell here, with a max texture size + of 8kx8k, one font wants 9711 height. This fallsback to + sw in this case. + + A proper solution probably involves using an array texture. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 6dcb73375e0ce389315d55587623eb84e9d13543 +Author: Adam Jackson +Date: Wed Jan 6 10:03:23 2016 -0500 + + os: Failure to remove a non-existent log file is not an error + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit 862cbf4c870c9ed913206c6ef4988bdb470e1c39 +Author: Thomas Klausner +Date: Wed Nov 11 13:32:05 2015 +0100 + + Fix build when XSERVER_PLATFORM_BUS is not defined. + + Reviewed-by: Adam Jackson + Signed-off-by: Thomas Klausner + +commit 63f83d1b7f496d05b409352749cdb6674d71cf80 +Author: Thomas Klausner +Date: Tue Jan 5 12:51:41 2016 -0500 + + Fix uninitialized variable warnings reported by clang + + v2: Move initializing pos into the first clause of the for statement. We + have to keep this macro equivalent to a plain for statement from the + user's perspective, otherwise callers need to {} things to keep control + flow correct. [ajax] + + Signed-off-by: Thomas Klausner + Acked-by: Michel Dänzer + +commit ba71b69f94f00a6f6910597185610668e79c10be +Author: Alan Coopersmith +Date: Fri Jan 1 17:34:41 2016 -0800 + + Avoid segfault in CloseWellKnownConnections when using -displayfd + + When -displayfd is looping through the possible display ids to use, + if it can't open all the listening sockets for one (say when :0 is + already in use), it calls CloseWellKnownConnections to close all + the ListenTransConns entries before the point that ListenTransFds + was allocated & initialized, so CloseWellKnownConnections would + segfault trying to read entries from a NULL ListenTransFds pointer. + + Introduced by commit 7b02f0b8 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit edcb6426f20c3be5dd5f50b76a686754aef2f64e +Author: Alan Coopersmith +Date: Fri Jan 1 18:11:14 2016 -0800 + + Use unique logfile names when starting server with -displayfd + + Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93212 + + Previously all X servers started with -displayfd would overwrite + Xorg.0.log - now a temporary name of Xorg.pid-.log is used + until after -displayfd finds an open display - then it is renamed + to the traditional Xorg..log name. + + Reviewed-by: Adam Jackson + Signed-off-by: Alan Coopersmith + +commit fe8562f5316d8c74ca074ad145295c65ddff5fc2 +Author: Alan Coopersmith +Date: Fri Jan 1 18:10:08 2016 -0800 + + modesetting should not reference gbm when it's not defined + + Fixes build errors of: + present.c: In function 'ms_do_pageflip': + present.c:410:17: error: 'drmmode_bo' has no member named 'gbm' + new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front); + ^ + present.c:412:22: error: 'drmmode_bo' has no member named 'gbm' + if (!new_front_bo.gbm) { + ^ + present.c: In function 'ms_present_check_flip': + present.c:536:36: error: 'drmmode_bo' has no member named 'gbm' + if (drmmode_crtc->rotate_bo.gbm) + ^ + Introduced by commit 13c7d53d + + Reviewed-by: Adam Jackson + Signed-off-by: Alan Coopersmith + +commit 792176417f7e62a99c4f07801f74f804d6080de2 +Author: Adam Jackson +Date: Tue Jan 5 12:03:54 2016 -0500 + + Revert "Fix uninitialized variable warnings reported by clang" + + Crashes at startup: + + dmt:~/git/xserver% ./hw/kdrive/ephyr/Xephyr :1 + (EE) Backtrace: + (EE) 0: ./hw/kdrive/ephyr/Xephyr (OsSigHandler+0x29) [0x47c8f9] + (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f38d4de6b1f] + (EE) 2: ./hw/kdrive/ephyr/Xephyr (InitNotifyFds+0x17) [0x478697] + (EE) 3: ./hw/kdrive/ephyr/Xephyr (OsInit+0x1e) [0x47c99e] + (EE) 4: ./hw/kdrive/ephyr/Xephyr (dix_main+0x11c) [0x446efc] + (EE) 5: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f38d4dd2580] + (EE) 6: ./hw/kdrive/ephyr/Xephyr (_start+0x29) [0x427099] + (EE) 7: ? (?+0x29) [0x29] + (EE) + (EE) Segmentation fault at address 0x0 + + This reverts commit a221d4737c167589da44595c795d54f2c36b439a. + +commit a221d4737c167589da44595c795d54f2c36b439a +Author: Thomas Klausner +Date: Wed Dec 16 08:36:24 2015 +0100 + + Fix uninitialized variable warnings reported by clang + + Signed-off-by: Thomas Klausner + Acked-by: Michel Dänzer + +commit f3593918a0507cc080875788b2776ebe4f57c694 +Author: Peter Hutterer +Date: Wed Dec 16 09:21:39 2015 +1000 + + xfree86: move check for driver->PreInit up + + No real change, but if the driver is broken and doesn't provide a PreInit + function, then we don't need to worry about logind. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit fc4fbe8224fdc8d7774120b6e978c652a70a50ee +Author: Peter Hutterer +Date: Fri Dec 11 09:31:30 2015 +1000 + + xfree86: add NoMatchFoo directives for InputClass sections + + InputClass sections use various MatchFoo directives to decide which device to + apply to. This usually works fine for specific snippets but has drawbacks for + snippets that apply more generally to a multitude of devices. + + This patch adds a NoMatchFoo directive to negate a match, thus allowing + snippets that only apply if a given condition is not set. Specifically, this + allows for more flexible fallback driver matching, it is now possible to use a + snippet that says "assign driver foo, but only if driver bar wasn't already + assigned to it". For example: + + Section "InputClass" + Identifier "libinput for tablets" + MatchIsTablet "true" + NoMatchDriver "wacom" + Driver "libinput" + EndSection + + The above only assigns libinput to tablet devices if wacom isn't already + assigned to this device, making it possible to select a specific driver by + installing/uninstalling it. + + Signed-off-by: Peter Hutterer + Reviewed-by: Benjamin Tissoires + +commit eb671b804e902011ba901d0833a215799177bad0 +Author: Peter Hutterer +Date: Fri Dec 11 07:26:02 2015 +1000 + + xfree86: whitespace fix + + Signed-off-by: Peter Hutterer + +commit 3d68d1f26709ecb5ce22a9baa0d3d8162574ed6a +Author: Siim Põder +Date: Mon Jun 8 22:14:12 2015 +0000 + + vfb: add randr support (v2) + + The motivation for getting this is chrome remote desktop that runs under + Xvfb and wants to use RANDR to adjust screen size according to the + remote desktop client screen size. Apparently there are other use cases + as well, the bug mentions gnome-settings-daemon testing. + + [ajax: massaged commit message] + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=26391 + Reviewed-by: Adam Jackson + Signed-off-by: Lambros Lambrou + Signed-off-by: Mike Frysinger + Signed-off-by: Michal Srb + Signed-off-by: Siim Põder + +commit e98b36bc69d805ab52aba95b070a614427d46e05 +Author: Adam Jackson +Date: Tue Dec 8 16:22:16 2015 -0500 + + randr: Silence unused variable warning + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 8c49c883dc196ea57e3f64425c2a5b0a8ce3ba75 +Author: Adam Jackson +Date: Tue Dec 8 15:08:34 2015 -0500 + + sync: Don't allow creating a system counter before sync is initialized + + It probably doesn't work very well since there's other extension setup + we're not doing on this path, and in any event it's not a thing that + happens currently. + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit b5f04a79df8b5aab8b558461261d14721f0b3e41 +Author: Adam Jackson +Date: Tue Dec 8 15:56:17 2015 -0500 + + glxproxy: Silence shadowed-variable warnings + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit 18729a211a5fdd4f733e44eded754a0e6210b687 +Author: Adam Jackson +Date: Tue Dec 8 15:53:35 2015 -0500 + + glxproxy: Silence set-but-unused-variable warnings + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit bc996fa4e3c06f65eafe0a88ef491dbf01f31422 +Author: Adam Jackson +Date: Tue Dec 8 16:04:44 2015 -0500 + + dmx: Run 'doxygen -u' to upgrade the doxygen config file + + Also change the dot font setting back to the default of Helvetica as + doxygen no longer ships FreeSans. + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit a55e0bc56fd8f9da8f066dc344af19535dd092ca +Author: Adam Jackson +Date: Tue Dec 8 16:00:19 2015 -0500 + + dmx: Silence unused variable warning in dmxcompat + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit 2730ccb803c55af74dbdd1bfd982fc23e643554d +Author: Adam Jackson +Date: Tue Dec 8 15:37:12 2015 -0500 + + dmx: Silence lex/yacc-related config parser warnings + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit 718223d27452862eedcf1bee6278eae6040d45ea +Author: Laércio de Sousa +Date: Thu Dec 3 08:05:59 2015 -0200 + + systemd-logind.c: don't parse VT settings for non-seat0 X servers + + Since non-seat0 X servers no longer touch VTs, I believe these settings + are unnecessary. + + Signed-off-by: Laércio de Sousa + Reviewed-by: Hans de Goede + +commit 7c0ba32ddd5f1d5c65279365fa307dec3433caf3 +Author: Bob Ham +Date: Fri Dec 4 12:30:47 2015 +0000 + + xserver: Fix configure.ac check for libsystemd/-daemon + + The configure script looks for the libsystemd-daemon pkg-config + module. If the configure script finds it, the script will add + libsystemd-daemon to a list of modules which are used to consolidate + CFLAGS and LIBS. + + The check for libsystemd-daemon was altered to fallback to libsystemd + if libsystemd-daemon was not found (libsystemd-daemon was brought into + libsystemd). Unfortunately, the configure script still adds + "libsystemd-daemon" to the list of modules to consolidate, instead of + "libsystemd". With this patch, we set a variable depending on which + pkg-config module is found and add that to the module list instead. + + Changes since v1: + - Rearranged logic so that we do a versioned check for libsystemd + first, then look for libsystemd-daemon. + - Cleaned up the check a bit, only performing the module checks if we + don't have --with-systemd-daemon=no, in a similar style to + --with-dtrace. + - Changed the variable name to LIBSYSTEMD_DAEMON as per feedback. + + Reviewed-by: Adam Jackson + Signed-off-by: Bob Ham + +commit 530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4 +Author: Michel Dänzer +Date: Thu Dec 3 17:04:09 2015 +0900 + + prime: Damage full destination rectangle when we start dirty tracking + + This makes sure that the destination pixmap contents will be fully + initialized. Without this, a PRIME output starts out with garbage. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 2a52c06e235bd79f91851121f53f7c1808fde321 +Author: Adam Jackson +Date: Mon Dec 7 17:03:02 2015 -0500 + + x86emu: Squash a warning + + Apologies, should have caught this one when applying the previous x86emu + patch. + + Signed-off-by: Adam Jackson + +commit 59b618227ebd024e57720aaaea17596953f5b80e +Author: Julian Pidancet +Date: Sun Jul 1 18:49:25 2012 +0100 + + x86emu: Correctly handle 0x66 prefix for some instructions + + (Sorry for double posting) + + I repost this patch because I havn't got any replies from maintainers + since I posted the initial patch back in March. + + Some instructions are not emulated correctly by x86emu when they + are prefixed by the 0x66 opcode. + I've identified problems in the emulation of these intructions: ret, + enter, leave, iret and some forms of call. + + Most of the time, the problem is that these instructions should push or + pop 32-bit values to/from the stack, instead of 16bit, when they are + prefixed by the 0x66 special opcode. + + The SeaBIOS project aims to produce a complete legacy BIOS + implementation as well as a VGA option ROM, entirely written in C and + using the GCC compiler. + + In 16bit code produced by the GCC compiler, the 0x66 prefix is used + almost everywhere. This patch is necessary to allow the SeaBIOS VGA + option ROM to function with Xorg when using the vesa driver. + + SeaBIOS currently use postprocessing on the ROM assembly output to + replace the affected instruction with alternative unaffected instructions. + This is obviously not very elegant, and this fix in x86emu would be + more appropriate. + + v2: - Decrement BP instead of EBP in accordance with the Intel Manual + - Assign EIP instead of IP when poping the return address from the + stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret + - When poping EFLAGS from the stack in iret in 32-bit operand size + mode, apply some mask to preserve Read-only flags. + + v3: - Rebase + + Reviewed-by: Adam Jackson + Signed-off-by: Julian Pidancet + +commit 72f0724cdc65dc9abbbf70b9feb6cce7c2b9f8a0 +Author: Chris Wilson +Date: Sun Feb 8 09:47:42 2015 +0000 + + present: Do not replace Pixmaps on redirected Window on unflip + + When unflipping, we may find that our flip window has been redirected. + If we replace the redirected Window with the Screen Pixmap we then have + mutliple fullscreen Windows believing that their own the Screen Pixmap - + multiple fullscreen Windows that are being flipped by Clients, and so + continue to flip causing popping between e.g. the compositor and the + game. + + [ajax: Fix up present_execute() hunk to account for changes introduced + in fe07ec19e212a68076560d243a2a935c54589068] + + Signed-off-by: Chris Wilson + Reviewed-by: Michel Dänzer + +commit 180b09912c0d2c4a43b5a08678bcad4b818924c7 +Author: Chris Wilson +Date: Sun Feb 8 09:47:41 2015 +0000 + + present: When cancelling a pending synchronous flip, requeue it + + The vblank event request for a synchronous flip is scheduled for the + vblank before the target flip msc (so that the flip itself appears at + the right frame). If we cancel that flip and so wish to schedule a + copy instead, that copy needs to be postponed by a frame in order for it + be performed at the requested time. + + Signed-off-by: Chris Wilson + Reviewed-by: Michel Dänzer + +commit b2d55338f6b8f43ebcb49994abad123a797248cf +Author: Chris Wilson +Date: Sun Feb 8 09:47:40 2015 +0000 + + present: Requery pending flips with the right sync_flip mode + + When verifying whether a pending flip is still valid, we need to pass + down the orignal sync_flip mode (e.g. if the driver only supports sync + flips, verifying a async flip will falsely fail). + + Signed-off-by: Chris Wilson + Reviewed-by: Michel Dänzer + +commit 548a3d5fd69bb059bbaf26ededdc94c212712cd7 +Author: Dave Airlie +Date: Mon Nov 16 09:05:27 2015 +1000 + + modesetting: create entities for pci and old probe. (v2) + + This moves the code from the platform case into + a common function, and calls that from the + other two. + + v2: Emil convinced me we don't need to lookup pEnt + here, so let's not bother. + + Reported-by: Mark Kettenis + Reviewed-by: Mark Kettenis + Signed-off-by: Dave Airlie + +commit 771016f0705909c908917b4ccaeafc950ba93c05 +Author: Dave Airlie +Date: Mon Nov 16 09:05:26 2015 +1000 + + modesetting: drop platform_dev pointer. + + This isn't used anywhere, so no point storing it until we need it. + + Reviewed-by: Mark Kettenis + Signed-off-by: Dave Airlie + +commit 19b0249a5e07b9fc008e5d8709d7e489874415de +Author: Arkadiusz Miśkiewicz +Date: Mon Nov 16 11:06:57 2015 +0100 + + Xorg.wrap: activate libdrm based detection for KMS drivers + + Xorg.wrap includes code guarded with WITH_LIBDRM for detecting KMS drivers. + Unfortunately it is never activated since code missed to include file + which defines WITH_LIBDRM. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92894 + Signed-off-by: Arkadiusz Miśkiewicz + Reviewed-by: Michel Dänzer + Signed-off-by: Hans de Goede + +commit 5bccde749db93296b7784e4cdc5e54c4443656c1 +Author: Michel Dänzer +Date: Wed Dec 2 18:21:12 2015 +0900 + + randr: Stop dirty tracking for shared pixmap being destroyed + + Otherwise, we leave a dangling reference to the destroyed pixmap in the + master screen's pixmap_dirty_list. + + Fixes regression from commit cf5d6414 ("randr: Factor out shared pixmap + destruction"). + + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 2e3d9623ae3f562f81e513cb183ca1b1b68f279c +Author: Adam Jackson +Date: Wed Dec 2 10:42:36 2015 -0500 + + Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups" + + Reported to break libinput: + + http://lists.freedesktop.org/archives/xorg-devel/2015-December/048091.html + + This reverts commit 1df07dc36ca145c59f51176d9ab2651112506d75. + +commit 7b02f0b87ec2fa0cc5a65307a1fd55c671cec884 +Author: Keith Packard +Date: Wed Nov 11 22:02:17 2015 -0800 + + os: Use NotifyFd interface for listen descriptors + + Replace the custom path for dealing with new incoming connections with + the general-purpose NotifyFd API. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 1df07dc36ca145c59f51176d9ab2651112506d75 +Author: Keith Packard +Date: Wed Nov 11 22:02:16 2015 -0800 + + hw/xfree86: Use NotifyFd for device and other input fd wakeups + + Remove code in xf86Wakeup for dealing with device and other input and + switch to using the new NotifyFd interface. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e51ea53b26bd9ec05b9209825960af28d0b6bbe1 +Author: Keith Packard +Date: Wed Nov 11 22:02:15 2015 -0800 + + render: Use OsTimer for animated cursor timing + + This replaces the block/wakeup handlers with an OsTimer. This also + avoids problems with performing rendering during the wakeup handler. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 49c0f2413d32fdfe36e45861fcb32aaeab633094 +Author: Keith Packard +Date: Wed Nov 11 22:02:14 2015 -0800 + + os/xdmcp: Replace xdmcp block/wakeup handlers with timer and NotifyFd + + This removes the block and wakeup handlers and replaces them with a + combination of a NotifyFd callback and timers. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 6a121f55381ecbb9cdaaef36ba6135890f3e006f +Author: Keith Packard +Date: Wed Nov 11 22:02:13 2015 -0800 + + Xext/xselinux: Use NotifyFd interface + + Replace block/wakeup handlers with SetNotifyFd. Much nicer now. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit f933a1b38ed1c65cc39fce1ee37aa18e3022c3f0 +Author: Keith Packard +Date: Mon Nov 23 17:36:53 2015 -0800 + + hw/xwayland: Use NotifyFd handler to monitor wayland socket + + Replace the block/wakeup handler with a NotifyFd callback instead. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8543d4d8bc0526d1c910913b76259e5dee108e74 +Author: Keith Packard +Date: Wed Nov 11 22:02:11 2015 -0800 + + modesetting: Use NotifyFd for drm event monitoring + + Replace the block/wakeup handlers with a NotifyFd callback. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 58354fcf472cefc35b9c19cf84bf079cadfa2e1d +Author: Keith Packard +Date: Wed Nov 11 22:02:10 2015 -0800 + + kdrive/ephyr: Use NotifyFd for XCB connection input [v2] + + Eliminates polling every 20ms for device input. + + v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be + used directly for SetNotifyFd. Thanks to Daniel Martin + + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + Cc: Daniel Martin + +commit 483c2a1adf044ba1da844687b908c1c802060d2d +Author: Keith Packard +Date: Wed Nov 11 22:02:09 2015 -0800 + + hw/kdrive: Use NotifyFd for kdrive input devices + + This switches the kdrive code to use FD notification for input + devices, rather than the block and wakeup handlers. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 21c1680e83865a52d88cf8c80fb236d212931e5c +Author: Keith Packard +Date: Wed Nov 11 22:02:08 2015 -0800 + + hw/kdrive: Use NotifyFd interface for kdrive/linux APM monitoring + + Replace the block/wakeup handlers with a NotifyFd callback + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8c8f3567fe4b4e372e22420810443c43e008da2c +Author: Keith Packard +Date: Wed Nov 11 22:02:07 2015 -0800 + + config: Use NotifyFd interface for udev + + This uses the NotifyFd interface to monitor the udev file descriptor + rather than adding another block/wakeup handler + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit bf920b2390dc27947f87dd0b228518290a5ed85d +Author: Keith Packard +Date: Wed Nov 11 22:02:06 2015 -0800 + + config: Use NotifyFd for dbus interface + + This uses the NotifyFd interface to monitor the dbus socket rather + than a block/wakeup handler. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 91ea0965dd4dfeba0a914c47ad4a64768e983b1b +Author: Keith Packard +Date: Wed Nov 11 22:02:04 2015 -0800 + + dix: Move InitFonts up above screen initialization + + Font initialization was split into two stages, the first was to set up + font privates with a call to ResetFontPrivateIndex, then much later + the call to InitFonts to set up all of the FPEs. Doing the full font + initialization before initializing the video drivers means that we can + move the call to ResetFontPrivateIndex inside InitFonts. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 4020aacd1fc5b9c63369f011aeb9120af9c55218 +Author: Keith Packard +Date: Wed Nov 11 22:02:03 2015 -0800 + + os: Implement support for NotifyFd X_NOTIFY_WRITE + + This adds the ability to be notified when a file descriptor is + available for writing. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 0c41b7af4ab0c8d22b88f201293f59524d1e7317 +Author: Keith Packard +Date: Wed Nov 11 22:02:02 2015 -0800 + + os: Add NotifyFd interfaces + + This provides a callback-based interface to monitor file + descriptors beyond the usual client and device interfaces. + + Modules within the server using file descriptors for reading and/or + writing can call + + Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); + + mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE. + + When 'fd' becomes readable or writable, the notify_fd function will be + called with the 'fd', the ready conditions and 'data' values as arguments, + + When the module no longer needs to monitor the fd, it will call + + void RemoveNotifyFd(int fd); + + RemoveNotifyFd may be called from the notify function. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e10ba9e4b52269b2ac75c4802dce4ca47d169657 +Author: Keith Packard +Date: Wed Nov 11 22:02:01 2015 -0800 + + Remove non-smart scheduler. Don't require setitimer. + + This allows the server to call GetTimeInMillis() after each request is + processed to avoid needing setitimer. -dumbSched now turns off the + setitimer. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c7f4aef8f45e500c900d59f68c653477148907ea +Author: agoins +Date: Wed Nov 25 18:39:31 2015 -0800 + + randr: Cleanup rrSetupPixmapSharing() + + protopix is completely redundant with mscreenpix. Get rid of it. + + We don't need rrScrPriv, so remove it. + + [ajax: also squash an unused variable in RRCrtcDetachScanoutPixmap, + though it'll come back when the rest of this series lands] + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit 8d3f0e964e399dcfa8eb5e85d405217fdc5dbcd4 +Author: agoins +Date: Wed Nov 25 18:39:27 2015 -0800 + + xf86: Bump ABI version to 21 + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit 7006b4e7ff759c899d5391b7d12db889cbc0b535 +Author: agoins +Date: Wed Nov 25 18:39:26 2015 -0800 + + randr: Factor out shared pixmap creation + + The old version of rrCreateSharedPixmap(), in addition to actually creating + a shared pixmap with scanout, also set up pixmap tracking on the source + driver. + + I will be needing to create multiple shared pixmaps for PRIME double + buffering, so factor the part that does shared pixmap creation into its own + function, the new rrCreateSharedPixmap(). Rename the old + rrCreateSharedPixmap() to rrSetupPixmapSharing(), a function that + replicates the old functionality of rrCreateSharedPixmap() using the new + rrCreateSharedPixmap(). + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit cf5d6414e0c21140f763d618bde1e91ad2b1cb49 +Author: agoins +Date: Wed Nov 25 18:39:25 2015 -0800 + + randr: Factor out shared pixmap destruction + + Shared pixmap destruction is done by unrefing the master pixmap twice: once + for the original reference, and once for the reference implicitly added by + PixmapShareToSlave. Then, unrefing the slave pixmap once. + + When I add PRIME double buffering and synchronization, I will need to do + this in multiple places. To avoid duplication of code and comments + explaining it everywhere, factor it out into its own function and use that + in place of where it was before. + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit ab9837cc6a11f46b9df780f131b69de3822c3dd9 +Author: Olivier Fourdan +Date: Tue Dec 1 17:16:03 2015 +0100 + + xwayland: Update screen size on output removal + + When unplugging an output, it's still listed in xrandr and the size + of the root window still includes the removed output. + + The RR output should be destroyed when its Wayland counterpart is + destroyed and the screen dimensions must be updated in both the done + and the destroy handlers. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92914 + Signed-off-by: Olivier Fourdan + Reviewed-by: Marek Chalupa + +commit 07941a50a547f2ca094e242588298695f48903ed +Author: Jonas Ådahl +Date: Wed Oct 7 12:01:53 2015 +0800 + + xwayland: Always update the wl_pointer cursor on pointer focus + + In Wayland, a client (in this case XWayland) should set the cursor + surface when it receives pointer focus. Not doing this will leave the + curser at whatever it was previously. + + When running on XWayland, the X server will not be the entity that + controls what actual pointer cursor is displayed, and it wont be notified + about the pointer cursor changes done by the Wayland compositor. This + causes X11 clients running via XWayland to end up with incorrect pointer + cursors because the X server believes that, if the cursor was previously + set to the cursor C, if we receive Wayland pointer focus over window W + which also has the pointer cursor C, we do not need to update it. This + will cause us to end up with the wrong cursor if cursor C was not the + same one that was already set by the Wayland compositor. + + This patch works around this by, when receiving pointer focus, getting + the private mipointer struct changing the "current sprite" pointer to + an invalid cursor in order to trigger the update path next time a cursor + is displayed by dix. + + Reviewed-by: Adam Jackson + Signed-off-by: Jonas Ådahl + +commit 51a4399b94f9adfac5f7718d4cbf73f793dcca56 +Author: Olivier Fourdan +Date: Mon Nov 23 08:51:48 2015 +0100 + + xwayland: Do not set root clip when rootless + + Otherwise the server may try to draw onto the root window when closing + down, but when running rootless the root window has no storage thus + causing a memory corruption. + + Thanks to Adam Jackson for helping tracking this down! + + Reviewed-by: Adam Jackson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93045 + Signed-off-by: Olivier Fourdan + Tested-by: Marek Chalupa + +commit 5b2ca3413203210d112a08a4e20d14382abae437 +Author: Marek Chalupa +Date: Fri Nov 27 14:27:46 2015 +0100 + + xwayland: check if creating xwl_output succeeded + + check return values of RR.*Create calls + + v2. do not bail out if we don't have any output + + Signed-off-by: Marek Chalupa + Reviewed-by: Olivier Fourdan + +commit 646ebea456b4c5251ae997eab8d9b971f97de836 +Author: Marek Chalupa +Date: Fri Nov 27 14:59:27 2015 +0100 + + xwayland: fix memory leaks on error paths in xwl_realize_window + + don't leak memory when realizing window fails + + v2. take care of all memory allocation and return values, + not just one leak + + Signed-off-by: Marek Chalupa + Reviewed-by: Olivier Fourdan + +commit e6b106715f24112d1dc7a84c6e37df4b5debb2d0 +Author: Richard PALO +Date: Tue Nov 17 07:02:07 2015 +0100 + + Replace 'sun' with '__sun' + + Globally replace #ifdef and #if defined usage of 'sun' with '__sun' + such that strict ISO compiler modes such as -ansi or -std=c99 can be used. + + Signed-off-by: Richard PALO + Reviewed-by: Alan Coopersmith + +commit 44d0fd435a4eaf45e252b4f00409152a6d599dfc +Author: Egbert Eich +Date: Tue Nov 24 17:37:36 2015 +0100 + + kdrive/UnregisterFd: Fix off by one + + The number of FDs has been decremented already, therefore the + number contained the index of the top one that is to me moved down. + + This problem was introduced by: + commit 1110b71e360195aab040d835b54540ab558638c5 + Author: Chris Clayton + + kdrive: fix build error on gcc 4.8 for out-of-bounds array access + + The reason for the warning was likely a confused compiler. + Hoping to reduce the confusion by moving the decrement behind the end + if the copy loop. + + Signed-off-by: Egbert Eich + Reviewed-by: Peter Hutterer + +commit eb36924ead40564325aa56d54a973dc8fb4eae83 +Author: Adam Jackson +Date: Tue Nov 24 08:31:21 2015 -0500 + + dix: Remove redundant ChangeWindowProperty + + Use dixChangeWindowProperty(serverClient, ...) instead. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 4affa75a90d2455c81087b930126ad7adfd019f0 +Author: Adam Jackson +Date: Thu Nov 19 12:21:08 2015 -0500 + + xnest: Fix needless build dependency on xcb-util-keysyms + + This was added in: + + commit 43014795087a0a8774dd9687f5967329b15f06a2 + Author: Olivier Fourdan + Date: Mon Jan 5 16:44:22 2015 +0100 + + Synchronize capslock in Xnest and Xephyr + + Which is fine if you're building both, but if you don't happen to have + xcb-util-keysyms' headers installed Xnest will configure as enabled but + fail to build. + + Fortunately has a corresponding #define, so use that instead. + + Signed-off-by: Adam Jackson + Reviewed-by: Olivier Fourdan + +commit fee0827a9a695600765f3d04376fc9babe497401 +Author: Daniel Stone +Date: Fri Nov 20 15:37:31 2015 +0000 + + XWayland: Use FocusIn events for keyboard enter + + wl_keyboard::enter is the equivalent of FocusIn + KeymapNotify: it + notifies us that the surface/window has now received the focus, and + provides us a set of keys which are currently down. + + We should use these keys to update the current state, but not to send + any events to clients. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 816015648ffe660ddaa0f7d4d192e555b723c372 +Author: Daniel Stone +Date: Fri Nov 20 15:37:30 2015 +0000 + + Input: Add focus-in event source + + Add a new event source type for keypress events synthesised from focus + notifications (e.g. KeymapNotify from the parent server, when running + nested). This is used to keep the keys-down array in sync with the host + server's, without sending actual keypress events to clients. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c3788394e9190130a8eed44c5c93eeb93c2a9893 +Author: Daniel Stone +Date: Fri Nov 20 15:37:29 2015 +0000 + + Input: Add DeviceEventSource enum + + Add a flag to DeviceEvents, giving the source of the event. Currently + this only supports a 'normal' flag, but will be used later to add a + 'focus-in' flag, noting events synthesised from key/button arrays on + focus-in notifications. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 2e61901e46d28ce2f436219ad1a495aa0dcd0fba +Author: Daniel Stone +Date: Fri Nov 20 15:37:28 2015 +0000 + + XKB: Split filter execution into a separate function + + Move the giant state machine which maps from a key action to actually + running the filters into a separate function, to be used when adding + KeyFocusIn. + + Signed-off-by: Daniel Stone + Tested-by: Giulio Camuffo + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 71ba82690158f46d50a455e69a83ee0d685bb274 +Author: Peter Hutterer +Date: Mon Nov 23 07:59:24 2015 +1000 + + xfree86: fix minor memory leak + + xf86*StrOption returns a strdup + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 51984dddfcc7133ed3c1f20d03514aa98c9a7831 +Author: Eric Anholt +Date: Thu Jun 18 11:14:41 2015 -0700 + + glamor: Delay making pixmaps shareable until we need to. + + If a pixmap isn't getting exported as a dmabuf, then we don't need to + make an EGLImage/GBM bo for it. This should reduce normal pixmap + allocation overhead, and also lets the driver choose non-scanout + formats which may be much higher performance. + + On Raspberry Pi, where scanout isn't usable as a texture source, this + improves x11perf -copypixwin100 from about 4300/sec to 5780/sec under + xcompmgr -a, because we no longer need to upload our x11perf window to + a tiled temporary in order to render it to the screen. + + v2: Just use pixmap->usage_hint instead of a new field. Drop the + changes that started storing gbm_bos in the pixmap priv due to + lifetime issues. + v3: Fix a missing gbm_bo_destroy() on the pixmap-from-fd success path. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 7cd495a88807698b4ebaf9c1fb3db6edf31dd7e6 +Author: Eric Anholt +Date: Thu Oct 15 13:25:12 2015 -0700 + + glamor: Make glamor_get_name_from_bo static. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 6be33fd044949330e0b2b4185882c9664d2f90b4 +Author: Eric Anholt +Date: Thu Jun 18 11:26:46 2015 -0700 + + glamor: Simplify DRI3 pixmap-from-fd, using GBM. + + This GBM import path was introduced in 10.2, which we already require. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 1b8f16d8e659fb483453e1123a9fa876adb758ff +Author: Eric Anholt +Date: Thu Jun 18 11:21:10 2015 -0700 + + glamor: Use real types for glamor_egl's public gbm functions. + + I think void * was just used to avoid needing to #include gbm.h, but + we can just forward-declare the structs and be fine. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit f80758f32a7b922baf8fbf3ac6d8c9aae5fea1c4 +Author: Eric Anholt +Date: Thu Jun 18 11:15:40 2015 -0700 + + glamor: Use the GBM function for getting an FD from a GBM BO. + + We were rolling ioctl calls ourselves, when there's a nice interface + for it. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit ff2850424c99652506d0d6bc43506b4c16bf2ad5 +Author: Eric Anholt +Date: Sun Oct 18 19:26:14 2015 -0700 + + glamor: Hook up EGL DestroyPixmap through the normal wrap chain. + + One less layering violation (EGL should call glamor, if anything, not + the other way around). + + v2: Move glamor.c's DestroyPixmap wrapping up above the + glamor_egl_screen_init() call, since glamor.c's DestroyPixmap + needs to be the bottom of the stack (it calls fb directly and + doesn't wrap). Caught by Michel. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit e91fd30049ba9ebfb6ee8aded74eebe006af3f57 +Author: Eric Anholt +Date: Sun Oct 18 21:34:45 2015 -0700 + + glamor: Unexport glamor_destroy_textured_pixmap(). + + This is just a bit of the DestroyPixmap chain. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 3dd202933fd94615aeeaec7e4cfd05a68954a3f3 +Author: Eric Anholt +Date: Sun Oct 18 21:28:19 2015 -0700 + + glamor: Remove glamor_egl_destroy_textured_pixmap(). + + The DestroyPixmap chain and CloseScreen chain all do pixmap teardown + already, and calling it manually would be redundant. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 9d2b76652f0bca5680b9e3ae2aacd508d5525684 +Author: Eric Anholt +Date: Fri Jun 19 15:56:13 2015 -0700 + + modesetting: No need to free the EGLImage just before freeing the pixmap. + + DestroyPixmap handles that just fine. This also lets us drop our use + of the manual image destruction function (Note that the radeon driver + still uses it in a similar fashion, though). + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 98a1993536add730b7ec29a9e37f62b1cd70ad31 +Author: Eric Anholt +Date: Sun Oct 18 19:16:20 2015 -0700 + + glamor: No need to glFlush before destroying a pixmap. + + I assume this was a workaround for an old, broken, closed driver. The + driver doesn't get to throw away rendering just because the rendering + context's shared-across-processes render target is getting freed from + the local address space. If the rendering isn't to a shared render + target, then we *do* want to throw away the rendering to it. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 9a5972801f7789833062e5711e77483b643eef92 +Author: Eric Anholt +Date: Thu Nov 5 16:35:56 2015 -0800 + + glamor: Fix segfault in fallback picture uploading. + + If the source/mask pixmap is a pixmap that doesn't have an FBO + attached, and it doesn't match the Render operation's size, then we'll + composite it to a CPU temporary (not sure why). We would take the + PictFormatShort from the source Picture, make a pixmap of that depth, + and try to look up the PictFormat description from the depth and the + PictFormatShort. However, the screen's PictFormats are only attached + to the screen's visuals' depths. So, with an x2r10g10b10 short format + (depth 30), we wouldn't find the screen's PictFormat for it + (associated with depth 32). + + Instead of trying to look up from the screen, just use the pFormat + that came from our source picture. The only time we need to look up a + PictFormat when we're doing non-shader gradients, which we put in + a8r8g8b8. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit e7aa4d3c7420d45cca2b7e1e69e22cebc64d5b74 +Author: Eric Anholt +Date: Thu Nov 5 16:03:14 2015 -0800 + + glamor: Fix assert failures when fallback picture upload alloc fails. + + If the glTexImage (or glTexSubImage) out-of-memories, error out + cleanly so that we can fall back to software. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit ff8ef975df9cd99ec6f0b8b8047445091bf35ef0 +Author: Eric Anholt +Date: Thu Nov 5 15:13:55 2015 -0800 + + glamor: Fix rendering when core font texture allocation fails. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit a6b05d10da2fe476f46e6dc4ad8a603964735905 +Author: Eric Anholt +Date: Thu Nov 5 15:05:11 2015 -0800 + + glamor: Fix crashes when the glyph atlas allocation fails. + + We already have a fallback path, so we just need to jump to it when we + hit the failure. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit de959ec939b262cb1cb4c0b6146826e3092843f9 +Author: Eric Anholt +Date: Thu Nov 5 14:47:42 2015 -0800 + + glamor: Handle GL_OUT_OF_MEMORY when allocating texture images. + + The spec allows general undefined behavior when GL_OOM is thrown. But + if the driver happens to throw the error at this point, it probably + means the pixmap was just too big, so we should delete that texture + and have this pixmap fall back to software. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 74be466d40080545117628c376cb59b696db33bc +Author: Eric Anholt +Date: Mon Nov 9 15:47:05 2015 -0800 + + glamor: Avoid GL errors from mapping with size == 0. + + GL 4.5 / GLES 3.0 require throwing GL errors at map time, and Mesa + before that might throw errors accidentally if a malloc(0) call was + made to return the mapping. + + Signed-off-by: Eric Anholt + Reviewed-by: Rob Clark + +commit a6cddb8c04ddc3c48aae3f3611ad9f336fecb09d +Author: Michael Stapelberg +Date: Tue Nov 3 03:51:48 2015 -0800 + + Also dump passive grabs on XF86LogGrabInfo + + Signed-off-by: Michael Stapelberg + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f2ceb683c2da1ec08c8e07d7ec146f14864f2386 +Author: Adam Jackson +Date: Mon Nov 9 16:22:12 2015 -0500 + + Post-release version bump for 1.19 + + Signed-off-by: Adam Jackson + commit 43fb888bd01cf9d3d277e77a52a3d0c93ccff8bd Author: Adam Jackson Date: Mon Nov 9 16:00:26 2015 -0500 @@ -4314,13 +16770,13 @@ backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] - if (dladdr((void *)(pip.start_ip + off), &dlinfo) && + if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && - ^ + ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] - (void *)(pip.start_ip + off)); - ^ + (void *)(pip.start_ip + off)); + ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... @@ -7220,9 +19676,9 @@ attributions in place before copying that. To get this list of names I went through: - git log -- os/xsha1.c + git log -- os/xsha1.c and: - git log -- render/glyph.c + git log -- render/glyph.c Signed-off-by: Keith Packard @@ -9127,11 +21583,11 @@ include/gcstruct.h header which wasn't included by the source file, only gc.h was. That caused the following build failure: - CC xvmain.lo - Xext/xvmain.c: In function 'XvFillColorKey': - Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type - (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); - ^ + CC xvmain.lo + Xext/xvmain.c: In function 'XvFillColorKey': + Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + ^ Fix this by including the correct header file. @@ -9323,7 +21779,7 @@ Merge remote-tracking branch 'jturney/master' Conflicts: - hw/xwin/winpixmap.c + hw/xwin/winpixmap.c Adam removed a pile of windows code, including this file. @@ -10774,12 +23230,12 @@ I can't find any performance benefit to using the GL path and the code renders this trapezoid incorrectly: - top: FIXED 29.50 - bottom: FIXED 30.00 - left top: POINT 0.00, 29.50 - left bottom: POINT 0.00, 30.50 - right top: POINT -127.50, 29.50 - right bottom: POINT 52.50, 30.00 + top: FIXED 29.50 + bottom: FIXED 30.00 + left top: POINT 0.00, 29.50 + left bottom: POINT 0.00, 30.50 + right top: POINT -127.50, 29.50 + right bottom: POINT 52.50, 30.00 This should render a solid line from 0,30 to 52,30 but draws nothing. @@ -13629,11 +26085,11 @@ drawable as x_dest, y_dest. The protocol coordinates now exist solely to 'pin' the three objects together. - extents->x1,y1 Screen origin of clipped operation + extents->x1,y1 Screen origin of clipped operation width,height Extents of the clipped operation - x_dest,y_dest Unclipped destination-relative operation coordinate - x_source,y_source Unclipped source-relative operation coordinate - x_mask,y_mask Unclipped mask-relative operation coordinate + x_dest,y_dest Unclipped destination-relative operation coordinate + x_source,y_source Unclipped source-relative operation coordinate + x_mask,y_mask Unclipped mask-relative operation coordinate One thing we want to know is what the offset is from the original operation origin to the clipped origin @@ -14029,11 +26485,11 @@ to load for non-PCI output devices. DDX modules can ship an xorg.conf.d snippet (e.g. in /usr/share/X11/xorg.conf.d) that looks like this: - Section "OutputClass" - Identifer "NVIDIA Tegra open-source driver" - MatchDriver "tegra" - Driver "opentegra" - EndSection + Section "OutputClass" + Identifer "NVIDIA Tegra open-source driver" + MatchDriver "tegra" + Driver "opentegra" + EndSection This will cause any device that's driven by the kernel driver named "tegra" to use the "opentegra" DDX module. @@ -16277,17 +28733,17 @@ int screen; xcb_connection_t *c = xcb_connect(NULL, &screen); if (!c || xcb_connection_has_error(c)) { - fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); - return EXIT_FAILURE; + fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); + return EXIT_FAILURE; } // Find root window and depth const xcb_setup_t *setup = xcb_get_setup(c); if (screen >= setup->roots_len) - screen = 0; + screen = 0; xcb_screen_iterator_t si = xcb_setup_roots_iterator(setup); for (int i=0; i < screen; i++) - xcb_screen_next(&si); + xcb_screen_next(&si); xcb_window_t root = si.data->root; uint8_t depth = si.data->root_depth; xcb_visualid_t visual = si.data->root_visual; @@ -16296,8 +28752,8 @@ xcb_render_query_pict_formats_reply_t *qpf; qpf = xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), NULL); if (!qpf) { - fprintf(stderr, "Cannot query RENDER picture formats\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot query RENDER picture formats\n"); + return EXIT_FAILURE; } xcb_render_pictformat_t fmt_a8 = 0; xcb_render_pictforminfo_iterator_t pfi = @@ -16313,8 +28769,8 @@ xcb_render_pictforminfo_next(&pfi); } if (!fmt_a8) { - fprintf(stderr, "Cannot find a8 RENDER picture format\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot find a8 RENDER picture format\n"); + return EXIT_FAILURE; } xcb_render_pictformat_t fmt_visual = 0; @@ -16339,8 +28795,8 @@ } found_visual: if (!fmt_visual) { - fprintf(stderr, "Cannot find visual RENDER picture format\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot find visual RENDER picture format\n"); + return EXIT_FAILURE; } xcb_render_glyphset_t glyphset = xcb_generate_id(c); @@ -16353,8 +28809,8 @@ xcb_window_t window = xcb_generate_id(c); uint32_t list[] = { si.data->black_pixel, XCB_EVENT_MASK_EXPOSURE }; xcb_create_window(c, XCB_COPY_FROM_PARENT, window, root, 0, 0, WIN_SIZE, WIN_SIZE, - 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, - XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); + 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, + XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); xcb_map_window(c, window); xcb_render_picture_t winpic = xcb_generate_id(c); xcb_render_create_picture(c, winpic, window, fmt_visual, 0, NULL); @@ -16369,9 +28825,9 @@ xcb_flush(c); for (xcb_generic_event_t *ev = xcb_wait_for_event(c); ev; ev = xcb_wait_for_event(c)) { - int type = ev->response_type; - free(ev); - if (type == XCB_EXPOSE) { + int type = ev->response_type; + free(ev); + if (type == XCB_EXPOSE) { xcb_clear_area(c, 0, window, 0, 0, 0, 0); xcb_render_composite_glyphs_8(c, XCB_RENDER_PICT_OP_SRC, pixpic, winpic, fmt_a8, glyphset, 0, 0, sizeof(elt), (uint8_t *)&elt); @@ -19900,7 +32356,7 @@ LDADD is for libraries and not for source code. - Introduced in commit: ccb3e78124fb05defd0c9b438746b79d84dfc3ae + Introduced in commit: ccb3e78124fb05defd0c9b438746b79d84dfc3ae Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer @@ -19916,8 +32372,8 @@ the field (rather than the field's address). The correct way to do it would have been (note the &'s): - assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0); - assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0); + assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0); + assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0); That's essentially what the offsetof() macro does. Using offsetof() has the added benefit of not using void pointer arithmetic and therefore @@ -20302,9 +32758,9 @@ Fixes Solaris Studio compiler warning & error: "glxext.c", line 557: warning: assignment type mismatch: - pointer to void "=" pointer to function(void) returning void + pointer to void "=" pointer to function(void) returning void "glxext.c", line 559: error: operands have incompatible types: - pointer to void ":" pointer to function(void) returning void + pointer to void ":" pointer to function(void) returning void Signed-off-by: Alan Coopersmith Signed-off-by: Keith Packard @@ -20795,7 +33251,7 @@ Merge remote-tracking branch 'anholt/glamor-reformat' Conflicts: - Makefile.am + Makefile.am Conflict caused by adding PSEUDORAMIX and GLAMOR directory defines in separate branches @@ -24189,9 +36645,9 @@ are not frequenly used in real application. We simply fallback them currently. - PictOpAtop: s*mask*dst.a + (1 - s.a*mask)*dst - PictOpAtopReverse: s*mask*(1 - dst.a) + dst *s.a*mask - PictOpXor: s*mask*(1 - dst.a) + dst * (1 - s.a*mask) + PictOpAtop: s*mask*dst.a + (1 - s.a*mask)*dst + PictOpAtopReverse: s*mask*(1 - dst.a) + dst *s.a*mask + PictOpXor: s*mask*(1 - dst.a) + dst * (1 - s.a*mask) The two oprands in the above three ops are all reated to dst and the blend factors are not constant (0 or 1), it's hardly to @@ -26176,14 +38632,14 @@ > --- a/configure.ac > +++ b/configure.ac > @@ -1822,6 +1822,9 @@ if test "x$XORG" = xyes; then - > if test "x$CONFIG_UDEV_KMS" = xyes; then - > AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) - > fi - > + if test "x$INT10" != xstub; then - > + AC_MSG_ERROR([Cannot build int10 without libpciaccess]) - > + fi - > fi - > AC_MSG_RESULT([$PCI]) + > if test "x$CONFIG_UDEV_KMS" = xyes; then + > AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) + > fi + > + if test "x$INT10" != xstub; then + > + AC_MSG_ERROR([Cannot build int10 without libpciaccess]) + > + fi + > fi + > AC_MSG_RESULT([$PCI]) > This causes my build to fail where --disable-int10-module --disable-pciaccess @@ -26551,11 +39007,11 @@ Change check to vblank->window == NULL in: - present_flip_notify + present_flip_notify Add check for vblank->window == NULL in: - present_vblank_notify - present_execute + present_vblank_notify + present_execute present_flip_notify was also using vblank->window->drawable.pScreen, so stop doing that and use vblank->screen instead. @@ -26947,8 +39403,8 @@ v3: Also catch errors in ShmCreateSegment Conflicts: - include/dix-config.h.in - include/xorg-config.h.in + include/dix-config.h.in + include/xorg-config.h.in commit 719e880d7698d92f9b854b217ef9680aaa446f2e Author: Keith Packard @@ -27415,17 +39871,17 @@ void SetReqFds(ClientPtr client, int req_fds) - Marks the number of file descriptors expected for this - request. Call this before any request processing so that - any un-retrieved file descriptors will be closed - automatically. + Marks the number of file descriptors expected for this + request. Call this before any request processing so that + any un-retrieved file descriptors will be closed + automatically. int ReadFdFromClient(ClientPtr client) - Reads the next queued file descriptor from the connection. If - this request is not expecting any more file descriptors, or - if there are no more file descriptors available from the - connection, then this will return -1. + Reads the next queued file descriptor from the connection. If + this request is not expecting any more file descriptors, or + if there are no more file descriptors available from the + connection, then this will return -1. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson @@ -27758,7 +40214,7 @@ Author: Adam Jackson Date: Mon Mar 21 11:59:29 2011 -0400 - glx: Reimplement context tags + glx: Reimplement context tags In that, I changed the glx client state to not explicitly track the list of current contexts for the client (since that was what we were deriving @@ -34891,11 +47347,11 @@ Merge remote-tracking branch 'whot/barriers' Conflicts: - Xi/xichangehierarchy.c + Xi/xichangehierarchy.c Small conflict with the patch from - Xi: don't use devices after removing them + Xi: don't use devices after removing them Was easily resolved by hand. @@ -37758,14 +50214,14 @@ In commit: - commit 092c57ab173c8b71056f6feb3b9d04d063a46579 - Author: Adam Jackson - Date: Fri Jun 17 14:03:01 2011 -0400 + commit 092c57ab173c8b71056f6feb3b9d04d063a46579 + Author: Adam Jackson + Date: Fri Jun 17 14:03:01 2011 -0400 - os: Hide the Connection{In,Out}put implementation details + os: Hide the Connection{In,Out}put implementation details - Reviewed-by: Daniel Stone - Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson the check for an empty output buffer was moved from one calling location into the FlushClient implementation itself. However, this @@ -40351,11 +52807,11 @@ In: - commit d792ac125a0462a04a930af543cbc732f8cdab7d - Author: Alan Coopersmith - Date: Mon Jul 9 19:12:43 2012 -0700 + commit d792ac125a0462a04a930af543cbc732f8cdab7d + Author: Alan Coopersmith + Date: Mon Jul 9 19:12:43 2012 -0700 - Use C99 designated initializers in dix Replies + Use C99 designated initializers in dix Replies the initializer for the .length element of the xGetPointerMappingReply structure uses the value of rep.nElts, but that won't be set until @@ -40364,7 +52820,7 @@ Easy to verify: - $ xmodmap -pp + $ xmodmap -pp Fixed by creating a local nElts variable and using that. @@ -42383,10 +54839,10 @@ The objects which support screen-specific privates are: - Windows - Pixmaps - GCs - Pictures + Windows + Pixmaps + GCs + Pictures Extending this list to include Colormaps would be possible, but require slightly more work as the default colormap is created before @@ -42602,7 +55058,7 @@ Merge branch 'sigio-vt-switch-issues' into for-keith Conflicts: - test/Makefile.am + test/Makefile.am Signed-off-by: Peter Hutterer @@ -46935,7 +59391,7 @@ s += sprintf(s, "nval: %d ::", (int)THIS->nvaluators); for (i = 0; i < THIS->nvaluators; i++) { - s += sprintf(s, " %d: ", i); + s += sprintf(s, " %d: ", i); if (BitIsSet(mask, i)) s += sprintf(s, "%d", (int)valuators[i]); } @@ -47217,13 +59673,13 @@ from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: - -bap - -psl - -T PrivatePtr - -T pmWait - -T _XFUNCPROTOBEGIN - -T _XFUNCPROTOEND - -T _X_EXPORT + -bap + -psl + -T PrivatePtr + -T pmWait + -T _XFUNCPROTOBEGIN + -T _XFUNCPROTOEND + -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that @@ -47239,17 +59695,17 @@ dir2=$2 for dir in $dir1 $dir2; do - (cd $dir && find . -name '*.o' | while read file; do - dir=`dirname $file` - base=`basename $file .o` - dump=$dir/$base.dump - objdump -d $file > $dump - done) + (cd $dir && find . -name '*.o' | while read file; do + dir=`dirname $file` + base=`basename $file .o` + dump=$dir/$base.dump + objdump -d $file > $dump + done) done find $dir1 -name '*.dump' | while read dump; do - otherdump=`echo $dump | sed "s;$dir1;$dir2;"` - diff -u $dump $otherdump + otherdump=`echo $dump | sed "s;$dir1;$dir2;"` + diff -u $dump $otherdump done Signed-off-by: Keith Packard @@ -49260,7 +61716,7 @@ The touchid test was using a loop like: - for(i = 1; i < 0xffffffff; i <<= 1) + for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. @@ -49316,8 +61772,8 @@ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into multitouch Conflicts: - configure.ac - dix/inpututils.c + configure.ac + dix/inpututils.c Signed-off-by: Peter Hutterer @@ -52285,7 +64741,7 @@ LogVMessageVerb: Fix const mismatch warning "log.c", line 382: warning: assignment type mismatch: - pointer to char "=" pointer to const char + pointer to char "=" pointer to const char Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston @@ -55205,8 +67661,8 @@ Merge branch 'raw-events' into next Conflicts: - configure.ac - dix/events.c + configure.ac + dix/events.c commit 52c9b59a9fed6abfeca775a7a04133cee18eac0b Author: Peter Hutterer @@ -58208,7 +70664,7 @@ Use internal temp variable for swap macros Also, fix whitespace, mainly around - swaps(&rep.sequenceNumber) + swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner @@ -58479,11 +70935,11 @@ Conflicts: - ChangeLog - dix/colormap.c - dix/pixmap.c - dix/window.c - include/pixmapstr.h + ChangeLog + dix/colormap.c + dix/pixmap.c + dix/window.c + include/pixmapstr.h Signed-off-by: Jamey Sharp Reviewed-by: Aaron Plattner @@ -58518,9 +70974,9 @@ Alan Coopersmith explains: - XmuSnprintf() can be replaced by snprintf() now. (It was a - implementation X provided for it's libraries to use in the days - before all platforms we cared about had snprintf in libc.) + XmuSnprintf() can be replaced by snprintf() now. (It was a + implementation X provided for it's libraries to use in the days + before all platforms we cared about had snprintf in libc.) Reported-by: walter harms Signed-off-by: Jamey Sharp @@ -58683,7 +71139,7 @@ x86emu: There is no NO_INLINE implementation of unaligned access here. Patch produced with: - unifdef -UNO_INLINE -B + unifdef -UNO_INLINE -B This change isn't relevant to the similar code in hw/xfree86/common/compiler.h, because x86emu is expected to someday move @@ -59373,7 +71829,7 @@ Conflicts: - composite/compalloc.c + composite/compalloc.c Signed-off-by: Keith Packard commit e87adcc9e024982fdad974de2876b00cf974dab8 @@ -61305,14 +73761,14 @@ Fixes regression introduced by b0c665ac0fe6840dda581e4d0d0b76c703d62a7b - 0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684 - 1 X11.bin 0x00000001001315b0 DoCreateContext + 163 - 2 X11.bin 0x000000010013509f __glXDispatch + 211 - 3 X11.bin 0x00000001000c7dad Dispatch + 785 - 4 X11.bin 0x00000001000b97e5 dix_main + 1022 - 5 X11.bin 0x00000001000122bc server_thread + 50 - 6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331 - 7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13 + 0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684 + 1 X11.bin 0x00000001001315b0 DoCreateContext + 163 + 2 X11.bin 0x000000010013509f __glXDispatch + 211 + 3 X11.bin 0x00000001000c7dad Dispatch + 785 + 4 X11.bin 0x00000001000b97e5 dix_main + 1022 + 5 X11.bin 0x00000001000122bc server_thread + 50 + 6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331 + 7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13 http://lists.apple.com/archives/X11-users/2011/May/msg00045.html @@ -61547,18 +74003,18 @@ Usage example (tested on a dual-seat PC): Section "InputClass" - Identifier "keyboard-all" - MatchIsKeyboard "on" - MatchDevicePath "/dev/input/event*" - MatchLayout "!GeForce|!Matrox" - Driver "evdev" - Option "XkbLayout" "us" - Option "XkbOptions" "terminate:ctrl_alt_bksp" + Identifier "keyboard-all" + MatchIsKeyboard "on" + MatchDevicePath "/dev/input/event*" + MatchLayout "!GeForce|!Matrox" + Driver "evdev" + Option "XkbLayout" "us" + Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection It disables auto keyboard configuration for layouts "GeForce" and "Matrox". Note that "" in patterns means "no Layout sections found", e.g. - MatchLayout "GeForce|" + MatchLayout "GeForce|" is "in layout GeForce or without explicit layout at all". Signed-off-by: Oleh Nykyforchyn @@ -66035,7 +78491,7 @@ Merge branch 'next' into for-keith Conflicts: - dix/devices.c + dix/devices.c Signed-off-by: Peter Hutterer @@ -70144,7 +82600,7 @@ Remove --enable-builddocs as this was last use for BUILDDOCS - *** From the RELEASE NOTES *** + *** From the RELEASE NOTES *** New configure options for documentation in modules -------------------------------------------------- @@ -71984,7 +84440,7 @@ This will allow a dependency to be specified as done in libX11: %.html: %.xml $(dist_spec_DATA) - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon @@ -72572,8 +85028,8 @@ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api Conflicts: - dix/getevents.c - hw/xfree86/common/xf86Xinput.h + dix/getevents.c + hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer @@ -74036,11 +86492,11 @@ Merge branch 'master' into input-api Conflicts: - config/udev.c - hw/xfree86/common/xf86Helper.c - hw/xfree86/common/xf86Module.h - hw/xfree86/common/xf86Xinput.h - hw/xfree86/os-support/linux/lnx_init.c + config/udev.c + hw/xfree86/common/xf86Helper.c + hw/xfree86/common/xf86Module.h + hw/xfree86/common/xf86Xinput.h + hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer @@ -77644,7 +90100,7 @@ Conflicts: - dix/events.c + dix/events.c Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard @@ -77685,7 +90141,7 @@ Conflicts: - dix/events.c + dix/events.c Signed-off-by: Peter Hutterer Acked-by: Daniel Stone @@ -78397,8 +90853,8 @@ don't care how the driver was selected for that device. The MatchDriver entry can be used to match the current driver string: - MatchDriver "evdev|mouse" - Option "Emulate3Buttons" "yes" + MatchDriver "evdev|mouse" + Option "Emulate3Buttons" "yes" The driver string is a case sensitive match. @@ -78418,8 +90874,8 @@ For instance, an InputClass with - MatchProduct "foo" - MatchProduct "bar" + MatchProduct "foo" + MatchProduct "bar" will require that the device's product name contain both foo and bar. This provides a complement to the || style matching when an entry is @@ -78456,7 +90912,7 @@ has been added that supports shell pattern matching when fnmatch(3) is available. For example: - MatchUSBID "046d:*" + MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". @@ -78476,7 +90932,7 @@ test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: - MatchPnPID "WACf*" + MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME @@ -78999,8 +91455,8 @@ This also renames the device private index and macros to better reflect their usage: - miDCSpriteKey -> miDCDeviceKey - MIDCBUFFER -> miGetDCDevice + miDCSpriteKey -> miDCDeviceKey + MIDCBUFFER -> miGetDCDevice Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp @@ -81632,9 +94088,9 @@ But no one cares, and it's a modest size win: - text data bss dec hex filename - 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before - 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb + text data bss dec hex filename + 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before + 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb Signed-off-by: Adam Jackson Reviewed-by: Keith Packard @@ -81899,7 +94355,7 @@ Merge remote branch 'jamey/for-keith' Conflicts: - hw/xfree86/common/xf86xv.c + hw/xfree86/common/xf86xv.c commit a974c8e7cba40c8d7d1b91e07de8c414627b71a2 Merge: 6581bc4 02e8622 @@ -82267,7 +94723,7 @@ Conflicts: - configure.ac + configure.ac Signed-off-by: Yaakov Selkowitz Reviewed-by: Peter Hutterer @@ -82514,7 +94970,7 @@ Merge remote branch 'vignatti/for-keith' Conflicts: - exa/exa.c + exa/exa.c Signed-off-by: Keith Packard @@ -83212,15 +95668,15 @@ for local administration, we also reserve a system directory for vendor and package usage. The simple search path is: - /usr/share/X11/xorg.conf.d - $datadir/X11/xorg.conf.d + /usr/share/X11/xorg.conf.d + $datadir/X11/xorg.conf.d Files from these directories will have the lowest config priority. The directory $datadir/X11/xorg.conf.d is exported from xorg-server.pc in the variable "sysconfigdir". Packages should install their .conf files to the directory specified by: - `pkg-config --variable=sysconfigdir xorg-server` + `pkg-config --variable=sysconfigdir xorg-server` Signed-off-by: Dan Nicholson Signed-off-by: Peter Hutterer @@ -83235,10 +95691,10 @@ hostname to the search path for xorg.conf.d. This changes it to something very simple: - /etc/X11/ - $sysconfdir/X11/ - /etc/X11/xorg.conf.d - $sysconfdir/X11/xorg.conf.d + /etc/X11/ + $sysconfdir/X11/ + /etc/X11/xorg.conf.d + $sysconfdir/X11/xorg.conf.d Signed-off-by: Dan Nicholson Signed-off-by: Peter Hutterer @@ -84772,7 +97228,7 @@ xselinux: Bump extension minor version. Changes introduced in this version: - - 3 window-related requests now handle pixmaps also. + - 3 window-related requests now handle pixmaps also. Signed-off-by: Eamon Walsh Reviewed-by: Keith Packard @@ -84784,9 +97240,9 @@ xselinux: Rename window-related requests that now support pixmaps. Renamed requests: - SetWindowCreateContext -> SetDrawableCreateContext - GetWindowCreateContext -> GetDrawableCreateContext - GetWindowContext -> GetDrawableContext + SetWindowCreateContext -> SetDrawableCreateContext + GetWindowCreateContext -> GetDrawableCreateContext + GetWindowContext -> GetDrawableContext Signed-off-by: Eamon Walsh Reviewed-by: Keith Packard @@ -87515,7 +99971,7 @@ Conflicts: - fb/fbpict.c + fb/fbpict.c Signed-off-by: Keith Packard Acked-by: Soeren Sandmann @@ -88853,7 +101309,7 @@ Make sys.c use unaligned access functions provided in compiler. Favorite deleted line was definitely - /* to cope with broken egcs-1.1.2 :-(((( */ + /* to cope with broken egcs-1.1.2 :-(((( */ Signed-off-by: Matt Turner Signed-off-by: Keith Packard @@ -89862,7 +102318,7 @@ Merge remote branch 'alanc/master' Conflicts: - configure.ac + configure.ac Signed-off-by: Keith Packard @@ -95007,7 +107463,7 @@ Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty: Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details] - 167 rc = XIPropToInt(val, &nelem, &ptr); + 167 rc = XIPropToInt(val, &nelem, &ptr); Event leaked_storage: Variable "ptr" goes out of scope @@ -95025,10 +107481,10 @@ Event var_tested_neg: Variable "fd" tested NEGATIVE At conditional (1): "fd != -1" taking false path - 335 if (fd != -1) { + 335 if (fd != -1) { Event negative_returns: Tracked variable "fd" was passed to a negative sink. - 347 close(fd); + 347 close(fd); commit 53ae6b63387e04324b23b6f8311cc22a154c1fb8 Author: Jeremy Huddleston @@ -96321,8 +108777,8 @@ The new clipping rules: - - client clips happen after transformation - - pixels unavailable due to the hierarchy are undefined + - client clips happen after transformation + - pixels unavailable due to the hierarchy are undefined The first one is implemented in pixman; the second one is realized by making a copy of window sources (to prevent out-of-bounds access). @@ -97723,16 +110179,16 @@ Merge branch 'master' into xi2 Conflicts: - Xext/geext.c - Xi/chdevcur.c - Xi/extgrbdev.c - Xi/xiproperty.c - configure.ac - dix/ptrveloc.c - hw/xfree86/common/xf86Config.c - mi/mipointer.h - test/input.c - xkb/xkb.c + Xext/geext.c + Xi/chdevcur.c + Xi/extgrbdev.c + Xi/xiproperty.c + configure.ac + dix/ptrveloc.c + hw/xfree86/common/xf86Config.c + mi/mipointer.h + test/input.c + xkb/xkb.c commit a25f248fc3bd0375d91ca8a44320200d445ecfbb Author: Peter Hutterer @@ -98896,12 +111352,12 @@ Array size is 128 elements (of 4 bytes each), index <= 128 Error: Buffer overflow at dix/events.c:592 - in function 'SetMaskForEvent' [Symbolic analysis] + in function 'SetMaskForEvent' [Symbolic analysis] In array dereference of filters[deviceid] with index 'deviceid' Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20 Error: Read buffer overflow at hw/xfree86/loader/loader.c:226 - in function 'LoaderOpen' [Symbolic analysis] + in function 'LoaderOpen' [Symbolic analysis] In array dereference of refCount[new_handle] with index 'new_handle' Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256 @@ -99609,8 +112065,8 @@ Merge branch 'master' into xi2 Conflicts: - Xi/chdevhier.c - include/input.h + Xi/chdevhier.c + include/input.h commit 932d6bcbb68194c5bdfeb336f700dc8b31529223 Author: Peter Hutterer @@ -102018,7 +114474,7 @@ Conflicts: - exa/exa_render.c + exa/exa_render.c commit d0dd649035fc3698c5b436f9d9d248116aa106a3 Author: Jon TURNEY @@ -107685,9 +120141,9 @@ Remove xorgconfig & xorgcfg Update driver lists: - - Remove vga - - i810->intel - - via->openchrome + - Remove vga + - i810->intel + - via->openchrome commit bd147e6f4b03f344c967c88fd433877b14fe1912 Author: Alan Coopersmith @@ -107866,19 +120322,19 @@ SPECIAL CASES o defined as _X_INTERNAL - xf86NewInputDevice() + xf86NewInputDevice() o defined as static - fbGCPrivateKey - fbOverlayScreenPrivateKey - fbScreenPrivateKey - fbWinPrivateKey + fbGCPrivateKey + fbOverlayScreenPrivateKey + fbScreenPrivateKey + fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h - GetGlyphs() - QueryGlyphExtents() - QueryTextExtents() - ParseGlyphCachingMode() - InitGlyphCaching() - SetGlyphCachingMode() + GetGlyphs() + QueryGlyphExtents() + QueryTextExtents() + ParseGlyphCachingMode() + InitGlyphCaching() + SetGlyphCachingMode() commit ffb484f7ef84099019b196ef97bfb2355eb6d52a Author: Maarten Maathuis @@ -107972,13 +120428,13 @@ Still missing symbols worth mentioning are: sunleo - miFindMaxBand no longer available + miFindMaxBand no longer available - intel (uxa/uxa-accel.c) - fbShmPutImage no longer available (and should have been static) + intel (uxa/uxa-accel.c) + fbShmPutImage no longer available (and should have been static) mga - MGAGetClientPointer (should come from matrox's libhal) + MGAGetClientPointer (should come from matrox's libhal) This is not a definitive "visibility" patch, as all it does is to export missing symbols, but the modules that current don't compile, @@ -108134,18 +120590,18 @@ Includes fixes for: "xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype: - prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351 - argument : pointer to const struct _DisplayModeRec + prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351 + argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype: - prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351 - argument : pointer to const struct _DisplayModeRec + prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351 + argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 438: warning: assignment type mismatch: - pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec + pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec "xf86Modes.c", line 701: warning: assignment type mismatch: - pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec + pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec commit d5ad296869c38ab30136b5a293a0125b76aad994 Author: Alan Coopersmith @@ -111129,7 +123585,7 @@ Conflicts: - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/xf86sym.c commit 94919480d8bb66e1807b4fe87b8f326ef6e012c6 Author: Adam Jackson @@ -112921,7 +125377,7 @@ stuck-modifier fixes (capslock) 3button-emulation now doesn't send the modifier key with the click Added other options to fake_button2 and fake_button3 defaults options: - ({l,r}{control,alt,command,shift}) + ({l,r}{control,alt,command,shift}) (cherry picked from commit 8fb6a1cf44c35a20dfb0c05c9824f94898f88da7) (cherry picked from commit ae9c1b3cfb3874b4d1251681c24bda91c398bcab) @@ -116967,7 +129423,7 @@ Restore return type on xf86SetScrnInfoModes - Seems to have been accidentally lost by commit 76943fec860315f3c93539e59a59080b8a7b3e75 + Seems to have been accidentally lost by commit 76943fec860315f3c93539e59a59080b8a7b3e75 commit 7a550cefd9417c22a4397ea4d103ddc347ab1a0f Author: Peter Hutterer @@ -116996,13 +129452,13 @@ Conflicts: - Xext/xprint.c (removed in master) - config/hal.c - dix/main.c - hw/kdrive/ati/ati_cursor.c (removed in master) - hw/kdrive/i810/i810_cursor.c (removed in master) - hw/xprint/ddxInit.c (removed in master) - xkb/ddxLoad.c + Xext/xprint.c (removed in master) + config/hal.c + dix/main.c + hw/kdrive/ati/ati_cursor.c (removed in master) + hw/kdrive/i810/i810_cursor.c (removed in master) + hw/xprint/ddxInit.c (removed in master) + xkb/ddxLoad.c commit 0178b6a4abed0df3e90ba393709ed566105e7c2c Author: Adam Jackson @@ -117954,8 +130410,8 @@ Conflicts: - Xi/exevents.c - dix/devices.c + Xi/exevents.c + dix/devices.c commit a338007be6fd4302af012109d959f43ac7eab2b1 Author: Jeremy Huddleston @@ -118863,12 +131319,12 @@ Conflicts: - Xext/EVI.c - Xext/appgroup.c - Xext/cup.c - Xext/mitmisc.c - Xext/sampleEVI.c - dix/window.c + Xext/EVI.c + Xext/appgroup.c + Xext/cup.c + Xext/mitmisc.c + Xext/sampleEVI.c + dix/window.c commit 179a082c26f9e562492ee2e59e7f44f949f39f9c Author: Peter Hutterer @@ -119979,8 +132435,8 @@ Conflicts: - Xext/xevie.c - dix/dispatch.c + Xext/xevie.c + dix/dispatch.c commit 539bf3c2836727e7560c64144071b086f8ea32fe Merge: 3ab33e7 6c0cfe3 @@ -120997,25 +133453,25 @@ Conflicts: - Xi/opendev.c - dix/devices.c - dix/dixfonts.c - dix/getevents.c - dix/resource.c - dix/window.c - hw/xfree86/common/xf86Xinput.c - mi/mipointer.c - xkb/ddxBeep.c - xkb/ddxCtrls.c - xkb/ddxKeyClick.c - xkb/ddxList.c - xkb/ddxLoad.c - xkb/xkb.c - xkb/xkbAccessX.c - xkb/xkbEvents.c - xkb/xkbInit.c - xkb/xkbPrKeyEv.c - xkb/xkbUtils.c + Xi/opendev.c + dix/devices.c + dix/dixfonts.c + dix/getevents.c + dix/resource.c + dix/window.c + hw/xfree86/common/xf86Xinput.c + mi/mipointer.c + xkb/ddxBeep.c + xkb/ddxCtrls.c + xkb/ddxKeyClick.c + xkb/ddxList.c + xkb/ddxLoad.c + xkb/xkb.c + xkb/xkbAccessX.c + xkb/xkbEvents.c + xkb/xkbInit.c + xkb/xkbPrKeyEv.c + xkb/xkbUtils.c commit 72f2197545e734cd0aa785d05a57b2fc0351a763 Author: Eamon Walsh @@ -121949,9 +134405,9 @@ - This allows some compositing managers to work, even after randr12 has changed the root window size. - Thanks to ajax for figuring out the best place to put this. - Example: - - xf86RandR12SetMode() calls EnableDisableFBAccess(). - - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). - - The final step is the call to PositionWindow(). + - xf86RandR12SetMode() calls EnableDisableFBAccess(). + - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). + - The final step is the call to PositionWindow(). commit b95059c20746a71e60ef152bb627e1d5c2210d75 Author: Jeremy Huddleston @@ -122453,7 +134909,7 @@ Conflicts: - dix/events.c + dix/events.c commit 6c38682084e24b18bac0ea75729b1183aeb01600 Author: Benjamin Tissoires @@ -122577,7 +135033,7 @@ Conflicts: - Xext/sampleEVI.c + Xext/sampleEVI.c commit e915a2639752bc0ea9e6e192e020cc2031c08063 Author: Eamon Walsh @@ -123267,35 +135723,35 @@ Conflicts: - XTrap/xtrapddmi.c - Xext/security.c - Xext/xprint.c - Xext/xtest.c - Xext/xvdisp.c - Xi/exevents.c - Xi/grabdevb.c - Xi/grabdevk.c - Xi/opendev.c - Xi/ungrdev.c - Xi/ungrdevb.c - Xi/ungrdevk.c - dix/cursor.c - dix/devices.c - dix/dixutils.c - dix/events.c - dix/getevents.c - dix/main.c - dix/window.c - hw/xfree86/ramdac/xf86Cursor.c - include/dix.h - include/input.h - include/inputstr.h - mi/midispcur.c - mi/miinitext.c - mi/misprite.c - render/animcur.c - xfixes/cursor.c - xkb/xkbAccessX.c + XTrap/xtrapddmi.c + Xext/security.c + Xext/xprint.c + Xext/xtest.c + Xext/xvdisp.c + Xi/exevents.c + Xi/grabdevb.c + Xi/grabdevk.c + Xi/opendev.c + Xi/ungrdev.c + Xi/ungrdevb.c + Xi/ungrdevk.c + dix/cursor.c + dix/devices.c + dix/dixutils.c + dix/events.c + dix/getevents.c + dix/main.c + dix/window.c + hw/xfree86/ramdac/xf86Cursor.c + include/dix.h + include/input.h + include/inputstr.h + mi/midispcur.c + mi/miinitext.c + mi/misprite.c + render/animcur.c + xfixes/cursor.c + xkb/xkbAccessX.c commit ccf6636d2ca8acdaaeb8da34db507a10a082b0de Author: Alan Coopersmith @@ -123906,7 +136362,7 @@ Conflicts: - configure.ac + configure.ac This is the last pull before merging to master. @@ -123954,36 +136410,36 @@ Conflicts: - Xext/EVI.c - Xext/bigreq.c - Xext/cup.c - Xext/dpms.c - Xext/fontcache.c - Xext/mitmisc.c - Xext/xcmisc.c - Xext/xf86bigfont.c - Xext/xtest.c - configure.ac - dbe/dbe.c - hw/darwin/darwin.h - hw/darwin/darwinEvents.c - hw/darwin/iokit/xfIOKit.h - hw/darwin/iokit/xfIOKitCursor.c - hw/darwin/quartz/fullscreen/fullscreen.c - hw/darwin/quartz/fullscreen/quartzCursor.c - hw/darwin/quartz/quartz.c - hw/darwin/quartz/quartzCommon.h - hw/darwin/quartz/quartzCursor.c - hw/darwin/quartz/xpr/dri.c - hw/darwin/quartz/xpr/dristruct.h - hw/darwin/quartz/xpr/xprCursor.c - hw/darwin/quartz/xpr/xprFrame.c - hw/xfree86/modes/xf86RandR12.c - include/cursor.h - miext/rootless/rootlessCommon.h - miext/rootless/rootlessScreen.c - miext/rootless/rootlessWindow.c - render/picturestr.h + Xext/EVI.c + Xext/bigreq.c + Xext/cup.c + Xext/dpms.c + Xext/fontcache.c + Xext/mitmisc.c + Xext/xcmisc.c + Xext/xf86bigfont.c + Xext/xtest.c + configure.ac + dbe/dbe.c + hw/darwin/darwin.h + hw/darwin/darwinEvents.c + hw/darwin/iokit/xfIOKit.h + hw/darwin/iokit/xfIOKitCursor.c + hw/darwin/quartz/fullscreen/fullscreen.c + hw/darwin/quartz/fullscreen/quartzCursor.c + hw/darwin/quartz/quartz.c + hw/darwin/quartz/quartzCommon.h + hw/darwin/quartz/quartzCursor.c + hw/darwin/quartz/xpr/dri.c + hw/darwin/quartz/xpr/dristruct.h + hw/darwin/quartz/xpr/xprCursor.c + hw/darwin/quartz/xpr/xprFrame.c + hw/xfree86/modes/xf86RandR12.c + include/cursor.h + miext/rootless/rootlessCommon.h + miext/rootless/rootlessScreen.c + miext/rootless/rootlessWindow.c + render/picturestr.h Trying to pick up the pieces from the darwin churn here... @@ -125391,7 +137847,7 @@ Date: Tue Nov 20 15:21:31 2007 -0500 devPrivates rework: put back some changes that were mistakenly removed - during merge conflict resolution. + during merge conflict resolution. commit 709c1a70c8c6a9e132bf0d92f78a12be72beee51 Author: Eamon Walsh @@ -125410,7 +137866,7 @@ Date: Mon Nov 19 21:01:22 2007 -0500 devPrivates rework: put back a comment that was mistakenly removed - during merge conflict resolution. + during merge conflict resolution. commit 2d17f47cc7d6b174857617d31ad1b437d8e97d94 Merge: 60be452 ea9c63e @@ -125421,8 +137877,8 @@ Conflicts: - hw/xnest/Pixmap.c - include/dix.h + hw/xnest/Pixmap.c + include/dix.h commit 60be452c2e88342f92a76ba5ec7d90b5b0211aaf Author: Eamon Walsh @@ -125749,8 +138205,8 @@ Conflicts: - Xext/xace.c - Xext/xace.h + Xext/xace.c + Xext/xace.h commit f207e69d62bc04c7f254347b03e6d8fa8b569d66 Author: Eamon Walsh @@ -126126,7 +138582,7 @@ Conflicts: - Xi/opendev.c + Xi/opendev.c commit e94ab0b502160376d1956345196f7e1c7e2e886f Merge: 26e1fc7 9bee1c6 @@ -126176,19 +138632,19 @@ Conflicts: - Xi/extinit.c - Xi/grabdev.c - Xi/setmode.c - Xi/ungrdev.c - dix/devices.c - dix/events.c - dix/getevents.c - include/dix.h - mi/midispcur.c - mi/misprite.c - xkb/xkbActions.c - xkb/xkbEvents.c - xkb/xkbPrKeyEv.c + Xi/extinit.c + Xi/grabdev.c + Xi/setmode.c + Xi/ungrdev.c + dix/devices.c + dix/events.c + dix/getevents.c + include/dix.h + mi/midispcur.c + mi/misprite.c + xkb/xkbActions.c + xkb/xkbEvents.c + xkb/xkbPrKeyEv.c commit e717409bae355df9a617a226f12fbb8c54ae77e5 Author: Daniel Stone @@ -126302,12 +138758,12 @@ Conflicts: - dix/dispatch.c - dix/property.c - hw/xfree86/common/xf86VidMode.c - include/xkbsrv.h - render/glyph.c - xkb/xkbActions.c + dix/dispatch.c + dix/property.c + hw/xfree86/common/xf86VidMode.c + include/xkbsrv.h + render/glyph.c + xkb/xkbActions.c commit 58332894c061ae96d6a457f65266660f5f65e88b Author: Adam Jackson @@ -127000,11 +139456,11 @@ Conflicts: - GL/glx/glxscreens.c - hw/xnest/Screen.c - render/glyph.c - render/glyphstr.h - render/render.c + GL/glx/glxscreens.c + hw/xnest/Screen.c + render/glyph.c + render/glyphstr.h + render/render.c commit 242f56f722243938e908d1957781ee53c2999783 Author: Naoki Hamada @@ -127202,7 +139658,7 @@ Conflicts: - configure.ac + configure.ac commit 12e889d202ac9849f534c51167cbfed91c32027a Author: Eamon Walsh @@ -127408,7 +139864,7 @@ Conflicts: - os/access.c + os/access.c commit af4dde0ac19ecec1d0ad988eb25b15401e7c6b36 Author: Eamon Walsh @@ -128272,8 +140728,8 @@ Xephyr: remove a potential crasher - * hw/kdrive/ephyr/hostx.c: - (hostx_has_dri): be more defensive. + * hw/kdrive/ephyr/hostx.c: + (hostx_has_dri): be more defensive. commit 06c8977966e76255ce7798f4839ef6e3530264a8 Author: Dodji Seketeli @@ -128317,8 +140773,8 @@ Xephyr: better compilation without GLX - * hw/kdrive/ephyr/ephyrinit.c: protect GLX related code with GLXEXT - macro + * hw/kdrive/ephyr/ephyrinit.c: protect GLX related code with GLXEXT + macro commit 3549a1282365e69e70c7c2546cfa7d25923cce31 Author: Michel Dänzer @@ -128348,49 +140804,49 @@ We can now launch GL or XV apps in any of the Xephyr screens we want. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_get_window): - (hostx_create_window): make these functions be screen - number aware. - * hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings. - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIQueryDirectRenderingCapable), - (ephyrDRIOpenConnection), - (ephyrDRIAuthConnection), - (ephyrDRICloseConnection), - (ephyrDRIGetClientDriverName), - (ephyrDRICreateContext), - (ephyrDRIDestroyContext), - (ephyrDRICreateDrawable), - (ephyrDRIGetDrawableInfo), - (ephyrDRIGetDeviceInfo): in all those functions, don't forward - the screen number we receive - from the client - to the host X. - We (Xephyr) are always targetting the same X display screen, which is - the one Xephyr got launched against. So we enforce that in the code. - * hw/kdrive/ephyr/ephyrdriext.c: - (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X - default screen into a given Xephyr screen. This way we have a chance - to update the visuals of all Xephyr screen to make them mirror those - of the host X. - (many other places): specify screen number where required by the api - change in hostx.h. - * hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required - by the api change in hostx.h - * hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we - receive - from the client - to the host X. - We (Xephyr) are always targetting the same - X display screen, which is - the one Xephyr got launched against. So we enforce that in the code. - * hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received - from the client app. This is useful to know on which Xephyr screen we - need to display video stuff. - * hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change - in hw/kdrive/ephyr/ephyrhostvideo.h. - (ephyrSetPortAttribute): when parameters are not valid - - they exceed their validity range - send them to the host anyway - and do not return an error to clients. - Some host expose buggy validity range, so rejecting client for that - is too harsh. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_get_window): + (hostx_create_window): make these functions be screen + number aware. + * hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings. + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIQueryDirectRenderingCapable), + (ephyrDRIOpenConnection), + (ephyrDRIAuthConnection), + (ephyrDRICloseConnection), + (ephyrDRIGetClientDriverName), + (ephyrDRICreateContext), + (ephyrDRIDestroyContext), + (ephyrDRICreateDrawable), + (ephyrDRIGetDrawableInfo), + (ephyrDRIGetDeviceInfo): in all those functions, don't forward + the screen number we receive - from the client - to the host X. + We (Xephyr) are always targetting the same X display screen, which is + the one Xephyr got launched against. So we enforce that in the code. + * hw/kdrive/ephyr/ephyrdriext.c: + (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X + default screen into a given Xephyr screen. This way we have a chance + to update the visuals of all Xephyr screen to make them mirror those + of the host X. + (many other places): specify screen number where required by the api + change in hostx.h. + * hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required + by the api change in hostx.h + * hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we + receive - from the client - to the host X. + We (Xephyr) are always targetting the same + X display screen, which is + the one Xephyr got launched against. So we enforce that in the code. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received + from the client app. This is useful to know on which Xephyr screen we + need to display video stuff. + * hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change + in hw/kdrive/ephyr/ephyrhostvideo.h. + (ephyrSetPortAttribute): when parameters are not valid + - they exceed their validity range - send them to the host anyway + and do not return an error to clients. + Some host expose buggy validity range, so rejecting client for that + is too harsh. commit ab88cb8d2e7c1410f9ed2be928b38f176b132e11 Author: Peter Hutterer @@ -128479,8 +140935,8 @@ Conflicts: - configure.ac - exa/exa_render.c + configure.ac + exa/exa_render.c commit 59cebcd2e9302d15a52588ecafbbc2d2c5ae3a6c Author: Eamon Walsh @@ -128514,9 +140970,9 @@ Xephyr: glx fixlet - * hw/kdrive/ephyr/ephyrhostglx.c: - (ephyrHostGLXQueryVersion): properly query - the host for its gxl version. + * hw/kdrive/ephyr/ephyrhostglx.c: + (ephyrHostGLXQueryVersion): properly query + the host for its gxl version. commit 6a435b00003fb00930299a0e0810c93afc23a72e Author: Dodji Seketeli @@ -128524,17 +140980,17 @@ Xephyr: check presence of extensions in host X - * hw/kdrive/ephyr/hostx.c,h: - (hostx_has_xshape), - (hostx_has_glx), - (hostx_has_dri): added these new entry points - * hw/kdrive/ephyr/ephyrdriext.c: - (ephyrDRIExtensionInit): - check presence of DRI and XShape extensions before - trying to use them. - * hw/kdrive/ephyr/ephyrglxext.c: - (ephyrHijackGLXExtension): - check presence of glx extension before we use it. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_has_xshape), + (hostx_has_glx), + (hostx_has_dri): added these new entry points + * hw/kdrive/ephyr/ephyrdriext.c: + (ephyrDRIExtensionInit): + check presence of DRI and XShape extensions before + trying to use them. + * hw/kdrive/ephyr/ephyrglxext.c: + (ephyrHijackGLXExtension): + check presence of glx extension before we use it. commit 2b217fc055300d4c709dd27c4e8ec8166183993b Author: Dodji Seketeli @@ -128548,9 +141004,9 @@ Xephyr: add -nodri and -noxv switches. - * hw/kdrive/ephyr/ephyr.c,ephyrinit.c:: - add -nodri and -noxv to disable either DRI or XV. - When -nodri, mesa GL (non acceleretated) works. + * hw/kdrive/ephyr/ephyr.c,ephyrinit.c:: + add -nodri and -noxv to disable either DRI or XV. + When -nodri, mesa GL (non acceleretated) works. commit 50674391388b3cfe987782a3ad81b4f240f3db67 Author: Dodji Seketeli @@ -128558,12 +141014,12 @@ Kdrive: use fbcmap_mi.c instead of fbcmap.c - * hw/kdrive/src/Makefile.am: use fb/fbcmap_mi.c - and not fb/fbcmap.c. This allows kdrive to take advantage of - extensions redefining the entry points of micmap.c stuff. - For instance it allows Xephyr to have a working GL, which is not - possible otherwise, because GL redefines mInitVisualsProc - to initialise its visuals. + * hw/kdrive/src/Makefile.am: use fb/fbcmap_mi.c + and not fb/fbcmap.c. This allows kdrive to take advantage of + extensions redefining the entry points of micmap.c stuff. + For instance it allows Xephyr to have a working GL, which is not + possible otherwise, because GL redefines mInitVisualsProc + to initialise its visuals. commit a5bd536869f646e4024befa84f6e677b990310bc Author: Dodji Seketeli @@ -128584,14 +141040,14 @@ GLX: allow skipping of visual init wrapping - * GL/glx/glxvisuals.c: added boolean to disable - calling init_visuals(). This gives a chance to Xephyr - to take over visuals manipulation and avoid a crash at - server shutdown in __glXMesaScreenDestroy(), due to the fact - that mesa might sees more visual than what it has actually created in - init_visuals(). It might see more visuals because Xephyr can augment - the number of visuals, dynamically. - * os/utils.c: the boolean is actually defined here. + * GL/glx/glxvisuals.c: added boolean to disable + calling init_visuals(). This gives a chance to Xephyr + to take over visuals manipulation and avoid a crash at + server shutdown in __glXMesaScreenDestroy(), due to the fact + that mesa might sees more visual than what it has actually created in + init_visuals(). It might see more visuals because Xephyr can augment + the number of visuals, dynamically. + * os/utils.c: the boolean is actually defined here. commit ffe9ce6a843443606ad9367eca1645bf5e0635e5 Author: Dodji Seketeli @@ -128599,15 +141055,15 @@ Xephyr: fix a clipping issue xephyr-dri - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIGetDrawableInfo): force the back clipping rects - to equal the front clipping rects. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): properly overclip the clipping rects we - got from the client. This bug fixes a clipping rect that was too - small in height, basically. Also fix a possible mem corruption. - * hw/kdrive/ephyr/hostx.c: - (hostx_set_window_geometry): remove a useless XSync + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIGetDrawableInfo): force the back clipping rects + to equal the front clipping rects. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): properly overclip the clipping rects we + got from the client. This bug fixes a clipping rect that was too + small in height, basically. Also fix a possible mem corruption. + * hw/kdrive/ephyr/hostx.c: + (hostx_set_window_geometry): remove a useless XSync commit 79782726617d4b5a4f9b376f21936d035fc870e1 Author: Dodji Seketeli @@ -128627,23 +141083,23 @@ Xephyr: make accelerated glxgears work in Xephyr - * hw/kdrive/ephyr/ephyr.c: - (ephyrInitialize): cleanup ephyrDRI extension init. - remove functions that belongs in ephyrdriext.c . - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRICreateDrawable): create the drawable on the host X peer - window, not on the host xephyr main window. - (ephyrDRIGetDrawableInfo): get drawable info of the host X peer - window. - * hw/kdrive/ephyr/ephyrdriext.c: make ephyr DRI extention wrap - a bunch of screen ops so that it can update the host X peer - window whenever DRI bound drawable are moved in Xephyr. - Also code the building blocks of the management of the - host X window peer. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_create_window): added this new entry point - (hostx_destroy_window): ditto - ()hostx_set_window_geometry): ditto + * hw/kdrive/ephyr/ephyr.c: + (ephyrInitialize): cleanup ephyrDRI extension init. + remove functions that belongs in ephyrdriext.c . + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRICreateDrawable): create the drawable on the host X peer + window, not on the host xephyr main window. + (ephyrDRIGetDrawableInfo): get drawable info of the host X peer + window. + * hw/kdrive/ephyr/ephyrdriext.c: make ephyr DRI extention wrap + a bunch of screen ops so that it can update the host X peer + window whenever DRI bound drawable are moved in Xephyr. + Also code the building blocks of the management of the + host X window peer. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_create_window): added this new entry point + (hostx_destroy_window): ditto + ()hostx_set_window_geometry): ditto commit 6d1e44d3d53b451d466d43197be589d0ecc4b9f6 Author: Dodji Seketeli @@ -128651,22 +141107,22 @@ Xephyr: fix a host X hang. - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIGetDrawableInfo): quickly hook - this into getting the drawable info from the host - X server. For the time being, this only gets the drawable info - of the Xephyr main window in the host. It should really get - the info of a the peer drawable in the host X. So there should be a - peer drawable to begin with. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): some cleanups. Properly get the + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIGetDrawableInfo): quickly hook + this into getting the drawable info from the host + X server. For the time being, this only gets the drawable info + of the Xephyr main window in the host. It should really get + the info of a the peer drawable in the host X. So there should be a + peer drawable to begin with. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): some cleanups. Properly get the the drawable info otherwise there is a host X hang. - * hw/kdrive/ephyr/ephyrhostglx.c: do not - (ephyrHostGLXQueryVersion): do not use C bindings of the glx protocol - calls. Some of those actually access DRI context directly, resulting - in the context having three clients. Instead all XF86DRI proto - fowarding request should be coded by hand and only forward the - protocol requests + * hw/kdrive/ephyr/ephyrhostglx.c: do not + (ephyrHostGLXQueryVersion): do not use C bindings of the glx protocol + calls. Some of those actually access DRI context directly, resulting + in the context having three clients. Instead all XF86DRI proto + fowarding request should be coded by hand and only forward the + protocol requests commit a39b57d2f784f14e3198c8506f5eb865bacc2440 Author: Dodji Seketeli @@ -128674,7 +141130,7 @@ Xephyr: add more logging to GLX forwarding - * hw/kdrive/ephyr/ephyrhostglx.c: added more logging. + * hw/kdrive/ephyr/ephyrhostglx.c: added more logging. commit 9e192d2118246ad715e23cf5626a038274eb1eaa Author: Dodji Seketeli @@ -128682,14 +141138,14 @@ Xephyr: better error handling in GLX forwarding - * hw/kdrive/ephyr/ephyrglxext.c: - fixed various logging functions - (ephyrGLXGetStringReal): make sure all the string is sent to clients - including the ending zero. - * hw/kdrive/ephyr/ephyrhostglx.c: - (ephyrHostGLXGetStringFromServer): better error handling. - (ephyrHostGLXSendClientInfo): ditto. - (ephyrHostGLXMakeCurrent): ditto + * hw/kdrive/ephyr/ephyrglxext.c: + fixed various logging functions + (ephyrGLXGetStringReal): make sure all the string is sent to clients + including the ending zero. + * hw/kdrive/ephyr/ephyrhostglx.c: + (ephyrHostGLXGetStringFromServer): better error handling. + (ephyrHostGLXSendClientInfo): ditto. + (ephyrHostGLXMakeCurrent): ditto commit 4dd4be99df38b70d43b02d9cb19e09e0ed94462b Author: Dodji Seketeli @@ -128697,34 +141153,34 @@ Xephyr: Make glxinfo work on the ATI R200 free driver. - * hw/kdrive/ephyr/ephyr.c: - (EphyrDuplicateVisual): when duplicating the - visual, copy the color component masks and the class - from the hostX - (EphyrMirrorHostVisuals): don't mix blue and green mask. - * hw/kdrive/ephyr/ephyrdri.c: add more logs. - (ephyrDRICreateDrawable): actually implement this. - for the moment it creates a DRI drawable for the hostX window, - no matter what drawable this call was issued for. - (ephyrDRIGetDrawableInfo): actually implemented this. - for the moment the drawable info queried for its attrs is the - Xephyr main main window. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): properly hook this dispatch - function to the ephyrDRIGetDrawableInfo() function. - * hw/kdrive/ephyr/ephyrglxext.c: add a bunch of GLX implementation hooks - here. Hijack some of the xserver GLX hooks with them. Still need to - properly support byteswapped clients though. - * hw/kdrive/ephyr/ephyrhostglx.c,h: actually implemented the protocol - level forwarding functions used by the GLX entr points in - ephyrglxext.c. Here as well, there are a bunch of them, but we are - far from having implemented all the GLX calls. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_get_window_attributes): added this new entry point - (hostx_allocate_resource_id_peer): added this to keep track of - resource IDs peers: one member of the peer is in Xephyr, the other - is in host X. - (hostx_get_resource_id_peer): ditto. + * hw/kdrive/ephyr/ephyr.c: + (EphyrDuplicateVisual): when duplicating the + visual, copy the color component masks and the class + from the hostX + (EphyrMirrorHostVisuals): don't mix blue and green mask. + * hw/kdrive/ephyr/ephyrdri.c: add more logs. + (ephyrDRICreateDrawable): actually implement this. + for the moment it creates a DRI drawable for the hostX window, + no matter what drawable this call was issued for. + (ephyrDRIGetDrawableInfo): actually implemented this. + for the moment the drawable info queried for its attrs is the + Xephyr main main window. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): properly hook this dispatch + function to the ephyrDRIGetDrawableInfo() function. + * hw/kdrive/ephyr/ephyrglxext.c: add a bunch of GLX implementation hooks + here. Hijack some of the xserver GLX hooks with them. Still need to + properly support byteswapped clients though. + * hw/kdrive/ephyr/ephyrhostglx.c,h: actually implemented the protocol + level forwarding functions used by the GLX entr points in + ephyrglxext.c. Here as well, there are a bunch of them, but we are + far from having implemented all the GLX calls. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_get_window_attributes): added this new entry point + (hostx_allocate_resource_id_peer): added this to keep track of + resource IDs peers: one member of the peer is in Xephyr, the other + is in host X. + (hostx_get_resource_id_peer): ditto. commit 8c78df0ea36abc7d46c4f59670289f4280f75507 Author: Dodji Seketeli @@ -128732,9 +141188,9 @@ Xserver: fix potential crash - * dix/extension.c: - (AddExtensionAlias): don't crash when failed to add - extension alias. + * dix/extension.c: + (AddExtensionAlias): don't crash when failed to add + extension alias. commit 024abe825cd702334266f6b8da289907bbd05970 Author: Dodji Seketeli @@ -128748,11 +141204,11 @@ mirror the visuals of the host X at startup. - * hw/kdrive/ephyr/ephyr.c: make Xephyr mirror - the visuals of the host X upon startup. This - is important for GLX client apps. - * hw/kdrive/ephyr/hostx.c,h: add a hostx_get_visuals_info() - to get the visuals of the host X. + * hw/kdrive/ephyr/ephyr.c: make Xephyr mirror + the visuals of the host X upon startup. This + is important for GLX client apps. + * hw/kdrive/ephyr/hostx.c,h: add a hostx_get_visuals_info() + to get the visuals of the host X. commit 26da625055a3876c93a7a005520657b971748c4e Author: Dodji Seketeli @@ -128760,20 +141216,20 @@ proxy the glXGetFBConfigSGIX call - * hw/kdrive/ephyr/ephyrglxext.c: - (ephyrGLXGetFBConfigsSGIX): proxy the GLXGetFBConfigsSGIX call. - It is a vendor extension to get the visual configs as a list of - name/value pairs. - (ephyrHijackGLXExtension): hijack the VendorPriv_dispatch_info - dispatch table to register our implementation of GLXGetFBConfigsSGIX - (ephyrGLXGetFBConfigsSGIXReal): added this where the real - implementation of GLXGetFBConfigsSGIX is. It support bytes swapping. - (ephyrGLXGetFBConfigsSGIX,ephyrGLXGetFBConfigsSGIXSwap): these are - the dispatch entry points. They just call - ephyrGLXGetFBConfigsSGIXReal. - * hw/kdrive/ephyr/ephyrhostglx.c,h: reorganize the proxies to get - visual params from the host so that they clearly support the different - methods of doing so. + * hw/kdrive/ephyr/ephyrglxext.c: + (ephyrGLXGetFBConfigsSGIX): proxy the GLXGetFBConfigsSGIX call. + It is a vendor extension to get the visual configs as a list of + name/value pairs. + (ephyrHijackGLXExtension): hijack the VendorPriv_dispatch_info + dispatch table to register our implementation of GLXGetFBConfigsSGIX + (ephyrGLXGetFBConfigsSGIXReal): added this where the real + implementation of GLXGetFBConfigsSGIX is. It support bytes swapping. + (ephyrGLXGetFBConfigsSGIX,ephyrGLXGetFBConfigsSGIXSwap): these are + the dispatch entry points. They just call + ephyrGLXGetFBConfigsSGIXReal. + * hw/kdrive/ephyr/ephyrhostglx.c,h: reorganize the proxies to get + visual params from the host so that they clearly support the different + methods of doing so. commit 5af73f98c46dfe5640185ca90feb20c39c6e06fa Author: Dodji Seketeli @@ -128781,16 +141237,16 @@ EPHYR: Add an experiment proto proxy extension. - * hw/kdrive/ephyr/Makefile.am: add the proxy extension to - ephyr. The proxy extension is an experimental extension that - forwards protocol packets targeted at a given extension to the - host X. - * hw/kdrive/ephyr/ephyr.c: init proxy ext. - * hw/kdrive/ephyr/ephyrhostproxy.c,h: added this new file as part of the - proxy extension. - * hw/kdrive/ephyr/ephyrproxyext.c,h: ditto - * hw/kdrive/ephyr/hostx.c: add the hostx_get_get_extension_info() entry - point. + * hw/kdrive/ephyr/Makefile.am: add the proxy extension to + ephyr. The proxy extension is an experimental extension that + forwards protocol packets targeted at a given extension to the + host X. + * hw/kdrive/ephyr/ephyr.c: init proxy ext. + * hw/kdrive/ephyr/ephyrhostproxy.c,h: added this new file as part of the + proxy extension. + * hw/kdrive/ephyr/ephyrproxyext.c,h: ditto + * hw/kdrive/ephyr/hostx.c: add the hostx_get_get_extension_info() entry + point. commit c06fa924b4781a35b86e4a78d95ff3e9d95b02d1 Author: Dodji Seketeli @@ -128798,22 +141254,22 @@ XEPHYR: more GLX/DRI proxying work. - * hw/kdrive/ephyr/XF86dri.c: re format this correctly. - Make function decls honour the Ansi-C standard. - * hw/kdrive/ephyr/ephyr.c: protect glx/dri related - extension initialisation with the XEPHYR_DRI - macro. Initialize the GLX ext hijacking - at startup. - * hw/kdrive/ephyr/ephyrdri.c: add more logging to ease debugging - * hw/kdrive/ephyr/ephyrdriext.c: ditto. reformat. - * hw/kdrive/ephyr/ephyrglxext.c,h: add this extension to - proxy GLX requests to the host X. started to proxy those nedded to - make glxinfo work with fglrx. Not yet finished. - * hw/kdrive/ephyr/ephyrhostglx.c,h: put here the actual - Xlib code used to hit the host X server because Xlib stuff cannot be - mixed with xserver internal code, otherwise compilation erros due to - type clashes happen. So no Xlib type should be exported by the - entrypoints defined here. + * hw/kdrive/ephyr/XF86dri.c: re format this correctly. + Make function decls honour the Ansi-C standard. + * hw/kdrive/ephyr/ephyr.c: protect glx/dri related + extension initialisation with the XEPHYR_DRI + macro. Initialize the GLX ext hijacking + at startup. + * hw/kdrive/ephyr/ephyrdri.c: add more logging to ease debugging + * hw/kdrive/ephyr/ephyrdriext.c: ditto. reformat. + * hw/kdrive/ephyr/ephyrglxext.c,h: add this extension to + proxy GLX requests to the host X. started to proxy those nedded to + make glxinfo work with fglrx. Not yet finished. + * hw/kdrive/ephyr/ephyrhostglx.c,h: put here the actual + Xlib code used to hit the host X server because Xlib stuff cannot be + mixed with xserver internal code, otherwise compilation erros due to + type clashes happen. So no Xlib type should be exported by the + entrypoints defined here. commit 0b8545144975bf7ed43c2564d01c697144eb1244 Author: Dodji Seketeli @@ -128821,14 +141277,14 @@ Implement ReputImage and StopVideo - * hw/kdrive/ephyr/ephyrhostvideo.c/h: - (ephyrHostXVStopVideo): add this entry point. - * hw/kdrive/ephyr/ephyrvideo.c: - Basically add ReputImage and StopVideo implementations. - Now, when other windows obscur the video window, the reclipping - seems to be well handled using StopVideo and ReputImage. - To do this, I was obliged to save the frame in PutImage, so - that I could resend it un ReputImage. + * hw/kdrive/ephyr/ephyrhostvideo.c/h: + (ephyrHostXVStopVideo): add this entry point. + * hw/kdrive/ephyr/ephyrvideo.c: + Basically add ReputImage and StopVideo implementations. + Now, when other windows obscur the video window, the reclipping + seems to be well handled using StopVideo and ReputImage. + To do this, I was obliged to save the frame in PutImage, so + that I could resend it un ReputImage. commit 810dc55866d1c2343512354646c7ab309ea1fad2 Author: Dodji Seketeli @@ -128836,8 +141292,8 @@ Ephyr-Xv: add a new line to a log - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrQueryImageAttributes): add newline to log. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrQueryImageAttributes): add newline to log. commit 47e6dff89e48249828e828502e98951eee7f85bc Author: Dodji Seketeli @@ -128845,11 +141301,11 @@ Xephyr-Xv: fix a crash when host X support several ports - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrXVPrivQueryHostAdaptors): properly set - port private luke. This fixes a crash when - the host Xv supports multiple ports. - Make sure number of ports cannot be zero. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrXVPrivQueryHostAdaptors): properly set + port private luke. This fixes a crash when + the host Xv supports multiple ports. + Make sure number of ports cannot be zero. commit a38ad562a6f50e9d76a37917b936035215ea460e Author: Dodji Seketeli @@ -128857,15 +141313,15 @@ make xephyr talk DRI protocol with hostX - * configure.ac,include/dix-config.h.in: define the XEPHYR_DRI macro. - define it when --enable-xephyr and --enable-dri are both turned on. - * hw/kdrive/ephyr/XF86dri.c: copy this from mesa source to enable - Xephyr to talk DRI protocol the host X. In mesa, this is used by libGL.so to - talk DRI protocol with the server. - * hw/kdrive/ephyr/ephyr.c: finally initialise the DRI extension - in the ephyrInitScreen() function. - * hw/kdrive/ephyr/ephyrdri.c,ephyrdriext.c: safeguard the compilation - using the XEPHYR_DRI macro. + * configure.ac,include/dix-config.h.in: define the XEPHYR_DRI macro. + define it when --enable-xephyr and --enable-dri are both turned on. + * hw/kdrive/ephyr/XF86dri.c: copy this from mesa source to enable + Xephyr to talk DRI protocol the host X. In mesa, this is used by libGL.so to + talk DRI protocol with the server. + * hw/kdrive/ephyr/ephyr.c: finally initialise the DRI extension + in the ephyrInitScreen() function. + * hw/kdrive/ephyr/ephyrdri.c,ephyrdriext.c: safeguard the compilation + using the XEPHYR_DRI macro. commit e4239a48075c77e6a8d2d5cb21f58dd67687482f Author: Dodji Seketeli @@ -128873,16 +141329,16 @@ Initial dri forwarding big bricks. - * hw/kdrive/ephyr/ephyrdriext.c: added this to implement a DRI extension - into Xephyr. Normally the DRI extension is only present in the - xfree86 server, but I have ported it to Xephyr. The extension calls - functions that declared/defined in ephyrdri.h ephyrdri.c that - forwards the DRI calls to the host X. It does not work yet, as this - entry is just to put the big bricks in place. - * hw/kdrive/ephyr/ephyrdri.c,h: declaration & definition of the - DRI client API that would hit the hostX server. - * hw/kdrive/ephyr/GL/internal/dri_interface.h: added this, otherwise - inclusion of /usr/include/X11/dri/xf86dri.h won't compile + * hw/kdrive/ephyr/ephyrdriext.c: added this to implement a DRI extension + into Xephyr. Normally the DRI extension is only present in the + xfree86 server, but I have ported it to Xephyr. The extension calls + functions that declared/defined in ephyrdri.h ephyrdri.c that + forwards the DRI calls to the host X. It does not work yet, as this + entry is just to put the big bricks in place. + * hw/kdrive/ephyr/ephyrdri.c,h: declaration & definition of the + DRI client API that would hit the hostX server. + * hw/kdrive/ephyr/GL/internal/dri_interface.h: added this, otherwise + inclusion of /usr/include/X11/dri/xf86dri.h won't compile commit e01d3dd98d1b596e75d25f94dd89c7d41223011d Author: Dodji Seketeli @@ -128890,13 +141346,13 @@ Support clipping region in PutImage. - * hw/kdrive/ephyr/ephyrhostvideo.c,h: - (ephyrHostXVPutImage): make this support clipping region. - The clipping region is propagated to host using XSetClipRectangles. - This changes the API of ephyrHostXVPutImage. - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrPutImage): propagate the clipping region to the new - ephyrHostXVPutImage() entry point. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: + (ephyrHostXVPutImage): make this support clipping region. + The clipping region is propagated to host using XSetClipRectangles. + This changes the API of ephyrHostXVPutImage. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrPutImage): propagate the clipping region to the new + ephyrHostXVPutImage() entry point. commit 39d3895469f07304d72800d8dcef6c7732f13d5f Author: Dodji Seketeli @@ -128904,10 +141360,10 @@ make EphyrXVPriv be a singleton - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrInitVideo) make the EphyrXVPriv object be a - singleton instance, otherwise a new object is created at each - generation. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrInitVideo) make the EphyrXVPriv object be a + singleton instance, otherwise a new object is created at each + generation. commit 4ed083095a13ec92bb4c8e705f26500f8312c138 Author: Dodji Seketeli @@ -128915,21 +141371,21 @@ add [Get/Put]Video and [Get/Put]Still support - * hw/kdrive/ephyr/ephyrhostvideo.c,h: - (ephyrHostXVAdaptorHasXXX): fix these. - (ephyrHostXVAdaptorHasGetVideo): added this - (ephyrHostXVAdaptorHasGetStill): ditto - (ephyrHostXVPutVideo): added this - (ephyrHostXVGetVideo): ditto - (ephyrHostXVPutStill): ditto - (ephyrHostXVGetStill): ditto - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrPutVideo): implement this - (ephyrGetVideo): ditto - (ephyrPutStill): ditto - (ephyrGetStill): ditto - (ephyrXVPrivSetAdaptorsHooks): advertise GetVideo and GetStill - when the host X supports it. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: + (ephyrHostXVAdaptorHasXXX): fix these. + (ephyrHostXVAdaptorHasGetVideo): added this + (ephyrHostXVAdaptorHasGetStill): ditto + (ephyrHostXVPutVideo): added this + (ephyrHostXVGetVideo): ditto + (ephyrHostXVPutStill): ditto + (ephyrHostXVGetStill): ditto + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrPutVideo): implement this + (ephyrGetVideo): ditto + (ephyrPutStill): ditto + (ephyrGetStill): ditto + (ephyrXVPrivSetAdaptorsHooks): advertise GetVideo and GetStill + when the host X supports it. commit 6f7961bc218169aaa0d10cfad0952adb7fac2f00 Author: Dodji Seketeli @@ -129102,21 +141558,21 @@ Xephyr: add "multiscreen" suport - * This patch adds multiscreen support to Xephyr. For instance, - the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480" - will launch with two "screens" - namely two main windows. - The first main window represents a screen that has the number :4.0, with - a geometry of 320x240 pixels, and the second one represents a screen - that has the number :4.1 with a geometry of 640x480. - The command line: "DISPLAY=:4.1 xclock" will launch the xclock program - on the second screen, for intance. - - * this patch was edited by Dodji Seketeli for: - - better style compliance with the rest of the Xephyr code - - make sure Xephyr could be launched with no -screen option. By - default that creates a default screen of 640x480 pixel like before - - display full titles on the windows - with insctructions to grab - keyboard and mouse - like before. + * This patch adds multiscreen support to Xephyr. For instance, + the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480" + will launch with two "screens" - namely two main windows. + The first main window represents a screen that has the number :4.0, with + a geometry of 320x240 pixels, and the second one represents a screen + that has the number :4.1 with a geometry of 640x480. + The command line: "DISPLAY=:4.1 xclock" will launch the xclock program + on the second screen, for intance. + + * this patch was edited by Dodji Seketeli for: + - better style compliance with the rest of the Xephyr code + - make sure Xephyr could be launched with no -screen option. By + default that creates a default screen of 640x480 pixel like before + - display full titles on the windows - with insctructions to grab + keyboard and mouse - like before. commit 81692b628f41cb64329f3cccc0503fb216a2b8e3 Author: Dodji Seketeli @@ -129124,12 +141580,12 @@ Fix #12650: "windows not receiving mouse events in multiple screens context" - * dix/events.c, include/dix.h: - (UpdateSpriteForScreen): added this to update the mouse sprite context - when we switch from a pScreen to another. - * mi/mipointer.c: - (miPointerWarpCursor): as we are switching to a new pScreen, - don't forget to update the mouse sprite context. + * dix/events.c, include/dix.h: + (UpdateSpriteForScreen): added this to update the mouse sprite context + when we switch from a pScreen to another. + * mi/mipointer.c: + (miPointerWarpCursor): as we are switching to a new pScreen, + don't forget to update the mouse sprite context. commit f965a5f3454a95ddffb2faf9b291feff46305adf Author: Peter Hutterer @@ -129412,7 +141868,7 @@ Conflicts: - dix/devices.c + dix/devices.c commit 3b114f2603fc2adeec7f5f8f20fe4870afb8dff1 Author: Eamon Walsh @@ -129440,9 +141896,9 @@ Xephyr: fix compiler warnings - * hw/kdrive/ephyr/ephyr_draw.c: - (ephyrDownloadFromScreen), - (ephyrUploadToScreen): fix compiler warnings + * hw/kdrive/ephyr/ephyr_draw.c: + (ephyrDownloadFromScreen), + (ephyrUploadToScreen): fix compiler warnings commit 8f9bf927e1beecf9b9ec8877131ec12c765e4d84 Author: Peter Hutterer @@ -129833,24 +142289,24 @@ Conflicts: - afb/afbpntwin.c - afb/afbscrinit.c - afb/afbwindow.c - cfb/cfb.h - cfb/cfballpriv.c - cfb/cfbscrinit.c - cfb/cfbwindow.c - configure.ac - fb/wfbrename.h - hw/xfree86/xf4bpp/ppcIO.c - hw/xfree86/xf4bpp/ppcPntWin.c - hw/xfree86/xf4bpp/ppcWindow.c - hw/xfree86/xf8_32bpp/cfbscrinit.c - mfb/mfb.h - mfb/mfbpntwin.c - mfb/mfbscrinit.c - mfb/mfbwindow.c - mi/miexpose.c + afb/afbpntwin.c + afb/afbscrinit.c + afb/afbwindow.c + cfb/cfb.h + cfb/cfballpriv.c + cfb/cfbscrinit.c + cfb/cfbwindow.c + configure.ac + fb/wfbrename.h + hw/xfree86/xf4bpp/ppcIO.c + hw/xfree86/xf4bpp/ppcPntWin.c + hw/xfree86/xf4bpp/ppcWindow.c + hw/xfree86/xf8_32bpp/cfbscrinit.c + mfb/mfb.h + mfb/mfbpntwin.c + mfb/mfbscrinit.c + mfb/mfbwindow.c + mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes. @@ -129958,7 +142414,7 @@ Conflicts: - mi/miexpose.c + mi/miexpose.c commit e4d11e58ce349dfe6af2f73ff341317f9b39684c Author: Eric Anholt @@ -130883,10 +143339,10 @@ Conflicts: - include/miscstruct.h - mi/mibstore.c - mi/midispcur.c - os/Makefile.am + include/miscstruct.h + mi/mibstore.c + mi/midispcur.c + os/Makefile.am commit 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3 Author: Eric Anholt @@ -131037,16 +143493,16 @@ Conflicts: - hw/xfree86/common/xf86.h - hw/xfree86/common/xf86Init.c - hw/xfree86/common/xf86pciBus.c - hw/xfree86/int10/generic.c - hw/xfree86/int10/helper_exec.c - hw/xfree86/loader/xf86sym.c - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/Pci.h - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/os-support/linux/int10/linux.c + hw/xfree86/common/xf86.h + hw/xfree86/common/xf86Init.c + hw/xfree86/common/xf86pciBus.c + hw/xfree86/int10/generic.c + hw/xfree86/int10/helper_exec.c + hw/xfree86/loader/xf86sym.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/Pci.h + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/linux/int10/linux.c commit 93ae6fe18c417a22f1fccb22add4890a20cae713 Author: Carl Worth @@ -131486,11 +143942,11 @@ Conflicts: - Xi/exevents.c - dix/devices.c - dix/getevents.c - include/dix.h - mi/mieq.c + Xi/exevents.c + dix/devices.c + dix/getevents.c + include/dix.h + mi/mieq.c commit 03f9da672466b9ab9a9814d784b8c44f1030587e Author: Samuel Thibault @@ -131861,9 +144317,9 @@ Conflicts: - dix/devices.c - dix/property.c - include/dix.h + dix/devices.c + dix/property.c + include/dix.h commit f3955c0a020b39021050cd33c20a17f14fc4b579 Author: Arkadiusz Miskiewicz @@ -132046,7 +144502,7 @@ find -name '*.c' -o -name '*.h' | xargs gvim egrep -Rli "permission|copyright" * | grep -v "\.[ch]" \ - | grep -v "\.in$" | xargs gvim + | grep -v "\.in$" | xargs gvim cd .. tar xvjf /usr/portage/distfiles/xorg-server-1.3.0.0.tar.bz2 @@ -133027,7 +145483,7 @@ Conflicts: - Xi/exevents.c + Xi/exevents.c commit 24ee89fd60f489f2d3af0399e0d667057df74d02 Author: Peter Hutterer @@ -133169,10 +145625,10 @@ Conflicts: - dix/devices.c - hw/xfree86/common/xf86Xinput.c - hw/xfree86/loader/xf86sym.c - mi/mieq.c + dix/devices.c + hw/xfree86/common/xf86Xinput.c + hw/xfree86/loader/xf86sym.c + mi/mieq.c commit 40f27a2df4906d9ceb1c78f6163a62c497321535 Author: Michel Dänzer @@ -133211,8 +145667,8 @@ Conflicts: - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/linuxPci.c commit 2e7fef7d0837939e822c40b6ac77e7f0e66d57bd Author: Adam Jackson @@ -133293,7 +145749,7 @@ Conflicts: - dix/dixutils.c + dix/dixutils.c commit 3f9adb18f127318d054f30a57e3a77176e14c692 Author: Søren Sandmann Pedersen @@ -133790,7 +146246,7 @@ Conflicts: - include/miscstruct.h + include/miscstruct.h commit cc648e609d472472bac4a2e568eb3598b3690ba3 Author: Michel Dänzer @@ -134035,7 +146491,7 @@ Conflicts: - dix/events.c + dix/events.c commit 81fc6a128b64ad412064405ed45db0175398e3f0 Author: Peter Hutterer @@ -134529,8 +146985,8 @@ Conflicts: - dix/devices.c - dix/events.c + dix/devices.c + dix/events.c commit 339b73e710a0920608a3fbcb20b406f0f6c4e0f6 Author: Peter Hutterer @@ -135060,7 +147516,7 @@ Conflicts: - dix/privates.c + dix/privates.c commit b6aec7f6f906a18d13586d63afabf1ee4fbb11c3 Author: Peter Hutterer @@ -135231,9 +147687,9 @@ Conflicts: - configure.ac - dix/events.c - hw/xfree86/common/xf86Xinput.c + configure.ac + dix/events.c + hw/xfree86/common/xf86Xinput.c commit 33a5d9605e3e282f6aa1921d7321a2a12ef02c42 Author: Daniel Stone @@ -135485,7 +147941,7 @@ Conflicts: - configure.ac + configure.ac commit 5ad562565ac8ef9257da3afb0de1ae4f90f80fe9 Author: Eamon Walsh @@ -135770,14 +148226,14 @@ Conflicts: - Xi/closedev.c - Xi/exevents.c - Xi/extinit.c - Xi/listdev.c - dix/window.c - hw/xfree86/common/xf86Xinput.c - include/extinit.h - mi/mipointer.c + Xi/closedev.c + Xi/exevents.c + Xi/extinit.c + Xi/listdev.c + dix/window.c + hw/xfree86/common/xf86Xinput.c + include/extinit.h + mi/mipointer.c commit 96ce17aa94413c4b8bcb61cae71167050130a307 Author: Peter Hutterer @@ -135985,8 +148441,8 @@ Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/dri/dri.c + hw/xfree86/Makefile.am + hw/xfree86/dri/dri.c commit 85220446359a75ea2c359b418b4051c04eea739c Author: Daniel Stone @@ -136205,8 +148661,8 @@ Conflicts: - randr/randrstr.h - randr/rrcrtc.c + randr/randrstr.h + randr/rrcrtc.c I think master and server-1.3-branch are more in sync now. @@ -136457,9 +148913,9 @@ Conflicts: - dix/devices.c - dix/events.c - mi/misprite.c + dix/devices.c + dix/events.c + mi/misprite.c commit 720f302d241e88e6e9f2962207da1aa9a79728b7 Author: Keith Packard @@ -136527,7 +148983,7 @@ Conflicts: - randr/randrstr.h + randr/randrstr.h Updated code to work in master with recent security API changes. @@ -136988,11 +149444,11 @@ Conflicts: - configure.ac - dix/getevents.c - hw/xfree86/ramdac/xf86Cursor.c - mi/mipointer.c - xkb/xkbUtils.c + configure.ac + dix/getevents.c + hw/xfree86/ramdac/xf86Cursor.c + mi/mipointer.c + xkb/xkbUtils.c commit 06b01186f6ae17aafdd1f628c306466ddea9e065 Author: Keith Packard @@ -137301,9 +149757,9 @@ Author: Peter Hutterer Date: Thu Feb 22 20:00:59 2007 +1030 - Xi: Add access control request handling. + Xi: Add access control request handling. - dix: New file access.c to handle all access control for devices. + dix: New file access.c to handle all access control for devices. commit 9a3eb0357e779d5d5f76858f23667956c4c5d721 Author: Eamon Walsh @@ -137787,7 +150243,7 @@ dix: If POINTER_CORE_ONLY is set, GetPointerEvents() only creates a core event - mi: fix: Create motion event in miPointerMoved + mi: fix: Create motion event in miPointerMoved commit 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6 Author: Daniel Stone @@ -137812,9 +150268,9 @@ Author: Peter Hutterer Date: Mon Feb 5 11:38:44 2007 +1030 - xkb: Daniel's patch to stop evdev keyboard segfaults. + xkb: Daniel's patch to stop evdev keyboard segfaults. - mi: Remove quickfix from ba547d4f6a2707f51f0d826389d2d418fb62367a + mi: Remove quickfix from ba547d4f6a2707f51f0d826389d2d418fb62367a commit 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec Author: Dave Airlie @@ -137912,7 +150368,7 @@ Conflicts: - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/linuxPci.c commit 31f2d4a57e04f5ea635fbb50c508405c4fc37b65 Author: Eric Anholt @@ -137931,12 +150387,12 @@ Author: Peter Hutterer Date: Mon Jan 29 18:23:24 2007 +1030 - Xi: Adding ChangePointerKeyboardPairing request - Adding PointerKeyboardPairingChanged event - Correct error values for XWarpDevicePointer + Xi: Adding ChangePointerKeyboardPairing request + Adding PointerKeyboardPairingChanged event + Correct error values for XWarpDevicePointer - dix: Adding device argument to SendMappingNotify - Adding spriteOwner flag to devices + dix: Adding device argument to SendMappingNotify + Adding spriteOwner flag to devices commit f3418b52dcf2ab4982504856ab9fae3e726ee6d2 Author: Peter Hutterer @@ -138377,8 +150833,8 @@ Author: Peter Hutterer Date: Thu Jan 11 14:05:39 2007 +1030 - mi: remove core pointer special handling. No event has core pointer as - device now. + mi: remove core pointer special handling. No event has core pointer as + device now. dix: zero pSprite memory, stop segfaults on server restart. @@ -138403,8 +150859,8 @@ Date: Wed Jan 10 14:52:13 2007 +1030 Xi: add missing call for SProcXChangeDeviceCursor - add DeviceEnterNotify and DeviceLeaveNotify - fix: QueryDevicePointer crashed if called with keyboard device + add DeviceEnterNotify and DeviceLeaveNotify + fix: QueryDevicePointer crashed if called with keyboard device commit 6a2fb2928714ce77ee342cdc23a1178e5e766cf2 Author: Eric Anholt @@ -138421,7 +150877,7 @@ Conflicts: - hw/xfree86/int10/generic.c + hw/xfree86/int10/generic.c commit e3aa6ad201eb20862c11c000e76206e317a96dc9 Author: Matthieu Herrb @@ -138506,8 +150962,8 @@ Conflicts: - GL/glx/indirect_dispatch_swap.c - GL/glx/swap_interval.c + GL/glx/indirect_dispatch_swap.c + GL/glx/swap_interval.c commit 45aa26ccb4f61c2919ce2475d0907c6e1b177da2 Author: Ian Romanick @@ -138755,10 +151211,10 @@ Date: Wed Dec 20 13:05:53 2006 +1030 xfree86: Changing "IsMPDevice" to "SharedPointer" option. Devices will default - to MP devices. + to MP devices. - Xi: Adding QueryDevicePointer request/reply - Adding WarpDevicePointer request/reply + Xi: Adding QueryDevicePointer request/reply + Adding WarpDevicePointer request/reply commit e437f357b6850a6c87ca6696870b3abd40e5b8ed Author: Alan Coopersmith @@ -138815,8 +151271,8 @@ Conflicts: - exa/exa_accel.c - exa/exa_migration.c + exa/exa_accel.c + exa/exa_migration.c commit fdcc22ca1704d3519156c66804528c21b04fea65 Author: Michel Dänzer @@ -138881,14 +151337,14 @@ Date: Mon Dec 18 15:33:54 2006 +1030 mi: removing MPX ifdefs - global sprite renaming in mipointer and misprite - fixed: multiple remove cursor call in miSpriteInstallColormap - fixed: wrong core pointer usage in miSpriteStoreColors + global sprite renaming in mipointer and misprite + fixed: multiple remove cursor call in miSpriteInstallColormap + fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement - removing MPX ifdefs - removing MPX event generation (using Xi solely now) - bugfix GrabDevice: uninitialized field in grab struct caused segfault + removing MPX ifdefs + removing MPX event generation (using Xi solely now) + bugfix GrabDevice: uninitialized field in grab struct caused segfault xfree86: removing MPX fdefs @@ -139041,13 +151497,13 @@ Date: Thu Dec 14 10:50:18 2006 +1030 mi: removing MPX ifdefs - global sprite renaming in mipointer and misprite - fixed: multiple remove cursor call in miSpriteInstallColormap - fixed: wrong core pointer usage in miSpriteStoreColors + global sprite renaming in mipointer and misprite + fixed: multiple remove cursor call in miSpriteInstallColormap + fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement - removing MPX ifdefs - removing MPX event generation (using Xi solely now) + removing MPX ifdefs + removing MPX event generation (using Xi solely now) commit b88ad820fac81d0dfd557a384bf0406e8893e7af Author: Alan Hourihane @@ -139168,8 +151624,8 @@ Date: Mon Dec 11 18:09:59 2006 +1030 dix: Moving SpriteRec into DeviceIntRec - removing global sprite structure - beginning to remove MPX ifdefs + removing global sprite structure + beginning to remove MPX ifdefs xnest: Fix to make xnest compile again @@ -139188,16 +151644,16 @@ Conflicts: - hw/xfree86/common/xf86Configure.c - hw/xfree86/common/xf86Helper.c - hw/xfree86/common/xf86pciBus.c - hw/xfree86/int10/helper_exec.c - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/os-support/linux/lnx_pci.c - hw/xfree86/scanpci/Makefile.am - hw/xfree86/utils/pcitweak/Makefile.am - hw/xfree86/utils/scanpci/Makefile.am + hw/xfree86/common/xf86Configure.c + hw/xfree86/common/xf86Helper.c + hw/xfree86/common/xf86pciBus.c + hw/xfree86/int10/helper_exec.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/linux/lnx_pci.c + hw/xfree86/scanpci/Makefile.am + hw/xfree86/utils/pcitweak/Makefile.am + hw/xfree86/utils/scanpci/Makefile.am commit d56249a15ead51ad4d2117d5538ada24af05b693 Merge: f1f8df1 ec84f72 @@ -139370,7 +151826,7 @@ Conflicts: - dix/events.c + dix/events.c commit 2a511492f9a235d3f5390ab87b6c643cbea92d88 Author: Peter Hutterer @@ -139379,8 +151835,8 @@ Xi: adding MPX checks to ProcessOtherEvents mpx: adding QueryPointer request and reply - adjusting names of requests to Xlib compatible naming (xMPX*** instead of - mpx***) + adjusting names of requests to Xlib compatible naming (xMPX*** instead of + mpx***) commit f9f7d7f3be53c808abb5eaceb7a1abc55744a210 Author: Alan Coopersmith @@ -139434,13 +151890,13 @@ Date: Fri Dec 1 15:56:52 2006 +1030 mpx: SelectEvents and GetEventBase requests. - Some renaming and cleaning up in extinit.c - MPXLastEvent added + Some renaming and cleaning up in extinit.c + MPXLastEvent added - Xi: ShouldFreeInputMask() from XI is not static any more, used in mpx + Xi: ShouldFreeInputMask() from XI is not static any more, used in mpx - dix: GetPointerEvents() allocates MPX event for MPX devices. - DeliverDeviceEvents() caters for MPX devices. + dix: GetPointerEvents() allocates MPX event for MPX devices. + DeliverDeviceEvents() caters for MPX devices. commit ccd804c6c01cdfffe938fa5336be9b5668a6f0c0 Merge: 9423ac1 82912ad @@ -139591,9 +152047,9 @@ Author: Peter Hutterer Date: Tue Nov 28 18:06:34 2006 +1030 - dix: missing parameter to SetCursorPosition in CheckMotion ifndef MPX + dix: missing parameter to SetCursorPosition in CheckMotion ifndef MPX - mi: missing include in misprite.c ifndef MPX + mi: missing include in misprite.c ifndef MPX commit e88bc0e55a6937ff0b47fe38f60bfa8991196578 Author: Peter Hutterer @@ -139624,12 +152080,12 @@ Conflicts: - dix/events.c - dix/getevents.c - hw/xfree86/common/xf86Mode.c - hw/xfree86/dri/Makefile.am - hw/xfree86/os-support/drm/xf86drm.c - hw/xfree86/os-support/xf86drm.h + dix/events.c + dix/getevents.c + hw/xfree86/common/xf86Mode.c + hw/xfree86/dri/Makefile.am + hw/xfree86/os-support/drm/xf86drm.c + hw/xfree86/os-support/xf86drm.h commit d6cd0313c7f23f32c9c7dda00ff739e772bf7db3 Author: Eric Anholt @@ -139646,49 +152102,49 @@ Date: Mon Nov 27 18:07:16 2006 +1030 mi: malloc checks for misprite and midispcur, code cleanup - removed IsMPDev() + removed IsMPDev() commit 023da4e804ad260eaf0c50d2ec7213dd514e2113 Author: Peter Hutterer Date: Mon Nov 27 15:54:33 2006 +1030 mi: mipointer.c cleanup, reducing code duplication, using MPHasCursor() - instead of IsMPDev() + instead of IsMPDev() commit a2340a73687dfd93affb6de28a33d73fd808c96b Author: Peter Hutterer Date: Mon Nov 27 14:47:23 2006 +1030 mi: free allocated memory in miDCCloseScreen and in miDCInitialize in case - of errors. - Some copyright notices. - misprite.c passes DeviceIntPtr around and down to DC (previously - miCursorInfoPtr and the plain device id). - Large cleanup in misprite.c to avoid code duplication. + of errors. + Some copyright notices. + misprite.c passes DeviceIntPtr around and down to DC (previously + miCursorInfoPtr and the plain device id). + Large cleanup in misprite.c to avoid code duplication. commit 1c7568b8a1417257fa67c7fca69aa253099b9461 Author: Peter Hutterer Date: Thu Nov 23 17:15:14 2006 +1030 - mi: closing memory leak, miPointer is freed in miPointerCloseScreen - bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX - adding DeviceIntPtr parameter to ScreenRec's cursor functions. - cleanup of miPointer code to use same scheme in each function + mi: closing memory leak, miPointer is freed in miPointerCloseScreen + bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX + adding DeviceIntPtr parameter to ScreenRec's cursor functions. + cleanup of miPointer code to use same scheme in each function - dix: MPHasCursor() function determines checking whether to invoke - cursor rendering. + dix: MPHasCursor() function determines checking whether to invoke + cursor rendering. animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies - on the core pointer right now. + on the core pointer right now. xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on - the core pointer right now. + the core pointer right now. - rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on - the core pointer right now. + rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on + the core pointer right now. - ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on - the core pointer right now. + ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on + the core pointer right now. commit 64de3baf85f6df274f71f736016f0848567cd9f6 Author: Aaron Plattner @@ -139725,7 +152181,7 @@ Author: Peter Hutterer Date: Wed Nov 22 17:58:57 2006 +1030 - dix: DeliverEventsToWindow adjusted for MPX + dix: DeliverEventsToWindow adjusted for MPX mi: sprite debugging disabled @@ -139733,10 +152189,10 @@ Author: Peter Hutterer Date: Wed Nov 22 17:06:47 2006 +1030 - dix GetSpriteWindow() adjusted for MPX - added device dependency for MPX to DoEnterLeaveEvents, - EnterLeaveEvents, EnterNotifies, LeaveNotifies and - FixUpEventFromWindow. + dix GetSpriteWindow() adjusted for MPX + added device dependency for MPX to DoEnterLeaveEvents, + EnterLeaveEvents, EnterNotifies, LeaveNotifies and + FixUpEventFromWindow. commit 70383105de279df553874efa56b37a7b3e426ea1 Author: Peter Hutterer @@ -139749,7 +152205,7 @@ events.c (XineramaChangeToCursor, XineramaCheckPhysLimits, XineramaConstrainCursor) - Xi: fix: accessing other->buttons for keyboard segfaulted the server + Xi: fix: accessing other->buttons for keyboard segfaulted the server commit 33ff4cec5ff7533ec725f71d357c096dfb0acb79 Author: Alan Hourihane @@ -139763,27 +152219,27 @@ Author: Peter Hutterer Date: Tue Nov 21 20:31:30 2006 +1030 - dix: WindowsRestructured() calls CheckMotion() on all devices + dix: WindowsRestructured() calls CheckMotion() on all devices - mi: core pointer was checked twice in miSpriteReportDamage, - miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas - and miSpriteRealiseCursor - using damage bug (see comment in file) to avoid artefacts + mi: core pointer was checked twice in miSpriteReportDamage, + miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas + and miSpriteRealiseCursor + using damage bug (see comment in file) to avoid artefacts commit 9db851c22d4befb95bfb074b96620261d8e32ac9 Author: Peter Hutterer Date: Tue Nov 21 18:15:04 2006 +1030 dix: moved sprite from static to be pointer of type SpritePtr - added SpriteRecs for MPX devices - changed sprite dependency and added MPX functionality to parts - of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion, - CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits, - PointerConfinedToScreen) - added DeviceIntRec param to GetSpritePosition(). This required some - minor changes in ddx, xtest, xkb and xfixes. + added SpriteRecs for MPX devices + changed sprite dependency and added MPX functionality to parts + of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion, + CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits, + PointerConfinedToScreen) + added DeviceIntRec param to GetSpritePosition(). This required some + minor changes in ddx, xtest, xkb and xfixes. - mi: changed miPointer to pointer instead of static struct. + mi: changed miPointer to pointer instead of static struct. commit fd8b9a6eaee28a453a00af14195b81ef1890a577 Author: Peter Hutterer @@ -139795,7 +152251,7 @@ Author: Peter Hutterer Date: Tue Nov 21 14:46:00 2006 +1030 - mi: constrain MPX cursors to screen + mi: constrain MPX cursors to screen commit 1107d8bea22eea26f7b666f1c00a53360b7d237e Author: Peter Hutterer @@ -141123,14 +153579,14 @@ Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/common/xf86.h - hw/xfree86/common/xf86DoScanPci.c - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/scanpci/extrapci.ids - hw/xfree86/scanpci/pci.ids - hw/xfree86/scanpci/pciid2c.pl - hw/xfree86/scanpci/xf86PciStdIds.h + hw/xfree86/Makefile.am + hw/xfree86/common/xf86.h + hw/xfree86/common/xf86DoScanPci.c + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/scanpci/extrapci.ids + hw/xfree86/scanpci/pci.ids + hw/xfree86/scanpci/pciid2c.pl + hw/xfree86/scanpci/xf86PciStdIds.h commit 0cd6a3d8efb5cc1ce4f85ab95bcdf4fb66c7245d Author: Daniel Stone @@ -142587,8 +155043,8 @@ * Define XPSERVERLIST with `/etc/init.d/xprint get_xpserverlist` instead of `/bin/sh /etc/init.d/xprint get_xpserverlist` - - allows the initscript to set its own different shell under #! - - allows disabling of XPSERVERLIST by making the script non-executable + - allows the initscript to set its own different shell under #! + - allows disabling of XPSERVERLIST by making the script non-executable * Allow files to be installed by using dist_*_DATA instead of EXTRA_DIST. Also, use dist_*_SCRIPTS to install scripts. * Fix minor typos in man pages. @@ -142728,7 +155184,7 @@ Conflicts: - configure.ac + configure.ac commit c2813514cf7b1a36caa848cbc2ceef99cf2eb769 Author: Ian Romanick @@ -144027,8 +156483,8 @@ Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/common/xf86AutoConfig.c + hw/xfree86/Makefile.am + hw/xfree86/common/xf86AutoConfig.c commit 24051ef97406f28c102cf46a78223400b61fdae2 Author: Daniel Stone @@ -144200,14 +156656,14 @@ Conflicts: - hw/xfree86/common/xf86Init.c - hw/xfree86/int10/pci.c - hw/xfree86/scanpci/xf86PciData.h - hw/xfree86/scanpci/xf86PciStdIds.h - hw/xfree86/scanpci/xf86PciStr.h - hw/xfree86/scanpci/xf86ScanPci.h - hw/xfree86/utils/pcitweak/pcitweak.c - hw/xfree86/utils/scanpci/scanpci.c + hw/xfree86/common/xf86Init.c + hw/xfree86/int10/pci.c + hw/xfree86/scanpci/xf86PciData.h + hw/xfree86/scanpci/xf86PciStdIds.h + hw/xfree86/scanpci/xf86PciStr.h + hw/xfree86/scanpci/xf86ScanPci.h + hw/xfree86/utils/pcitweak/pcitweak.c + hw/xfree86/utils/scanpci/scanpci.c Re-removed most of the conflicting files. @@ -144450,9 +156906,9 @@ Conflicts: - hw/xfree86/common/xf86DoScanPci.c - hw/xfree86/common/xf86Init.c - hw/xfree86/common/xf86pciBus.c + hw/xfree86/common/xf86DoScanPci.c + hw/xfree86/common/xf86Init.c + hw/xfree86/common/xf86pciBus.c commit aff404f293ed86a44a093a51a9f11e79e6c3f4f6 Author: Adam Jackson @@ -144926,7 +157382,7 @@ Conflicts: - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/linuxPci.c commit 8d07ee070ecf0d403d9d27c80764d343b80af6f0 Author: Ian Romanick @@ -145061,7 +157517,7 @@ Optimize out computing a gradient pixel if the mask value is 0. - Obtained from: kdrive CVS (DavidR XGL fb/ megapatch) + Obtained from: kdrive CVS (DavidR XGL fb/ megapatch) commit a838fb70c52a829872680f6a2a2e7dd6d2dc9247 Author: Eric Anholt @@ -145293,7 +157749,7 @@ Conflicts: - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/xf86sym.c commit 6c514ca14c2326c2cf82b73196429789d11e4a01 Author: Ian Romanick @@ -145369,7 +157825,7 @@ Conflicts: - Xext/appgroup.c + Xext/appgroup.c commit 3e098efa35ba70ad4d5699af3130a3b02e1cb06e Author: Alan Coopersmith @@ -145464,16 +157920,16 @@ Conflicts: - Xext/appgroup.c - Xext/security.c - dix/devices.c - dix/dispatch.c - dix/dixutils.c - dix/events.c - dix/extension.c - dix/property.c - dix/window.c - os/access.c + Xext/appgroup.c + Xext/security.c + dix/devices.c + dix/dispatch.c + dix/dixutils.c + dix/events.c + dix/extension.c + dix/property.c + dix/window.c + os/access.c commit d44b2a0a57fb89741173c31676af0ccc822387dc Author: Alan Coopersmith @@ -145522,8 +157978,8 @@ Conflicts: - hw/xfree86/loader/Makefile.am - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/Makefile.am + hw/xfree86/loader/xf86sym.c commit 88ede2cec79281a43cecb43ee6dec65770f82530 Merge: 227a319 2b58685 @@ -145565,8 +158021,8 @@ Cherry-picking patches: - 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and - 4d755fe14274a7293748ce9aa666ab85df6297c5 + 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and + 4d755fe14274a7293748ce9aa666ab85df6297c5 commit f818e0ab60da3779ab2602c6e6d3ff261b50917e Author: Eamon Walsh @@ -145629,7 +158085,7 @@ Correct component ordering when fetching [ax]4b4g4r4 pixels. - Noticed by: rendercheck + Noticed by: rendercheck commit e1672a12eb70836a2ceec803d505294897ae8cd2 Author: Eric Anholt diff -Nru xorg-server-hwe-16.04-1.18.4/composite/compalloc.c xorg-server-hwe-16.04-1.19.3/composite/compalloc.c --- xorg-server-hwe-16.04-1.18.4/composite/compalloc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/composite/compalloc.c 2017-03-15 18:05:25.000000000 +0000 @@ -55,13 +55,13 @@ } static void -compBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +compBlockHandler(ScreenPtr pScreen, void *pTimeout) { CompScreenPtr cs = GetCompScreen(pScreen); pScreen->BlockHandler = cs->BlockHandler; compScreenUpdate(pScreen); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); /* Next damage will restore the block handler */ cs->BlockHandler = NULL; @@ -612,7 +612,7 @@ else pWin->redirectDraw = RedirectDrawManual; - compSetPixmap(pWin, pPixmap); + compSetPixmap(pWin, pPixmap, bw); cw->oldx = COMP_ORIGIN_INVALID; cw->oldy = COMP_ORIGIN_INVALID; cw->damageRegistered = FALSE; @@ -651,7 +651,7 @@ RegionCopy(&pWin->borderClip, &cw->borderClip); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = RedirectDrawNone; - compSetPixmap(pWin, pParentPixmap); + compSetPixmap(pWin, pParentPixmap, pWin->borderWidth); } /* @@ -682,7 +682,7 @@ if (!pNew) return FALSE; cw->pOldPixmap = pOld; - compSetPixmap(pWin, pNew); + compSetPixmap(pWin, pNew, bw); } else { pNew = pOld; diff -Nru xorg-server-hwe-16.04-1.18.4/composite/compext.c xorg-server-hwe-16.04-1.19.3/composite/compext.c --- xorg-server-hwe-16.04-1.18.4/composite/compext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/composite/compext.c 2017-03-15 18:05:25.000000000 +0000 @@ -66,17 +66,6 @@ #define GetCompositeClient(pClient) ((CompositeClientPtr) \ dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey)) -static void -CompositeClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - CompositeClientPtr pCompositeClient = GetCompositeClient(pClient); - - pCompositeClient->major_version = 0; - pCompositeClient->minor_version = 0; -} - static int FreeCompositeClientWindow(void *value, XID ccwid) { @@ -510,16 +499,17 @@ } /** @see GetDefaultBytes */ +static SizeType coreGetWindowBytes; + static void -GetCompositeClientWindowBytes(void *value, XID id, ResourceSizePtr size) +GetCompositeWindowBytes(void *value, XID id, ResourceSizePtr size) { WindowPtr window = value; - /* Currently only pixmap bytes are reported to clients. */ - size->resourceSize = 0; + /* call down */ + coreGetWindowBytes(value, id, size); - /* Calculate pixmap reference sizes. */ - size->pixmapRefSize = 0; + /* account for redirection */ if (window->redirectDraw != RedirectDrawNone) { SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); @@ -563,8 +553,8 @@ if (!CompositeClientWindowType) return; - SetResourceTypeSizeFunc(CompositeClientWindowType, - GetCompositeClientWindowBytes); + coreGetWindowBytes = GetResourceTypeSizeFunc(RT_WINDOW); + SetResourceTypeSizeFunc(RT_WINDOW, GetCompositeWindowBytes); CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows, "CompositeClientSubwindows"); @@ -580,9 +570,6 @@ sizeof(CompositeClientRec))) return; - if (!AddCallback(&ClientStateCallback, CompositeClientCallback, 0)) - return; - for (s = 0; s < screenInfo.numScreens; s++) if (!compScreenInit(screenInfo.screens[s])) return; diff -Nru xorg-server-hwe-16.04-1.18.4/composite/compint.h xorg-server-hwe-16.04-1.19.3/composite/compint.h --- xorg-server-hwe-16.04-1.18.4/composite/compint.h 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/composite/compint.h 2017-03-15 18:05:25.000000000 +0000 @@ -274,7 +274,7 @@ #endif void - compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap); + compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap, int bw); Bool compCheckRedirect(WindowPtr pWin); diff -Nru xorg-server-hwe-16.04-1.18.4/composite/compwindow.c xorg-server-hwe-16.04-1.19.3/composite/compwindow.c --- xorg-server-hwe-16.04-1.18.4/composite/compwindow.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/composite/compwindow.c 2017-03-15 18:05:25.000000000 +0000 @@ -89,6 +89,7 @@ typedef struct _compPixmapVisit { WindowPtr pWindow; PixmapPtr pPixmap; + int bw; } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool @@ -126,19 +127,20 @@ */ SetWinSize(pWindow); SetBorderSize(pWindow); - if (HasBorder(pWindow)) + if (pVisit->bw) QueueWorkProc(compRepaintBorder, serverClient, (void *) (intptr_t) pWindow->drawable.id); return WT_WALKCHILDREN; } void -compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap) +compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap, int bw) { CompPixmapVisitRec visitRec; visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; + visitRec.bw = bw; TraverseTree(pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree(pWindow->drawable.pScreen); } @@ -463,7 +465,8 @@ * Reset pixmap pointers as appropriate */ if (pWin->parent && pWin->redirectDraw == RedirectDrawNone) - compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent)); + compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent), + pWin->borderWidth); /* * Call down to next function */ diff -Nru xorg-server-hwe-16.04-1.18.4/composite/Makefile.in xorg-server-hwe-16.04-1.19.3/composite/Makefile.in --- xorg-server-hwe-16.04-1.18.4/composite/Makefile.in 2016-07-19 17:27:25.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/composite/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -92,9 +92,10 @@ subdir = composite ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -386,6 +387,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -416,7 +420,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -511,6 +518,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/config/config.c xorg-server-hwe-16.04-1.19.3/config/config.c --- xorg-server-hwe-16.04-1.18.4/config/config.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/config.c 2017-03-15 18:05:25.000000000 +0000 @@ -86,10 +86,10 @@ /* Call PIE here so we don't try to dereference a device that's * already been removed. */ - OsBlockSignals(); + input_lock(); ProcessInputEvents(); DeleteInputDeviceRequest(dev); - OsReleaseSignals(); + input_unlock(); } void @@ -107,6 +107,8 @@ if (dev->config_info && strcmp(dev->config_info, config_info) == 0) remove_device(backend, dev); } + + RemoveInputDeviceTraces(config_info); } BOOL diff -Nru xorg-server-hwe-16.04-1.18.4/config/dbus-core.c xorg-server-hwe-16.04-1.19.3/config/dbus-core.c --- xorg-server-hwe-16.04-1.18.4/config/dbus-core.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/dbus-core.c 2017-03-15 18:05:25.000000000 +0000 @@ -43,16 +43,16 @@ OsTimerPtr timer; struct dbus_core_hook *hooks; }; -static struct dbus_core_info bus_info; +static struct dbus_core_info bus_info = { .fd = -1 }; static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg); static void -wakeup_handler(void *data, int num_fds, void *read_mask) +socket_handler(int fd, int ready, void *data) { struct dbus_core_info *info = data; - if (info->connection && num_fds > 0 && FD_ISSET(info->fd, (fd_set *) read_mask)) { + if (info->connection) { do { dbus_connection_read_write_dispatch(info->connection, 0); } while (info->connection && @@ -62,11 +62,6 @@ } } -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ -} - /** * Disconnect (if we haven't already been forcefully disconnected), clean up * after ourselves, and call all registered disconnect hooks. @@ -87,9 +82,8 @@ if (bus_info.connection) dbus_connection_unref(bus_info.connection); - RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); if (bus_info.fd != -1) - RemoveGeneralSocket(bus_info.fd); + RemoveNotifyFd(bus_info.fd); bus_info.fd = -1; bus_info.connection = NULL; @@ -162,9 +156,7 @@ } dbus_error_free(&error); - AddGeneralSocket(bus_info.fd); - - RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); + SetNotifyFd(bus_info.fd, socket_handler, X_NOTIFY_READ, &bus_info); for (hook = bus_info.hooks; hook; hook = hook->next) { if (hook->connect) diff -Nru xorg-server-hwe-16.04-1.18.4/config/hal.c xorg-server-hwe-16.04-1.19.3/config/hal.c --- xorg-server-hwe-16.04-1.18.4/config/hal.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/hal.c 2017-03-15 18:05:25.000000000 +0000 @@ -170,13 +170,15 @@ free(hal_tags); if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL)) - attrs.flags |= ATTR_KEYBOARD; + attrs.flags |= ATTR_KEY | ATTR_KEYBOARD; if (libhal_device_query_capability(hal_ctx, udi, "input.mouse", NULL)) attrs.flags |= ATTR_POINTER; if (libhal_device_query_capability(hal_ctx, udi, "input.joystick", NULL)) attrs.flags |= ATTR_JOYSTICK; if (libhal_device_query_capability(hal_ctx, udi, "input.tablet", NULL)) attrs.flags |= ATTR_TABLET; + if (libhal_device_query_capability(hal_ctx, udi, "input.tablet_pad", NULL)) + attrs.flags |= ATTR_TABLET_PAD; if (libhal_device_query_capability(hal_ctx, udi, "input.touchpad", NULL)) attrs.flags |= ATTR_TOUCHPAD; if (libhal_device_query_capability(hal_ctx, udi, "input.touchscreen", NULL)) diff -Nru xorg-server-hwe-16.04-1.18.4/config/Makefile.in xorg-server-hwe-16.04-1.19.3/config/Makefile.in --- xorg-server-hwe-16.04-1.18.4/config/Makefile.in 2016-07-19 17:27:25.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -102,9 +102,10 @@ subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -406,6 +407,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -436,7 +440,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -531,6 +538,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/config/udev.c xorg-server-hwe-16.04-1.19.3/config/udev.c --- xorg-server-hwe-16.04-1.18.4/config/udev.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/udev.c 2017-03-15 18:05:25.000000000 +0000 @@ -240,6 +240,10 @@ } else if (!strcmp(key, "ID_INPUT_KEY")) { LOG_PROPERTY(path, key, value); + attrs.flags |= ATTR_KEY; + } + else if (!strcmp(key, "ID_INPUT_KEYBOARD")) { + LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_KEYBOARD; } else if (!strcmp(key, "ID_INPUT_MOUSE")) { @@ -254,6 +258,10 @@ LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TABLET; } + else if (!strcmp(key, "ID_INPUT_TABLET_PAD")) { + LOG_PROPERTY(path, key, value); + attrs.flags |= ATTR_TABLET_PAD; + } else if (!strcmp(key, "ID_INPUT_TOUCHPAD")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TOUCHPAD; @@ -332,41 +340,34 @@ } static void -wakeup_handler(void *data, int err, void *read_mask) +socket_handler(int fd, int ready, void *data) { - int udev_fd = udev_monitor_get_fd(udev_monitor); struct udev_device *udev_device; const char *action; - if (err < 0) + input_lock(); + udev_device = udev_monitor_receive_device(udev_monitor); + if (!udev_device) { + input_unlock(); return; - - if (FD_ISSET(udev_fd, (fd_set *) read_mask)) { - udev_device = udev_monitor_receive_device(udev_monitor); - if (!udev_device) - return; - action = udev_device_get_action(udev_device); - if (action) { - if (!strcmp(action, "add")) { + } + action = udev_device_get_action(udev_device); + if (action) { + if (!strcmp(action, "add")) { + device_removed(udev_device); + device_added(udev_device); + } else if (!strcmp(action, "change")) { + /* ignore change for the drm devices */ + if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { device_removed(udev_device); device_added(udev_device); - } else if (!strcmp(action, "change")) { - /* ignore change for the drm devices */ - if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { - device_removed(udev_device); - device_added(udev_device); - } } - else if (!strcmp(action, "remove")) - device_removed(udev_device); } - udev_device_unref(udev_device); + else if (!strcmp(action, "remove")) + device_removed(udev_device); } -} - -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ + udev_device_unref(udev_device); + input_unlock(); } int @@ -441,8 +442,7 @@ } udev_enumerate_unref(enumerate); - RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); - AddGeneralSocket(udev_monitor_get_fd(udev_monitor)); + SetNotifyFd(udev_monitor_get_fd(udev_monitor), socket_handler, X_NOTIFY_READ, NULL); return 1; } @@ -457,8 +457,7 @@ udev = udev_monitor_get_udev(udev_monitor); - RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor)); - RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); + RemoveNotifyFd(udev_monitor_get_fd(udev_monitor)); udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_unref(udev); diff -Nru xorg-server-hwe-16.04-1.18.4/config/wscons.c xorg-server-hwe-16.04-1.19.3/config/wscons.c --- xorg-server-hwe-16.04-1.18.4/config/wscons.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config/wscons.c 2017-03-15 18:05:25.000000000 +0000 @@ -163,7 +163,7 @@ } kbd_config_done: - attrs.flags |= ATTR_KEYBOARD; + attrs.flags |= ATTR_KEY | ATTR_KEYBOARD; rc = NewInputDeviceRequest(input_options, &attrs, &dev); if (rc != Success) goto unwind; diff -Nru xorg-server-hwe-16.04-1.18.4/config.guess xorg-server-hwe-16.04-1.19.3/config.guess --- xorg-server-hwe-16.04-1.18.4/config.guess 2016-03-30 20:37:48.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/config.guess 2017-03-15 18:05:58.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2015-01-01' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches to . +# Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac @@ -579,9 +579,8 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -827,7 +826,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - *:MSYS*:*) + i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -970,10 +969,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) + or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1261,26 +1260,16 @@ if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1372,6 +1361,154 @@ exit ;; esac +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + cat >&2 <. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -260,12 +260,11 @@ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv | ft32 \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -283,10 +282,8 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -298,11 +295,11 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ + | open8 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -313,7 +310,6 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -328,10 +324,7 @@ c6x) basic_machine=tic6x-unknown ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -388,7 +381,6 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -408,10 +400,8 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -423,7 +413,6 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ - | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -441,7 +430,6 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ - | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -779,9 +767,6 @@ basic_machine=m68k-isi os=-sysv ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -837,10 +822,6 @@ basic_machine=powerpc-unknown os=-morphos ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; msdos) basic_machine=i386-pc os=-msdos @@ -1386,14 +1367,14 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1611,6 +1592,9 @@ mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff -Nru xorg-server-hwe-16.04-1.18.4/configure xorg-server-hwe-16.04-1.19.3/configure --- xorg-server-hwe-16.04-1.18.4/configure 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/configure 2017-03-15 18:05:39.000000000 +0000 @@ -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.18.4. +# Generated by GNU Autoconf 2.69 for xorg-server 1.19.3. # # Report bugs to . # @@ -651,8 +651,8 @@ # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.18.4' -PACKAGE_STRING='xorg-server 1.18.4' +PACKAGE_VERSION='1.19.3' +PACKAGE_STRING='xorg-server 1.19.3' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -693,6 +693,7 @@ # include #endif" +ac_config_libobj_dir=os ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -702,6 +703,7 @@ RELEASE_DATE SYSCONFDIR PROJECTROOT +WAYLAND_PROTOCOLS_DATADIR WAYLAND_SCANNER XWAYLAND_SYS_LIBS XWAYLAND_LIBS @@ -788,6 +790,8 @@ 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 @@ -805,6 +809,8 @@ XWIN_SYS_LIBS XWIN_SERVER_NAME XWIN_LIBS +WINDOWSDRI_LIBS +WINDOWSDRI_CFLAGS WINDOWSWM_LIBS WINDOWSWM_CFLAGS XWINMODULES_LIBS @@ -963,16 +969,12 @@ PRESENT_TRUE GLX_SYS_LIBS GLX_DEFINES -AIGLX_DRI_LOADER_FALSE -AIGLX_DRI_LOADER_TRUE GLX_FALSE GLX_TRUE GL_LIBS GL_CFLAGS XLIB_LIBS XLIB_CFLAGS -DRI2_AIGLX_FALSE -DRI2_AIGLX_TRUE LIBDRM_LIBS LIBDRM_CFLAGS DRI3_FALSE @@ -1034,6 +1036,10 @@ HAVE_SYSTEMD_DAEMON_TRUE SYSTEMD_DAEMON_LIBS SYSTEMD_DAEMON_CFLAGS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config SDK_REQUIRED_MODULES PIXMAN_LIBS PIXMAN_CFLAGS @@ -1082,6 +1088,8 @@ FBDEVHW_TRUE AGP_FALSE AGP_TRUE +POLL_FALSE +POLL_TRUE LIBOBJS DLOPEN_LIBS SPECIAL_DTRACE_OBJECTS_FALSE @@ -1296,7 +1304,6 @@ with_dtrace enable_werror enable_debug -enable_use_sigio_by_default with_int10 with_vendor_name with_vendor_name_short @@ -1310,6 +1317,7 @@ enable_listen_tcp enable_listen_unix enable_listen_local +with_fallback_input_driver with_fontrootdir with_fontmiscdir with_fontotfdir @@ -1334,7 +1342,6 @@ enable_sparkle with_sparkle_feed_url enable_visibility -enable_aiglx with_khronos_spec_dir enable_composite enable_mitshm @@ -1369,6 +1376,7 @@ enable_vbe enable_int10_module enable_windowswm +enable_windowsdri enable_libdrm enable_clientids enable_pciaccess @@ -1400,6 +1408,7 @@ enable_ipv6 enable_local_transport enable_secure_rpc +enable_input_thread with_systemd_daemon with_shared_memory_dir enable_xtrans_send_fds @@ -1481,6 +1490,8 @@ XWINMODULES_LIBS WINDOWSWM_CFLAGS WINDOWSWM_LIBS +WINDOWSDRI_CFLAGS +WINDOWSDRI_LIBS KHRONOS_OPENGL_REGISTRY_CFLAGS KHRONOS_OPENGL_REGISTRY_LIBS XPBPROXY_CFLAGS @@ -2047,7 +2058,7 @@ # 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.18.4 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.19.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2117,7 +2128,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.18.4:";; + short | recursive ) echo "Configuration of xorg-server 1.19.3:";; esac cat <<\_ACEOF @@ -2149,16 +2160,12 @@ --disable-largefile omit support for large files --enable-werror Obsolete - use --enable-strict-compilation instead --enable-debug Enable debugging (default: disabled) - --enable-use-sigio-by-default - Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT) - --enable-listen-tcp Listen on TCP by default (default:disabled) --disable-listen-unix Listen on Unix by default (default:enabled) --disable-listen-local Listen on local by default (default:enabled) --enable-sparkle Enable updating of X11.app using the Sparkle Framework (default: disabled) --enable-visibility Enable symbol visibility (default: auto) - --enable-aiglx Build accelerated indirect GLX (default: enabled) --disable-composite Build Composite extension (default: enabled) --disable-mitshm Build SHM extension (default: auto) --disable-xres Build XRes extension (default: enabled) @@ -2194,6 +2201,7 @@ --enable-vbe Build Xorg with VBE module (default: enabled) --enable-int10-module Build Xorg with int10 module (default: enabled) --enable-windowswm Build XWin with WindowsWM extension (default: no) + --enable-windowsdri Build XWin with WindowsDRI extension (default: auto) --enable-libdrm Build Xorg with libdrm support (default: enabled) --disable-clientids Build Xorg with client ID tracking (default: enabled) @@ -2216,7 +2224,7 @@ integrated into Xquartz as a separate thread) (default: no) --enable-xwin Build XWin server (default: auto) - --enable-glamor Build glamor dix module (default: no) + --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) @@ -2235,6 +2243,7 @@ --enable-local-transport Enable os-specific local transport --enable-secure-rpc Enable Secure RPC + --enable-input-thread Enable input threads --disable-xtrans-send-fds Use Xtrans support for fd passing (default: auto) @@ -2277,6 +2286,9 @@ Name of OS vendor --with-builderstring=BUILDERSTRING Additional builder string + --with-fallback-input-driver=$FALLBACK_INPUT_DRIVER + Input driver fallback if the requested driver for a + device is unavailable --with-fontrootdir=DIR Path to root directory for font files --with-fontmiscdir=DIR Path to misc files [FONTROOTDIR/misc] --with-fontotfdir=DIR Path to OTF files [FONTROOTDIR/OTF] @@ -2313,10 +2325,10 @@ org.x) --with-bundle-version=VERSION Version to use for X11.app's CFBundleVersion - (default: 1.18.4) + (default: 1.19.3) --with-bundle-version-string=VERSION Version to use for X11.app's - CFBundleShortVersionString (default: 1.18.4) + CFBundleShortVersionString (default: 1.19.3) --with-sparkle-feed-url=URL URL for the Sparkle feed (default: https://www.xquartz.org/releases/sparkle/release.xml) @@ -2451,6 +2463,10 @@ C compiler flags for WINDOWSWM, overriding pkg-config WINDOWSWM_LIBS linker flags for WINDOWSWM, overriding pkg-config + WINDOWSDRI_CFLAGS + C compiler flags for WINDOWSDRI, overriding pkg-config + WINDOWSDRI_LIBS + linker flags for WINDOWSDRI, overriding pkg-config KHRONOS_OPENGL_REGISTRY_CFLAGS C compiler flags for KHRONOS_OPENGL_REGISTRY, overriding pkg-config @@ -2569,7 +2585,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.18.4 +xorg-server configure 1.19.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3278,7 +3294,7 @@ 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.18.4, which was +It was created by xorg-server $as_me 1.19.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3626,8 +3642,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2016-07-19" -RELEASE_NAME="Skordalia" +RELEASE_DATE="2017-03-15" +RELEASE_NAME="Lobster Bisque" am__api_version='1.15' @@ -4145,7 +4161,7 @@ # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.18.4' + VERSION='1.19.3' cat >>confdefs.h <<_ACEOF @@ -12085,8 +12101,9 @@ if test x$FILE_MAN_SUFFIX = x ; then case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[01]) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -12095,8 +12112,9 @@ if test x$MISC_MAN_SUFFIX = x ; then case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[01]) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -12105,8 +12123,9 @@ if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[01]) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -12115,8 +12134,9 @@ if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + # Solaris 2.0 - 11 use SysV man page sections + solaris2.?|solaris2.1[01]) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -12636,6 +12656,11 @@ fi # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF @@ -12643,10 +12668,18 @@ if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then : have_xmlto_text=yes else + # Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then : + have_xmlto_text=yes +else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto cannot generate text format, this format skipped" >&5 $as_echo "$as_me: WARNING: xmlto cannot generate text format, this format skipped" >&2;} fi fi +fi rm -f conftest.xml if test $have_xmlto_text = yes; then HAVE_XMLTO_TEXT_TRUE= @@ -22742,7 +22775,7 @@ for ac_func in backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext + walkcontext setitimer poll epoll_create1 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" @@ -22754,6 +22787,7 @@ fi done + ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray" if test "x$ac_cv_func_reallocarray" = xyes; then : $as_echo "#define HAVE_REALLOCARRAY 1" >>confdefs.h @@ -22832,6 +22866,84 @@ fi +ac_fn_c_check_func "$LINENO" "timingsafe_memcmp" "ac_cv_func_timingsafe_memcmp" +if test "x$ac_cv_func_timingsafe_memcmp" = xyes; then : + $as_echo "#define HAVE_TIMINGSAFE_MEMCMP 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" timingsafe_memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS timingsafe_memcmp.$ac_objext" + ;; +esac + +fi + + + if test "x$ac_cv_func_poll" = "xyes"; then + POLL_TRUE= + POLL_FALSE='#' +else + POLL_TRUE='#' + POLL_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 +$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_arc4random_buf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $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 arc4random_buf (); +int +main () +{ +return arc4random_buf (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_arc4random_buf=yes +else + ac_cv_lib_bsd_arc4random_buf=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_bsd_arc4random_buf" >&5 +$as_echo "$ac_cv_lib_bsd_arc4random_buf" >&6; } +if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBSD 1 +_ACEOF + + LIBS="-lbsd $LIBS" + +fi + +for ac_func in arc4random_buf +do : + ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf" +if test "x$ac_cv_func_arc4random_buf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARC4RANDOM_BUF 1 +_ACEOF + +fi +done ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include @@ -23273,7 +23385,6 @@ DRI=no -USE_SIGIO_BY_DEFAULT="yes" case $host_os in *freebsd* | *dragonfly*) case $host_os in @@ -23323,19 +23434,7 @@ DRI=yes ;; *solaris*) - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - DRI=yes -else - DRI=no -fi - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" + DRI=yes ;; darwin*) @@ -23373,11 +23472,6 @@ DEBUGGING=no fi -# Check whether --enable-use-sigio-by-default was given. -if test "${enable_use_sigio_by_default+set}" = set; then : - enableval=$enable_use_sigio_by_default; USE_SIGIO_BY_DEFAULT=$enableval -fi - # Check whether --with-int10 was given. if test "${with_int10+set}" = set; then : @@ -23474,6 +23568,33 @@ fi +case $host_os in + linux*) + FALLBACK_INPUT_DRIVER="libinput" + ;; + *) + FALLBACK_INPUT_DRIVER="" + ;; +esac + +# Check whether --with-fallback-input-driver was given. +if test "${with_fallback_input_driver+set}" = set; then : + withval=$with_fallback_input_driver; FALLBACK_INPUT_DRIVER=$withval +fi + +if test "x$FALLBACK_INPUT_DRIVER" = "xno"; then + FALLBACK_INPUT_DRIVER="" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fallback input driver" >&5 +$as_echo_n "checking for fallback input driver... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FALLBACK_INPUT_DRIVER" >&5 +$as_echo "$FALLBACK_INPUT_DRIVER" >&6; } + +cat >>confdefs.h <<_ACEOF +#define FALLBACK_INPUT_DRIVER "$FALLBACK_INPUT_DRIVER" +_ACEOF + + @@ -23719,7 +23840,7 @@ if test "${with_bundle_version+set}" = set; then : withval=$with_bundle_version; BUNDLE_VERSION="${withval}" else - BUNDLE_VERSION="1.18.4" + BUNDLE_VERSION="1.19.3" fi @@ -23757,14 +23878,6 @@ fi -# Check whether --enable-aiglx was given. -if test "${enable_aiglx+set}" = set; then : - enableval=$enable_aiglx; AIGLX=$enableval -else - AIGLX=yes -fi - - # Check whether --with-khronos-spec-dir was given. if test "${with_khronos_spec_dir+set}" = set; then : @@ -24003,6 +24116,13 @@ WINDOWSWM=no fi +# Check whether --enable-windowsdri was given. +if test "${enable_windowsdri+set}" = set; then : + enableval=$enable_windowsdri; WINDOWSDRI=$enableval +else + WINDOWSDRI=auto +fi + # Check whether --enable-libdrm was given. if test "${enable_libdrm+set}" = set; then : enableval=$enable_libdrm; DRM=$enableval @@ -24113,7 +24233,7 @@ if test "${enable_glamor+set}" = set; then : enableval=$enable_glamor; GLAMOR=$enableval else - GLAMOR=no + GLAMOR=auto fi # Check whether --enable-kdrive was given. @@ -24785,7 +24905,7 @@ APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" -XPROTO="xproto >= 7.0.28" +XPROTO="xproto >= 7.0.31" RANDRPROTO="randrproto >= 1.5.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" @@ -24802,12 +24922,12 @@ LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.0" +LIBDRM="libdrm >= 2.3.1" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" +LIBXFONT="xfont2 >= 2.0.0" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" @@ -24913,6 +25033,538 @@ # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc +ac_fn_c_check_decl "$LINENO" "PTHREAD_MUTEX_RECURSIVE" "ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" "#include +" +if test "x$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" = xyes; then : + HAVE_RECURSIVE_MUTEX=yes +else + HAVE_RECURSIVE_MUTEX=no +fi + + +THREAD_DEFAULT=no + +if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then + THREAD_DEFAULT=yes +fi + +# Check whether --enable-input-thread was given. +if test "${enable_input_thread+set}" = set; then : + enableval=$enable_input_thread; INPUTTHREAD=$enableval +else + INPUTTHREAD=$THREAD_DEFAULT +fi + + +if test "x$INPUTTHREAD" = "xyes" ; then + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + 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 pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; + netbsd*) + # use libc stubs, don't link against libpthread, to allow + # dynamic loading + ax_pthread_flags="" + ;; +esac + +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5 +$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; } +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void); +int +main () +{ +foo() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + ax_pthread_extra_flags= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr = $attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5 +$as_echo "$flag" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + +fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + if as_fn_executable_p ${CC}_r; then : + PTHREAD_CC="${CC}_r" +fi ;; #( + *) : + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + ;; +esac ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + as_fn_error $? "threaded input requested but no pthread support has been found" "$LINENO" 5 +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + SYS_LIBS="$SYS_LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + +$as_echo "#define INPUTTHREAD 1" >>confdefs.h + + + save_LIBS="$LIBS" + LIBS="$LIBS $SYS_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(const char*)" >&5 +$as_echo_n "checking for pthread_setname_np(const char*)... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_setname_np("example") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(pthread_t, const char*)" >&5 +$as_echo_n "checking for pthread_setname_np(pthread_t, const char*)... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_setname_np(pthread_self(), "example") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" +fi + REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" LIBSYSTEMD="libsystemd >= 209" @@ -25574,16 +26226,6 @@ fi -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi - -cat >>confdefs.h <<_ACEOF -#define USE_SIGIO_BY_DEFAULT $USE_SIGIO_BY_DEFAULT_VALUE -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc..." >&5 $as_echo_n "checking for glibc...... " >&6; } @@ -26057,7 +26699,7 @@ case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in - linux*|solaris*) + linux*|solaris*|freebsd*|dragonfly*|openbsd*) XTRANS_SEND_FDS=yes ;; *) @@ -26450,44 +27092,6 @@ fi fi -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $GL_CFLAGS $LIBDRM_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - HAVE_DRI2EXTENSION=yes -else - HAVE_DRI2EXTENSION=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - -$as_echo "#define DRI2_AIGLX 1" >>confdefs.h - - DRI2_AIGLX=yes - else - { $as_echo "$as_me:${as_lineno-$LINENO}: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&5 -$as_echo "$as_me: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&6;} - DRI2_AIGLX=no - fi -fi - if test "x$DRI2_AIGLX" = xyes; then - DRI2_AIGLX_TRUE= - DRI2_AIGLX_FALSE='#' -else - DRI2_AIGLX_TRUE='#' - DRI2_AIGLX_FALSE= -fi - - if test "x$GLX" = xyes; then pkg_failed=no @@ -26689,24 +27293,6 @@ fi -if test "x$GLX" = xno; then - AIGLX=no -fi - -if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then - -$as_echo "#define AIGLX 1" >>confdefs.h - -fi - if { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes; then - AIGLX_DRI_LOADER_TRUE= - AIGLX_DRI_LOADER_FALSE='#' -else - AIGLX_DRI_LOADER_TRUE='#' - AIGLX_DRI_LOADER_FALSE= -fi - - @@ -28526,7 +29112,7 @@ if test "x$have_xnest" = xno; then as_fn_error $? "Xnest build explicitly requested, but required modules not found." "$LINENO" 5 fi - XNEST_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" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $RENDER_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" @@ -29486,6 +30072,15 @@ fi +if test "x$GLAMOR" = xauto; then + if test "x$XORG" = xyes; then + GLAMOR=yes + fi + if test "x$XEPHYR" = xyes; then + GLAMOR=yes + fi +fi + if test "x$GLAMOR" = xyes; then GLAMOR_TRUE= GLAMOR_FALSE='#' @@ -29494,6 +30089,7 @@ GLAMOR_FALSE= fi + if test "x$GLAMOR" = xyes; then $as_echo "#define GLAMOR 1" >>confdefs.h @@ -29674,8 +30270,11 @@ fi + else + if test "x$XORG" = xyes; then + as_fn_error $? "Glamor for Xorg requires $LIBGBM" "$LINENO" 5 + fi fi - fi if test "x$GBM" = xyes; then GLAMOR_EGL_TRUE= @@ -29829,12 +30428,12 @@ pkg_cv_XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes" 2>/dev/null` + pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29846,12 +30445,12 @@ pkg_cv_XWINMODULES_LIBS="$XWINMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes" 2>/dev/null` + pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29872,14 +30471,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>&1` else - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWINMODULES_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (x11 xdmcp xau xfixes) were not met: + as_fn_error $? "Package requirements (x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm) were not met: $XWINMODULES_PKG_ERRORS @@ -30022,6 +30621,112 @@ fi + if test "x$WINDOWSDRI" = xauto; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + WINDOWSDRI=yes +else + WINDOWSDRI=no +fi + fi + if test "x$WINDOWSDRI" = xyes ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WINDOWSDRI" >&5 +$as_echo_n "checking for WINDOWSDRI... " >&6; } + +if test -n "$WINDOWSDRI_CFLAGS"; then + pkg_cv_WINDOWSDRI_CFLAGS="$WINDOWSDRI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WINDOWSDRI_CFLAGS=`$PKG_CONFIG --cflags "windowsdriproto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WINDOWSDRI_LIBS"; then + pkg_cv_WINDOWSDRI_LIBS="$WINDOWSDRI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WINDOWSDRI_LIBS=`$PKG_CONFIG --libs "windowsdriproto" 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 + WINDOWSDRI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "windowsdriproto" 2>&1` + else + WINDOWSDRI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "windowsdriproto" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WINDOWSDRI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (windowsdriproto) were not met: + +$WINDOWSDRI_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 WINDOWSDRI_CFLAGS +and WINDOWSDRI_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 WINDOWSDRI_CFLAGS +and WINDOWSDRI_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 + WINDOWSDRI_CFLAGS=$pkg_cv_WINDOWSDRI_CFLAGS + WINDOWSDRI_LIBS=$pkg_cv_WINDOWSDRI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + fi + case $host_os in cygwin*) XWIN_SERVER_NAME=XWin @@ -30066,7 +30771,7 @@ $as_echo "#define DDXBEFORERESET 1" >>confdefs.h - if test "x$XWIN" = xyes && test "x$AIGLX" = xyes ; then + if test "x$XWIN" = xyes && test "x$GLX" = xyes ; then # Extract the first word of "python3", so it can be a program name with args. set dummy python3; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -30245,7 +30950,7 @@ XWIN_CLIPBOARD_FALSE= fi - if test "x$XWIN" = xyes && test "x$AIGLX" = xyes; then + if test "x$XWIN" = xyes && test "x$GLX" = xyes; then XWIN_GLX_WINDOWS_TRUE= XWIN_GLX_WINDOWS_FALSE='#' else @@ -30253,6 +30958,14 @@ XWIN_GLX_WINDOWS_FALSE= fi + if test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes; then + XWIN_WINDOWS_DRI_TRUE= + XWIN_WINDOWS_DRI_FALSE='#' +else + XWIN_WINDOWS_DRI_TRUE='#' + XWIN_WINDOWS_DRI_FALSE= +fi + if test "x$XWIN" = xyes; then XWIN_RANDR_TRUE= XWIN_RANDR_FALSE='#' @@ -30769,7 +31482,7 @@ fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - 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_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_SYS_LIBS="$DMXMODULES_LIBS" @@ -31583,12 +32296,12 @@ 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" + 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" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBDRM xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" @@ -31908,7 +32621,7 @@ -XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -32009,6 +32722,10 @@ + if test "x$MONOTONIC_CLOCK" != 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 @@ -32050,6 +32767,9 @@ fi + + WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols` + fi @@ -32142,7 +32862,7 @@ ***********************************************" >&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/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/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/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" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -32334,6 +33054,10 @@ Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${POLL_TRUE}" && test -z "${POLL_FALSE}"; then + as_fn_error $? "conditional \"POLL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AGP_TRUE}" && test -z "${AGP_FALSE}"; then as_fn_error $? "conditional \"AGP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32482,18 +33206,10 @@ as_fn_error $? "conditional \"DRI3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRI2_AIGLX_TRUE}" && test -z "${DRI2_AIGLX_FALSE}"; then - as_fn_error $? "conditional \"DRI2_AIGLX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${GLX_TRUE}" && test -z "${GLX_FALSE}"; then as_fn_error $? "conditional \"GLX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${AIGLX_DRI_LOADER_TRUE}" && test -z "${AIGLX_DRI_LOADER_FALSE}"; then - as_fn_error $? "conditional \"AIGLX_DRI_LOADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${PRESENT_TRUE}" && test -z "${PRESENT_FALSE}"; then as_fn_error $? "conditional \"PRESENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32650,6 +33366,10 @@ as_fn_error $? "conditional \"XWIN_GLX_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${XWIN_WINDOWS_DRI_TRUE}" && test -z "${XWIN_WINDOWS_DRI_FALSE}"; then + 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 @@ -33131,7 +33851,7 @@ # 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.18.4, which was +This file was extended by xorg-server $as_me 1.19.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33197,7 +33917,7 @@ 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.18.4 +xorg-server config.status 1.19.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -33709,6 +34429,7 @@ "hw/xnest/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/Makefile" ;; "hw/xnest/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/man/Makefile" ;; "hw/xwin/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/Makefile" ;; + "hw/xwin/dri/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/dri/Makefile" ;; "hw/xwin/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/glx/Makefile" ;; "hw/xwin/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/man/Makefile" ;; "hw/xwin/winclipboard/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/winclipboard/Makefile" ;; diff -Nru xorg-server-hwe-16.04-1.18.4/configure.ac xorg-server-hwe-16.04-1.19.3/configure.ac --- xorg-server-hwe-16.04-1.18.4/configure.ac 2016-07-19 17:27:07.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/configure.ac 2017-03-15 18:05:25.000000000 +0000 @@ -26,9 +26,9 @@ dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.18.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2016-07-19" -RELEASE_NAME="Skordalia" +AC_INIT([xorg-server], 1.19.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2017-03-15" +RELEASE_NAME="Lobster Bisque" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -219,8 +219,14 @@ AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext]) -AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup]) + walkcontext setitimer poll epoll_create1]) +AC_CONFIG_LIBOBJ_DIR([os]) +AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\ + timingsafe_memcmp]) +AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"]) + +AC_CHECK_LIB([bsd], [arc4random_buf]) +AC_CHECK_FUNCS([arc4random_buf]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) @@ -381,7 +387,6 @@ AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) DRI=no -USE_SIGIO_BY_DEFAULT="yes" dnl it would be nice to autodetect these *CONS_SUPPORTs case $host_os in *freebsd* | *dragonfly*) @@ -410,10 +415,7 @@ DRI=yes ;; *solaris*) - PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" + DRI=yes ;; darwin*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) @@ -446,9 +448,6 @@ AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debugging (default: disabled)]), [DEBUGGING=$enableval], [DEBUGGING=no]) -AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] - [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), - [USE_SIGIO_BY_DEFAULT=$enableval], []) AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), [INT10="$withval"], [INT10="$DEFAULT_INT10"]) @@ -493,6 +492,25 @@ [Listen on local by default (default:enabled)]), [LISTEN_LOCAL=$enableval], [LISTEN_LOCAL=yes]) +case $host_os in + linux*) + FALLBACK_INPUT_DRIVER="libinput" + ;; + *) + FALLBACK_INPUT_DRIVER="" + ;; +esac +AC_ARG_WITH(fallback-input-driver, + AC_HELP_STRING([--with-fallback-input-driver=$FALLBACK_INPUT_DRIVER], + [Input driver fallback if the requested driver for a device is unavailable]), + [ FALLBACK_INPUT_DRIVER=$withval ], []) +if test "x$FALLBACK_INPUT_DRIVER" = "xno"; then + FALLBACK_INPUT_DRIVER="" +fi +AC_MSG_CHECKING([for fallback input driver]) +AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER]) +AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ]) + dnl Determine font path XORG_FONTROOTDIR XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) @@ -581,10 +599,6 @@ [SYMBOL_VISIBILITY=auto]) dnl GLX build options -AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), - [AIGLX=$enableval], - [AIGLX=yes]) - AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]), [KHRONOS_SPEC_DIR="${withval}"], [KHRONOS_SPEC_DIR=auto]) @@ -623,6 +637,7 @@ AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) +AC_ARG_ENABLE(windowsdri, AS_HELP_STRING([--enable-windowsdri], [Build XWin with WindowsDRI extension (default: auto)]), [WINDOWSDRI=$enableval], [WINDOWSDRI=auto]) AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes]) AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes]) @@ -640,7 +655,7 @@ AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto]) 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: no)]), [GLAMOR=$enableval], [GLAMOR=no]) +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]) @@ -797,7 +812,7 @@ LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules -XPROTO="xproto >= 7.0.28" +XPROTO="xproto >= 7.0.31" RANDRPROTO="randrproto >= 1.5.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" @@ -815,12 +830,12 @@ LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.0" +LIBDRM="libdrm >= 2.3.1" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" +LIBXFONT="xfont2 >= 2.0.0" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" @@ -839,6 +854,45 @@ # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc AC_SUBST(SDK_REQUIRED_MODULES) +AC_CHECK_DECL([PTHREAD_MUTEX_RECURSIVE], [HAVE_RECURSIVE_MUTEX=yes], [HAVE_RECURSIVE_MUTEX=no], [[#include ]]) + +THREAD_DEFAULT=no + +if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then + THREAD_DEFAULT=yes +fi + +AC_ARG_ENABLE(input-thread, AS_HELP_STRING([--enable-input-thread], + [Enable input threads]), + [INPUTTHREAD=$enableval], [INPUTTHREAD=$THREAD_DEFAULT]) + +if test "x$INPUTTHREAD" = "xyes" ; then + AX_PTHREAD(,AC_MSG_ERROR([threaded input requested but no pthread support has been found])) + SYS_LIBS="$SYS_LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + AC_DEFINE(INPUTTHREAD, 1, [Use a separate input thread]) + + save_LIBS="$LIBS" + LIBS="$LIBS $SYS_LIBS" + dnl MacOS X 10.6 & higher + AC_MSG_CHECKING(for pthread_setname_np(const char*)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [pthread_setname_np("example")])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID,1, + [Have function pthread_setname_np(const char*)])], + [AC_MSG_RESULT(no)]) + dnl GNU libc 2.12 & higher, Solaris 11.3 & higher + AC_MSG_CHECKING(for pthread_setname_np(pthread_t, const char*)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [pthread_setname_np(pthread_self(), "example")])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITH_TID,1, + [Have function pthread_setname_np(pthread_t, const char*)])], + [AC_MSG_RESULT(no)]) + LIBS="$save_LIBS" +fi + REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" dnl systemd socket activation @@ -967,13 +1021,6 @@ AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration]) fi -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi -AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], - [Use SIGIO handlers for input device events by default]) AC_MSG_CHECKING([for glibc...]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([ @@ -1184,7 +1231,7 @@ case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in - linux*|solaris*) + linux*|solaris*|freebsd*|dragonfly*|openbsd*) XTRANS_SEND_FDS=yes ;; *) @@ -1301,27 +1348,6 @@ fi fi -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $GL_CFLAGS $LIBDRM_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -#include -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif]])], - [HAVE_DRI2EXTENSION=yes], - [HAVE_DRI2EXTENSION=no]) - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) - DRI2_AIGLX=yes - else - AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) - DRI2_AIGLX=no - fi -fi -AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) - if test "x$GLX" = xyes; then PKG_CHECK_MODULES([XLIB], [x11]) PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) @@ -1334,15 +1360,6 @@ fi AM_CONDITIONAL(GLX, test "x$GLX" = xyes) -if test "x$GLX" = xno; then - AIGLX=no -fi - -if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then - AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) -fi -AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes) - AC_SUBST([GLX_DEFINES]) AC_SUBST([GLX_SYS_LIBS]) @@ -1831,7 +1848,7 @@ if test "x$have_xnest" = xno; then AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) fi - XNEST_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" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $RENDER_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XNEST_LIBS]) AC_SUBST([XNEST_SYS_LIBS]) @@ -2124,7 +2141,17 @@ AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xyes]) dnl glamor +if test "x$GLAMOR" = xauto; then + if test "x$XORG" = xyes; then + GLAMOR=yes + fi + if test "x$XEPHYR" = xyes; then + GLAMOR=yes + fi +fi + AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes]) + if test "x$GLAMOR" = xyes; then AC_DEFINE(GLAMOR, 1, [Build glamor]) PKG_CHECK_MODULES([GLAMOR], [epoxy]) @@ -2137,8 +2164,11 @@ [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [], [#include #include ]) + else + if test "x$XORG" = xyes; then + AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM]) + fi fi - fi AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes]) @@ -2160,7 +2190,7 @@ AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes]) + PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm]) if test "x$WINDOWSWM" = xauto; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) @@ -2171,6 +2201,13 @@ AC_DEFINE(ROOTLESS,1,[Build Rootless code]) fi + if test "x$WINDOWSDRI" = xauto; then + PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no]) + fi + if test "x$WINDOWSDRI" = xyes ; then + PKG_CHECK_MODULES(WINDOWSDRI, [windowsdriproto]) + fi + case $host_os in cygwin*) XWIN_SERVER_NAME=XWin @@ -2199,8 +2236,8 @@ AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) -dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions - if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then +dnl XWin requires OpenGL spec files in order to generate wrapper code for native GL functions + if [test "x$XWIN" = xyes && test "x$GLX" = xyes] ; then AC_CHECK_PROG(PYTHON3, python3, python3) if test -z "$PYTHON3"; then AC_MSG_ERROR([python3 not found]) @@ -2223,7 +2260,8 @@ 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$AIGLX" = 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]) @@ -2296,7 +2334,7 @@ fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - 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_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_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) @@ -2406,12 +2444,12 @@ 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" + 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" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBDRM xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" @@ -2465,7 +2503,7 @@ dnl Xwayland DDX -XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -2487,9 +2525,15 @@ AC_SUBST([XWAYLAND_LIBS]) AC_SUBST([XWAYLAND_SYS_LIBS]) + if test "x$MONOTONIC_CLOCK" != 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_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) fi @@ -2622,6 +2666,7 @@ 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 diff -Nru xorg-server-hwe-16.04-1.18.4/damageext/damageext.c xorg-server-hwe-16.04-1.19.3/damageext/damageext.c --- xorg-server-hwe-16.04-1.18.4/damageext/damageext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/damageext/damageext.c 2017-03-15 18:05:25.000000000 +0000 @@ -568,24 +568,6 @@ return (*SProcDamageVector[stuff->damageReqType]) (client); } -static void -DamageClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - DamageClientPtr pDamageClient = GetDamageClient(pClient); - - pDamageClient->critical = 0; - pDamageClient->major_version = 0; - pDamageClient->minor_version = 0; -} - - /*ARGSUSED*/ static void -DamageResetProc(ExtensionEntry * extEntry) -{ - DeleteCallback(&ClientStateCallback, DamageClientCallback, 0); -} - static int FreeDamageExt(void *value, XID did) { @@ -757,13 +739,10 @@ (&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec))) return; - if (!AddCallback(&ClientStateCallback, DamageClientCallback, 0)) - return; - if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents, XDamageNumberErrors, ProcDamageDispatch, SProcDamageDispatch, - DamageResetProc, StandardMinorOpcode)) != 0) { + NULL, StandardMinorOpcode)) != 0) { DamageReqCode = (unsigned char) extEntry->base; DamageEventBase = extEntry->eventBase; EventSwapVector[DamageEventBase + XDamageNotify] = diff -Nru xorg-server-hwe-16.04-1.18.4/damageext/Makefile.in xorg-server-hwe-16.04-1.19.3/damageext/Makefile.in --- xorg-server-hwe-16.04-1.18.4/damageext/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/damageext/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -91,9 +91,10 @@ subdir = damageext ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -353,6 +354,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -383,7 +387,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -478,6 +485,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/dbe/Makefile.in xorg-server-hwe-16.04-1.19.3/dbe/Makefile.in --- xorg-server-hwe-16.04-1.18.4/dbe/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dbe/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -92,9 +92,10 @@ subdir = dbe ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -385,6 +386,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -415,7 +419,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -510,6 +517,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/debian/changelog xorg-server-hwe-16.04-1.19.3/debian/changelog --- xorg-server-hwe-16.04-1.18.4/debian/changelog 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/changelog 2017-07-26 20:48:23.000000000 +0000 @@ -1,4 +1,4 @@ -xorg-server-hwe-16.04 (2:1.18.4-1ubuntu6.1~16.04.2) xenial-security; urgency=medium +xorg-server-hwe-16.04 (2:1.19.3-1ubuntu1~16.04.2) xenial; urgency=medium * SECURITY UPDATE: DoS and possible code execution in endianness conversion of X Events @@ -13,13 +13,193 @@ - debian/patches/CVE-2017-10972.patch: zero target buffer in SProcXSendExtensionEvent in Xi/sendexev.c. - CVE-2017-10972 - * SECURITY UPDATE: MIT-MAGIC-COOKIES timing attack - - debian/patches/CVE-2017-2624.patch: use timingsafe_memcmp() in - configure.ac, include/dix-config.h.in, include/os.h, - os/mitauth.c, os/timingsafe_memcmp.c. - - CVE-2017-2624 - -- Marc Deslauriers Mon, 17 Jul 2017 13:16:04 -0400 + -- Marc Deslauriers Tue, 25 Jul 2017 09:04:30 -0400 + +xorg-server-hwe-16.04 (2:1.19.3-1ubuntu1~16.04.1) xenial; urgency=medium + + * Backport for hwe-16.04 stack. (LP: #1687981) + * control: Bump libwayland-dev build-dep to 1.11.0 which has the proxy + wrappers. + * rules: Clean files not needed on hwe pkgs and make dh_install happy. + * control: Add dh-autoreconf back, needed on xenial. + + -- Timo Aaltonen Thu, 04 May 2017 10:37:47 +0300 + +xorg-server (2:1.19.3-1ubuntu1) zesty; urgency=medium + + [ Timo Aaltonen ] + * Merge from Debian experimental. (LP: #1671799) + - Patches refreshed + - randr-adjust-masters-last-set-time.diff, + modesetting-unifdef-slave-support.diff: Dropped, upstream + - config-add-no-removal.patch, xf86-inactive-gpuscreen.patch, + fix-detach-gpu.patch: Dropped, more or less obsolete + * 190_cache-xkbcomp_output_for_fast_start_up.patch: Cleaned up from + the package as it wasn't used. + * 111_armel-drv-fallbacks.patch: Dropped, we don't ship these drivers + anymore. + * rules: Drop the workaround that adds lt_cv_prog_compiler_static_works=no + to confflags. + * 232-xf86compatoutput-valgrind.patch: This was added upstream + already, no need to carry a duplicate check. + * 208_switch_on_release.diff: Dropped, doesn't work with 1.19. + * 228_autobind_gpu.patch: Update from Fedora, fixes nvidia. + * disable-rotation-transform-gpuscreens.patch: Dropped, nvidia + supports rotation now. + * 122_xext_fix_card32_overflow_in_xauth.patch: Dropped, upstream + review found issues and it never got applied. + * xfree86-no-xv-for-gpuscreens.patch: Drop bogus buglink. + * 227_null_ptr_midispcur.patch: Dropped, upstream didn't accept it. + * randr-do-not-check-the-screen-size.diff: Dropped, can't reproduce + #1586260 anymore without the patch. + + [ Robert Ancell ] + * debian/patches/xmir.patch: + - Refresh + - Fix warnings when built against lp:mir/0.25 + - Support both Mir 0.24, 0.25 and 0.26 client APIs + - Fix crashing on arm64 (LP: #1642297) + + -- Timo Aaltonen Mon, 27 Mar 2017 19:43:08 +0300 + +xorg-server (2:1.19.3-1) unstable; urgency=medium + + * New upstream release. + + -- Emilio Pozuelo Monfort Wed, 15 Mar 2017 20:53:42 +0100 + +xorg-server (2:1.19.2-1) unstable; urgency=medium + + [ Andreas Boll ] + * xserver-xorg-core.bug.script: Change udevadm path from /sbin to /bin + (Closes: #852584). + + [ Emilio Pozuelo Monfort ] + * New upstream stable release. + - CVE-2017-2624: Timing attack against MIT cookie. Closes: #856398. + * control: Build-depend on libbsd-dev everywhere, needed for + arc4random_buf for the above fix. + + -- Emilio Pozuelo Monfort Fri, 03 Mar 2017 15:41:15 +0100 + +xorg-server (2:1.19.1-4) unstable; urgency=medium + + * rules: Only set the suid bit on Xorg.wrap when building arch:any + packages. Thanks Julien Cristau. + + -- Emilio Pozuelo Monfort Fri, 20 Jan 2017 00:22:09 +0100 + +xorg-server (2:1.19.1-3) unstable; urgency=medium + + * rules: Fix setting suid bit on Xorg.wrap. + * rules: Don't ignore errors when setting the suid bit. + + -- Emilio Pozuelo Monfort Thu, 19 Jan 2017 19:14:06 +0100 + +xorg-server (2:1.19.1-2) unstable; urgency=medium + + * rules: Fix udeb regression from dh migration. Should also fix FTBFS + on hurd and kfreebsd. + * rules: Add --fail-missing to dh_install. + * rules: Remove unused vars config_backend_main and + config_backend_udeb. + + -- Andreas Boll Wed, 18 Jan 2017 09:46:53 +0100 + +xorg-server (2:1.19.1-1) unstable; urgency=medium + + [ Emilio Pozuelo Monfort ] + * Switch to dh. + * Drop build-deps on automake and libtool, dh-autoreconf depends on + them for us. + * rules: use install consistently. + * Drop pre-wheezy Breaks. + + [ Andreas Boll ] + * New upstream release. + - AttendClient of grab-pervious client must queue to + saved_ready_clients [v2] (Closes: #846779, #850940). + - present: Only call present_flip_notify if vblank->queued == FALSE + (Closes: #849250). + + -- Emilio Pozuelo Monfort Tue, 17 Jan 2017 20:43:34 +0100 + +xorg-server (2:1.19.0-3) unstable; urgency=medium + + * Drop xserver-xorg-core-dbg in favor of xserver-xorg-core-dbgsym. + * Cherry-pick upstream commit d6da2086951, + Revert "damage: Make damageRegionProcessPending take a damage not a + drawable". Fixes a crash caused by trying to free an invalid pointer. + Closes: #847025, #848321. + + -- Emilio Pozuelo Monfort Fri, 16 Dec 2016 19:39:45 +0100 + +xorg-server (2:1.19.0-2) unstable; urgency=medium + + * Disable glamor on the udeb build. It's not needed there. + This has the side effect of fixing the Hurd build. + * debian/patches/02_kbsd-input-devd.diff: + - Ported to NotifyFd. Fixes the kFreeBSD build. + * Bump Standards-Version to 3.9.8; no changes needed. + + -- Emilio Pozuelo Monfort Wed, 23 Nov 2016 19:32:09 +0100 + +xorg-server (2:1.19.0-1) unstable; urgency=medium + + [ Andreas Boll ] + * New upstream release. + * rules: Explicitly disable glamor on hurd. Should fix FTBFS on hurd. + + [ Emilio Pozuelo Monfort ] + * Upload to unstable. + + -- Emilio Pozuelo Monfort Tue, 22 Nov 2016 23:27:39 +0100 + +xorg-server (2:1.18.99.902-1) experimental; urgency=medium + + [ Timo Aaltonen ] + * New upstream release candidate 1. + * control: Bump libxfont-dev build-dependency. + * patches: + - refreshed + - glamor-Declare-pos-in-the-composite-glyph.diff dropped, upstream + * control: Add libxcb-xkb-dev to build-depends. + * serverminver: Bumped. + * watch: Fix a typo. + + [ Emilio Pozuelo Monfort ] + * New upstream release candidate 2. + * rules: Drop aiglx enable/disable flags, removed upstream. + * control: Bump x11proto-core-dev requirement. + * control: Add wayland-protocols build-dep on linux for Xwayland. + + -- Emilio Pozuelo Monfort Sat, 05 Nov 2016 19:56:43 +0100 + +xorg-server (2:1.18.4-2) unstable; urgency=medium + + [ Julien Cristau ] + * Adjust bug script to look for log files in $HOME/.local/share/xorg in + addition to /var/log, to handle unprivileged Xorg. + * Update a bunch of URLs in packaging to https. + + [ Andreas Boll ] + * Add glamor-Declare-pos-in-the-composite-glyph.diff from upstream + (Closes: #834054). + + -- Timo Aaltonen Tue, 06 Sep 2016 16:09:04 +0300 + +xorg-server (2:1.18.4-1ubuntu9) zesty; urgency=medium + + * control: Depend on libxfont1-dev. + + -- Timo Aaltonen Thu, 15 Dec 2016 13:44:15 +0200 + +xorg-server (2:1.18.4-1ubuntu8) zesty; urgency=medium + + * xvfb-run: Bump default bitdepth to 16 so that GLX works. + + -- Timo Aaltonen Thu, 15 Dec 2016 12:33:01 +0200 xorg-server-hwe-16.04 (2:1.18.4-1ubuntu6.1~16.04.1) xenial; urgency=medium diff -Nru xorg-server-hwe-16.04-1.18.4/debian/control xorg-server-hwe-16.04-1.19.3/debian/control --- xorg-server-hwe-16.04-1.18.4/debian/control 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/control 2017-07-26 20:48:23.000000000 +0000 @@ -5,6 +5,7 @@ XSBC-Original-Maintainer: Debian X Strike Force Build-Depends: debhelper (>= 9), + dh-autoreconf, po-debconf, dpkg-dev (>= 1.16.1), quilt, @@ -12,14 +13,12 @@ pkg-config, bison, flex, - automake, - libtool, xauth, xutils-dev (>= 1:7.6+4), xfonts-utils (>= 1:7.5+1), x11proto-bigreqs-dev (>= 1:1.1.0), x11proto-composite-dev (>= 1:0.4), - x11proto-core-dev (>= 7.0.28), + x11proto-core-dev (>= 7.0.31), x11proto-damage-dev (>= 1.1), x11proto-fixes-dev (>= 1:5.0), x11proto-fonts-dev (>= 2.1.3), @@ -43,7 +42,7 @@ x11proto-input-dev (>= 2.3), x11proto-dri2-dev (>= 2.8), libxdmcp-dev (>= 1:0.99.1), - libxfont-dev (>= 1:1.4.2), + libxfont-dev (>= 1:2.0.1), libxkbfile-dev (>= 1:0.99.1), libpixman-1-dev (>= 0.27.2), libpciaccess-dev (>= 0.12.901), @@ -79,6 +78,7 @@ libgbm-dev (>= 10.2) [linux-any kfreebsd-any], # XCB bits for Xephyr libxcb1-dev, + libxcb-xkb-dev, libxcb-shape0-dev, libxcb-render0-dev, libxcb-render-util0-dev, @@ -94,10 +94,11 @@ # unit tests xkb-data, x11-xkb-utils, -# getpeereid() - libbsd-dev [kfreebsd-any], +# arc4random_buf(), getpeereid() + libbsd-dev, # xwayland - libwayland-dev [linux-any], + libwayland-dev (>= 1.11.0) [linux-any], + wayland-protocols (>= 1.1) [linux-any], #logind libdbus-1-dev (>= 1.0) [linux-any], # systemd-daemon @@ -105,10 +106,10 @@ # XMir libmirclient-dev (>= 0.13.1) [!powerpc !ppc64el !s390x], mir-client-platform-mesa-dev, -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/xserver/xorg-server.git Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/xserver/xorg-server.git -Homepage: http://www.x.org/ +Homepage: https://www.x.org/ Package: xserver-xorg-core-hwe-16.04 Architecture: any @@ -126,33 +127,6 @@ libpam-systemd, Suggests: xfonts-100dpi | xfonts-75dpi, xfonts-scalable Breaks: - xserver-xorg-video, - xserver-xorg-video-1.0, - xserver-xorg-video-1.9, - xserver-xorg-video-2, - xserver-xorg-video-4, - xserver-xorg-video-5, - xserver-xorg-video-6, - xserver-xorg-input, - xserver-xorg-input-2, - xserver-xorg-input-2.1, - xserver-xorg-input-4, - xserver-xorg-input-7, - xserver-xorg-input-wacom-hwe-16.04 (<< 0.7.8), - xserver-xorg-input-joystick (<= 1:1.5.0-3), - xserver-xorg-input-synaptics (<= 1.2.2-1), - xserver-xorg-input-tslib (<= 0.0.6-3), - xserver-xorg-input-vmmouse-hwe-16.04 (<= 1:12.6.5-4), - xserver-xorg-input-wacom-hwe-16.04 (<= 0.10.5+20100415-1), - xserver-xorg-video-cyrix (<= 1:1.1.0-8), - xserver-xorg-video-i810 (<< 2:2.4), - xserver-xorg-video-imstt (<= 1:1.1.0-7), - xserver-xorg-video-nsc (<= 1:2.8.3-4), - xserver-xorg-video-sunbw2 (<= 1:1.1.0-5), - xserver-xorg-video-v4l (<< 1:0.2.0), - xserver-xorg-video-vga (<= 1:4.1.0-8), - libgl1-mesa-dri (<< 7.10.2-4), - libgl1-mesa-dri-experimental (<< 7.10.2-4), xserver-xorg-hwe-16.04 (<< 1:7.7+10~), systemd (<< 226-4~), Replaces: @@ -176,7 +150,7 @@ and supersedes all XFree86 X servers. . More information about X.Org can be found at: - + . This package is built from the X.org xserver module. @@ -204,7 +178,7 @@ Architecture: any Depends: libpixman-1-dev (>= 0.27.2), - x11proto-core-dev (>= 7.0.28), + x11proto-core-dev (>= 7.0.31), x11proto-input-dev (>= 2.3), x11proto-xext-dev (>= 7.2.99.901), x11proto-video-dev, @@ -239,7 +213,7 @@ xserver-xorg and/or xserver-xorg-core instead. . More information about X.Org can be found at: - + . This package is built from the X.org xserver module. Replaces: xserver-xorg-dev @@ -353,7 +327,7 @@ composite. . More information about X.Org can be found at: - + . This package is built from the X.org xserver module. Replaces: xserver-xephyr diff -Nru xorg-server-hwe-16.04-1.18.4/debian/local/xvfb-run xorg-server-hwe-16.04-1.19.3/debian/local/xvfb-run --- xorg-server-hwe-16.04-1.18.4/debian/local/xvfb-run 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/local/xvfb-run 2017-07-26 20:48:23.000000000 +0000 @@ -14,7 +14,7 @@ SERVERNUM=99 AUTHFILE= ERRORFILE=/dev/null -XVFBARGS="-screen 0 640x480x8" +XVFBARGS="-screen 0 640x480x16" LISTENTCP="-nolisten tcp" XAUTHPROTO=. diff -Nru xorg-server-hwe-16.04-1.18.4/debian/local/xvfb-run.1 xorg-server-hwe-16.04-1.19.3/debian/local/xvfb-run.1 --- xorg-server-hwe-16.04-1.18.4/debian/local/xvfb-run.1 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/local/xvfb-run.1 2017-07-26 20:48:23.000000000 +0000 @@ -265,7 +265,7 @@ will exit. .SH BUGS See -.URL "http://bugs.debian.org/xvfb" "the Debian Bug Tracking System" . +.URL "https://bugs.debian.org/xvfb" "the Debian Bug Tracking System" . If you wish to report a bug in .BR xvfb\-run , please use the diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/02_kbsd-input-devd.diff xorg-server-hwe-16.04-1.19.3/debian/patches/02_kbsd-input-devd.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/02_kbsd-input-devd.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/02_kbsd-input-devd.diff 2017-07-26 20:48:23.000000000 +0000 @@ -7,6 +7,10 @@ by Koop Mast and myself. Signed-off-by: Robert Millan + +v2 - Emilio Pozuelo Monfort + + - Ported to NotifyFd API. --- config/Makefile.am | 4 + config/config-backends.h | 5 + @@ -19,11 +23,9 @@ 8 files changed, 427 insertions(+), 3 deletions(-) create mode 100644 config/devd.c -Index: xorg-server/config/Makefile.am -=================================================================== ---- xorg-server.orig/config/Makefile.am -+++ xorg-server/config/Makefile.am -@@ -34,6 +34,10 @@ if CONFIG_WSCONS +--- a/config/Makefile.am ++++ b/config/Makefile.am +@@ -34,6 +34,10 @@ libconfig_la_SOURCES += wscons.c endif # CONFIG_WSCONS @@ -34,11 +36,9 @@ endif # !CONFIG_HAL endif # !CONFIG_UDEV -Index: xorg-server/config/config-backends.h -=================================================================== ---- xorg-server.orig/config/config-backends.h -+++ xorg-server/config/config-backends.h -@@ -44,3 +44,8 @@ void config_hal_fini(void); +--- a/config/config-backends.h ++++ b/config/config-backends.h +@@ -44,3 +44,8 @@ int config_wscons_init(void); void config_wscons_fini(void); #endif @@ -47,11 +47,9 @@ +int config_devd_init(void); +void config_devd_fini(void); +#endif -Index: xorg-server/config/config.c -=================================================================== ---- xorg-server.orig/config/config.c -+++ xorg-server/config/config.c -@@ -55,6 +55,9 @@ config_init(void) +--- a/config/config.c ++++ b/config/config.c +@@ -55,6 +55,9 @@ #elif defined(CONFIG_WSCONS) if (!config_wscons_init()) ErrorF("[config] failed to initialise wscons\n"); @@ -61,7 +59,7 @@ #endif } -@@ -67,6 +70,8 @@ config_fini(void) +@@ -67,6 +70,8 @@ config_hal_fini(); #elif defined(CONFIG_WSCONS) config_wscons_fini(); @@ -70,11 +68,9 @@ #endif } -Index: xorg-server/config/devd.c -=================================================================== --- /dev/null -+++ xorg-server/config/devd.c -@@ -0,0 +1,387 @@ ++++ b/config/devd.c +@@ -0,0 +1,375 @@ +/* + * Copyright © 2012 Baptiste Daroussin + * Copyright © 2014 Robert Millan @@ -378,39 +374,29 @@ +} + +static void -+wakeup_handler(void *data, int err, void *read_mask) ++socket_handler(int fd, int ready, void *data) +{ + char *line = NULL; + char *walk; + -+ if (err < 0) ++ if (socket_getline(sock_devd, &line) < 0) + return; + -+ if (FD_ISSET(sock_devd, (fd_set *) read_mask)) { -+ if (socket_getline(sock_devd, &line) < 0) -+ return; -+ -+ walk = strchr(line + 1, ' '); -+ if (walk != NULL) -+ walk[0] = '\0'; -+ -+ switch (*line) { -+ case DEVD_EVENT_ADD: -+ device_added(line + 1); -+ break; -+ case DEVD_EVENT_REMOVE: -+ device_removed(line + 1); -+ break; -+ default: -+ break; -+ } -+ free(line); ++ walk = strchr(line + 1, ' '); ++ if (walk != NULL) ++ walk[0] = '\0'; ++ ++ switch (*line) { ++ case DEVD_EVENT_ADD: ++ device_added(line + 1); ++ break; ++ case DEVD_EVENT_REMOVE: ++ device_removed(line + 1); ++ break; ++ default: ++ break; + } -+} -+ -+static void -+block_handler(void *data, struct timeval **tv, void *read_mask) -+{ ++ free(line); +} + +int @@ -446,8 +432,7 @@ + return 0; + } + -+ RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); -+ AddGeneralSocket(sock_devd); ++ SetNotifyFd(sock_devd, socket_handler, X_NOTIFY_READ, NULL); + + return 1; +} @@ -458,15 +443,12 @@ + if (sock_devd < 0) + return; + -+ RemoveGeneralSocket(sock_devd); -+ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); ++ RemoveNotifyFd(sock_devd); + close(sock_devd); +} -Index: xorg-server/configure.ac -=================================================================== ---- xorg-server.orig/configure.ac -+++ xorg-server/configure.ac -@@ -606,6 +606,7 @@ AC_ARG_ENABLE(dpms, AS_HELP_ST +--- a/configure.ac ++++ b/configure.ac +@@ -627,6 +627,7 @@ AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto]) AC_ARG_ENABLE(config-udev-kms, AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto]) AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) @@ -474,7 +456,7 @@ AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto]) AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes]) AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes]) -@@ -953,6 +954,21 @@ if test "x$CONFIG_WSCONS" = xyes; then +@@ -1017,6 +1018,21 @@ AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration]) fi @@ -493,10 +475,10 @@ + AC_DEFINE(CONFIG_DEVD, 1, [Use devd for input auto configuration]) +fi + - if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE - else -@@ -2507,7 +2523,7 @@ AC_SUBST([prefix]) + + AC_MSG_CHECKING([for glibc...]) + AC_PREPROC_IFELSE([AC_LANG_SOURCE([ +@@ -2566,7 +2582,7 @@ AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep]) @@ -505,11 +487,9 @@ AC_MSG_WARN([ *********************************************** Neither HAL nor udev backend will be enabled. -Index: xorg-server/hw/xfree86/common/xf86Config.c -=================================================================== ---- xorg-server.orig/hw/xfree86/common/xf86Config.c -+++ xorg-server/hw/xfree86/common/xf86Config.c -@@ -1384,15 +1384,18 @@ checkCoreInputDevices(serverLayoutPtr se +--- a/hw/xfree86/common/xf86Config.c ++++ b/hw/xfree86/common/xf86Config.c +@@ -1375,15 +1375,18 @@ } if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) { @@ -530,11 +510,9 @@ #endif xf86Msg(X_INFO, "The server relies on %s to provide the list of " "input devices.\n\tIf no devices become available, " -Index: xorg-server/hw/xfree86/common/xf86Globals.c -=================================================================== ---- xorg-server.orig/hw/xfree86/common/xf86Globals.c -+++ xorg-server/hw/xfree86/common/xf86Globals.c -@@ -122,7 +122,8 @@ xf86InfoRec xf86Info = { +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -122,7 +122,8 @@ .pmFlag = TRUE, .disableRandR = FALSE, .randRFrom = X_DEFAULT, @@ -544,11 +522,9 @@ .forceInputDevices = FALSE, .autoAddDevices = TRUE, .autoEnableDevices = TRUE, -Index: xorg-server/include/dix-config.h.in -=================================================================== ---- xorg-server.orig/include/dix-config.h.in -+++ xorg-server/include/dix-config.h.in -@@ -439,6 +439,9 @@ +--- a/include/dix-config.h.in ++++ b/include/dix-config.h.in +@@ -445,6 +445,9 @@ /* Enable systemd-logind integration */ #undef SYSTEMD_LOGIND 1 diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/03_static-nettle.diff xorg-server-hwe-16.04-1.19.3/debian/patches/03_static-nettle.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/03_static-nettle.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/03_static-nettle.diff 2017-07-26 20:48:23.000000000 +0000 @@ -2,11 +2,9 @@ There's no libnettle udeb. -Index: xorg-server/configure.ac -=================================================================== ---- xorg-server.orig/configure.ac -+++ xorg-server/configure.ac -@@ -1656,7 +1656,7 @@ fi +--- a/configure.ac ++++ b/configure.ac +@@ -1725,7 +1725,7 @@ fi if test "x$with_sha1" = xlibnettle; then AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1], [Use libnettle SHA1 functions]) diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/05_Revert-Unload-submodules.diff xorg-server-hwe-16.04-1.19.3/debian/patches/05_Revert-Unload-submodules.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/05_Revert-Unload-submodules.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/05_Revert-Unload-submodules.diff 2017-07-26 20:48:23.000000000 +0000 @@ -10,11 +10,9 @@ hw/xfree86/common/xf86Helper.c | 6 ++++++ 1 file changed, 6 insertions(+) -Index: xorg-server/hw/xfree86/common/xf86Helper.c -=================================================================== ---- xorg-server.orig/hw/xfree86/common/xf86Helper.c -+++ xorg-server/hw/xfree86/common/xf86Helper.c -@@ -1636,7 +1636,13 @@ xf86LoadOneModule(const char *name, void +--- a/hw/xfree86/common/xf86Helper.c ++++ b/hw/xfree86/common/xf86Helper.c +@@ -1625,7 +1625,13 @@ xf86LoadOneModule(const char *name, void void xf86UnloadSubModule(void *mod) { diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/105_nvidia_autodetect.patch xorg-server-hwe-16.04-1.19.3/debian/patches/105_nvidia_autodetect.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/105_nvidia_autodetect.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/105_nvidia_autodetect.patch 2017-07-26 20:48:23.000000000 +0000 @@ -32,7 +32,7 @@ --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c -@@ -1189,6 +1189,7 @@ xf86VideoPtrToDriverList(struct pci_devi +@@ -1205,6 +1205,7 @@ xf86VideoPtrToDriverList(struct pci_devi { int idx = 0; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/111_armel-drv-fallbacks.patch xorg-server-hwe-16.04-1.19.3/debian/patches/111_armel-drv-fallbacks.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/111_armel-drv-fallbacks.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/111_armel-drv-fallbacks.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -Description: Add support for armel driver fallbacks. -Bug-Ubuntu: https://launchpad.net/bugs/550701 - -Index: xorg-server-1.17.2/hw/xfree86/common/xf86AutoConfig.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86AutoConfig.c -+++ xorg-server-1.17.2/hw/xfree86/common/xf86AutoConfig.c -@@ -45,6 +45,12 @@ - #include "xf86sbusBus.h" - #endif - -+#if defined(__arm__) && defined(__linux__) -+#include "loaderProcs.h" -+#include /* For opendir in test_sysfs_device */ -+#include /* For opendir in test_sysfs_device */ -+#endif -+ - #ifdef sun - #include - #include -@@ -200,6 +206,27 @@ xf86AutoConfig(void) - return ret == CONFIG_OK; - } - -+#if defined(__arm__) && defined(__linux__) -+static int -+test_sysfs_device(char *device_name, char *driver_name) -+{ -+ DIR *dir = opendir("/sys/devices/platform"); -+ struct dirent *current_dir; -+ int len = strlen(device_name); -+ -+ while (current_dir = readdir(dir)) { -+ if (strlen(current_dir->d_name) >= len && -+ strncmp(device_name, current_dir->d_name, len) == 0) -+ break; -+ } -+ closedir(dir); -+ if (!current_dir) -+ return 0; -+ -+ return 1; -+} -+#endif /* defined(__arm__) && defined(__linux__) */ -+ - static void - listPossibleVideoDrivers(char *matches[], int nmatches) - { -@@ -278,6 +305,21 @@ listPossibleVideoDrivers(char *matches[] - i += xf86PciMatchDriver(&matches[i], nmatches - i); - #endif - -+#if defined(__linux__) && defined(__arm__) -+ if (i < (nmatches - 1)) { -+ if (test_sysfs_device("mxc_gpu", "imx")) -+ matches[i++] = xnfstrdup("imx"); -+ else if (test_sysfs_device("dovefb", "dovefb")) -+ matches[i++] = xnfstrdup("dovefb"); -+ else if (test_sysfs_device("omapdrm", "omap")) -+ matches[i++] = xnfstrdup("omap"); -+ else if (test_sysfs_device("omapfb", "omapfb")) -+ matches[i++] = xnfstrdup("omapfb"); -+ else if (test_sysfs_device("omap", "pvr")) -+ matches[i++] = xnfstrdup("pvr"); -+ } -+#endif /* defined(__linux__) && defined(__arm__) */ -+ - #if defined(__linux__) - matches[i++] = xnfstrdup("modesetting"); - #endif diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch xorg-server-hwe-16.04-1.19.3/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/122_xext_fix_card32_overflow_in_xauth.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -Description: Prevent overflow of a CARD32 variable millis by doing bounds checking. - This is a patch currently in discussion at fdo #27134, so this patch can be dropped in favor of whatever upstream decides to include. -Author: Bryce Harrington -Bug-Ubuntu: https://launchpad.net/bugs/519049 - -Index: xorg-server-1.17.2/Xext/security.c -=================================================================== ---- xorg-server-1.17.2.orig/Xext/security.c -+++ xorg-server-1.17.2/Xext/security.c -@@ -261,9 +261,9 @@ SecurityComputeAuthorizationTimeout(Secu - /* maxSecs is the number of full seconds that can be expressed in - * 32 bits worth of milliseconds - */ -- CARD32 maxSecs = (CARD32) (~0) / (CARD32) MILLI_PER_SECOND; -+ CARD32 maxSecs = (CARD32) (MAXINT) / (CARD32) MILLI_PER_SECOND; - -- if (seconds > maxSecs) { /* only come here if we want to wait more than 49 days */ -+ if (seconds > maxSecs) { /* only come here if we want to wait more than 24 days */ - pAuth->secondsRemaining = seconds - maxSecs; - return maxSecs * MILLI_PER_SECOND; - } -@@ -297,8 +297,6 @@ SecurityAuthorizationExpired(OsTimerPtr - { - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) pval; - -- assert(pAuth->timer == timer); -- - if (pAuth->secondsRemaining) { - return SecurityComputeAuthorizationTimeout(pAuth, - pAuth->secondsRemaining); diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/168_glibc_trace_to_stderr.patch xorg-server-hwe-16.04-1.19.3/debian/patches/168_glibc_trace_to_stderr.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/168_glibc_trace_to_stderr.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/168_glibc_trace_to_stderr.patch 2017-07-26 20:48:23.000000000 +0000 @@ -2,11 +2,9 @@ Author: Kees Cook Bug-Ubuntu: https://launchpad.net/bugs/345748 -Index: xorg-server-1.17.2/hw/xfree86/common/xf86Init.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Init.c -+++ xorg-server-1.17.2/hw/xfree86/common/xf86Init.c -@@ -992,6 +992,9 @@ OsVendorInit(void) +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -937,6 +937,9 @@ OsVendorInit(void) if (!beenHere) { umask(022); diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch xorg-server-hwe-16.04-1.19.3/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/190_cache-xkbcomp_output_for_fast_start_up.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,469 +0,0 @@ -Description: Causes the X Keyboard Compiler (xkbcomp) to create a cache file of the keyboard settings. - This will make the 2nd and later boots slightly faster. - TESTERS: Watch for issues relating to keyboard customizations not taking effect properly following boot. -Author: Bryce Harrington -Last-Update: 2013-09-19 - ---- a/configure.ac -+++ b/configure.ac -@@ -519,9 +519,9 @@ 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)]), - [ XKBPATH="$withval" ], - [ XKBPATH="${datadir}/X11/xkb" ]) --AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), -+AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]), - [ XKBOUTPUT="$withval" ], -- [ XKBOUTPUT="compiled" ]) -+ [ XKBOUTPUT="${localstatedir}/cache/xkb" ]) - AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], - [Keyboard ruleset (default: base/evdev)]), - [ XKB_DFLT_RULES="$withval" ], -@@ -1450,7 +1450,7 @@ AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN - dnl Make sure XKM_OUTPUT_DIR is an absolute path - XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` - if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then -- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" -+ AC_MSG_ERROR([xkb-output must be an absolute path.]) - fi - - dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed ---- a/xkb/README.compiled -+++ b/xkb/README.compiled -@@ -4,10 +4,10 @@ current keymap and/or any scratch keymap - or some other tool might destroy or replace the files in this directory, - so it is not a safe place to store compiled keymaps for long periods of - time. The default keymap for any server is usually stored in: -- X-default.xkm --where is the display number of the server in question, which makes --it possible for several servers *on the same host* to share the same --directory. -+ server-.xkm -+ -+where is the SHA1 hash of keymap source, so that compiled -+keymap of different keymap sources are stored in different files. - - Unless the X server is modified, sharing this directory between servers on - different hosts could cause problems. ---- a/xkb/ddxLoad.c -+++ b/xkb/ddxLoad.c -@@ -30,6 +30,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. - - #include - -+#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */ -+#include -+#else /* Use OpenSSL's libcrypto */ -+#warning "xkbcomp caching support disabled" -+#endif -+ - #include - #include - #include -@@ -43,20 +49,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. - #define XKBSRV_NEED_FILE_FUNCS - #include - #include -+#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\"" -@@ -69,28 +64,73 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. - #endif - - static unsigned --LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn); -+LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn, Bool is_private_directory); - - static void --OutputDirectory(char *outdir, size_t size) -+OutputDirectory(char *outdir, size_t size, Bool *is_private_directory) - { - #ifndef WIN32 - /* Can we write an xkm and then open it too? */ - if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && - (strlen(XKM_OUTPUT_DIR) < size)) { - (void) strcpy(outdir, XKM_OUTPUT_DIR); -+ if (is_private_directory) -+ *is_private_directory = TRUE; - } - else - #else - if (strlen(Win32TempDir()) + 1 < size) { - (void) strcpy(outdir, Win32TempDir()); - (void) strcat(outdir, "\\"); -+ if (is_private_directory) -+ *is_private_directory = FALSE; - } - else - #endif - if (strlen("/tmp/") < size) { - (void) strcpy(outdir, "/tmp/"); -+ if (is_private_directory) -+ *is_private_directory = FALSE; -+ } -+} -+ -+#ifndef SHA_DIGEST_LENGTH -+#define SHA_DIGEST_LENGTH 20 -+#endif -+ -+static Bool -+Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH * 2 + 1], const char *input) -+{ -+ int i; -+ unsigned char sha1[SHA_DIGEST_LENGTH]; -+ -+#ifdef HAVE_SHA1_IN_LIBGCRYPT /* Use libgcrypt for SHA1 */ -+ static int init; -+ gcry_md_hd_t h; -+ gcry_error_t err; -+ -+ if (!init) { -+ if (!gcry_check_version(NULL)) -+ return BadAlloc; -+ gcry_control(GCRYCTL_DISABLE_SECMEM, 0); -+ gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); -+ init = 1; -+ } -+ -+ err = gcry_md_open(&h, GCRY_MD_SHA1, 0); -+ if (err) -+ return BadAlloc; -+ gcry_md_write(h, input, strlen(input)); -+ memcpy(sha1, gcry_md_read(h, GCRY_MD_SHA1), 20); -+ gcry_md_close(h); -+#endif -+ -+ /* convert sha1 to sha1_asc */ -+ for (i = 0; i < SHA_DIGEST_LENGTH; ++i) { -+ sprintf(sha1Asc + i * 2, "%02X", sha1[i]); - } -+ -+ return Success; - } - - /** -@@ -103,10 +143,13 @@ typedef void (*xkbcomp_buffer_callback)( - * return a strdup'd copy of the file name we've written to. - */ - static char * --RunXkbComp(xkbcomp_buffer_callback callback, void *userdata) -+RunXkbComp(xkbcomp_buffer_callback callback, void *userdata, Bool *is_private_directory) - { - FILE *out; -- char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX]; -+ char *buf = NULL, xkmfile[PATH_MAX], xkm_output_dir[PATH_MAX]; -+ char *tmpXkmFile = NULL; -+ char *canonicalXkmFileName = NULL; -+ char sha1Asc[SHA_DIGEST_LENGTH * 2 + 1], xkbKeyMapBuf[100 * 1024]; - - const char *emptystring = ""; - char *xkbbasedirflag = NULL; -@@ -117,14 +160,64 @@ RunXkbComp(xkbcomp_buffer_callback callb - /* WIN32 has no popen. The input must be stored in a file which is - used as input for xkbcomp. xkbcomp does not read from stdin. */ - char tmpname[PATH_MAX]; -- const char *xkmfile = tmpname; -+ const char *xkbfile = tmpname; - #else -- const char *xkmfile = "-"; -+ const char *xkbfile = "-"; - #endif - -- snprintf(keymap, sizeof(keymap), "server-%s", display); -+ /* Write keymap source (xkbfile) to memory buffer `xkbKeyMapBuf', -+ of which SHA1 is generated and used as result xkm file name */ -+ memset(xkbKeyMapBuf, 0, sizeof(xkbKeyMapBuf)); -+ out = fmemopen(xkbKeyMapBuf, sizeof(xkbKeyMapBuf), "w"); -+ if (NULL == out) { -+ ErrorF("[xkb] Open xkbKeyMapBuf for writing failed\n"); -+ return NULL; -+ } -+ callback(out, userdata); -+ if (fclose(out) != 0) { -+ ErrorF -+ ("[xkb] callback error, perhaps xkbKeyMapBuf is too small\n"); -+ return NULL; -+ } -+#ifdef DEBUG -+ if (xkbDebugFlags) { -+ ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); -+ fputs(xkbKeyMapBuf, stderr); -+ } -+#endif - -- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -+ DebugF("[xkb] computing SHA1 of keymap\n"); -+ if (Success == Sha1Asc(sha1Asc, xkbKeyMapBuf)) { -+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", sha1Asc); -+ } -+ else { -+ ErrorF("[xkb] Computing SHA1 of keymap failed, " -+ "using display name instead as xkm file name\n"); -+ snprintf(xkmfile, sizeof(xkmfile), "server-%s", display); -+ } -+ -+ OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir), is_private_directory); -+ /* set nameRtrn, fail if it's too small */ -+ if (strlen(xkmfile) + 1 > sizeof(xkmfile)) { -+ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n"); -+ return NULL; -+ } -+ -+ /* if the xkm file already exists, reuse it */ -+ if (asprintf(&canonicalXkmFileName, "%s%s.xkm", xkm_output_dir, xkmfile) == -1) -+ canonicalXkmFileName = NULL; -+ else if (*is_private_directory && -+ (access(canonicalXkmFileName, R_OK) == 0)) { -+ /* yes, we can reuse the old xkm file */ -+ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName); -+ return canonicalXkmFileName; -+ } -+ -+ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName); -+ -+ /* continue to call xkbcomp to compile the keymap. to avoid race -+ condition, we compile it to a tmpfile then rename it to -+ xkmfile */ - - #ifdef WIN32 - strcpy(tmpname, Win32TempDir()); -@@ -148,15 +241,20 @@ RunXkbComp(xkbcomp_buffer_callback callb - } - } - -+ if ((tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL) { -+ ErrorF("[xkb] Can't generate temp xkm file name"); -+ goto err; -+ } -+ - if (asprintf(&buf, - "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " -- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", -+ "-em1 %s -emp %s -eml %s \"%s\"", - xkbbindir, xkbbindirsep, - ((xkbDebugFlags < 2) ? 1 : - ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), -- xkbbasedirflag ? xkbbasedirflag : "", xkmfile, -+ xkbbasedirflag ? xkbbasedirflag : "", xkbfile, - PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, -- xkm_output_dir, keymap) == -1) -+ tmpXkmFile) == -1) - buf = NULL; - - free(xkbbasedirflag); -@@ -164,9 +262,14 @@ RunXkbComp(xkbcomp_buffer_callback callb - if (!buf) { - LogMessage(X_ERROR, - "XKB: Could not invoke xkbcomp: not enough memory\n"); -- return NULL; -+ goto err; - } - -+ /* there's a potential race condition between calling tempnam() -+ and invoking xkbcomp to write the result file (potential temp -+ file name conflicts), but since xkbcomp is a standalone -+ program, we have to live with this */ -+ - #ifndef WIN32 - out = Popen(buf, "w"); - #else -@@ -175,7 +278,10 @@ RunXkbComp(xkbcomp_buffer_callback callb - - if (out != NULL) { - /* Now write to xkbcomp */ -- (*callback)(out, userdata); -+ if (EOF == fputs(xkbKeyMapBuf, out)) { -+ ErrorF("[xkb] Sending keymap to xkbcomp failed\n"); -+ goto err; -+ } - - #ifndef WIN32 - if (Pclose(out) == 0) -@@ -183,16 +289,31 @@ RunXkbComp(xkbcomp_buffer_callback callb - if (fclose(out) == 0 && System(buf) >= 0) - #endif - { -+ /* xkbcomp success */ - if (xkbDebugFlags) - DebugF("[xkb] xkb executes: %s\n", buf); -+ -+ /* if canonicalXkmFileName already exists now, we simply -+ overwrite it, this is OK */ -+ if (rename(tmpXkmFile, canonicalXkmFileName) < 0) { -+ ErrorF("[xkb] Can't rename %s to %s, error: %s\n", -+ tmpXkmFile, canonicalXkmFileName, strerror(errno)); -+ -+ /* in case of error, don't unlink tmpXkmFile, leave i -+ for debugging */ -+ -+ goto err; -+ } -+ - free(buf); -+ free(tmpXkmFile); - #ifdef WIN32 - unlink(tmpname); - #endif -- return xnfstrdup(keymap); -+ return canonicalXkmFileName; - } - else -- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); -+ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkmfile); - #ifdef WIN32 - /* remove the temporary file */ - unlink(tmpname); -@@ -205,6 +326,10 @@ RunXkbComp(xkbcomp_buffer_callback callb - LogMessage(X_ERROR, "Could not open file %s\n", tmpname); - #endif - } -+ -+err: -+ free(canonicalXkmFileName); -+ free(tmpXkmFile); - free(buf); - return NULL; - } -@@ -233,7 +358,8 @@ static Bool - XkbDDXCompileKeymapByNames(XkbDescPtr xkb, - XkbComponentNamesPtr names, - unsigned want, -- unsigned need, char *nameRtrn, int nameRtrnLen) -+ unsigned need, char *nameRtrn, int nameRtrnLen, -+ Bool *is_private_directory) - { - char *keymap; - Bool rc = FALSE; -@@ -244,7 +370,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xk - .need = need - }; - -- keymap = RunXkbComp(xkb_write_keymap_for_names_cb, &ctx); -+ keymap = RunXkbComp(xkb_write_keymap_for_names_cb, &ctx, is_private_directory); - - if (keymap) { - if(nameRtrn) -@@ -279,6 +405,7 @@ XkbDDXLoadKeymapFromString(DeviceIntPtr - { - unsigned int have; - char *map_name; -+ Bool is_private_directory; - XkbKeymapString map = { - .keymap = keymap, - .len = keymap_length -@@ -286,62 +413,25 @@ XkbDDXLoadKeymapFromString(DeviceIntPtr - - *xkbRtrn = NULL; - -- map_name = RunXkbComp(xkb_write_keymap_string_cb, &map); -+ map_name = RunXkbComp(xkb_write_keymap_string_cb, &map, &is_private_directory); - if (!map_name) { - LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); - return 0; - } - -- have = LoadXKM(want, need, map_name, xkbRtrn); -+ have = LoadXKM(want, need, map_name, xkbRtrn, is_private_directory); - free(map_name); - - return have; - } - --static FILE * --XkbDDXOpenConfigFile(const char *mapName, char *fileNameRtrn, int fileNameRtrnLen) --{ -- char buf[PATH_MAX], xkm_output_dir[PATH_MAX]; -- FILE *file; -- -- buf[0] = '\0'; -- if (mapName != NULL) { -- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -- if ((XkbBaseDirectory != NULL) && (xkm_output_dir[0] != '/') --#ifdef WIN32 -- && (!isalpha(xkm_output_dir[0]) || xkm_output_dir[1] != ':') --#endif -- ) { -- if (snprintf(buf, PATH_MAX, "%s/%s%s.xkm", XkbBaseDirectory, -- xkm_output_dir, mapName) >= PATH_MAX) -- buf[0] = '\0'; -- } -- else { -- if (snprintf(buf, PATH_MAX, "%s%s.xkm", xkm_output_dir, mapName) -- >= PATH_MAX) -- buf[0] = '\0'; -- } -- if (buf[0] != '\0') -- file = fopen(buf, "rb"); -- else -- file = NULL; -- } -- else -- file = NULL; -- if ((fileNameRtrn != NULL) && (fileNameRtrnLen > 0)) { -- strlcpy(fileNameRtrn, buf, fileNameRtrnLen); -- } -- return file; --} -- - static unsigned --LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn) -+LoadXKM(unsigned want, unsigned need, const char *fileName, XkbDescPtr *xkbRtrn, Bool is_private_directory) - { - FILE *file; -- char fileName[PATH_MAX]; - unsigned missing; - -- file = XkbDDXOpenConfigFile(keymap, fileName, PATH_MAX); -+ file = fopen(fileName, "rb"); - if (file == NULL) { - LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n", - fileName); -@@ -359,7 +449,8 @@ LoadXKM(unsigned want, unsigned need, co - (*xkbRtrn)->defined); - } - fclose(file); -- (void) unlink(fileName); -+ if (!is_private_directory) -+ (void) unlink(fileName); - return (need | want) & (~missing); - } - -@@ -371,6 +462,7 @@ XkbDDXLoadKeymapByNames(DeviceIntPtr key - XkbDescPtr *xkbRtrn, char *nameRtrn, int nameRtrnLen) - { - XkbDescPtr xkb; -+ Bool is_private_directory; - - *xkbRtrn = NULL; - if ((keybd == NULL) || (keybd->key == NULL) || -@@ -386,12 +478,13 @@ XkbDDXLoadKeymapByNames(DeviceIntPtr key - return 0; - } - else if (!XkbDDXCompileKeymapByNames(xkb, names, want, need, -- nameRtrn, nameRtrnLen)) { -+ nameRtrn, nameRtrnLen, -+ &is_private_directory)) { - LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); - return 0; - } - -- return LoadXKM(want, need, nameRtrn, xkbRtrn); -+ return LoadXKM(want, need, nameRtrn, xkbRtrn, is_private_directory); - } - - Bool diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/191-Xorg-add-an-extra-module-path.patch xorg-server-hwe-16.04-1.19.3/debian/patches/191-Xorg-add-an-extra-module-path.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/191-Xorg-add-an-extra-module-path.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/191-Xorg-add-an-extra-module-path.patch 2017-07-26 20:48:23.000000000 +0000 @@ -2,7 +2,7 @@ --- a/configure.ac +++ b/configure.ac -@@ -464,6 +464,10 @@ AC_ARG_WITH(module-dir, AS_HELP_STR +@@ -460,6 +460,10 @@ AC_ARG_WITH(module-dir, AS_HELP_STR [Directory where modules are installed (default: $libdir/xorg/modules)]), [ moduledir="$withval" ], [ moduledir="${libdir}/xorg/modules" ]) @@ -13,7 +13,7 @@ AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR], [Directory where log files are kept (default: $localstatedir/log)]), [ logdir="$withval" ], -@@ -2077,6 +2081,7 @@ if test "x$XORG" = xyes; then +@@ -2106,6 +2110,7 @@ if test "x$XORG" = xyes; then AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) @@ -23,7 +23,7 @@ AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default logfile prefix]) --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c -@@ -641,11 +641,22 @@ configFiles(XF86ConfFilesPtr fileconf) +@@ -658,11 +658,22 @@ configFiles(XF86ConfFilesPtr fileconf) /* ModulePath */ diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/208_switch_on_release.diff xorg-server-hwe-16.04-1.19.3/debian/patches/208_switch_on_release.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/208_switch_on_release.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/208_switch_on_release.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -Description: Perform keyboard layout switches on key-release rather than key-press events. - This solves a very long-standing issue where e.g. ++ fails when ctrl+shift is configured for layout switching. -Author: Bryce Harrington -Bug-Ubuntu: https://launchpad.net/bugs/36812 -Bug-Ubuntu: https://launchpad.net/bugs/711842 -Bug: https://bugs.freedesktop.org/show_bug.cgi?id=865 - ---- a/xkb/xkbActions.c -+++ b/xkb/xkbActions.c -@@ -352,25 +352,86 @@ _XkbFilterLatchState(XkbSrvInfoPtr xkbi, - } - - static int --_XkbFilterLockState(XkbSrvInfoPtr xkbi, -+xkbSwitchGroupOnRelease(void) -+{ -+ /* TODO: user configuring */ -+ return TRUE; -+} -+ -+static void -+xkbUpdateLockedGroup(XkbSrvInfoPtr xkbi, XkbAction *pAction) -+{ -+ XkbGroupAction ga = pAction->group; -+ -+ if (ga.flags & XkbSA_GroupAbsolute) -+ xkbi->state.locked_group = XkbSAGroup(&ga); -+ else -+ xkbi->state.locked_group += XkbSAGroup(&ga); -+} -+ -+static XkbFilterPtr _XkbNextFreeFilter(XkbSrvInfoPtr xkbi); -+ -+static int -+_XkbFilterLockGroup(XkbSrvInfoPtr xkbi, - XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) - { - if (filter->keycode == 0) /* initial press */ - AccessXCancelRepeatKey(xkbi, keycode); - -- if (pAction && (pAction->type == XkbSA_LockGroup)) { -- if (pAction->group.flags & XkbSA_GroupAbsolute) -- xkbi->state.locked_group = XkbSAGroup(&pAction->group); -- else -- xkbi->state.locked_group += XkbSAGroup(&pAction->group); -- return 1; -+ int sendEvent = 1; -+ -+ if (!xkbSwitchGroupOnRelease()) { -+ xkbUpdateLockedGroup(xkbi, pAction); -+ return sendEvent; - } -+ -+ /* Delay switch till button release */ -+ if (filter->keycode == 0) { /* initial press */ -+ filter->keycode = keycode; -+ filter->active = 1; -+ filter->filterOthers = 0; /* for what? */ -+ filter->filter = _XkbFilterLockGroup; -+ -+ /* filter->priv = 0; */ -+ filter->upAction = *pAction; -+ -+ /* Ok, now we need to simulate the action which would go if this action didn't block it. -+ XkbSA_SetMods is the one: it is to set modifier' flag up. */ -+ { -+ XkbStateRec fake_state = xkbi->state; -+ XkbAction act; -+ -+ fake_state.mods = 0; -+ act = XkbGetKeyAction(xkbi, &fake_state, keycode); -+ -+ /* KLUDGE: XkbSA_SetMods only? */ -+ if (act.type == XkbSA_SetMods) { -+ XkbFilterPtr filter = _XkbNextFreeFilter(xkbi); -+ -+ sendEvent = _XkbFilterSetState(xkbi, filter, keycode, &act); -+ } -+ } -+ } -+ else { -+ /* do nothing if some button else is pressed */ -+ if (!pAction) -+ xkbUpdateLockedGroup(xkbi, &filter->upAction); -+ filter->active = 0; -+ } -+ -+ return sendEvent; -+} -+ -+static int -+_XkbFilterLockMods(XkbSrvInfoPtr xkbi, -+ XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) -+{ - if (filter->keycode == 0) { /* initial press */ - filter->keycode = keycode; - filter->active = 1; - filter->filterOthers = 0; - filter->priv = xkbi->state.locked_mods & pAction->mods.mask; -- filter->filter = _XkbFilterLockState; -+ filter->filter = _XkbFilterLockMods; - filter->upAction = *pAction; - if (!(filter->upAction.mods.flags & XkbSA_LockNoLock)) - xkbi->state.locked_mods |= pAction->mods.mask; -@@ -1250,9 +1311,12 @@ XkbHandleActions(DeviceIntPtr dev, Devic - sendEvent = _XkbFilterLatchState(xkbi, filter, key, &act); - break; - case XkbSA_LockMods: -+ filter = _XkbNextFreeFilter(xkbi); -+ sendEvent = _XkbFilterLockMods(xkbi, filter, key, &act); -+ break; - case XkbSA_LockGroup: - filter = _XkbNextFreeFilter(xkbi); -- sendEvent = _XkbFilterLockState(xkbi, filter, key, &act); -+ sendEvent = _XkbFilterLockGroup(xkbi, filter, key, &act); - break; - case XkbSA_ISOLock: - filter = _XkbNextFreeFilter(xkbi); diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/226_fall_back_to_autoconfiguration.patch xorg-server-hwe-16.04-1.19.3/debian/patches/226_fall_back_to_autoconfiguration.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/226_fall_back_to_autoconfiguration.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/226_fall_back_to_autoconfiguration.patch 2017-07-26 20:48:23.000000000 +0000 @@ -1,10 +1,8 @@ Description: Fall back to autoconfiguration for graphics drivers in some cases instead of letting X fail when configuration files are available. Author: Alberto Milone -Index: xorg-server-1.17.2/hw/xfree86/common/xf86Globals.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Globals.c -+++ xorg-server-1.17.2/hw/xfree86/common/xf86Globals.c +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c @@ -161,6 +161,7 @@ InputDriverPtr *xf86InputDriverList = NU int xf86NumInputDrivers = 0; int xf86NumScreens = 0; @@ -13,10 +11,8 @@ const char *xf86VisualNames[] = { "StaticGray", -Index: xorg-server-1.17.2/hw/xfree86/common/xf86Init.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Init.c -+++ xorg-server-1.17.2/hw/xfree86/common/xf86Init.c +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c @@ -469,20 +469,34 @@ InitOutput(ScreenInfo * pScreenInfo, int free(optionlist); } @@ -73,13 +69,11 @@ xf86PostProbe(); -Index: xorg-server-1.17.2/hw/xfree86/common/xf86Priv.h -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Priv.h -+++ xorg-server-1.17.2/hw/xfree86/common/xf86Priv.h +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h @@ -89,6 +89,7 @@ extern _X_EXPORT int xf86NumDrivers; extern _X_EXPORT Bool xf86Resetting; - extern _X_EXPORT Bool xf86Initialising; + extern Bool xf86Initialising; extern _X_EXPORT int xf86NumScreens; +extern _X_EXPORT Bool xf86AttemptedFallback; extern _X_EXPORT const char *xf86VisualNames[]; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/227_null_ptr_midispcur.patch xorg-server-hwe-16.04-1.19.3/debian/patches/227_null_ptr_midispcur.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/227_null_ptr_midispcur.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/227_null_ptr_midispcur.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Check for NULL pointer before dereferencing pointer from miGetDCDevice. - Fixes crash after connecting a bluetooth keyboard. -Author: Bryce Harrington -Bug-Ubuntu: https://launchpad.net/bugs/930936 - ---- a/mi/midispcur.c -+++ b/mi/midispcur.c -@@ -421,6 +421,10 @@ miDCRestoreUnderCursor(DeviceIntPtr pDev - GCPtr pGC; - - pBuffer = miGetDCDevice(pDev, pScreen); -+ -+ if (!pBuffer) -+ return FALSE; -+ - pSave = pBuffer->pSave; - - pWin = pScreen->root; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/228_autobind_gpu.patch xorg-server-hwe-16.04-1.19.3/debian/patches/228_autobind_gpu.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/228_autobind_gpu.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/228_autobind_gpu.patch 2017-07-26 20:48:23.000000000 +0000 @@ -1,40 +1,158 @@ -From 37d51acb3b6a38af1717bfaa7925043c35bfb447 Mon Sep 17 00:00:00 2001 +From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 17 Aug 2012 09:49:24 +1000 -Subject: [PATCH] autobind GPUs to the screen, (v3) +Subject: [PATCH xserver v3] autobind GPUs to the screen -this is racy and really not what we want for hotplug going forward, -but until DE support is in GNOME its probably for the best. +This is a modified version of a patch we've been carry-ing in Fedora and +RHEL for years now. This patch automatically adds secondary GPUs to the +master as output sink / offload source making e.g. the use of +slave-outputs just work, with requiring the user to manually run +"xrandr --setprovideroutputsource" before he can hookup an external +monitor to his hybrid graphics laptop. -v2: fix if config or slave config is NULL -v3: fix multi useful slaves -DO NOT UPSTREAM. +There is one problem with this patch, which is why it was not upstreamed +before. What to do when a secondary GPU gets detected really is a policy +decission (e.g. one may want to autobind PCI GPUs but not USB ones) and +as such should be under control of the Desktop Environment. + +Unconditionally adding autobinding support to the xserver will result +in races between the DE dealing with the hotplug of a secondary GPU +and the server itself dealing with it. + +However we've waited for years for any Desktop Environments to actually +start doing some sort of autoconfiguration of secondary GPUs and there +is still not a single DE dealing with this, so I believe that it is +time to upstream this now. + +To avoid potential future problems if any DEs get support for doing +secondary GPU configuration themselves, the new autobind functionality +is made optional. Since no DEs currently support doing this themselves it +is enabled by default. When DEs grow support for doing this themselves +they can disable the servers autobinding through the servers cmdline or a +xorg.conf snippet. + +Signed-off-by: Dave Airlie +[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] +Signed-off-by: Hans de Goede +--- +Changes in v2: +-Make the default enabled instead of installing a xorg.conf + snippet which enables it unconditionally +Changes in v3: +-Handle GPUScreen autoconfig in randr/rrprovider.c, looking at + rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c + looking at xf86CrtcConfig->provider. This fixes the autoconfig not + working with the nvidia binary driver --- - hw/xfree86/common/xf86Init.c | 12 ++++++++++++ - hw/xfree86/common/xf86platformBus.c | 3 +++ - hw/xfree86/modes/xf86Crtc.c | 32 ++++++++++++++++++++++++++++++++ - 3 files changed, 47 insertions(+), 0 deletions(-) + hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ + hw/xfree86/common/xf86Globals.c | 2 ++ + hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++ + hw/xfree86/common/xf86Priv.h | 1 + + hw/xfree86/common/xf86Privstr.h | 1 + + hw/xfree86/common/xf86platformBus.c | 4 ++++ + hw/xfree86/man/Xorg.man | 7 +++++++ + hw/xfree86/man/xorg.conf.man | 6 ++++++ + randr/randrstr.h | 3 +++ + randr/rrprovider.c | 22 ++++++++++++++++++++++ + 10 files changed, 85 insertions(+) +diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c +index 21daf1a..df3ca50 100644 +--- a/hw/xfree86/common/xf86Config.c ++++ b/hw/xfree86/common/xf86Config.c +@@ -719,6 +719,7 @@ typedef enum { + FLAG_DRI2, + FLAG_USE_SIGIO, + FLAG_AUTO_ADD_GPU, ++ FLAG_AUTO_BIND_GPU, + FLAG_MAX_CLIENTS, + FLAG_IGLX, + } FlagValues; +@@ -778,6 +779,8 @@ static OptionInfoRec FlagOptions[] = { + {0}, FALSE}, + {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, + {0}, FALSE}, ++ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN, ++ {0}, FALSE}, + {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, + {0}, FALSE }, + {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, +@@ -857,6 +860,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) + } + xf86Msg(from, "%sutomatically adding GPU devices\n", + xf86Info.autoAddGPU ? "A" : "Not a"); ++ ++ if (xf86AutoBindGPUDisabled) { ++ xf86Info.autoBindGPU = FALSE; ++ from = X_CMDLINE; ++ } ++ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) { ++ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU, ++ &xf86Info.autoBindGPU); ++ from = X_CONFIG; ++ } ++ else { ++ from = X_DEFAULT; ++ } ++ xf86Msg(from, "%sutomatically binding GPU devices\n", ++ xf86Info.autoBindGPU ? "A" : "Not a"); ++ + /* + * Set things up based on the config file information. Some of these + * settings may be overridden later when the command line options are +diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c +index e962b75..0d1e31b 100644 +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -136,6 +136,7 @@ xf86InfoRec xf86Info = { + #else + .autoAddGPU = FALSE, + #endif ++ .autoBindGPU = TRUE, + }; + + const char *xf86ConfigFile = NULL; +@@ -197,6 +198,7 @@ Bool xf86FlipPixels = FALSE; + Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; + + Bool xf86AllowMouseOpenFail = FALSE; ++Bool xf86AutoBindGPUDisabled = FALSE; + + #ifdef XF86VIDMODE + Bool xf86VidModeDisabled = FALSE; +diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +index a544b65..b0cba3d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c -@@ -340,6 +340,16 @@ xf86CreateRootWindow(WindowPtr pWin) - return ret; +@@ -76,6 +76,7 @@ + #include "xf86DDC.h" + #include "xf86Xinput.h" + #include "xf86InPriv.h" ++#include "xf86Crtc.h" + #include "picturestr.h" + + #include "xf86Bus.h" +@@ -298,6 +299,19 @@ xf86PrivsElevated(void) } -+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); -+static void + static void +xf86AutoConfigOutputDevices(void) +{ + int i; + ++ if (!xf86Info.autoBindGPU) ++ return; ++ + for (i = 0; i < xf86NumGPUScreens; i++) -+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]); ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); +} + - static void ++static void InstallSignalHandlers(void) { -@@ -950,6 +960,8 @@ InitOutput(ScreenInfo * pScreenInfo, int + /* +@@ -871,6 +885,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumGPUScreens; i++) AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); @@ -42,65 +160,143 @@ + xf86VGAarbiterWrapFunctions(); if (sigio_blocked) - OsReleaseSIGIO(); ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -466,9 +466,12 @@ xf86platformProbeDev(DriverPtr drvp) - } + input_unlock(); +@@ -1389,6 +1405,10 @@ ddxProcessArgument(int argc, char **argv, int i) + xf86Info.iglxFrom = X_CMDLINE; + return 0; } ++ if (!strcmp(argv[i], "-noautoBindGPU")) { ++ xf86AutoBindGPUDisabled = TRUE; ++ return 1; ++ } -+ free(devList); - return foundScreen; - } + /* OS-specific processing */ + return xf86ProcessArgument(argc, argv, i); +diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h +index c1f8a18..9a3d0df 100644 +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h +@@ -46,6 +46,7 @@ + extern _X_EXPORT const char *xf86ConfigFile; + extern _X_EXPORT const char *xf86ConfigDir; + extern _X_EXPORT Bool xf86AllowMouseOpenFail; ++extern _X_EXPORT Bool xf86AutoBindGPUDisabled; -+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); -+ - int - xf86platformAddDevice(int index) - { -@@ -540,6 +543,7 @@ xf86platformAddDevice(int index) + #ifdef XF86VIDMODE + extern _X_EXPORT Bool xf86VidModeDisabled; +diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h +index c29b3cc..4c5f54b 100644 +--- a/hw/xfree86/common/xf86Privstr.h ++++ b/hw/xfree86/common/xf86Privstr.h +@@ -102,6 +102,7 @@ typedef struct { + MessageType dri2From; + + Bool autoAddGPU; ++ Bool autoBindGPU; + } xf86InfoRec, *xf86InfoPtr; + + #ifdef DPMSExtension +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 063e81c..42789ca 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -48,6 +48,7 @@ + #include "Pci.h" + #include "xf86platformBus.h" + #include "xf86Config.h" ++#include "xf86Crtc.h" + + #include "randrstr.h" + int platformSlotClaimed; +@@ -579,6 +580,9 @@ xf86platformAddDevice(int index) } /* attach unbound to 0 protocol screen */ AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); -+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]); ++ if (xf86Info.autoBindGPU) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); RRResourcesChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->pScreen); ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -3562,3 +3562,35 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn) - crtc->x = crtc->y = 0; - } - } +diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man +index def9bfc..8df6b7d 100644 +--- a/hw/xfree86/man/Xorg.man ++++ b/hw/xfree86/man/Xorg.man +@@ -283,6 +283,13 @@ is a comma separated list of directories to search for + server modules. This option is only available when the server is run + as root (i.e, with real-uid 0). + .TP 8 ++.B \-noautoBindGPU ++Disable automatically setting secondary GPUs up as output sinks and offload ++sources. This is equivalent to setting the ++.B AutoBindGPU ++xorg.conf(__filemansuffix__) file option. To ++.B false. ++.TP 8 + .B \-nosilk + Disable Silken Mouse support. + .TP 8 +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 7d0c524..3e596e4 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -673,6 +673,12 @@ Enabled by default. + If this option is disabled, then no GPU devices will be added from the udev + backend. Enabled by default. (May need to be disabled to setup Xinerama). + .TP 7 ++.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q ++If enabled then secondary GPUs will be automatically set up as output-sinks and ++offload-sources. Making e.g. laptop outputs connected only to the secondary ++GPU directly available for use without needing to run ++"xrandr --setprovideroutputsource". Enabled by default. ++.TP 7 + .BI "Option \*qLog\*q \*q" string \*q + This option controls whether the log is flushed and/or synced to disk after + each message. +diff --git a/randr/randrstr.h b/randr/randrstr.h +index 706e9a7..66999d5 100644 +--- a/randr/randrstr.h ++++ b/randr/randrstr.h +@@ -976,6 +976,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); + extern _X_EXPORT void + RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); + ++extern _X_EXPORT void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); + + /* rrproviderproperty.c */ + + extern _X_EXPORT void +diff --git a/randr/rrprovider.c b/randr/rrprovider.c +index f9df67e..abc5685 100644 +--- a/randr/rrprovider.c ++++ b/randr/rrprovider.c +@@ -482,3 +482,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) + + WriteEventsToClient(client, 1, (xEvent *) &pe); + } + -+void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master) ++void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) +{ -+ RRProviderPtr master_provider; -+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master); -+ xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn); -+ Bool unbound = FALSE; ++ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); ++ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); ++ RRProviderPtr provider = pScrPriv->provider; ++ RRProviderPtr master_provider = masterPriv->provider; + -+ if (!config || !slave_config) ++ if (!provider || !master_provider) + return; + -+ master_provider = config->randr_provider; -+ -+ if ((master->capabilities & RR_Capability_SinkOffload) && -+ pScrn->capabilities & RR_Capability_SourceOffload) { -+ /* source offload */ -+ -+ DetachUnboundGPU(pScrn->pScreen); -+ unbound = TRUE; -+ AttachOffloadGPU(master->pScreen, pScrn->pScreen); -+ slave_config->randr_provider->offload_sink = master_provider; -+ } -+ if ((master->capabilities & RR_Capability_SourceOutput) && -+ pScrn->capabilities & RR_Capability_SinkOutput) { -+ /* sink offload */ -+ if (!unbound) -+ DetachUnboundGPU(pScrn->pScreen); -+ AttachOutputGPU(master->pScreen, pScrn->pScreen); -+ slave_config->randr_provider->output_source = master_provider; ++ if ((provider->capabilities & RR_Capability_SinkOutput) && ++ (master_provider->capabilities & RR_Capability_SourceOutput)) { ++ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); ++ RRInitPrimeSyncProps(pScreen); + } ++ ++ if ((provider->capabilities & RR_Capability_SourceOffload) && ++ (master_provider->capabilities & RR_Capability_SinkOffload)) ++ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); +} +-- +2.9.3 + diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/232-xf86compatoutput-valgrind.patch xorg-server-hwe-16.04-1.19.3/debian/patches/232-xf86compatoutput-valgrind.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/232-xf86compatoutput-valgrind.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/232-xf86compatoutput-valgrind.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: Silence a valgrind error -Author: Maarten Lankhorst - -Index: xorg-server-1.17.2/hw/xfree86/modes/xf86Crtc.h -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/modes/xf86Crtc.h -+++ xorg-server-1.17.2/hw/xfree86/modes/xf86Crtc.h -@@ -731,6 +731,8 @@ static _X_INLINE xf86OutputPtr - xf86CompatOutput(ScrnInfoPtr pScrn) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); -+ if (config->compat_output < 0) -+ return NULL; - - if (config->compat_output < 0) - return NULL; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/config-add-no-removal.patch xorg-server-hwe-16.04-1.19.3/debian/patches/config-add-no-removal.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/config-add-no-removal.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/config-add-no-removal.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -Description: Do not call device_remove when a device is hotplugged. -Author: Maarten Lankhorst -Bug-Ubuntu: https://launchpad.net/bugs/1157614 - -Index: xorg-server-1.17.2/config/udev.c -=================================================================== ---- xorg-server-1.17.2.orig/config/udev.c -+++ xorg-server-1.17.2/config/udev.c -@@ -347,10 +347,9 @@ wakeup_handler(void *data, int err, void - return; - action = udev_device_get_action(udev_device); - if (action) { -- if (!strcmp(action, "add")) { -- device_removed(udev_device); -+ if (!strcmp(action, "add")) - device_added(udev_device); -- } else if (!strcmp(action, "change")) { -+ else if (!strcmp(action, "change")) { - /* ignore change for the drm devices */ - if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { - device_removed(udev_device); -Index: xorg-server-1.17.2/hw/xfree86/os-support/linux/lnx_platform.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/os-support/linux/lnx_platform.c -+++ xorg-server-1.17.2/hw/xfree86/os-support/linux/lnx_platform.c -@@ -177,6 +177,7 @@ xf86PlatformDeviceProbe(struct OdevAttri - return; - - out_free: -+ LogMessage(X_INFO, "config/udev: Ignoring already known drm device (%s)\n", path); - config_odev_free_attributes(attribs); - } - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/CVE-2017-10971-3.patch xorg-server-hwe-16.04-1.19.3/debian/patches/CVE-2017-10971-3.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/CVE-2017-10971-3.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/CVE-2017-10971-3.patch 2017-07-26 20:48:23.000000000 +0000 @@ -26,11 +26,11 @@ Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer -Index: xorg-server-1.18.4/dix/events.c -=================================================================== ---- xorg-server-1.18.4.orig/dix/events.c 2017-07-17 09:38:38.656585566 -0400 -+++ xorg-server-1.18.4/dix/events.c 2017-07-17 09:38:38.632585565 -0400 -@@ -5355,6 +5355,12 @@ ProcSendEvent(ClientPtr client) +diff --git a/dix/events.c b/dix/events.c +index 3e3a01e..d3a33ea 100644 +--- a/dix/events.c ++++ b/dix/events.c +@@ -5366,6 +5366,12 @@ ProcSendEvent(ClientPtr client) client->errorValue = stuff->event.u.u.type; return BadValue; } @@ -43,10 +43,10 @@ if (stuff->event.u.u.type == ClientMessage && stuff->event.u.u.detail != 8 && stuff->event.u.u.detail != 16 && stuff->event.u.u.detail != 32) { -Index: xorg-server-1.18.4/dix/swapreq.c -=================================================================== ---- xorg-server-1.18.4.orig/dix/swapreq.c 2017-07-17 09:38:38.656585566 -0400 -+++ xorg-server-1.18.4/dix/swapreq.c 2017-07-17 09:38:38.636585565 -0400 +diff --git a/dix/swapreq.c b/dix/swapreq.c +index 719e9b8..6785059 100644 +--- a/dix/swapreq.c ++++ b/dix/swapreq.c @@ -292,6 +292,13 @@ SProcSendEvent(ClientPtr client) swapl(&stuff->destination); swapl(&stuff->eventMask); @@ -61,3 +61,6 @@ /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */ +-- +cgit v0.10.2 + diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/CVE-2017-2624.patch xorg-server-hwe-16.04-1.19.3/debian/patches/CVE-2017-2624.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/CVE-2017-2624.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/CVE-2017-2624.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -Backport of: - -From d7ac755f0b618eb1259d93c8a16ec6e39a18627c Mon Sep 17 00:00:00 2001 -From: Matthieu Herrb -Date: Tue, 28 Feb 2017 19:18:25 +0100 -Subject: Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624 - -Provide the function definition for systems that don't have it. - -Signed-off-by: Matthieu Herrb -Reviewed-by: Alan Coopersmith - -Index: xorg-server-1.18.4/configure.ac -=================================================================== ---- xorg-server-1.18.4.orig/configure.ac 2017-07-17 10:23:07.040709996 -0400 -+++ xorg-server-1.18.4/configure.ac 2017-07-17 10:23:29.656711051 -0400 -@@ -220,7 +220,8 @@ AC_CHECK_FUNCS([backtrace ffs geteuid ge - getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ - mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext]) --AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup]) -+AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\ -+ timingsafe_memcmp]) - - AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) - -Index: xorg-server-1.18.4/include/dix-config.h.in -=================================================================== ---- xorg-server-1.18.4.orig/include/dix-config.h.in 2017-07-17 10:23:07.040709996 -0400 -+++ xorg-server-1.18.4/include/dix-config.h.in 2017-07-17 10:23:07.036709996 -0400 -@@ -232,6 +232,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_SYS_UTSNAME_H - -+/* 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 - -Index: xorg-server-1.18.4/include/os.h -=================================================================== ---- xorg-server-1.18.4.orig/include/os.h 2017-07-17 10:23:07.040709996 -0400 -+++ xorg-server-1.18.4/include/os.h 2017-07-17 10:23:07.036709996 -0400 -@@ -590,6 +590,11 @@ extern _X_EXPORT char * - strndup(const char *str, size_t n); - #endif - -+#ifndef HAVE_TIMINGSAFE_MEMCMP -+extern _X_EXPORT int -+timingsafe_memcmp(const void *b1, const void *b2, size_t len); -+#endif -+ - /* Logging. */ - typedef enum _LogParameter { - XLOG_FLUSH, -Index: xorg-server-1.18.4/os/mitauth.c -=================================================================== ---- xorg-server-1.18.4.orig/os/mitauth.c 2017-07-17 10:23:07.040709996 -0400 -+++ xorg-server-1.18.4/os/mitauth.c 2017-07-17 10:23:07.036709996 -0400 -@@ -76,7 +76,7 @@ MitCheckCookie(unsigned short data_lengt - - for (auth = mit_auth; auth; auth = auth->next) { - if (data_length == auth->len && -- memcmp(data, auth->data, (int) data_length) == 0) -+ timingsafe_memcmp(data, auth->data, (int) data_length) == 0) - return auth->id; - } - *reason = "Invalid MIT-MAGIC-COOKIE-1 key"; -Index: xorg-server-1.18.4/os/timingsafe_memcmp.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ xorg-server-1.18.4/os/timingsafe_memcmp.c 2017-07-17 10:23:07.036709996 -0400 -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (c) 2014 Google Inc. -+ * -+ * Permission to use, copy, modify, and distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, 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 -+#include -+ -+int -+timingsafe_memcmp(const void *b1, const void *b2, size_t len) -+{ -+ const unsigned char *p1 = b1, *p2 = b2; -+ size_t i; -+ int res = 0, done = 0; -+ -+ for (i = 0; i < len; i++) { -+ /* lt is -1 if p1[i] < p2[i]; else 0. */ -+ int lt = (p1[i] - p2[i]) >> CHAR_BIT; -+ -+ /* gt is -1 if p1[i] > p2[i]; else 0. */ -+ int gt = (p2[i] - p1[i]) >> CHAR_BIT; -+ -+ /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */ -+ int cmp = lt - gt; -+ -+ /* set res = cmp if !done. */ -+ res |= cmp & ~done; -+ -+ /* set done if p1[i] != p2[i]. */ -+ done |= lt | gt; -+ } -+ -+ return (res); -+} diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/disable-rotation-transform-gpuscreens.patch xorg-server-hwe-16.04-1.19.3/debian/patches/disable-rotation-transform-gpuscreens.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/disable-rotation-transform-gpuscreens.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/disable-rotation-transform-gpuscreens.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -Description: Disable support for rotations and transforms on gpu screens. -Author: Maarten Lankhorst -Bug-Ubuntu: https://launchpad.net/bugs/1386620 -Bug-Ubuntu: https://launchpad.net/bugs/1308515 -Bug-Ubuntu: https://launchpad.net/bugs/1489696 - ---- a/hw/xfree86/modes/xf86RandR12.c -+++ b/hw/xfree86/modes/xf86RandR12.c -@@ -922,6 +922,9 @@ xf86RandR12SetRotations(ScreenPtr pScree - if (xf86RandR12Key == NULL) - return; - -+ if (pScreen->isGPU) -+ rotations = RR_Rotate_0; -+ - randrp = XF86RANDRINFO(pScreen); - #if RANDR_12_INTERFACE - for (c = 0; c < config->num_crtc; c++) { -@@ -942,6 +945,9 @@ xf86RandR12SetTransformSupport(ScreenPtr - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - #endif - -+ if (pScreen->isGPU) -+ transforms = FALSE; -+ - if (xf86RandR12Key == NULL) - return; - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/fix-detach-gpu.patch xorg-server-hwe-16.04-1.19.3/debian/patches/fix-detach-gpu.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/fix-detach-gpu.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/fix-detach-gpu.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -Description: Fix crash in RRCrtcDetachScanoutPixmap. -Author: Maarten Lankhorst -Bug-Ubuntu: https://launchpad.net/bugs/1280743 - ---- a/hw/xfree86/modes/xf86RandR12.c -+++ b/hw/xfree86/modes/xf86RandR12.c -@@ -1845,7 +1845,8 @@ xf86RandR14ProviderSetOutputSource(Scree - ScreenPtr cmScreen = pScreen->current_master; - - xf86DetachOutputGPU(pScreen); -- AttachUnboundGPU(cmScreen, pScreen); -+ if (!pScreen->current_master) -+ AttachUnboundGPU(cmScreen, pScreen); - } - provider->output_source = NULL; - return TRUE; -@@ -1856,7 +1857,8 @@ xf86RandR14ProviderSetOutputSource(Scree - - SetRootClip(source_provider->pScreen, FALSE); - -- DetachUnboundGPU(pScreen); -+ if (!pScreen->current_master) -+ DetachUnboundGPU(pScreen); - AttachOutputGPU(source_provider->pScreen, pScreen); - - provider->output_source = source_provider; -@@ -1873,7 +1875,8 @@ xf86RandR14ProviderSetOffloadSink(Screen - if (provider->offload_sink) { - ScreenPtr cmScreen = pScreen->current_master; - xf86DetachOutputGPU(pScreen); -- AttachUnboundGPU(cmScreen, pScreen); -+ if (!pScreen->current_master) -+ AttachUnboundGPU(cmScreen, pScreen); - } - - provider->offload_sink = NULL; -@@ -1883,7 +1886,8 @@ xf86RandR14ProviderSetOffloadSink(Screen - if (provider->offload_sink == sink_provider) - return TRUE; - -- DetachUnboundGPU(pScreen); -+ if (!pScreen->current_master) -+ DetachUnboundGPU(pScreen); - AttachOffloadGPU(sink_provider->pScreen, pScreen); - - provider->offload_sink = sink_provider; -@@ -1962,12 +1966,14 @@ xf86RandR14ProviderDestroy(ScreenPtr scr - config->randr_provider->offload_sink = NULL; - RRSetChanged(screen); - } -- else if (config->randr_provider->output_source) { -+ -+ if (config->randr_provider->output_source) { - xf86DetachOutputGPU(screen); - config->randr_provider->output_source = NULL; - RRSetChanged(screen); - } -- else if (screen->current_master) -+ -+ if (screen->current_master) - DetachUnboundGPU(screen); - } - config->randr_provider = NULL; ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -3952,6 +3952,8 @@ AttachUnboundGPU(ScreenPtr pScreen, Scre - assert(new->isGPU); - assert(!new->current_master); - xorg_list_add(&new->unattached_head, &pScreen->unattached_list); -+ xorg_list_init(&new->offload_head); -+ xorg_list_init(&new->output_head); - new->current_master = pScreen; - } - -@@ -3976,7 +3978,8 @@ DetachOutputGPU(ScreenPtr slave) - { - assert(slave->isGPU); - xorg_list_del(&slave->output_head); -- slave->current_master = NULL; -+ if (xorg_list_is_empty(&slave->offload_head)) -+ slave->current_master = NULL; - } - - void -@@ -3992,6 +3995,7 @@ DetachOffloadGPU(ScreenPtr slave) - { - assert(slave->isGPU); - xorg_list_del(&slave->offload_head); -- slave->current_master = NULL; -+ if (xorg_list_is_empty(&slave->output_head)) -+ slave->current_master = NULL; - } - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/modesetting-unifdef-slave-support.diff xorg-server-hwe-16.04-1.19.3/debian/patches/modesetting-unifdef-slave-support.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/modesetting-unifdef-slave-support.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/modesetting-unifdef-slave-support.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Subject: [PATCH xserver] modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT -From: Nikhil Mahale -Date: 22.10.2016 15:10 - -Commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 had already -unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT but commit -9257b1252da9092ddc676fec9aabe2b33dfad272 didn't -notice that. - -Signed-off-by: Nikhil Mahale ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 2 -- - 1 file changed, 2 deletions(-) - ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -1401,10 +1401,8 @@ drmmode_create_name(ScrnInfoPtr pScrn, d - fallback: - if (koutput->connector_type >= MS_ARRAY_SIZE(output_names)) - snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, koutput->connector_type_id); --#ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT - 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); --#endif - else - snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id); - } diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/no-nv.patch xorg-server-hwe-16.04-1.19.3/debian/patches/no-nv.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/no-nv.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/no-nv.patch 2017-07-26 20:48:23.000000000 +0000 @@ -9,7 +9,7 @@ --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c -@@ -1193,8 +1193,9 @@ xf86VideoPtrToDriverList(struct pci_devi +@@ -1208,8 +1208,9 @@ xf86VideoPtrToDriverList(struct pci_devi driverList[idx++] = "nvidia"; #ifdef __linux__ driverList[idx++] = "nouveau"; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/randr-adjust-masters-last-set-time.diff xorg-server-hwe-16.04-1.19.3/debian/patches/randr-adjust-masters-last-set-time.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/randr-adjust-masters-last-set-time.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/randr-adjust-masters-last-set-time.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -Subject: [PATCH xserver] randr: Adjust master's last set time with slaves -From: Nikhil Mahale -Date: 20.05.2016 08:01 -To: -CC: Nikhil Mahale - -In prime configurations master's last set time may not be latest -and greatest, adjust it with slaves last set time, pick up greatest -one. Otherwise xserver may end with events which has -lastSetTime < lastConfigTime even if that's not -the case and confuse xrandr client. - -Signed-off-by: Nikhil Mahale ---- - randr/randr.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/randr/randr.c b/randr/randr.c -index 3aabb19..c07def1 100644 ---- a/randr/randr.c -+++ b/randr/randr.c -@@ -584,6 +585,15 @@ RRTellChanged(ScreenPtr pScreen) - mastersp = pScrPriv; - } - -+ xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) { -+ pSlaveScrPriv = rrGetScrPriv(iter); -+ -+ if (CompareTimeStamps(mastersp->lastSetTime, -+ pSlaveScrPriv->lastSetTime) == EARLIER) { -+ mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; -+ } -+ } -+ - if (mastersp->changed) { - UpdateCurrentTimeIf(); - if (mastersp->configChanged) { --- 2.8.2 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/randr-do-not-check-the-screen-size.diff xorg-server-hwe-16.04-1.19.3/debian/patches/randr-do-not-check-the-screen-size.diff --- xorg-server-hwe-16.04-1.18.4/debian/patches/randr-do-not-check-the-screen-size.diff 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/randr-do-not-check-the-screen-size.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -Subject: [PATCH xserver] randr: Do not check the screen size bound for gpu screens -From: Nikhil Mahale -Date: 20.05.2016 08:00 -To: -CC: Nikhil Mahale - -For gpu screen, CrtcSet set/adjust the master screen size along -mode in following callstack - - - ProcRRSetCrtcConfig() - | - -> RRCrtcSet() - | - -> rrCheckPixmapBounding() - | - -> pScrPriv->rrScreenSetSize() - -Checking screen size bound for gpus screen cause some configurations -to fails, e.g - - $ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \ - --mode 2560x1440 --pos 0x0 - - Here xrandr utility first sets screen size to 2560x1440 which - gets resized to 1920x1080 on RRSetCrtcConfig request for eDP, - and then RRSetCrtcConfig request for HDMI fails because - of failure of screen bound check. - -Signed-off-by: Nikhil Mahale ---- - randr/rrcrtc.c | 19 ++++++------------- - 1 file changed, 6 insertions(+), 13 deletions(-) - -diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c -index 566a3db..82db9a8 100644 ---- a/randr/rrcrtc.c -+++ b/randr/rrcrtc.c -@@ -1176,27 +1176,20 @@ ProcRRSetCrtcConfig(ClientPtr client) - - #ifdef RANDR_12_INTERFACE - /* -+ * For gpu screen, CrtcSet set/adjust the master screen size along -+ * with mode. -+ * - * Check screen size bounds if the DDX provides a 1.2 interface - * for setting screen size. Else, assume the CrtcSet sets - * the size along with the mode. If the driver supports transforms, - * then it must allow crtcs to display a subset of the screen, so - * only do this check for drivers without transform support. - */ -- if (pScrPriv->rrScreenSetSize && !crtc->transforms) { -+ if (!pScreen->isGPU && pScrPriv->rrScreenSetSize && !crtc->transforms) { - int source_width; - int source_height; - PictTransform transform; - struct pixman_f_transform f_transform, f_inverse; -- int width, height; -- -- if (pScreen->isGPU) { -- width = pScreen->current_master->width; -- height = pScreen->current_master->height; -- } -- else { -- width = pScreen->width; -- height = pScreen->height; -- } - - RRTransformCompute(stuff->x, stuff->y, - mode->mode.width, mode->mode.height, -@@ -1206,13 +1199,13 @@ ProcRRSetCrtcConfig(ClientPtr client) - - RRModeGetScanoutSize(mode, &transform, &source_width, - &source_height); -- if (stuff->x + source_width > width) { -+ if (stuff->x + source_width > pScreen->width) { - client->errorValue = stuff->x; - free(outputs); - return BadValue; - } - -- if (stuff->y + source_height > height) { -+ if (stuff->y + source_height > pScreen->height) { - client->errorValue = stuff->y; - free(outputs); - return BadValue; --- 2.8.2 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/series xorg-server-hwe-16.04-1.19.3/debian/patches/series --- xorg-server-hwe-16.04-1.18.4/debian/patches/series 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/series 2017-07-26 20:48:23.000000000 +0000 @@ -13,48 +13,22 @@ 105_nvidia_autodetect.patch 168_glibc_trace_to_stderr.patch 188_default_primary_to_first_busid.patch -#190_cache-xkbcomp_output_for_fast_start_up.patch 191-Xorg-add-an-extra-module-path.patch 226_fall_back_to_autoconfiguration.patch ## send upstream -232-xf86compatoutput-valgrind.patch xfree86-no-xv-for-gpuscreens.patch no-nv.patch -## waiting for review by upstream -111_armel-drv-fallbacks.patch -122_xext_fix_card32_overflow_in_xauth.patch -# https://bugs.freedesktop.org/show_bug.cgi?id=27134 -# http://lists.x.org/archives/xorg-devel/2010-April/007777.html -# Resent to mailing list, Feb 2013 -208_switch_on_release.diff -# https://bugs.freedesktop.org/show_bug.cgi?id=865 -# - Violates XKB spec: Section 6.3, SA_LockGroup -# http://lists.freedesktop.org/archives/xorg-devel/2013-January/035046.html -# - Different implementation proposed on fdo mailing list -227_null_ptr_midispcur.patch -# https://bugs.freedesktop.org/show_bug.cgi?id=24181 -# Probably is just papering over issue; needs further analysis - ## upstream patches # hybrid graphics fixes 228_autobind_gpu.patch -xf86-inactive-gpuscreen.patch -config-add-no-removal.patch xf86-ignore-conflicting-rr-caps.patch -fix-detach-gpu.patch -disable-rotation-transform-gpuscreens.patch xmir.patch -xmir-desktop-file-hint-flag.patch xi2-resize-touch.patch -randr-adjust-masters-last-set-time.diff -randr-do-not-check-the-screen-size.diff -modesetting-unifdef-slave-support.diff CVE-2017-10971-1.patch CVE-2017-10971-2.patch CVE-2017-10971-3.patch CVE-2017-10972.patch -CVE-2017-2624.patch diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xf86-ignore-conflicting-rr-caps.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xf86-ignore-conflicting-rr-caps.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xf86-ignore-conflicting-rr-caps.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xf86-ignore-conflicting-rr-caps.patch 2017-07-26 20:48:23.000000000 +0000 @@ -4,7 +4,7 @@ --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c -@@ -1548,10 +1548,16 @@ xf86RandR12CreateObjects12(ScreenPtr pSc +@@ -1671,10 +1671,16 @@ xf86RandR12CreateObjects12(ScreenPtr pSc } if (config->name) { diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xf86-inactive-gpuscreen.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xf86-inactive-gpuscreen.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xf86-inactive-gpuscreen.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xf86-inactive-gpuscreen.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Description: Fix nvidia regression -Author: Maarten Lankhorst - -Index: xorg-server-1.17.2/hw/xfree86/common/xf86platformBus.c -=================================================================== ---- xorg-server-1.17.2.orig/hw/xfree86/common/xf86platformBus.c -+++ xorg-server-1.17.2/hw/xfree86/common/xf86platformBus.c -@@ -424,7 +424,7 @@ xf86platformProbeDev(DriverPtr drvp) - Bool foundScreen = FALSE; - GDevPtr *devList; - const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList); -- int i, j; -+ int i, j, flags; - - /* find the main device or any device specificed in xorg.conf */ - for (i = 0; i < numDevs; i++) { -@@ -450,7 +450,11 @@ xf86platformProbeDev(DriverPtr drvp) - if (j == xf86_num_platform_devices) - continue; - -- foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0); -+ flags = 0; -+ if (!devList[i]->active) -+ flags |= PLATFORM_PROBE_GPU_SCREEN; -+ -+ foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], flags); - if (!foundScreen) - continue; - } diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xfree86-no-xv-for-gpuscreens.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xfree86-no-xv-for-gpuscreens.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xfree86-no-xv-for-gpuscreens.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xfree86-no-xv-for-gpuscreens.patch 2017-07-26 20:48:23.000000000 +0000 @@ -1,6 +1,5 @@ Description: Do not bother registering xv/xvmc on gpu screens. Author: Maarten Lankhorst -Bug-Ubuntu: https://launchpad.net/bugs/1079096 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xi2-resize-touch.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xi2-resize-touch.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xi2-resize-touch.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xi2-resize-touch.patch 2017-07-26 20:48:23.000000000 +0000 @@ -3,7 +3,7 @@ --- a/dix/touch.c +++ b/dix/touch.c -@@ -460,11 +460,25 @@ TouchEventHistoryPush(TouchPointInfoPtr +@@ -430,11 +430,25 @@ TouchEventHistoryPush(TouchPointInfoPtr if (ev->flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING)) return; diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xmir-desktop-file-hint-flag.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xmir-desktop-file-hint-flag.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xmir-desktop-file-hint-flag.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xmir-desktop-file-hint-flag.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From de9e6e1d66680e717471df2c4032e590fd1b9ae0 Mon Sep 17 00:00:00 2001 -From: Robert Ancell -Date: Fri, 29 Apr 2016 14:58:28 +0200 -Subject: [PATCH xserver 2/3] xmir: Ignore --desktop_file_hint flag required by - Unity8 to decide which application is starting - ---- - hw/xmir/xmir.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/hw/xmir/xmir.c b/hw/xmir/xmir.c -index 5526958..ea85f1a 100644 ---- a/hw/xmir/xmir.c -+++ b/hw/xmir/xmir.c -@@ -172,6 +172,9 @@ ddxProcessArgument(int argc, char *argv[], int i) - } else if (!strcmp(argv[i], "-novtswitch") || - !strncmp(argv[i], "vt", 2)) { - return 1; -+ /* Bypass unity8 "security" */ -+ } else if (!strncmp(argv[i], "--desktop_file_hint=", strlen("--desktop_file_hint="))) { -+ return 1; - } else if (!strcmp(argv[i], "-fd")) { - if (!seen_shared) - NoListenAll = 1; --- -2.7.4 - diff -Nru xorg-server-hwe-16.04-1.18.4/debian/patches/xmir.patch xorg-server-hwe-16.04-1.19.3/debian/patches/xmir.patch --- xorg-server-hwe-16.04-1.18.4/debian/patches/xmir.patch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/patches/xmir.patch 2017-07-26 20:48:23.000000000 +0000 @@ -1,4 +1,4 @@ -From 8467ede06b3b40fae1d362d73cfa313737e0defc Mon Sep 17 00:00:00 2001 +From 4d62680bb8961651be15732cc815bf8cff2535ef Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 29 Apr 2016 14:57:53 +0200 Subject: [PATCH xserver 1/3] XMir DDX @@ -11,25 +11,25 @@ Daniel van Vugt Chris Townsend --- - configure.ac | 25 + - hw/Makefile.am | 9 +- - hw/xmir/.gitignore | 1 + - hw/xmir/Makefile.am | 61 ++ - hw/xmir/dri2/Makefile.am | 14 + - hw/xmir/dri2/dri2.c | 1398 ++++++++++++++++++++++++++++++++++ - hw/xmir/dri2/dri2.h | 364 +++++++++ - hw/xmir/dri2/dri2ext.c | 683 +++++++++++++++++ - hw/xmir/dri2/dri2int.h | 26 + - hw/xmir/xmir-cursor.c | 210 ++++++ - hw/xmir/xmir-cvt.c | 304 ++++++++ - hw/xmir/xmir-dri2.c | 551 ++++++++++++++ - hw/xmir/xmir-glamor.c | 1164 +++++++++++++++++++++++++++++ - hw/xmir/xmir-input.c | 611 +++++++++++++++ - hw/xmir/xmir-output.c | 476 ++++++++++++ - hw/xmir/xmir-thread-proxy.c | 115 +++ - hw/xmir/xmir.c | 1729 +++++++++++++++++++++++++++++++++++++++++++ - hw/xmir/xmir.h | 232 ++++++ - 18 files changed, 7971 insertions(+), 2 deletions(-) + configure.ac | 25 + hw/Makefile.am | 9 + hw/xmir/.gitignore | 1 + hw/xmir/Makefile.am | 59 + + hw/xmir/dri2/Makefile.am | 14 + hw/xmir/dri2/dri2.c | 1398 +++++++++++++++++++++++++++++++++ + hw/xmir/dri2/dri2.h | 364 ++++++++ + hw/xmir/dri2/dri2ext.c | 683 ++++++++++++++++ + hw/xmir/dri2/dri2int.h | 26 + hw/xmir/xmir-cursor.c | 225 +++++ + hw/xmir/xmir-cvt.c | 304 +++++++ + hw/xmir/xmir-dri2.c | 564 +++++++++++++ + hw/xmir/xmir-glamor.c | 1180 ++++++++++++++++++++++++++++ + hw/xmir/xmir-input.c | 650 +++++++++++++++ + hw/xmir/xmir-output.c | 501 ++++++++++++ + hw/xmir/xmir-thread-proxy.c | 110 ++ + hw/xmir/xmir.c | 1818 ++++++++++++++++++++++++++++++++++++++++++++ + hw/xmir/xmir.h | 234 +++++ + 18 files changed, 8163 insertions(+), 2 deletions(-) create mode 100644 hw/xmir/.gitignore create mode 100644 hw/xmir/Makefile.am create mode 100644 hw/xmir/dri2/Makefile.am @@ -49,15 +49,15 @@ --- a/configure.ac +++ b/configure.ac -@@ -643,6 +643,7 @@ AC_ARG_ENABLE(xvfb, AS_HELP_ST +@@ -658,6 +658,7 @@ AC_ARG_ENABLE(xvfb, AS_HELP_ST 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(xmir, AS_HELP_STRING([--enable-xmir], [Build Xmir server (default: auto)]), [XMIR=$enableval], [XMIR=auto]) 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: no)]), [GLAMOR=$enableval], [GLAMOR=no]) -@@ -761,6 +762,7 @@ case $host_os in + AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: auto)]), [GLAMOR=$enableval], [GLAMOR=auto]) +@@ -776,6 +777,7 @@ case $host_os in XVFB=no XNEST=no XWAYLAND=no @@ -65,8 +65,8 @@ COMPOSITE=no DGA=no -@@ -2513,6 +2515,27 @@ if test "x$XWAYLAND" = xyes; then - [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) +@@ -2557,6 +2559,27 @@ if test "x$XWAYLAND" = xyes; then + AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) fi +dnl Xmir DDX @@ -93,7 +93,7 @@ dnl and the rest of these are generic, so they're in config.h dnl -@@ -2661,6 +2684,8 @@ hw/kdrive/fbdev/Makefile +@@ -2706,6 +2729,8 @@ hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile @@ -134,7 +134,7 @@ +Xmir --- /dev/null +++ b/hw/xmir/Makefile.am -@@ -0,0 +1,61 @@ +@@ -0,0 +1,59 @@ +bin_PROGRAMS = Xmir + +if DRI2 @@ -165,7 +165,7 @@ + +Xmir_LDADD = \ + $(glamor_lib) \ -+ $(aiglx_lib) \ ++ $(glxdri_lib) \ + $(XMIR_LIBS) \ + $(XMIR_SYS_LIBS) \ + $(XSERVER_SYS_LIBS) @@ -187,11 +187,9 @@ +Xmir_LDADD += dri2/libdri2.la +endif + -+if AIGLX_DRI_LOADER -+aiglx_lib = $(top_builddir)/glx/libglxdri.la ++glxdri_lib = $(top_builddir)/glx/libglxdri.la +if NO_UNDEFINED -+aiglx_lib += $(LIBDRM_LIBS) $(PIXMAN_LIBS) -+endif ++glxdri_lib += $(LIBDRM_LIBS) $(PIXMAN_LIBS) +endif + +relink: @@ -2698,9 +2696,9 @@ +extern Bool DRI2ModuleSetup(void); --- /dev/null +++ b/hw/xmir/xmir-cursor.c -@@ -0,0 +1,210 @@ +@@ -0,0 +1,225 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -2766,7 +2764,8 @@ + return TRUE; +} + -+static void xmir_input_set_cursor(struct xmir_input *xmir_input, CursorPtr cursor); ++static void xmir_input_set_cursor(struct xmir_input *xmir_input, ++ CursorPtr cursor); + +static Bool +xmir_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) @@ -2793,26 +2792,35 @@ + MirCursorConfiguration *config; + MirBufferStream *stream; + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + if (!cursor) { + config = mir_cursor_configuration_from_name(mir_disabled_cursor_name); + goto apply; -+ } else if (cursor == rootCursor) { ++ } ++ else if (cursor == rootCursor) { + /* Avoid using the old style X default black cross cursor */ + config = mir_cursor_configuration_from_name(mir_arrow_cursor_name); + goto apply; + } ++#pragma GCC diagnostic pop + + stream = dixGetPrivate(&cursor->devPrivates, &xmir_cursor_private_key); + if (stream) { + mir_buffer_stream_get_graphics_region(stream, ®ion); -+ if (region.width != cursor->bits->width || region.height != cursor->bits->height) { ++ if (region.width != cursor->bits->width || ++ region.height != cursor->bits->height) { + mir_buffer_stream_release_sync(stream); + stream = NULL; + } + } + + if (!stream) { -+ stream = mir_connection_create_buffer_stream_sync(xmir_input->xmir_screen->conn, cursor->bits->width, cursor->bits->height, mir_pixel_format_argb_8888, mir_buffer_usage_software); ++ stream = mir_connection_create_buffer_stream_sync(xmir_input->xmir_screen->conn, ++ cursor->bits->width, ++ cursor->bits->height, ++ mir_pixel_format_argb_8888, ++ mir_buffer_usage_software); + dixSetPrivate(&cursor->devPrivates, &xmir_cursor_private_key, stream); + mir_buffer_stream_get_graphics_region(stream, ®ion); + } @@ -2829,13 +2837,17 @@ + expand_source_and_mask(cursor, region.vaddr); + + mir_buffer_stream_swap_buffers(stream, NULL, NULL); -+ config = mir_cursor_configuration_from_buffer_stream(stream, cursor->bits->xhot, cursor->bits->yhot); ++ config = mir_cursor_configuration_from_buffer_stream(stream, ++ cursor->bits->xhot, ++ cursor->bits->yhot); + +apply: -+ if (!xmir_input->xmir_screen->rootless) -+ mir_wait_for(mir_surface_configure_cursor(xmir_window_get(xmir_input->xmir_screen->screen->root)->surface, config)); ++ if (!xmir_input->xmir_screen->rootless) { ++ struct xmir_window *w = xmir_window_get(xmir_input->xmir_screen->screen->root); ++ mir_window_configure_cursor(w->surface, config); ++ } + else if (xmir_input->focus_window) -+ mir_wait_for(mir_surface_configure_cursor(xmir_input->focus_window->surface, config)); ++ mir_window_configure_cursor(xmir_input->focus_window->surface, config); + mir_cursor_configuration_destroy(config); +} + @@ -2902,7 +2914,8 @@ +Bool +xmir_screen_init_cursor(struct xmir_screen *xmir_screen) +{ -+ if (!dixRegisterPrivateKey(&xmir_cursor_private_key, PRIVATE_CURSOR_BITS, 0)) ++ if (!dixRegisterPrivateKey(&xmir_cursor_private_key, ++ PRIVATE_CURSOR_BITS, 0)) + return FALSE; + + return miPointerInitialize(xmir_screen->screen, @@ -3218,7 +3231,7 @@ +} --- /dev/null +++ b/hw/xmir/xmir-dri2.c -@@ -0,0 +1,551 @@ +@@ -0,0 +1,564 @@ +/* + * Copyright © 2015 Canonical Ltd + * @@ -3352,7 +3365,8 @@ + if (xmir_window->surface) { + buf->driverPrivate = xmir_glamor_win_get_back(xmir_screen, xmir_window, &xmir_window->window->drawable); + xmir_pixmap = xmir_pixmap_get(buf->driverPrivate); -+ } else { ++ } ++ else { + struct xmir_window *xmir_window_parent = xmir_window_swappable_parent((WindowPtr)draw); + + if (xmir_window_parent && xmir_window_parent->back_pixmap) @@ -3381,6 +3395,8 @@ +static void +xmir_dri2_auth_magic_reply(MirConnection* con, MirPlatformMessage* reply, Bool* ret) +{ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct MirMesaAuthMagicResponse const* response; + unsigned int opcode = mir_platform_message_get_opcode(reply); + MirPlatformMessageData data = mir_platform_message_get_data(reply); @@ -3400,11 +3416,14 @@ + if (response->status == 0) + *ret = 1; + mir_platform_message_release(reply); ++#pragma GCC diagnostic pop +} + +static Bool +xmir_dri2_auth_magic(ScreenPtr screen, uint32_t magic) +{ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct xmir_screen *xmir_screen = xmir_screen_get(screen); + Bool ret = 0; + MirPlatformMessage *msg = NULL; @@ -3429,6 +3448,7 @@ + } + + return ret; ++#pragma GCC diagnostic pop +} + +static DRI2BufferPtr @@ -3458,7 +3478,8 @@ + xmir_window = xmir_window_parent; + + pixmap = screen->GetWindowPixmap((WindowPtr)pDraw); -+ } else ++ } ++ else + pixmap = (PixmapPtr)pDraw; + + ret->attachment = attachment; @@ -3550,7 +3571,8 @@ + if (draw->type == DRAWABLE_WINDOW) { + pixmap = screen->GetWindowPixmap((WindowPtr)draw); + xmir_window = xmir_window_get((WindowPtr)draw); -+ } else ++ } ++ else + pixmap = (PixmapPtr)draw; + + dx = draw->x - pixmap->screen_x; @@ -3589,7 +3611,8 @@ + + /* Make sure DRI2GetBuffers blocks, there is no updated buffer until the next flip */ + DRI2SwapLimit(draw, 1); -+ } else { ++ } ++ else { + pixmap = (PixmapPtr)draw; + memset(target_msc, 0, sizeof(*target_msc)); + } @@ -3621,7 +3644,8 @@ + swap_pix = *xmir_pixmap; + *xmir_pixmap = *xmir_pixmap_get(src->driverPrivate); + *xmir_pixmap_get(src->driverPrivate) = swap_pix; -+ } else { ++ } ++ else { + PixmapPtr dsrc = src->driverPrivate; + int dx = draw->x - pixmap->screen_x, dy = draw->y - pixmap->screen_y; + @@ -3640,7 +3664,8 @@ + dx, dy, xmir_window ? xmir_window->orientation : 0); + } + RegionTranslate(®ion, draw->x, draw->y); -+ } else { ++ } ++ else { + if (!xmir_window->surface) + xmir_window = xmir_window_get(screen->root); + @@ -3688,7 +3713,8 @@ + if (type != DRI2_FLIP_COMPLETE) { + DamageDamageRegion(draw, ®ion); + RegionUninit(®ion); -+ } else ++ } ++ else + DamageReportDamage(xmir_window->damage, &xmir_window->region); + + return 1; @@ -3772,9 +3798,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir-glamor.c -@@ -0,0 +1,1164 @@ +@@ -0,0 +1,1156 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -3893,7 +3919,7 @@ + MirNativeBuffer *buffer; + struct gbm_import_fd_data gbm_data; + -+ mir_buffer_stream_get_current_buffer(mir_surface_get_buffer_stream(xmir_win->surface), &buffer); ++ mir_buffer_stream_get_current_buffer(mir_window_get_buffer_stream(xmir_win->surface), &buffer); + + gbm_data.fd = buffer->fd[0]; + gbm_data.width = buffer->width; @@ -3903,7 +3929,8 @@ + + bo = gbm_bo_import(xmir_screen->gbm, GBM_BO_IMPORT_FD, &gbm_data, GBM_BO_USE_RENDERING); + xmir_pixmap->fake_back = false; -+ } else { ++ } ++ else { + bo = gbm_bo_create(xmir_screen->gbm, draw->width, draw->height, + GBM_FORMAT_ARGB8888, + GBM_BO_USE_RENDERING); @@ -4019,11 +4046,6 @@ + glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, + 2 * sizeof(float), texcoords); + glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); -+ if (!fbo) { -+ glUseProgram(glamor_priv->finish_access_prog[0]); -+ glUniform1i(glamor_priv->finish_access_revert[0], REVERT_NONE); -+ glUniform1i(glamor_priv->finish_access_swap_rb[0], SWAP_NONE_UPLOADING); -+ } + + if (!swap_xy) { + float _tx1, _tx2, _ty1, _ty2; @@ -4031,7 +4053,8 @@ + if (reflect_x) { + dbox.x1 = box->x2 + dstx; + dbox.x2 = box->x1 + dstx; -+ } else { ++ } ++ else { + dbox.x1 = box->x1 + dstx; + dbox.x2 = box->x2 + dstx; + } @@ -4039,7 +4062,8 @@ + if (reflect_y) { + dbox.y1 = box->y2 + dsty; + dbox.y2 = box->y1 + dsty; -+ } else { ++ } ++ else { + dbox.y1 = box->y1 + dsty; + dbox.y2 = box->y2 + dsty; + } @@ -4065,13 +4089,15 @@ + /* bottom left */ + vertices[6] = _tx1; + vertices[7] = _ty2; -+ } else { ++ } ++ else { + float _tx1, _tx2, _ty1, _ty2; + + if (reflect_x) { + dbox.y1 = box->x2 + dstx; + dbox.y2 = box->x1 + dstx; -+ } else { ++ } ++ else { + dbox.y1 = box->x1 + dstx; + dbox.y2 = box->x2 + dstx; + } @@ -4079,7 +4105,8 @@ + if (reflect_y) { + dbox.x1 = box->y2 + dsty; + dbox.x2 = box->y1 + dsty; -+ } else { ++ } ++ else { + dbox.x1 = box->y1 + dsty; + dbox.x2 = box->y2 + dsty; + } @@ -4139,7 +4166,8 @@ + glBlitFramebuffer(ext->x1, ext->y2, ext->x2, ext->y1, + ext->x1 + dx, ext->y2 + dy, ext->x2 + dx, ext->y1 + dy, + GL_COLOR_BUFFER_BIT, GL_LINEAR); -+ } else ++ } ++ else + xmir_glamor_copy_egl_tex(0, src, src_pixmap, src_pixmap_priv, ext, width, height, dx, dy, orientation); +} + @@ -4177,7 +4205,8 @@ + + xmir_win->front_pixmap = back; + glBindFramebuffer(GL_FRAMEBUFFER, 0); -+ } else { ++ } ++ else { + xmir_win->front_pixmap = xmir_win->back_pixmap; + xmir_win->back_pixmap = NULL; + } @@ -4373,7 +4402,6 @@ + * rotating back and forth. + */ + glamor_set_pixmap_type(src_pixmap, GLAMOR_TEXTURE_DRM); -+ src_pixmap_priv->fbo->external = TRUE; + + xmir_win->image = eglCreateImageKHR(xmir_screen->egl_display, xmir_screen->egl_context, EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(intptr_t)src_pixmap_priv->fbo->tex, attribs); + if (!xmir_win->image) { @@ -4456,7 +4484,7 @@ + if (xmir_screen->gbm) + return; + -+ egl_win = mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(xmir_window->surface)); ++ egl_win = mir_buffer_stream_get_egl_native_window(mir_window_get_buffer_stream(xmir_window->surface)); + + xmir_window->egl_surface = eglCreateWindowSurface(xmir_screen->egl_display, eglconfig, (EGLNativeWindowType)egl_win, NULL); +} @@ -4514,7 +4542,10 @@ +static void +xmir_drm_set_gbm_device_response(MirConnection *con, MirPlatformMessage* reply, void* context) +{ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + mir_platform_message_release(reply); ++#pragma GCC diagnostic pop +} + +static Bool @@ -4538,6 +4569,8 @@ + + + if (xmir_screen->drm_fd > 0) { ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct MirMesaSetGBMDeviceRequest req = { + .device = gbm_create_device(xmir_screen->drm_fd) + }; @@ -4558,10 +4591,12 @@ + &xmir_drm_set_gbm_device_response, + NULL)); + mir_platform_message_release(msg); ++#pragma GCC diagnostic pop + /* In GBM mode no mir functions are used in any way. + * This means using the GBM device directly is safe.. */ + xmir_screen->egl_display = eglGetDisplay(xmir_screen->gbm); -+ } else ++ } ++ else + xmir_screen->egl_display = eglGetDisplay(mir_connection_get_egl_native_display(xmir_screen->conn)); + + if (xmir_screen->egl_display == EGL_NO_DISPLAY) { @@ -4592,7 +4627,8 @@ + + if (!epoxy_has_egl_extension(xmir_screen->egl_display, "EGL_KHR_surfaceless_context")) { + xmir_screen->egl_surface = eglCreatePbufferSurface(xmir_screen->egl_display, egl_config, pbuffer_attribs); -+ } else ++ } ++ else + xmir_screen->egl_surface = EGL_NO_SURFACE; + + if (!eglMakeCurrent(xmir_screen->egl_display, @@ -4690,12 +4726,6 @@ + free(xmir_screen->device_name); +} + -+void -+glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) -+{ -+ glamor_destroy_textured_pixmap(pixmap); -+} -+ +static void +xmir_glamor_get_name_from_bo(int drm_fd, struct gbm_bo *bo, int *name) +{ @@ -4784,12 +4814,6 @@ + return fd; +} + -+unsigned int -+glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h, Bool linear) -+{ -+ return 0; -+} -+ +static PixmapPtr +xmir_glamor_create_pixmap(ScreenPtr screen, + int width, int height, int depth, unsigned int hint) @@ -4870,12 +4894,6 @@ + return glamor_create_pixmap(screen, width, height, depth, hint); +} + -+void -+glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) -+{ -+ /* XXX: Unused */ -+} -+ +static Bool +xmir_glamor_destroy_pixmap(PixmapPtr pixmap) +{ @@ -4939,9 +4957,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir-input.c -@@ -0,0 +1,611 @@ +@@ -0,0 +1,650 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -5101,7 +5119,8 @@ + /* reflection test parameters */ + bool magic_x_invert = false, magic_y_invert = false; + -+ DebugF("Raw input %i,%i in window (%i,%i)->(%i,%i) orientation %i and scale %i\n", *x, *y, dx, dy, dx + w, dy + h, xmir_window->orientation, scale); ++ DebugF("Raw input %i,%i in window (%i,%i)->(%i,%i) orientation %i and scale %i\n", ++ *x, *y, dx, dy, dx + w, dy + h, xmir_window->orientation, scale); + + if (magic_x_invert) + reflect_x = !reflect_x; @@ -5111,17 +5130,24 @@ + + switch (xmir_window->orientation) { + case 90: -+ reflect_x = !reflect_x; swap_xy = true; break; ++ reflect_x = !reflect_x; ++ swap_xy = true; ++ break; + case 180: -+ reflect_x = !reflect_x; reflect_y = !reflect_y; break; ++ reflect_x = !reflect_x; ++ reflect_y = !reflect_y; ++ break; + case 270: -+ reflect_y = !reflect_y; swap_xy = true; break; ++ reflect_y = !reflect_y; ++ swap_xy = true; ++ break; + } + + if (!swap_xy) { + sx = *x; + sy = *y; -+ } else { ++ } ++ else { + sx = *y; + sy = *x; + } @@ -5201,16 +5227,18 @@ + MirPointerEvent const *pev) +{ + DeviceIntPtr dev = xmir_input->pointer; -+ struct {MirPointerButton mir_button; int x_button;} map[3] = -+ { ++ struct { ++ MirPointerButton mir_button; ++ int x_button; ++ } map[3] = { + {mir_pointer_button_primary, 1}, /* Usually left button */ + {mir_pointer_button_secondary, 3}, /* Middle button */ + {mir_pointer_button_tertiary, 2}, /* Right button */ + }; + int i; + ValuatorMask mask; -+ valuator_mask_zero(&mask); + ++ valuator_mask_zero(&mask); + for (i = 0; i < 3; ++i) { + MirPointerButton mir_button = map[i].mir_button; + int x_button = map[i].x_button; @@ -5306,7 +5334,9 @@ +} + +static void -+fake_touch_move(struct xmir_input *xmir_input, struct xmir_window *xmir_window, int sx, int sy) ++fake_touch_move(struct xmir_input *xmir_input, ++ struct xmir_window *xmir_window, ++ int sx, int sy) +{ + ValuatorMask mask; + @@ -5327,9 +5357,13 @@ +{ + switch (mir_input_event_get_type(ev)) { + case mir_input_event_type_key: { -+ MirKeyboardEvent const *kev = mir_input_event_get_keyboard_event(ev); -+ MirKeyboardAction action = mir_keyboard_event_action(kev); -+ int code = mir_keyboard_event_scan_code(kev) + 8; ++ MirKeyboardEvent const *kev; ++ MirKeyboardAction action; ++ int code; ++ ++ kev = mir_input_event_get_keyboard_event(ev); ++ action = mir_keyboard_event_action(kev); ++ code = mir_keyboard_event_scan_code(kev) + 8; + + /* + * Note: mir_keyboard_action_repeat must KeyRelease then KeyPress @@ -5386,13 +5420,18 @@ + break; + case mir_touch_action_down: + xmir_input->touch_id = mir_touch_event_id(tev, i); -+ if (!pointer_ensure_focus(xmir_input, xmir_window, xmir_input->touch, sx, sy)) ++ if (!pointer_ensure_focus(xmir_input, ++ xmir_window, ++ xmir_input->touch, ++ sx, sy)) + fake_touch_move(xmir_input, xmir_window, sx, sy); + QueuePointerEvents(xmir_input->touch, ButtonPress, 1, 0, &mask); + break; + case mir_touch_action_change: + fake_touch_move(xmir_input, xmir_window, sx, sy); + break; ++ default: ++ break; + } + break; + @@ -5425,7 +5464,7 @@ + +static void +xmir_handle_keymap_event(struct xmir_input *xmir_input, -+ MirKeymapEvent const* ev) ++ MirKeymapEvent const* ev) +{ + char * buffer = NULL; + size_t length = 0; @@ -5454,15 +5493,24 @@ + void *arg) +{ + const MirEvent *ev = arg; -+ struct xmir_input *xmir_input = xorg_list_first_entry(&xmir_screen->input_list, struct xmir_input, link); ++ struct xmir_input *xmir_input; + ++ xmir_input = xorg_list_first_entry(&xmir_screen->input_list, ++ struct xmir_input, ++ link); + switch (mir_event_get_type(ev)) + { + case mir_event_type_input: -+ xmir_window_handle_input_event(xmir_input, xmir_window, mir_event_get_input_event(ev)); ++ xmir_window_handle_input_event(xmir_input, ++ xmir_window, ++ mir_event_get_input_event(ev)); + break; -+ case mir_event_type_surface: -+ xmir_handle_surface_event(xmir_window, mir_surface_event_get_attribute(mir_event_get_surface_event(ev)), mir_surface_event_get_attribute_value(mir_event_get_surface_event(ev))); ++ case mir_event_type_window: { ++ const MirWindowEvent *surface = mir_event_get_window_event(ev); ++ xmir_handle_surface_event(xmir_window, ++ mir_window_event_get_attribute(surface), ++ mir_window_event_get_attribute_value(surface)); ++ } + break; + case mir_event_type_resize: { + WindowPtr window = xmir_window->window; @@ -5480,19 +5528,22 @@ + case mir_event_type_prompt_session_state_change: + ErrorF("No idea about prompt_session_state_change\n"); + break; -+ case mir_event_type_orientation: -+ xmir_output_handle_orientation(xmir_window, mir_orientation_event_get_direction(mir_event_get_orientation_event(ev))); ++ case mir_event_type_orientation: { ++ const MirOrientationEvent *orientation = mir_event_get_orientation_event(ev); ++ xmir_output_handle_orientation(xmir_window, ++ mir_orientation_event_get_direction(orientation)); ++ } + break; -+ case mir_event_type_close_surface: ++ case mir_event_type_close_window: + xmir_close_surface(xmir_window); + break; -+ case mir_event_type_surface_output: ++ case mir_event_type_window_output: + break; + case mir_event_type_keymap: + xmir_handle_keymap_event(xmir_input, mir_event_get_keymap_event(ev)); + break; -+// case mir_event_type_input_device_state: -+// break; ++ case mir_event_type_input_device_state: ++ break; + default: + ErrorF("Received an unknown %u event\n", mir_event_get_type(ev)); + break; @@ -5501,7 +5552,7 @@ +} + +void -+xmir_surface_handle_event(MirSurface *surface, MirEvent const* ev, ++xmir_surface_handle_event(MirWindow *surface, MirEvent const* ev, + void *context) +{ + struct xmir_window *xmir_window = context; @@ -5533,9 +5584,15 @@ + xmir_input->xmir_screen = xmir_screen; + xorg_list_add(&xmir_input->link, &xmir_screen->input_list); + xmir_input->touch_id = -1; -+ xmir_input->pointer = add_device(xmir_input, "xmir-pointer", xmir_pointer_proc); -+ xmir_input->touch = add_device(xmir_input, "xmir-fake-touch-pointer", xmir_pointer_proc); -+ xmir_input->keyboard = add_device(xmir_input, "xmir-keyboard", xmir_keyboard_proc); ++ xmir_input->pointer = add_device(xmir_input, ++ "xmir-pointer", ++ xmir_pointer_proc); ++ xmir_input->touch = add_device(xmir_input, ++ "xmir-fake-touch-pointer", ++ xmir_pointer_proc); ++ xmir_input->keyboard = add_device(xmir_input, ++ "xmir-keyboard", ++ xmir_keyboard_proc); +} + +void @@ -5553,9 +5610,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir-output.c -@@ -0,0 +1,476 @@ +@@ -0,0 +1,501 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -5588,34 +5645,6 @@ +#include "glamor_priv.h" +#include "mipointer.h" + -+static const char* -+xmir_get_output_type_str(MirDisplayOutput *mir_output) -+{ -+ const char *str = "Invalid"; -+ -+ switch(mir_output->type) -+ { -+ case mir_display_output_type_vga: str = "VGA"; break; -+ case mir_display_output_type_dvii: str = "DVI"; break; -+ case mir_display_output_type_dvid: str = "DVI"; break; -+ case mir_display_output_type_dvia: str = "DVI"; break; -+ case mir_display_output_type_composite: str = "Composite"; break; -+ case mir_display_output_type_svideo: str = "TV"; break; -+ case mir_display_output_type_lvds: str = "LVDS"; break; -+ case mir_display_output_type_component: str = "CTV"; break; -+ case mir_display_output_type_ninepindin: str = "DIN"; break; -+ case mir_display_output_type_displayport: str = "DP"; break; -+ case mir_display_output_type_hdmia: str = "HDMI"; break; -+ case mir_display_output_type_hdmib: str = "HDMI"; break; -+ case mir_display_output_type_tv: str = "TV"; break; -+ case mir_display_output_type_edp: str = "eDP"; break; -+ case mir_display_output_type_unknown: str = "None"; break; -+ default: break; -+ } -+ -+ return str; -+} -+ +static Rotation +to_rr_rotation(MirOrientation orient) +{ @@ -5630,11 +5659,12 @@ +Bool +xmir_output_dpms(struct xmir_screen *xmir_screen, int mode) +{ -+ MirDisplayConfiguration *display_config = xmir_screen->display; ++ MirDisplayConfig *display_config = xmir_screen->display; + MirPowerMode mir_mode = mir_power_mode_on; + Bool unchanged = TRUE; ++ int num_outputs; + -+ if (xmir_screen->rootless) ++ if (xmir_screen->rootless || xmir_screen->windowed) + return FALSE; + + switch (mode) { @@ -5646,50 +5676,72 @@ + + DebugF("Setting DPMS mode to %d\n", mode); + -+ for (int i = 0; i < display_config->num_outputs; i++) { -+ if (display_config->outputs[i].power_mode != mir_mode) { -+ display_config->outputs[i].power_mode = mir_mode; ++ num_outputs = mir_display_config_get_num_outputs(display_config); ++ for (int i = 0; i < num_outputs; i++) { ++ MirOutput *output = mir_display_config_get_mutable_output(display_config, i); ++ MirPowerMode power_mode = mir_output_get_power_mode(output); ++ if (power_mode != mir_mode) { ++ mir_output_set_power_mode(output, mir_mode); + unchanged = FALSE; + } + } + + if (!unchanged) -+ mir_wait_for(mir_connection_apply_display_config(xmir_screen->conn, xmir_screen->display)); ++ mir_connection_apply_session_display_config(xmir_screen->conn, ++ xmir_screen->display); + + return TRUE; +} + +static void -+xmir_output_update(struct xmir_output *xmir_output, MirDisplayOutput *mir_output) ++xmir_output_update(struct xmir_output *xmir_output, MirOutput const *mir_output) +{ -+ RROutputSetConnection(xmir_output->randr_output, mir_output->connected ? RR_Connected : RR_Disconnected); ++ MirOutputConnectionState connection_state; ++ bool output_is_connected; ++ ++ connection_state = mir_output_get_connection_state(mir_output); ++ output_is_connected = !(connection_state == mir_output_connection_state_disconnected); ++ ++ RROutputSetConnection(xmir_output->randr_output, ++ output_is_connected ? RR_Connected : RR_Disconnected); + RROutputSetSubpixelOrder(xmir_output->randr_output, SubPixelUnknown); + -+ if (mir_output->connected && mir_output->used) { -+ MirDisplayMode *mode = &mir_output->modes[mir_output->current_mode]; ++ if (output_is_connected) { ++ MirOutputMode const *mode = mir_output_get_current_mode(mir_output); + RRModePtr randr_mode; ++ double refresh_rate; + -+ xmir_output->width = mode->horizontal_resolution; -+ xmir_output->height = mode->vertical_resolution; -+ xmir_output->x = mir_output->position_x; -+ xmir_output->y = mir_output->position_y; -+ -+ randr_mode = xmir_cvt(xmir_output->width, xmir_output->height, mode->refresh_rate, 0, 0); ++ xmir_output->width = mir_output_mode_get_width(mode); ++ xmir_output->height = mir_output_mode_get_height(mode); ++ xmir_output->x = mir_output_get_position_x(mir_output); ++ xmir_output->y = mir_output_get_position_y(mir_output); ++ ++ refresh_rate = mir_output_mode_get_refresh_rate(mode); ++ randr_mode = xmir_cvt(xmir_output->width, xmir_output->height, ++ refresh_rate, 0, 0); + /* Odd resolutions like 1366x768 don't show correctly otherwise */ -+ randr_mode->mode.width = mode->horizontal_resolution; -+ randr_mode->mode.height = mode->vertical_resolution; ++ randr_mode->mode.width = mir_output_mode_get_width(mode); ++ randr_mode->mode.height = mir_output_mode_get_height(mode); + sprintf(randr_mode->name, "%dx%d", -+ randr_mode->mode.width, randr_mode->mode.height); ++ randr_mode->mode.width, ++ randr_mode->mode.height); + -+ RROutputSetPhysicalSize(xmir_output->randr_output, mir_output->physical_width_mm, mir_output->physical_height_mm); ++ RROutputSetPhysicalSize(xmir_output->randr_output, ++ mir_output_get_physical_width_mm(mir_output), ++ mir_output_get_physical_height_mm(mir_output)); + RROutputSetModes(xmir_output->randr_output, &randr_mode, 1, 1); + + /* TODO: Hook up subpixel order when available (LP: #1393578) */ + RRCrtcNotify(xmir_output->randr_crtc, randr_mode, + xmir_output->x, xmir_output->y, -+ to_rr_rotation(mir_output->orientation), NULL, 1, &xmir_output->randr_output); -+ } else { -+ xmir_output->width = xmir_output->height = xmir_output->x = xmir_output->y = 0; ++ to_rr_rotation(mir_output_get_orientation(mir_output)), ++ NULL, 1, &xmir_output->randr_output); ++ } ++ else { ++ xmir_output->width = 0; ++ xmir_output->height = 0; ++ xmir_output->x = 0; ++ xmir_output->y = 0; + + RROutputSetPhysicalSize(xmir_output->randr_output, 0, 0); + RROutputSetModes(xmir_output->randr_output, NULL, 0, 0); @@ -5762,7 +5814,9 @@ + + xmir_output->xmir_screen = xmir_screen; + xmir_output->randr_crtc = RRCrtcCreate(xmir_screen->screen, xmir_output); -+ xmir_output->randr_output = RROutputCreate(xmir_screen->screen, name, strlen(name), xmir_output); ++ xmir_output->randr_output = RROutputCreate(xmir_screen->screen, ++ name, strlen(name), ++ xmir_output); + + RRCrtcGammaSetSize(xmir_output->randr_crtc, 256); + RROutputSetCrtcs(xmir_output->randr_output, &xmir_output->randr_crtc, 1); @@ -5795,30 +5849,37 @@ +static void +xmir_update_config(struct xmir_screen *xmir_screen) +{ -+ MirDisplayConfiguration *new_config; -+ MirDisplayOutput **mir_output; ++ MirDisplayConfig *new_config; + struct xmir_output *xmir_output; ++ int old_num_outputs, new_num_outputs; ++ MirOutput const *mir_output; ++ int i; + + if (xmir_screen->windowed) + return; + -+ new_config = mir_connection_create_display_config(xmir_screen->conn); -+ if (new_config->num_outputs != xmir_screen->display->num_outputs) ++ new_config = mir_connection_create_display_configuration(xmir_screen->conn); ++ new_num_outputs = mir_display_config_get_num_outputs(new_config); ++ old_num_outputs = mir_display_config_get_num_outputs(xmir_screen->display); ++ if (new_num_outputs != old_num_outputs) + FatalError("Number of outputs changed on update.\n"); + -+ mir_display_config_destroy(xmir_screen->display); ++ mir_display_config_release(xmir_screen->display); + xmir_screen->display = new_config; + -+ mir_output = &new_config->outputs; ++ i = 0; + xorg_list_for_each_entry(xmir_output, &xmir_screen->output_list, link) { -+ xmir_output_update(xmir_output, *mir_output); -+ mir_output++; ++ mir_output = mir_display_config_get_output(new_config, i); ++ xmir_output_update(xmir_output, mir_output); ++ ++i; + } ++ + xmir_output_screen_resized(xmir_screen); +} + +void -+xmir_output_handle_orientation(struct xmir_window *xmir_window, MirOrientation dir) ++xmir_output_handle_orientation(struct xmir_window *xmir_window, ++ MirOrientation dir) +{ + XMIR_DEBUG(("Orientation: %i\n", dir)); + @@ -5826,7 +5887,8 @@ +} + +void -+xmir_output_handle_resize(struct xmir_window *xmir_window, int width, int height) ++xmir_output_handle_resize(struct xmir_window *xmir_window, ++ int width, int height) +{ + WindowPtr window = xmir_window->window; + ScreenPtr screen = window->drawable.pScreen; @@ -5840,20 +5902,23 @@ + DeviceIntPtr pDev; + + MirOrientation old = xmir_window->orientation; -+ xmir_window->orientation = mir_surface_get_orientation(xmir_window->surface); ++ xmir_window->orientation = mir_window_get_orientation(xmir_window->surface); + + if (width < 0 && height < 0) { + if (old % 180 == xmir_window->orientation % 180) { + window_width = window->drawable.width; + window_height = window->drawable.height; -+ } else { ++ } ++ else { + window_width = window->drawable.height; + window_height = window->drawable.width; + } -+ } else if (xmir_window->orientation == 0 || xmir_window->orientation == 180) { ++ } ++ else if (xmir_window->orientation == 0 || xmir_window->orientation == 180) { + window_width = width * (1 + xmir_screen->doubled); + window_height = height * (1 + xmir_screen->doubled); -+ } else { ++ } ++ else { + window_width = height * (1 + xmir_screen->doubled); + window_height = width * (1 + xmir_screen->doubled); + } @@ -5888,7 +5953,11 @@ + XMIR_DEBUG(("Root resized, removing all outputs and inserting fake output\n")); + + while (!xorg_list_is_empty(&xmir_screen->output_list)) { -+ struct xmir_output *xmir_output = xorg_list_first_entry(&xmir_screen->output_list, typeof(*xmir_output), link); ++ struct xmir_output *xmir_output; ++ ++ xmir_output = xorg_list_first_entry(&xmir_screen->output_list, ++ typeof(*xmir_output), ++ link); + + RRCrtcDestroy(xmir_output->randr_crtc); + RROutputDestroy(xmir_output->randr_output); @@ -5896,12 +5965,16 @@ + } + + xmir_screen->windowed = xmir_output_create(xmir_screen, "Windowed"); ++ xmir_disable_screensaver(xmir_screen); + } + + XMIR_DEBUG(("Output resized %ix%i with rotation %i\n", + width, height, xmir_window->orientation)); + -+ pixmap = screen->CreatePixmap(screen, window_width, window_height, screen->rootDepth, CREATE_PIXMAP_USAGE_BACKING_PIXMAP); ++ pixmap = screen->CreatePixmap(screen, ++ window_width, window_height, ++ screen->rootDepth, ++ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); + + copy_box.x1 = copy_box.y1 = 0; + copy_box.x2 = min(window_width, oldroot->width); @@ -5915,7 +5988,8 @@ + glamor_copy(&screen->root->drawable, &pixmap->drawable, + NULL, ©_box, 1, 0, 0, FALSE, FALSE, 0, NULL); + glBindFramebuffer(GL_FRAMEBUFFER, 0); -+ } else { ++ } ++ else { + PixmapPtr old_pixmap = screen->GetWindowPixmap(window); + int src_stride = old_pixmap->devKind; + int dst_stride = pixmap->devKind; @@ -5994,25 +6068,33 @@ +{ + rrScrPrivPtr rp; + int i; -+ MirDisplayConfiguration *display_config = xmir_screen->display; ++ MirDisplayConfig *display_config = xmir_screen->display; ++ int num_outputs; + int output_type_count[mir_display_output_type_edp + 1] = {}; + + if (!RRScreenInit(xmir_screen->screen)) + return FALSE; + -+ mir_connection_set_display_config_change_callback(xmir_screen->conn, &xmir_display_config_callback, xmir_screen); ++ mir_connection_set_display_config_change_callback(xmir_screen->conn, ++ &xmir_display_config_callback, ++ xmir_screen); + -+ for (i = 0; i < display_config->num_outputs; i++) { ++ num_outputs = mir_display_config_get_num_outputs(display_config); ++ for (i = 0; i < num_outputs; i++) { + char name[32]; -+ MirDisplayOutput *mir_output = &display_config->outputs[i]; ++ int type_count; ++ MirOutput const *mir_output; ++ MirOutputType output_type; ++ const char* output_type_str; + struct xmir_output *xmir_output; -+ const char* output_type_str = xmir_get_output_type_str(mir_output); -+ int type_count = i; -+ -+ if (mir_output->type >= 0 && mir_output->type <= mir_display_output_type_edp) -+ type_count = output_type_count[mir_output->type]++; + ++ mir_output = mir_display_config_get_output(display_config, i); ++ output_type = mir_output_get_type(mir_output); ++ output_type_str = mir_output_type_name(output_type); ++ if (output_type_str) ++ type_count = output_type_count[output_type]++; + snprintf(name, sizeof name, "%s-%d", output_type_str, type_count); ++ + xmir_output = xmir_output_create(xmir_screen, name); + if (!xmir_output) + return FALSE; @@ -6032,9 +6114,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir-thread-proxy.c -@@ -0,0 +1,115 @@ +@@ -0,0 +1,110 @@ +/* -+ * Copyright © 2012-2015 Canonical Ltd ++ * Copyright © 2012-2017 Canonical Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- @@ -6085,39 +6167,34 @@ +static int pipefds[2]; + +static void -+xmir_wakeup_handler(void* data, int err, void* read_mask) ++xmir_socket_ready(int fd, int ready, void *data) +{ -+ if (err >= 0 && FD_ISSET(pipefds[0], (fd_set *)read_mask)) -+ xmir_process_from_eventloop(); ++ xmir_process_from_eventloop(); +} + +void +xmir_init_thread_to_eventloop(void) +{ -+ int err = pipe(pipefds); -+ if (err == -1) -+ FatalError("[XMIR] Failed to create thread-proxy pipes: %s\n", strerror(errno)); -+ -+ /* Set the read end to not block; we'll pull from this in the event loop -+ * We don't need to care about the write end, as that'll be written to -+ * from its own thread -+ */ -+ fcntl(pipefds[0], F_SETFL, O_NONBLOCK); -+ -+ AddGeneralSocket(pipefds[0]); -+ RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, -+ xmir_wakeup_handler, -+ NULL); ++ int err = pipe(pipefds); ++ if (err == -1) ++ FatalError("[XMIR] Failed to create thread-proxy pipes: %s\n", ++ strerror(errno)); ++ ++ /* Set the read end to not block; we'll pull from this in the event loop ++ * We don't need to care about the write end, as that'll be written to ++ * from its own thread ++ */ ++ fcntl(pipefds[0], F_SETFL, O_NONBLOCK); ++ ++ SetNotifyFd(pipefds[0], xmir_socket_ready, X_NOTIFY_READ, NULL); +} + +void +xmir_fini_thread_to_eventloop(void) +{ -+ RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, -+ xmir_wakeup_handler, NULL); -+ RemoveGeneralSocket(pipefds[0]); -+ close(pipefds[1]); -+ close(pipefds[0]); ++ RemoveNotifyFd(pipefds[0]); ++ close(pipefds[1]); ++ close(pipefds[0]); +} + +void @@ -6150,9 +6227,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir.c -@@ -0,0 +1,1729 @@ +@@ -0,0 +1,1818 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -6189,6 +6266,7 @@ +#include +#include + ++#include +#include + +#include "compint.h" @@ -6230,12 +6308,12 @@ + return *cache; +} + -+#define GET_ATOM(_a) get_atom(#_a, &known_atom._a, False) -+#define MAKE_ATOM(_a) get_atom(#_a, &known_atom._a, True) ++#define GET_ATOM(_a) get_atom(#_a, &known_atom._a, FALSE) ++#define MAKE_ATOM(_a) get_atom(#_a, &known_atom._a, TRUE) + +extern __GLXprovider __glXDRI2Provider; + -+Bool xmir_debug_logging = False; ++Bool xmir_debug_logging = FALSE; + +static const char get_title_from_top_window[] = "@"; + @@ -6260,6 +6338,21 @@ + return &rec; +} + ++/* Required by GLX module */ ++void ++xf86ProcessOptions(int scrnIndex, XF86OptionPtr options, OptionInfoPtr optinfo) ++{ ++} ++ ++/* Required by GLX module */ ++const char * ++xf86GetOptValString(const OptionInfoRec *table, int token) ++{ ++ /* This may bite us in the bum since it sends up hardcoding "mesa" as the GL ++ * vendor, but... */ ++ return NULL; ++} ++ +void +ddxGiveUp(enum ExitCode error) +{ @@ -6328,19 +6421,27 @@ + strcmp(argv[i], "-title") == 0 || + strcmp(argv[i], "-mir") == 0) { + return 2; -+ } else if (!strcmp(argv[i], "-novtswitch") || ++ } ++ else if (!strcmp(argv[i], "-novtswitch") || + !strncmp(argv[i], "vt", 2)) { + return 1; -+ } else if (!strcmp(argv[i], "-fd")) { ++ /* Bypass unity8 "security" */ ++ } ++ else if (!strncmp(argv[i], "--desktop_file_hint=", strlen("--desktop_file_hint="))) { ++ return 1; ++ } ++ else if (!strcmp(argv[i], "-fd")) { + if (!seen_shared) + NoListenAll = 1; + + return 2; -+ } else if (!strcmp(argv[i], "-shared")) { ++ } ++ else if (!strcmp(argv[i], "-shared")) { + seen_shared = 1; + NoListenAll = 0; + return 1; -+ } else if (!strcmp(argv[i], "-listen")) { ++ } ++ else if (!strcmp(argv[i], "-listen")) { + seen_shared = 1; + NoListenAll = 0; + return 0; @@ -6374,7 +6475,9 @@ +void +xmir_pixmap_set(PixmapPtr pixmap, struct xmir_pixmap *xmir_pixmap) +{ -+ return dixSetPrivate(&pixmap->devPrivates, &xmir_pixmap_private_key, xmir_pixmap); ++ return dixSetPrivate(&pixmap->devPrivates, ++ &xmir_pixmap_private_key, ++ xmir_pixmap); +} + +static Bool @@ -6392,8 +6495,9 @@ + size_t len = p->size >= bufsize ? bufsize - 1 : p->size; + memcpy(buf, p->data, len); + buf[len] = '\0'; -+ return True; -+ } else { ++ return TRUE; ++ } ++ else { + ErrorF("xmir_get_window_prop_string8: Atom %d is not " + "an 8-bit string as expected\n", atom); + break; @@ -6405,7 +6509,7 @@ + + if (bufsize) + buf[0] = '\0'; -+ return False; ++ return FALSE; +} + +static Bool @@ -6430,7 +6534,8 @@ + DixReadAccess) != Success) + ptr = NULL; + return ptr; -+ } else { ++ } ++ else { + ErrorF("xmir_get_window_prop_window: Atom %d is not " + "a Window as expected\n", atom); + return NULL; @@ -6451,7 +6556,8 @@ + if (p->propertyName == name) { + if (p->type == XA_ATOM) { + return *(Atom*)p->data; -+ } else { ++ } ++ else { + ErrorF("xmir_get_window_prop_atom: Atom %d is not " + "an Atom as expected\n", name); + return 0; @@ -6535,7 +6641,9 @@ +} + +static void -+xmir_sw_copy(struct xmir_screen *xmir_screen, struct xmir_window *xmir_win, RegionPtr dirty) ++xmir_sw_copy(struct xmir_screen *xmir_screen, ++ struct xmir_window *xmir_win, ++ RegionPtr dirty) +{ + PixmapPtr pix = xmir_screen->screen->GetWindowPixmap(xmir_win->window); + int x1 = dirty->extents.x1, y1 = dirty->extents.y1; @@ -6546,7 +6654,7 @@ + MirGraphicsRegion region; + + mir_buffer_stream_get_graphics_region( -+ mir_surface_get_buffer_stream(xmir_win->surface), ®ion); ++ mir_window_get_buffer_stream(xmir_win->surface), ®ion); + + /* + * Our window region (and hence damage region) might be a little ahead of @@ -6584,7 +6692,7 @@ +{ + MirBufferPackage *package; + MirGraphicsRegion reg; -+ MirBufferStream *stream = mir_surface_get_buffer_stream(xmir_win->surface); ++ MirBufferStream *stream = mir_window_get_buffer_stream(xmir_win->surface); + + switch (xmir_screen->glamor) { + case glamor_off: @@ -6612,7 +6720,7 @@ +static void +xmir_swap(struct xmir_screen *xmir_screen, struct xmir_window *xmir_win) +{ -+ MirBufferStream *stream = mir_surface_get_buffer_stream(xmir_win->surface); ++ MirBufferStream *stream = mir_window_get_buffer_stream(xmir_win->surface); + struct xmir_swap *swap = calloc(sizeof(struct xmir_swap), 1); + swap->server_generation = serverGeneration; + swap->xmir_screen = xmir_screen; @@ -6622,7 +6730,7 @@ + +void xmir_repaint(struct xmir_window *xmir_win) +{ -+ struct xmir_screen *xmir_screen = xmir_screen_get(xmir_win->window->drawable.pScreen); ++ struct xmir_screen *xmir_screen; + RegionPtr dirty = &xmir_win->region; + char wm_name[256]; + WindowPtr named = NULL; @@ -6630,12 +6738,15 @@ + if (!xmir_win->has_free_buffer) + ErrorF("ERROR: xmir_repaint requested without a buffer to paint to\n"); + ++ xmir_screen = xmir_screen_get(xmir_win->window->drawable.pScreen); + if (strcmp(xmir_screen->title, get_title_from_top_window)) { + /* Fixed title mode. Never change it. */ + named = NULL; -+ } else if (xmir_screen->rootless) { ++ } ++ else if (xmir_screen->rootless) { + named = xmir_win->window; -+ } else { /* Try and guess from the most relevant app window */ ++ } ++ else { /* Try and guess from the most relevant app window */ + WindowPtr top = xmir_screen->screen->root->firstChild; + WindowPtr top_named = NULL; + WindowPtr top_normal = NULL; @@ -6668,11 +6779,11 @@ + if (named && + xmir_get_window_name(named, wm_name, sizeof wm_name) && + strcmp(wm_name, xmir_win->wm_name)) { -+ MirSurfaceSpec *rename = -+ mir_connection_create_spec_for_changes(xmir_screen->conn); -+ mir_surface_spec_set_name(rename, wm_name); -+ mir_surface_apply_spec(xmir_win->surface, rename); -+ mir_surface_spec_release(rename); ++ MirWindowSpec *rename = ++ mir_create_window_spec(xmir_screen->conn); ++ mir_window_spec_set_name(rename, wm_name); ++ mir_window_apply_spec(xmir_win->surface, rename); ++ mir_window_spec_release(rename); + strncpy(xmir_win->wm_name, wm_name, sizeof(xmir_win->wm_name)); + } + @@ -6709,7 +6820,7 @@ + int buf_width, buf_height; + Bool xserver_lagging, xclient_lagging; + -+ if (!xmir_win->damage || !mir_surface_is_valid(xmir_win->surface)) { ++ if (!xmir_win->damage || !mir_window_is_valid(xmir_win->surface)) { + if (xmir_win->damage) + ErrorF("Buffer-available recieved for invalid surface?\n"); + return; @@ -6737,16 +6848,13 @@ + XID vlist[2] = {buf_width, buf_height}; + ConfigureWindow(xmir_win->window, CWWidth|CWHeight, vlist, + serverClient); -+ } else { ++ } ++ else { + /* Output resizing takes time, so start it going and let it + * finish next frame or so... + */ + xmir_output_handle_resize(xmir_win, buf_width, buf_height); + } -+ /* Admittedly the client won't have time to redraw itself in the -+ * new size before the below repaint, but the important bit is that -+ * the X server is using the correct buffer dimensions immediately. -+ */ + } + + if (xserver_lagging) @@ -6790,7 +6898,9 @@ + screen->CreateWindow = xmir_create_window; + + if (ret) -+ dixSetPrivate(&window->devPrivates, &xmir_window_private_key, xmir_window); ++ dixSetPrivate(&window->devPrivates, ++ &xmir_window_private_key, ++ xmir_window); + else + free(xmir_window); + @@ -6816,9 +6926,9 @@ + Atom wm_type = 0; + int mir_width = window->drawable.width / (1 + xmir_screen->doubled); + int mir_height = window->drawable.height / (1 + xmir_screen->doubled); -+ MirSurfaceSpec* spec = NULL; ++ MirWindowSpec* spec = NULL; + WindowPtr wm_transient_for = NULL, positioning_parent = NULL; -+ MirPersistentId *persistent_id = NULL; ++ MirWindowId *persistent_id = NULL; + XWMHints *wm_hints = NULL; + char wm_name[1024]; + @@ -6857,13 +6967,15 @@ + if (wm_hints) { + XMIR_DEBUG(("\tWM_HINTS={flags=0x%lx,input=%s}\n", + wm_hints->flags, wm_hints->input?"True":"False")); -+ } else { ++ } ++ else { + XMIR_DEBUG(("\tWM_HINTS=\n")); + } + + if (!window->viewable) { + return ret; -+ } else if (xmir_screen->rootless) { ++ } ++ else if (xmir_screen->rootless) { + if (!window->parent || window->parent == screen->root) { + compRedirectWindow(serverClient, window, + CompositeRedirectManual); @@ -6872,7 +6984,8 @@ + } + if (window->redirectDraw != RedirectDrawManual) + return ret; -+ } else if (window->parent) { ++ } ++ else if (window->parent) { + return ret; + } + @@ -6930,8 +7043,9 @@ + } + + if (xmir_screen->neverclosed) { -+ spec = mir_connection_create_spec_for_changes(xmir_screen->conn); -+ } else if (positioning_parent) { ++ spec = mir_create_window_spec(xmir_screen->conn); ++ } ++ else if (positioning_parent) { + struct xmir_window *rel = xmir_window_get(positioning_parent); + if (rel && rel->surface) { + short dx = window->drawable.x - rel->window->drawable.x; @@ -6939,20 +7053,29 @@ + MirRectangle placement = {dx, dy, 0, 0}; + + if (wm_type == GET_ATOM(_NET_WM_WINDOW_TYPE_TOOLTIP)) { ++ /* Why doesn't the API version match the Mir version?! */ ++#if MIR_CLIENT_VERSION >= MIR_VERSION_NUMBER(3,4,0) ++ spec = mir_create_tip_window_spec( ++ xmir_screen->conn, mir_width, mir_height, ++ rel->surface, &placement, mir_edge_attachment_any); ++#else + spec = mir_connection_create_spec_for_tooltip( + xmir_screen->conn, mir_width, mir_height, pixel_format, + rel->surface, &placement); -+ } else if (wm_type == GET_ATOM(_NET_WM_WINDOW_TYPE_DIALOG)) { -+ spec = mir_connection_create_spec_for_modal_dialog( -+ xmir_screen->conn, mir_width, mir_height, pixel_format, ++#endif ++ } ++ else if (wm_type == GET_ATOM(_NET_WM_WINDOW_TYPE_DIALOG)) { ++ spec = mir_create_modal_dialog_window_spec( ++ xmir_screen->conn, mir_width, mir_height, + rel->surface); -+ } else { /* Probably a menu. If not, still close enough... */ ++ } ++ else { /* Probably a menu. If not, still close enough... */ + MirEdgeAttachment edge = mir_edge_attachment_any; + if (wm_type == GET_ATOM(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)) + edge = mir_edge_attachment_vertical; -+ spec = mir_connection_create_spec_for_menu( ++ spec = mir_create_menu_window_spec( + xmir_screen->conn, -+ mir_width, mir_height, pixel_format, rel->surface, ++ mir_width, mir_height, rel->surface, + &placement, edge); + } + } @@ -6960,59 +7083,64 @@ + + if (!spec) { + if (wm_type == GET_ATOM(_NET_WM_WINDOW_TYPE_DIALOG)) { -+ spec = mir_connection_create_spec_for_dialog( -+ xmir_screen->conn, mir_width, mir_height, pixel_format); -+ } else { -+ spec = mir_connection_create_spec_for_normal_surface( -+ xmir_screen->conn, mir_width, mir_height, pixel_format); ++ spec = mir_create_dialog_window_spec( ++ xmir_screen->conn, mir_width, mir_height); ++ } ++ else { ++ spec = mir_create_normal_window_spec( ++ xmir_screen->conn, mir_width, mir_height); + } + } + + if (strcmp(xmir_screen->title, get_title_from_top_window)) -+ mir_surface_spec_set_name(spec, xmir_screen->title); ++ mir_window_spec_set_name(spec, xmir_screen->title); + else if (xmir_screen->rootless) -+ mir_surface_spec_set_name(spec, wm_name); ++ mir_window_spec_set_name(spec, wm_name); + + xmir_window->surface_width = mir_width; + xmir_window->surface_height = mir_height; + xmir_window->buf_width = mir_width; + xmir_window->buf_height = mir_height; + ++ mir_window_spec_set_pixel_format(spec, pixel_format); + if (xmir_screen->neverclosed) { -+ mir_surface_spec_set_width(spec, mir_width); -+ mir_surface_spec_set_height(spec, mir_height); -+ mir_surface_spec_set_pixel_format(spec, pixel_format); ++ mir_window_spec_set_width(spec, mir_width); ++ mir_window_spec_set_height(spec, mir_height); + + xmir_window->surface = xmir_screen->neverclosed; -+ mir_surface_apply_spec(xmir_window->surface, spec); -+ } else { -+ mir_surface_spec_set_buffer_usage(spec, ++ mir_window_apply_spec(xmir_window->surface, spec); ++ } ++ else { ++ mir_window_spec_set_buffer_usage(spec, + xmir_screen->glamor + ? mir_buffer_usage_hardware + : mir_buffer_usage_software); -+ xmir_window->surface = mir_surface_create_sync(spec); ++ xmir_window->surface = mir_create_window_sync(spec); + } -+ mir_surface_spec_release(spec); ++ mir_window_spec_release(spec); + + persistent_id = -+ mir_surface_request_persistent_id_sync(xmir_window->surface); -+ if (mir_persistent_id_is_valid(persistent_id)) { -+ const char *str = mir_persistent_id_as_string(persistent_id); ++ mir_window_request_window_id_sync(xmir_window->surface); ++ if (mir_window_id_is_valid(persistent_id)) { ++ const char *str = mir_window_id_as_string(persistent_id); + dixChangeWindowProperty(serverClient, window, + MAKE_ATOM(_MIR_WM_PERSISTENT_ID), + XA_STRING, 8, PropModeReplace, + strlen(str), (void*)str, FALSE); + } -+ mir_persistent_id_release(persistent_id); ++ mir_window_id_release(persistent_id); + + xmir_window->has_free_buffer = TRUE; -+ if (!mir_surface_is_valid(xmir_window->surface)) { -+ ErrorF("failed to create a surface: %s\n", mir_surface_get_error_message(xmir_window->surface)); ++ if (!mir_window_is_valid(xmir_window->surface)) { ++ ErrorF("failed to create a surface: %s\n", ++ mir_window_get_error_message(xmir_window->surface)); + return FALSE; + } + if (!xmir_screen->flatten_top) + xmir_screen->flatten_top = xmir_window; -+ mir_surface_set_event_handler(xmir_window->surface, xmir_surface_handle_event, xmir_window); ++ mir_window_set_event_handler(xmir_window->surface, ++ xmir_surface_handle_event, ++ xmir_window); + + xmir_window_enable_damage_tracking(xmir_window); + @@ -7023,13 +7151,13 @@ +} + +static const char * -+xmir_surface_type_str(MirSurfaceType type) ++xmir_surface_type_str(MirWindowType type) +{ + return "unk"; +} + +static const char * -+xmir_surface_state_str(MirSurfaceState state) ++xmir_surface_state_str(MirWindowState state) +{ + switch (state) { + case mir_surface_state_unknown: return "unknown"; @@ -7043,17 +7171,17 @@ +} + +static const char * -+xmir_surface_focus_str(MirSurfaceFocusState focus) ++xmir_surface_focus_str(MirWindowFocusState focus) +{ + switch (focus) { + case mir_surface_unfocused: return "unfocused"; -+ case mir_surface_focused: return "focused"; ++ case mir_window_focus_state_focused: return "focused"; + default: return "???"; + } +} + +static const char * -+xmir_surface_vis_str(MirSurfaceVisibility vis) ++xmir_surface_vis_str(MirWindowVisibility vis) +{ + switch (vis) { + case mir_surface_visibility_occluded: return "hidden"; @@ -7078,7 +7206,7 @@ + +static void +xmir_handle_focus_event(struct xmir_window *xmir_window, -+ MirSurfaceFocusState state) ++ MirWindowFocusState state) +{ + struct xmir_screen *xmir_screen = xmir_window->xmir_screen; + DeviceIntPtr keyboard = inputInfo.keyboard; /*PickKeyboard(serverClient);*/ @@ -7087,7 +7215,7 @@ + return; + + if (xmir_window->surface) { /* It's a real Mir window */ -+ xmir_screen->last_focus = (state == mir_surface_focused) ? ++ xmir_screen->last_focus = (state == mir_window_focus_state_focused) ? + xmir_window->window : NULL; + } + @@ -7097,33 +7225,37 @@ + Bool refuse_focus = window->overrideRedirect || + (hints && (hints->flags & InputHint) && !hints->input); + if (!refuse_focus) { -+ Window id = (state == mir_surface_focused) ? ++ Window id = (state == mir_window_focus_state_focused) ? + window->drawable.id : None; + SetInputFocus(serverClient, keyboard, id, RevertToParent, -+ CurrentTime, False); ++ CurrentTime, FALSE); + } -+ } else if (!strcmp(xmir_screen->title, get_title_from_top_window)) { ++ } ++ else if (!strcmp(xmir_screen->title, get_title_from_top_window)) { + /* + * So as to not break default behaviour, we only hack focus within + * the root window when in Unity8 invasive mode (-title @). + */ + Window id = None; -+ if (state == mir_surface_focused) { ++ if (state == mir_window_focus_state_focused) { + id = xmir_screen->saved_focus; + if (id == None) + id = PointerRoot; -+ } else { ++ } ++ else { + xmir_screen->saved_focus = xmir_get_current_input_focus(keyboard); + id = None; + } + SetInputFocus(serverClient, keyboard, id, RevertToNone, CurrentTime, -+ False); ++ FALSE); + } + /* else normal root window mode -- Xmir does not interfere in focus */ +} + +void -+xmir_handle_surface_event(struct xmir_window *xmir_window, MirSurfaceAttrib attr, int val) ++xmir_handle_surface_event(struct xmir_window *xmir_window, ++ MirWindowAttrib attr, ++ int val) +{ + switch (attr) { + case mir_surface_attrib_type: @@ -7137,7 +7269,7 @@ + break; + case mir_surface_attrib_focus: + XMIR_DEBUG(("Focus: %s\n", xmir_surface_focus_str(val))); -+ xmir_handle_focus_event(xmir_window, (MirSurfaceFocusState)val); ++ xmir_handle_focus_event(xmir_window, (MirWindowFocusState)val); + break; + case mir_surface_attrib_dpi: + XMIR_DEBUG(("DPI: %i\n", val)); @@ -7166,7 +7298,8 @@ + event.u.clientMessage.u.l.longs0 = GET_ATOM(WM_DELETE_WINDOW); + event.u.clientMessage.u.l.longs1 = CurrentTime; + DeliverEvents(window, &event, 1, NullWindow); -+ } else { ++ } ++ else { + ErrorF("Root window closed, shutting down Xmir\n"); + GiveUp(0); + /*DeleteWindow(window, 1); ? */ @@ -7179,7 +7312,8 @@ + struct xmir_input *xmir_input; + + xorg_list_for_each_entry(xmir_input, &xmir_screen->input_list, link) { -+ if (xmir_input->focus_window && xmir_input->focus_window->window == window) ++ if (xmir_input->focus_window && ++ xmir_input->focus_window->window == window) + xmir_input->focus_window = NULL; + } +} @@ -7200,14 +7334,16 @@ + ReparentWindow(benef->window, xmir_screen->screen->root, + 0, 0, serverClient); + compRedirectWindow(serverClient, benef->window, CompositeRedirectManual); -+ compRedirectSubwindows(serverClient, benef->window, CompositeRedirectAutomatic); ++ compRedirectSubwindows(serverClient, ++ benef->window, ++ CompositeRedirectAutomatic); + + xorg_list_for_each_entry(other, &xmir_screen->flattened_list, + link_flattened) { + ReparentWindow(other->window, benef->window, 0, 0, serverClient); + } + -+ mir_surface_set_event_handler(benef->surface, xmir_surface_handle_event, ++ mir_window_set_event_handler(benef->surface, xmir_surface_handle_event, + benef); + + xmir_window_enable_damage_tracking(benef); @@ -7217,9 +7353,9 @@ +} + +static void -+xmir_clear_to_black(MirSurface *surface) ++xmir_clear_to_black(MirWindow *surface) +{ /* Admittedly, this will only work for software surfaces */ -+ MirBufferStream *stream = mir_surface_get_buffer_stream(surface); ++ MirBufferStream *stream = mir_window_get_buffer_stream(surface); + MirGraphicsRegion region; + + /* On error mir_buffer_stream_get_graphics_region leaves us uninitialized */ @@ -7279,7 +7415,9 @@ +} + +static void -+xmir_unmap_surface(struct xmir_screen *xmir_screen, WindowPtr window, BOOL destroyed) ++xmir_unmap_surface(struct xmir_screen *xmir_screen, ++ WindowPtr window, ++ BOOL destroyed) +{ + struct xmir_window *xmir_window = + dixLookupPrivate(&window->devPrivates, &xmir_window_private_key); @@ -7304,7 +7442,7 @@ + if (!xmir_window->surface) + return; + -+ mir_surface_set_event_handler(xmir_window->surface, NULL, NULL); ++ mir_window_set_event_handler(xmir_window->surface, NULL, NULL); + + if (xmir_screen->flatten && xmir_screen->flatten_top == xmir_window) { + xmir_screen->flatten_top = NULL; @@ -7322,8 +7460,9 @@ + if (xmir_screen->neverclose) { + xmir_screen->neverclosed = xmir_window->surface; + xmir_clear_to_black(xmir_screen->neverclosed); -+ } else { -+ mir_surface_release_sync(xmir_window->surface); ++ } ++ else { ++ mir_window_release_sync(xmir_window->surface); + } + + xmir_window->surface = NULL; @@ -7392,12 +7531,12 @@ + + if (xmir_window->surface) { + /* This is correct in theory but most Mir shells don't do it yet */ -+ MirSurfaceSpec *changes = -+ mir_connection_create_spec_for_changes(xmir_screen->conn); -+ mir_surface_spec_set_width(changes, w); -+ mir_surface_spec_set_height(changes, h); -+ mir_surface_apply_spec(xmir_window->surface, changes); -+ mir_surface_spec_release(changes); ++ MirWindowSpec *changes = ++ mir_create_window_spec(xmir_screen->conn); ++ mir_window_spec_set_width(changes, w); ++ mir_window_spec_set_height(changes, h); ++ mir_window_apply_spec(xmir_window->surface, changes); ++ mir_window_spec_release(changes); + + XMIR_DEBUG(("X window %p resized to %ux%u %+d%+d with sibling %p\n", + window, w, h, x, y, sib)); @@ -7427,7 +7566,7 @@ + + if (xmir_screen->glamor) + xmir_glamor_fini(xmir_screen); -+ mir_display_config_destroy(xmir_screen->display); ++ mir_display_config_release(xmir_screen->display); + mir_connection_release(xmir_screen->conn); + + xmir_fini_thread_to_eventloop(); @@ -7457,7 +7596,7 @@ +DPMSSupported(void) +{ + struct xmir_screen *xmir_screen = xmir_screen_get(screenInfo.screens[0]); -+ return !xmir_screen->rootless; ++ return !xmir_screen->rootless && !xmir_screen->windowed; +} + +int @@ -7471,7 +7610,8 @@ + if (level != DPMSModeOn) { + if (xmir_is_unblank(screenIsSaved)) + rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive); -+ } else { ++ } ++ else { + if (!xmir_is_unblank(screenIsSaved)) + rc = dixSaveScreens(client, SCREEN_SAVER_OFF, ScreenSaverReset); + } @@ -7496,7 +7636,7 @@ +} + +static void -+xmir_block_handler(ScreenPtr screen, void *ptv, void *read_mask) ++xmir_block_handler(ScreenPtr screen, void *ptv) +{ + struct xmir_screen *xmir_screen = xmir_screen_get(screen); + struct xmir_window *xmir_window, *next; @@ -7525,7 +7665,11 @@ + return ret; + + if (!xmir_screen->rootless) -+ screen->devPrivate = screen->CreatePixmap(screen, screen->width, screen->height, screen->rootDepth, CREATE_PIXMAP_USAGE_BACKING_PIXMAP); ++ screen->devPrivate = screen->CreatePixmap(screen, ++ screen->width, ++ screen->height, ++ screen->rootDepth, ++ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); + else + screen->devPrivate = fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0); + @@ -7585,6 +7729,12 @@ + screen->DestroyPixmap(old_front); +} + ++void ++xmir_disable_screensaver(struct xmir_screen *xmir_screen) ++{ ++ ScreenSaverTime = 0; ++} ++ +static Bool +xmir_screen_init(ScreenPtr pScreen, int argc, char **argv) +{ @@ -7619,30 +7769,43 @@ + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-rootless") == 0) { + xmir_screen->rootless = 1; -+ } else if (strcmp(argv[i], "-flatten") == 0) { -+ xmir_screen->flatten = True; -+ } else if (strcmp(argv[i], "-neverclose") == 0) { -+ xmir_screen->neverclose = True; -+ } else if (strcmp(argv[i], "-title") == 0) { ++ xmir_disable_screensaver(xmir_screen); ++ } ++ else if (strcmp(argv[i], "-flatten") == 0) { ++ xmir_screen->flatten = TRUE; ++ } ++ else if (strcmp(argv[i], "-neverclose") == 0) { ++ xmir_screen->neverclose = TRUE; ++ } ++ else if (strcmp(argv[i], "-title") == 0) { + xmir_screen->title = argv[++i]; -+ } else if (strcmp(argv[i], "-mir") == 0) { ++ } ++ else if (strcmp(argv[i], "-mir") == 0) { + appid = argv[++i]; -+ } else if (strcmp(argv[i], "-mirSocket") == 0) { ++ } ++ else if (strcmp(argv[i], "-mirSocket") == 0) { + socket = argv[++i]; -+ } else if (strcmp(argv[i], "-sw") == 0) { ++ } ++ else if (strcmp(argv[i], "-sw") == 0) { + xmir_screen->glamor = glamor_off; -+ } else if (strcmp(argv[i], "-egl") == 0) { ++ } ++ else if (strcmp(argv[i], "-egl") == 0) { + if (xmir_screen->glamor != glamor_egl_sync) + xmir_screen->glamor = glamor_egl; -+ } else if (strcmp(argv[i], "-2x") == 0) { ++ } ++ else if (strcmp(argv[i], "-2x") == 0) { + xmir_screen->doubled = 1; -+ } else if (strcmp(argv[i], "-debug") == 0) { -+ xmir_debug_logging = True; -+ } else if (strcmp(argv[i], "-damage") == 0) { ++ } ++ else if (strcmp(argv[i], "-debug") == 0) { ++ xmir_debug_logging = TRUE; ++ } ++ else if (strcmp(argv[i], "-damage") == 0) { + /* Ignored. Damage-all is now the default and only option. */ -+ } else if (strcmp(argv[i], "-egl_sync") == 0) { ++ } ++ else if (strcmp(argv[i], "-egl_sync") == 0) { + xmir_screen->glamor = glamor_egl_sync; -+ } else if (strcmp(argv[i], "-fd") == 0) { ++ } ++ else if (strcmp(argv[i], "-fd") == 0) { + client_fd = (int)strtol(argv[++i], (char **)NULL, 0); + } + } @@ -7660,7 +7823,7 @@ + xmir_screen->title = xmir_screen->rootless ? get_title_from_top_window + : "Xmir root window"; + -+#ifdef __arm__ ++#if defined(__arm__) || defined(__aarch64__) + if (xmir_screen->glamor == glamor_dri) { + XMIR_DEBUG(("ARM architecture: Defaulting to software mode because " + "glamor is not stable\n")); @@ -7683,7 +7846,10 @@ + return FALSE; + } + xmir_screen->conn = conn; ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + mir_connection_get_platform(xmir_screen->conn, &xmir_screen->platform); ++#pragma GCC diagnostic pop + + xorg_list_init(&xmir_screen->output_list); + xorg_list_init(&xmir_screen->input_list); @@ -7718,7 +7884,7 @@ + } + } + -+ xmir_screen->display = mir_connection_create_display_config(conn); ++ xmir_screen->display = mir_connection_create_display_configuration(conn); + if (xmir_screen->display == NULL) { + FatalError("could not create display config\n"); + return FALSE; @@ -7882,9 +8048,9 @@ +} --- /dev/null +++ b/hw/xmir/xmir.h -@@ -0,0 +1,232 @@ +@@ -0,0 +1,234 @@ +/* -+ * Copyright © 2015 Canonical Ltd ++ * Copyright © 2015-2017 Canonical Ltd + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without @@ -7955,7 +8121,7 @@ + struct xorg_list damage_window_list; + + MirConnection *conn; -+ MirDisplayConfiguration *display; ++ MirDisplayConfig *display; + MirPlatformPackage platform; + + /* Bookkeeping for eglSwapBuffers */ @@ -7979,7 +8145,7 @@ + Bool destroying_root; + Bool closing; + const char *title; -+ MirSurface *neverclosed; ++ MirWindow *neverclosed; + struct xorg_list flattened_list; + struct xmir_window *flatten_top; + WindowPtr last_focus; @@ -8001,7 +8167,7 @@ + +struct xmir_window { + struct xmir_screen *xmir_screen; -+ MirSurface *surface; ++ MirWindow *surface; + WindowPtr window; + DamagePtr damage; + RegionRec region; @@ -8057,7 +8223,7 @@ +struct xmir_pixmap *xmir_pixmap_get(PixmapPtr pixmap); +void xmir_pixmap_set(PixmapPtr pixmap, struct xmir_pixmap *xmir_pixmap); + -+void xmir_handle_surface_event(struct xmir_window *, MirSurfaceAttrib, int); ++void xmir_handle_surface_event(struct xmir_window *, MirWindowAttrib, int); +void xmir_handle_buffer_available(struct xmir_screen *xmir_screen, + struct xmir_window *xmir_win, + void *unused); @@ -8065,6 +8231,8 @@ + +void xmir_repaint(struct xmir_window *); + ++void xmir_disable_screensaver(struct xmir_screen *xmir_screen); ++ +/* xmir-input.c */ +Bool xmir_screen_init_cursor(struct xmir_screen *xmir_screen); + @@ -8107,7 +8275,7 @@ +void xmir_process_from_eventloop_except(const struct xmir_window*); + +/* xmir-input.c */ -+void xmir_surface_handle_event(MirSurface *surface, MirEvent const* ev, void *context); ++void xmir_surface_handle_event(MirWindow *surface, MirEvent const* ev, void *context); + +#define XMIR_CREATE_PIXMAP_USAGE_FLIP 0x10000000 + diff -Nru xorg-server-hwe-16.04-1.18.4/debian/rules xorg-server-hwe-16.04-1.19.3/debian/rules --- xorg-server-hwe-16.04-1.18.4/debian/rules 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/rules 2017-07-26 20:48:23.000000000 +0000 @@ -1,48 +1,4 @@ #!/usr/bin/make -f -# debian/rules for the Debian xorg-server package. -# Copyright © 2004 Scott James Remnant -# Copyright © 2005 Daniel Stone -# Copyright © 2005 David Nusinow - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# Set up the $(STAMP_DIR) directory, and use it for quilt' stamp: -STAMP_DIR := stampdir -QUILT_STAMPFN := $(STAMP_DIR)/patch -$(STAMP_DIR)/stampdir: - mkdir $(STAMP_DIR) - >$@ - -include /usr/share/quilt/quilt.make - -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif - -DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build=$(DEB_HOST_GNU_TYPE) -else - confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -endif - -# udeb is arch-dependent... -ifeq (1, 0) - udeb = yes -endif - -# ...but let's support disabling it to speed up debug builds: -ifneq (,$(filter noudeb,$(DEB_BUILD_OPTIONS))) - udeb = - DH_INSTALL_OPTIONS = -Nxserver-xorg-core-udeb-hwe-16.04 -endif - ifeq ($(DEB_HOST_ARCH_OS), linux) selinux = --enable-xselinux @@ -64,6 +20,7 @@ ifeq ($(DEB_HOST_ARCH_OS), hurd) dri = --disable-dri --disable-dri2 + dri += --disable-glamor xshmfence = --disable-xshmfence else dri = --enable-dri --enable-dri2 @@ -111,17 +68,12 @@ config_tests = --enable-unit-tests endif -INSTALL=/usr/bin/install - VENDOR = $(shell lsb_release -i -s) SUPPORT = For technical support please see http://www.ubuntu.com/support SOURCE_NAME := xorg-server SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}') -# Add a workaround for LP: #1266492 -confflags += lt_cv_prog_compiler_static_works=no - # disable-static is so we don't get libfoo.a for modules. now if only we could # kill the .las. confflags += \ @@ -158,7 +110,6 @@ confflags_main = \ --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \ - --enable-aiglx \ --enable-composite \ --enable-record \ --enable-xv \ @@ -188,12 +139,10 @@ $(build_xmir) \ --with-sha1=libgcrypt \ --enable-xcsecurity \ - $(config_backend_main) \ $(void) confflags_udeb = \ --with-default-font-path="built-ins" \ - --disable-aiglx \ --disable-composite \ --disable-record \ --disable-xv \ @@ -205,6 +154,7 @@ --disable-glx \ --disable-dri \ --disable-dri2 \ + --disable-glamor \ $(libdrm_udeb) \ --disable-xinerama \ --disable-xf86vidmode \ @@ -222,88 +172,50 @@ --disable-xephyr \ --disable-xmir \ --with-sha1=libnettle \ - $(config_backend_udeb) \ $(void) -$(QUILT_STAMPFN): $(STAMP_DIR)/stampdir - -$(STAMP_DIR)/autoreconf: $(STAMP_DIR)/stampdir $(QUILT_STAMPFN) - dh_testdir - autoreconf -vfi - >$@ +%: + dh $@ --with quilt,autoreconf --parallel -$(STAMP_DIR)/build-source: $(STAMP_DIR)/autoreconf +build-source-stamp: mkdir -p build-source tar \ --owner=0 --group=0 \ --transform 's,^,xorg-server/,' \ - --exclude=stampdir --exclude=debian \ - --exclude=build-* --exclude=autom4te.cache \ + --exclude=debian \ + --exclude=autom4te.cache \ -cf - * | xz > build-source/xorg-server.tar.xz >$@ -$(STAMP_DIR)/configure-%: $(STAMP_DIR)/autoreconf - dh_testdir - mkdir -p build-$* - cd build-$* && \ - ../configure \ - --prefix=/usr \ - --libdir=\$${exec_prefix}/lib \ - --mandir=\$${prefix}/share/man \ - --infodir=\$${prefix}/share/info \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --libexecdir=\$${libdir}/xorg \ - $(confflags) \ - $(confflags_$*) \ - $(vars) - >$@ +override_dh_auto_configure: + dh_auto_configure --builddirectory=debian/build/main -- \ + --libdir=\$${prefix}/lib \ + --libexecdir=\$${libdir}/xorg \ + $(confflags) \ + $(confflags_main) \ + $(vars) + dh_auto_configure --builddirectory=debian/build/udeb -- \ + --libdir=\$${prefix}/lib \ + --libexecdir=\$${libdir}/xorg \ + $(confflags) \ + $(confflags_udeb) \ + $(vars) + +override_dh_auto_build: + dh_auto_build --builddirectory=debian/build/main + dh_auto_build --builddirectory=debian/build/udeb -$(STAMP_DIR)/build-%: $(STAMP_DIR)/configure-% - dh_testdir - cd build-$* && $(MAKE) - >$@ - -$(STAMP_DIR)/tests-%: $(STAMP_DIR)/build-% - cd build-$* && $(MAKE) -j1 check VERBOSE=1 - >$@ +override_dh_auto_test: + dh_auto_test -- -j1 VERBOSE=1 build: abibumpcheck -build: $(STAMP_DIR)/build-main -build: $(STAMP_DIR)/tests-main -ifeq ($(udeb), yes) -build: $(STAMP_DIR)/build-udeb -build: $(STAMP_DIR)/tests-udeb -endif -build-arch: build -build-indep: $(STAMP_DIR)/build-source build +build-indep: build-source-stamp -clean: unpatch - dh_testdir - rm -rf $(STAMP_DIR) - rm -f config.cache config.log config.status - rm -f */config.cache */config.log */config.status - rm -f conftest* */conftest* - rm -rf autom4te.cache */autom4te.cache - rm -rf build-* - rm -f compile config.guess config.sub configure depcomp install-sh - rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap - rm -f include/do-not-use-config.h.in - rm -f m4/lt*.m4 m4/libtool.m4 - find -name Makefile.in -delete - rm -f test-driver - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - cd build-main && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp/main install -ifeq ($(udeb), yes) - cd build-udeb && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp/udeb install -endif +override_dh_auto_install: + dh_auto_install --builddirectory=debian/build/main \ + --destdir=debian/tmp/main + dh_auto_install --builddirectory=debian/build/udeb \ + --destdir=debian/tmp/udeb # oh, yuck. find debian/tmp/*/usr/lib/xorg -type f -name '*.la' | \ @@ -316,43 +228,30 @@ rm -f debian/tmp/udeb/usr/lib/xorg/modules/libwfb.so rm -f debian/tmp/udeb/usr/lib/xorg/modules/libxf8_16bpp.so - # we don't ship these from the udeb build, reduce noise from dh_install - # --list-missing + # we don't ship these from the udeb build, needed for dh_install + # --fail-missing + rm -rf debian/tmp/udeb/var/lib/xkb/README.compiled + rm -rf debian/tmp/udeb/usr/bin/X rm -rf debian/tmp/udeb/usr/include rm -rf debian/tmp/udeb/usr/share/aclocal rm -rf debian/tmp/udeb/usr/share/man rm -rf debian/tmp/udeb/usr/lib/pkgconfig + # not needed on hwe + rm -rf debian/tmp/udeb + rm -f debian/tmp/main/usr/lib/xorg/protocol.txt + rm -f debian/tmp/main/usr/share/man/man1/Xserver.1 + rm -f debian/tmp/main/var/lib/xkb/README.compiled ifneq ($(DEB_HOST_ARCH_OS), linux) install -d debian/tmp/main/usr/share/X11/xorg.conf.d install -m 644 debian/local/10-*.conf debian/tmp/main/usr/share/X11/xorg.conf.d -ifeq ($(udeb), yes) install -d debian/tmp/udeb/usr/share/X11/xorg.conf.d install -m 644 debian/local/10-*.conf debian/tmp/udeb/usr/share/X11/xorg.conf.d endif -endif - -# stub to start building deb files, used by binary-indep and binary-arch -binary-initial: - dh_testdir - dh_testroot - -# stub to build deb files, used by binary-indep and binary-arch -binary-deb: - dh_lintian - dh_compress - dh_fixperms - -chown root:root $(CURDIR)/debian/xserver-xorg-legacy-hwe-16.04/usr/lib/xorg/Xorg.wrap - -chmod ug+s $(CURDIR)/debian/xserver-xorg-legacy-hwe-16.04/usr/lib/xorg/Xorg.wrap - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb # Only read the first line, the rest of the file is used to determine -# when the minimal version as to be bumped: +# when the minimal version is to be bumped: SERVERMINVER = debian/serverminver serverminver = $(shell head -1 $(SERVERMINVER)) @@ -374,14 +273,14 @@ rm -f $(SERVERMINVER).new; \ fi -# Build architecture-dependent files here. -binary-arch: build install - $(MAKE) -f debian/rules DH_OPTIONS=-s binary-initial - - dh_installdocs -s - dh_installchangelogs -s - dh_install $(DH_INSTALL_OPTIONS) -s --list-missing - $(INSTALL) -d $(CURDIR)/debian/xserver-xorg-dev-hwe-16.04/usr/share/xserver-xorg +override_dh_fixperms-arch: + dh_fixperms + chown root:root $(CURDIR)/debian/xserver-xorg-legacy-hwe-16.04/usr/lib/xorg/Xorg.wrap + chmod ug+s $(CURDIR)/debian/xserver-xorg-legacy-hwe-16.04/usr/lib/xorg/Xorg.wrap + +override_dh_install: + dh_install --fail-missing + install -d $(CURDIR)/debian/xserver-xorg-dev-hwe-16.04/usr/share/xserver-xorg # Extract only the major ABI version: abi_videodrv=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_videodrv xorg-server|cut -d . -f 1`; \ echo videoabi=xorg-video-abi-$$abi_videodrv > debian/xserver-xorg-core-hwe-16.04.substvars && \ @@ -407,32 +306,15 @@ echo 'xserver_confflags = $(confflags) $(confflags_main)' \ > debian/xserver-xorg-dev-hwe-16.04/usr/share/xserver-xorg/configure_flags.mk - $(INSTALL) -m 755 -d debian/xserver-xorg-core-hwe-16.04/usr/share/bug/xserver-xorg-core-hwe-16.04 - $(INSTALL) -m 755 debian/xserver-xorg-core-hwe-16.04.bug.script debian/xserver-xorg-core-hwe-16.04/usr/share/bug/xserver-xorg-core-hwe-16.04/script + install -m 755 -d debian/xserver-xorg-core-hwe-16.04/usr/share/bug/xserver-xorg-core-hwe-16.04 + install -m 755 debian/xserver-xorg-core-hwe-16.04.bug.script debian/xserver-xorg-core-hwe-16.04/usr/share/bug/xserver-xorg-core-hwe-16.04/script ifeq ($(DEB_HOST_ARCH_OS), linux) install -d debian/xserver-xorg-core-hwe-16.04/lib/udev/rules.d install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-hwe-16.04/lib/udev/rules.d -ifeq ($(udeb), yes) install -d debian/xserver-xorg-core-udeb-hwe-16.04/lib/udev/rules.d install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-udeb-hwe-16.04/lib/udev/rules.d endif -endif - dh_installdebconf -s - dh_installman -s - dh_link -s - dh_strip -pxserver-xorg-core-hwe-16.04 --dbg-package=xserver-xorg-core-hwe-16.04-dbg - dh_strip -s -Nxserver-xorg-core-hwe-16.04 -Nxserver-xorg-core-hwe-16.04-dbg - $(MAKE) -f debian/rules DH_OPTIONS=-s binary-deb - -# Build architecture-independent files here -binary-indep: build-indep install - $(MAKE) -f debian/rules DH_OPTIONS=-i binary-initial - dh_install -i - dh_installdocs -i - dh_installchangelogs -i ChangeLog - - $(MAKE) -f debian/rules DH_OPTIONS=-i binary-deb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +override_dh_strip: + dh_strip -pxserver-xorg-core-hwe-16.04 --dbgsym-migration="xserver-xorg-core-hwe-16.04-dbg (<< 2:1.19.0-3~)" + dh_strip -s -Nxserver-xorg-core-hwe-16.04 -Nxserver-xorg-core-hwe-16.04-dbg diff -Nru xorg-server-hwe-16.04-1.18.4/debian/serverminver xorg-server-hwe-16.04-1.19.3/debian/serverminver --- xorg-server-hwe-16.04-1.18.4/debian/serverminver 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/serverminver 2017-07-26 20:48:23.000000000 +0000 @@ -1,3 +1,3 @@ -2:1.17.99.902 -ABI_VIDEODRV_VERSION:20.0 -ABI_XINPUT_VERSION:22.1 +2:1.18.99.901 +ABI_VIDEODRV_VERSION:23.0 +ABI_XINPUT_VERSION:24.1 diff -Nru xorg-server-hwe-16.04-1.18.4/debian/watch xorg-server-hwe-16.04-1.19.3/debian/watch --- xorg-server-hwe-16.04-1.18.4/debian/watch 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/watch 2017-07-26 20:48:23.000000000 +0000 @@ -1,4 +1,4 @@ #git=git://anongit.freedesktop.org/xorg/xserver version=3 opts="pgpsigurlmangle=s/$/.sig/" \ -http://xorg.freedesktop.org/releases/individual/xserver/ xorg-server-(.*)\.tar\.gz +https://xorg.freedesktop.org/releases/individual/xserver/ xorg-server-(.*)\.tar\.gz diff -Nru xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-core.bug.script xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-core.bug.script --- xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-core.bug.script 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-core.bug.script 2017-07-26 20:48:23.000000000 +0000 @@ -111,11 +111,11 @@ echo -XORG_LOGS=$(ls -dt /var/log/Xorg.*.log 2>/dev/null) +XORG_LOGS=$(ls -dt /var/log/Xorg.*.log $HOME/.local/share/xorg/Xorg.*.log 2>/dev/null) if [ -n "$XORG_LOGS" ]; then pecho "Xorg X server log files on system:" - ls -dlrt /var/log/Xorg.*.log 2>/dev/null + ls -dlrt /var/log/Xorg.*.log $HOME/.local/share/xorg/Xorg.*.log 2>/dev/null echo for LOG in $XORG_LOGS; do if [ -f "$LOG" ]; then @@ -131,9 +131,9 @@ echo -if [ -x /sbin/udevadm ]; then +if [ -x /bin/udevadm ]; then pecho "udev information:" - /sbin/udevadm info --export-db | awk -F '\n' -v RS='\n\n' '/E: ID_INPUT/ { print; print "" }' + /bin/udevadm info --export-db | awk -F '\n' -v RS='\n\n' '/E: ID_INPUT/ { print; print "" }' echo fi diff -Nru xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.config xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.config --- xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.config 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.config 2017-07-26 20:48:23.000000000 +0000 @@ -2,7 +2,7 @@ # Debian x11-common package configuration script # Copyright 2000--2003 Branden Robinson. # Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or . +# /usr/share/common-licenses/GPL or . set -e diff -Nru xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.postinst xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.postinst --- xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.postinst 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.postinst 2017-07-26 20:48:23.000000000 +0000 @@ -2,7 +2,7 @@ # Debian xserver-xorg-legacy package post-installation script # Copyright 1998--2001, 2003 Branden Robinson. # Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or . +# /usr/share/common-licenses/GPL or . # Acknowlegements to Stephen Early, Mark Eichin, and Manoj Srivastava. set -e diff -Nru xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.postrm xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.postrm --- xorg-server-hwe-16.04-1.18.4/debian/xserver-xorg-legacy.postrm 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/debian/xserver-xorg-legacy.postrm 2017-07-26 20:48:23.000000000 +0000 @@ -2,7 +2,7 @@ # Debian xserver-xorg-legacy package post-removal script # Copyright 1998--2001, 2003 Branden Robinson. # Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or . +# /usr/share/common-licenses/GPL or . # Acknowlegements to Stephen Early, Mark Eichin, and Manoj Srivastava. diff -Nru xorg-server-hwe-16.04-1.18.4/dix/devices.c xorg-server-hwe-16.04-1.19.3/dix/devices.c --- xorg-server-hwe-16.04-1.18.4/dix/devices.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/devices.c 2017-03-15 18:05:25.000000000 +0000 @@ -281,6 +281,7 @@ dev->startup = autoStart; /* device grab defaults */ + UpdateCurrentTimeIf(); dev->deviceGrab.grabTime = currentTime; dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; @@ -336,12 +337,13 @@ SendDevicePresenceEvent(int deviceid, int type) { DeviceIntRec dummyDev = { .id = XIAllDevices }; - devicePresenceNotify ev = { - .type = DevicePresenceNotify, - .time = currentTime.milliseconds, - .devchange = type, - .deviceid = deviceid - }; + devicePresenceNotify ev; + + UpdateCurrentTimeIf(); + ev.type = DevicePresenceNotify; + ev.time = currentTime.milliseconds; + ev.devchange = type; + ev.deviceid = deviceid; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -397,9 +399,11 @@ } } + input_lock(); if ((*prev != dev) || !dev->inited || ((ret = (*dev->deviceProc) (dev, DEVICE_ON)) != Success)) { ErrorF("[dix] couldn't enable device %d\n", dev->id); + input_unlock(); return FALSE; } dev->enabled = TRUE; @@ -408,6 +412,7 @@ for (prev = &inputInfo.devices; *prev; prev = &(*prev)->next); *prev = dev; dev->next = NULL; + input_unlock(); enabled = TRUE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), @@ -486,19 +491,19 @@ if (dev->spriteInfo->paired) dev->spriteInfo->paired = NULL; + input_lock(); (void) (*dev->deviceProc) (dev, DEVICE_OFF); dev->enabled = FALSE; - FreeSprite(dev); - - /* now that the device is disabled, we can reset the signal handler's + /* now that the device is disabled, we can reset the event reader's * last.slave */ - OsBlockSignals(); for (other = inputInfo.devices; other; other = other->next) { if (other->last.slave == dev) other->last.slave = NULL; } - OsReleaseSignals(); + input_unlock(); + + FreeSprite(dev); LeaveWindow(dev); SetFocusOut(dev); @@ -567,7 +572,9 @@ if (!dev || !dev->deviceProc) return BadImplementation; + input_lock(); ret = (*dev->deviceProc) (dev, DEVICE_INIT); + input_unlock(); dev->inited = (ret == Success); if (!dev->inited) return ret; @@ -702,17 +709,32 @@ void InitCoreDevices(void) { - if (AllocDevicePair(serverClient, "Virtual core", - &inputInfo.pointer, &inputInfo.keyboard, - CorePointerProc, CoreKeyboardProc, TRUE) != Success) - FatalError("Failed to allocate core devices"); - - if (ActivateDevice(inputInfo.pointer, TRUE) != Success || - ActivateDevice(inputInfo.keyboard, TRUE) != Success) - FatalError("Failed to activate core devices."); - if (!EnableDevice(inputInfo.pointer, TRUE) || - !EnableDevice(inputInfo.keyboard, TRUE)) - FatalError("Failed to enable core devices."); + int result; + + result = AllocDevicePair(serverClient, "Virtual core", + &inputInfo.pointer, &inputInfo.keyboard, + CorePointerProc, CoreKeyboardProc, TRUE); + if (result != Success) { + FatalError("Failed to allocate virtual core devices: %d", result); + } + + result = ActivateDevice(inputInfo.pointer, TRUE); + if (result != Success) { + FatalError("Failed to activate virtual core pointer: %d", result); + } + + result = ActivateDevice(inputInfo.keyboard, TRUE); + if (result != Success) { + FatalError("Failed to activate virtual core keyboard: %d", result); + } + + if (!EnableDevice(inputInfo.pointer, TRUE)) { + FatalError("Failed to enable virtual core pointer."); + } + + if (!EnableDevice(inputInfo.keyboard, TRUE)) { + FatalError("Failed to enable virtual core keyboard."); + } InitXTestDevices(); } @@ -933,6 +955,8 @@ * enable it again and free associated structs. If you want the device to just * be disabled, DisableDevice(). * Don't call this function directly, use RemoveDevice() instead. + * + * Called with input lock held. */ static void CloseDevice(DeviceIntPtr dev) @@ -1031,7 +1055,7 @@ { DeviceIntPtr dev; - OsBlockSignals(); + input_lock(); /* Float all SDs before closing them. Note that at this point resources * (e.g. cursors) have been freed already, so we can't just call @@ -1058,7 +1082,7 @@ XkbDeleteRulesDflts(); XkbDeleteRulesUsed(); - OsReleaseSignals(); + input_unlock(); } /** @@ -1069,6 +1093,11 @@ AbortDevices(void) { DeviceIntPtr dev; + + /* Do not call input_lock as we don't know what + * state the input thread might be in, and that could + * cause a dead-lock. + */ nt_list_for_each_entry(dev, inputInfo.devices, next) { if (!IsMaster(dev)) (*dev->deviceProc) (dev, DEVICE_ABORT); @@ -1133,6 +1162,8 @@ flags[dev->id] = XIDeviceDisabled; } + input_lock(); + prev = NULL; for (tmp = inputInfo.devices; tmp; (prev = tmp), (tmp = next)) { next = tmp->next; @@ -1165,6 +1196,8 @@ } } + input_unlock(); + if (ret == Success && initialized) { inputInfo.numDevices--; SendDevicePresenceEvent(deviceid, DeviceRemoved); @@ -1403,6 +1436,7 @@ focc = malloc(sizeof(FocusClassRec)); if (!focc) return FALSE; + UpdateCurrentTimeIf(); focc->win = PointerRootWin; focc->revert = None; focc->time = currentTime; @@ -2354,6 +2388,7 @@ if (rc != Success) return rc; + UpdateCurrentTimeIf(); if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); rep = (xGetMotionEventsReply) { diff -Nru xorg-server-hwe-16.04-1.18.4/dix/dispatch.c xorg-server-hwe-16.04-1.19.3/dix/dispatch.c --- xorg-server-hwe-16.04-1.18.4/dix/dispatch.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/dispatch.c 2017-03-15 18:05:25.000000000 +0000 @@ -108,7 +108,7 @@ #include "windowstr.h" #include -#include +#include #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" @@ -151,7 +151,6 @@ #define GrabNone 0 #define GrabActive 1 -#define GrabKickout 2 static int grabState = GrabNone; static long grabWaiters[mskcnt]; CallbackListPtr ServerGrabCallback = NULL; @@ -196,7 +195,7 @@ systime.milliseconds = GetTimeInMillis(); if (systime.milliseconds < currentTime.milliseconds) systime.months++; - if (*checkForInput[0] != *checkForInput[1]) + if (InputCheckPending()) ProcessInputEvents(); if (CompareTimeStamps(systime, currentTime) == LATER) currentTime = systime; @@ -222,11 +221,11 @@ #define SMART_SCHEDULE_DEFAULT_INTERVAL 5 #define SMART_SCHEDULE_MAX_SLICE 15 -#if defined(WIN32) && !defined(__CYGWIN__) -Bool SmartScheduleDisable = TRUE; -#else -Bool SmartScheduleDisable = FALSE; +#ifdef HAVE_SETITIMER +#define SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE HAVE_SETITIMER +Bool SmartScheduleSignalEnable = SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE; #endif + long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -241,23 +240,88 @@ void Dispatch(void); -static int -SmartScheduleClient(int *clientReady, int nready) +static struct xorg_list ready_clients; +static struct xorg_list saved_ready_clients; +struct xorg_list output_pending_clients; + +static void +init_client_ready(void) { - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; + xorg_list_init(&ready_clients); + xorg_list_init(&saved_ready_clients); + xorg_list_init(&output_pending_clients); +} + +Bool +clients_are_ready(void) +{ + return !xorg_list_is_empty(&ready_clients); +} + +/* Client has requests queued or data on the network */ +void +mark_client_ready(ClientPtr client) +{ + if (xorg_list_is_empty(&client->ready)) + xorg_list_append(&client->ready, &ready_clients); +} + +/* + * Client has requests queued or data on the network, but awaits a + * server grab release + */ +void mark_client_saved_ready(ClientPtr client) +{ + if (xorg_list_is_empty(&client->ready)) + xorg_list_append(&client->ready, &saved_ready_clients); +} + +/* Client has no requests queued and no data on network */ +void +mark_client_not_ready(ClientPtr client) +{ + xorg_list_del(&client->ready); +} + +static void +mark_client_grab(ClientPtr grab) +{ + ClientPtr client, tmp; + + xorg_list_for_each_entry_safe(client, tmp, &ready_clients, ready) { + if (client != grab) { + xorg_list_del(&client->ready); + xorg_list_append(&client->ready, &saved_ready_clients); + } + } +} + +static void +mark_client_ungrab(void) +{ + ClientPtr client, tmp; + + xorg_list_for_each_entry_safe(client, tmp, &saved_ready_clients, ready) { + xorg_list_del(&client->ready); + xorg_list_append(&client->ready, &ready_clients); + } +} + +static ClientPtr +SmartScheduleClient(void) +{ + ClientPtr pClient, best = NULL; int bestRobin, robin; long now = SmartScheduleTime; long idle; + int nready = 0; - bestPrio = -0x7fffffff; bestRobin = 0; idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) { - client = clientReady[i]; - pClient = clients[client]; + + xorg_list_for_each_entry(pClient, &ready_clients, ready) { + nready++; + /* Praise clients which haven't run in a while */ if ((now - pClient->smart_stop_tick) >= idle) { if (pClient->smart_priority < 0) @@ -269,31 +333,35 @@ (pClient->index - SmartLastIndex[pClient->smart_priority - SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) { - bestPrio = pClient->smart_priority; + + /* pick the best client */ + if (!best || + pClient->priority > best->priority || + (pClient->priority == best->priority && + (pClient->smart_priority > best->smart_priority || + (pClient->smart_priority == best->smart_priority && robin > bestRobin)))) + { + best = pClient; bestRobin = robin; - best = client; } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) - fprintf(stderr, " %2d: %3d", client, pClient->smart_priority); + fprintf(stderr, " %2d: %3d", pClient->index, pClient->smart_priority); #endif } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) { - fprintf(stderr, " use %2d\n", best); + fprintf(stderr, " use %2d\n", best->index); SmartLastPrint = now; } #endif - pClient = clients[best]; - SmartLastIndex[bestPrio - SMART_MIN_PRIORITY] = pClient->index; + SmartLastIndex[best->smart_priority - SMART_MIN_PRIORITY] = best->index; /* * Set current client pointer */ - if (SmartLastClient != pClient) { - pClient->smart_start_tick = now; - SmartLastClient = pClient; + if (SmartLastClient != best) { + best->smart_start_tick = now; + SmartLastClient = best; } /* * Adjust slice @@ -304,7 +372,7 @@ * has run, bump the slice up to get maximal * performance from a single client */ - if ((now - pClient->smart_start_tick) > 1000 && + if ((now - best->smart_start_tick) > 1000 && SmartScheduleSlice < SmartScheduleMaxSlice) { SmartScheduleSlice += SmartScheduleInterval; } @@ -335,69 +403,50 @@ void Dispatch(void) { - int *clientReady; /* array of request ready clients */ int result; ClientPtr client; - int nready; - HWEventQueuePtr *icheck = checkForInput; long start_tick; nextFreeClientID = 1; nClients = 0; - clientReady = xallocarray(MaxClients, sizeof(int)); - if (!clientReady) - return; - SmartScheduleSlice = SmartScheduleInterval; + init_client_ready(); + while (!dispatchException) { - if (*icheck[0] != *icheck[1]) { + if (InputCheckPending()) { ProcessInputEvents(); FlushIfCriticalOutputPending(); } - nready = WaitForSomething(clientReady); + if (!WaitForSomething(clients_are_ready())) + continue; - if (nready && !SmartScheduleDisable) { - clientReady[0] = SmartScheduleClient(clientReady, nready); - nready = 1; - } /***************** * Handle events in round robin fashion, doing input between * each round *****************/ - while (!dispatchException && (--nready >= 0)) { - client = clients[clientReady[nready]]; - if (!client) { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) { - grabState = GrabActive; - break; - } + if (!dispatchException && clients_are_ready()) { + client = SmartScheduleClient(); + isItTimeToYield = FALSE; start_tick = SmartScheduleTime; while (!isItTimeToYield) { - if (*icheck[0] != *icheck[1]) + if (InputCheckPending()) ProcessInputEvents(); FlushIfCriticalOutputPending(); - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { + if ((SmartScheduleTime - start_tick) >= SmartScheduleSlice) + { /* Penalize clients which consume ticks */ if (client->smart_priority > SMART_MIN_PRIORITY) client->smart_priority--; break; } - /* now, finally, deal with client requests */ - /* Update currentTime so request time checks, such as for input - * device grabs, are calculated correctly */ - UpdateCurrentTimeIf(); + /* now, finally, deal with client requests */ result = ReadRequestFromClient(client); if (result <= 0) { if (result < 0) @@ -429,8 +478,10 @@ if (result == Success) result = (*client->requestVector[client->majorOp]) (client); - XaceHookAuditEnd(client, result); } + if (!SmartScheduleSignalEnable) + SmartScheduleTime = GetTimeInMillis(); + #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_DONE_ENABLED()) XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), @@ -450,8 +501,7 @@ } } FlushAllOutput(); - client = clients[clientReady[nready]]; - if (client) + if (client == SmartLastClient) client->smart_stop_tick = SmartScheduleTime; } dispatchException &= ~DE_PRIORITYCHANGE; @@ -460,7 +510,6 @@ ddxBeforeReset(); #endif KillAllClients(); - free(clientReady); dispatchException &= ~DE_RESET; SmartScheduleLatencyLimited = 0; ResetOsBuffers(); @@ -1058,8 +1107,9 @@ rc = OnlyListenToOneClient(client); if (rc != Success) return rc; - grabState = GrabKickout; + grabState = GrabActive; grabClient = client; + mark_client_grab(client); if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1079,6 +1129,7 @@ grabState = GrabNone; ListenToAllClients(); + mark_client_ungrab(); for (i = mskcnt; --i >= 0 && !grabWaiters[i];); if (i >= 0) { i <<= 5; @@ -1286,7 +1337,7 @@ return BadLength; length--; } - if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) + if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info)) return BadAlloc; reply = (xQueryTextExtentsReply) { .type = X_Reply, @@ -2146,12 +2197,8 @@ return BadAlloc; WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); - if (pDraw->type == DRAWABLE_WINDOW) { - pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); - if (pVisibleRegion) { - RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); - } - } + if (pDraw->type == DRAWABLE_WINDOW) + pVisibleRegion = &((WindowPtr) pDraw)->borderClip; if (linesPerBuf == 0) { /* nothing to do */ @@ -2210,8 +2257,6 @@ } } } - if (pVisibleRegion) - RegionDestroy(pVisibleRegion); free(pBuf); return Success; } @@ -3370,6 +3415,7 @@ if (grabState != GrabNone && grabClient == client) { UngrabServer(client); } + mark_client_not_ready(client); BITCLEAR(grabWaiters, client->index); DeleteClientFromAnySelections(client); ReleaseActiveGrabs(client); @@ -3398,6 +3444,7 @@ if (ClientIsAsleep(client)) ClientSignal(client); ProcessWorkQueueZombies(); + output_pending_clear(client); CloseDownConnection(client); /* If the client made it to the Running stage, nClients has @@ -3459,6 +3506,8 @@ InitClient(ClientPtr client, int i, void *ospriv) { client->index = i; + xorg_list_init(&client->ready); + xorg_list_init(&client->output_pending); client->clientAsMask = ((Mask) i) << CLIENTOFFSET; client->closeDownMode = i ? DestroyAll : RetainPermanent; client->requestVector = InitialVector; @@ -3790,9 +3839,7 @@ pScreen->CreateScreenResources = 0; xorg_list_init(&pScreen->pixmap_dirty_list); - xorg_list_init(&pScreen->unattached_list); - xorg_list_init(&pScreen->output_slave_list); - xorg_list_init(&pScreen->offload_slave_list); + xorg_list_init(&pScreen->slave_list); /* * This loop gets run once for every Screen that gets added, @@ -3921,6 +3968,16 @@ update_desktop_dimensions(); + /* + * We cannot register the Screen PRIVATE_CURSOR key if cursors are already + * created, because dix/privates.c does not have relocation code for + * PRIVATE_CURSOR. Once this is fixed the if() can be removed and we can + * register the Screen PRIVATE_CURSOR key unconditionally. + */ + if (!dixPrivatesCreated(PRIVATE_CURSOR)) + dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, + PRIVATE_CURSOR, 0); + return i; } @@ -3951,7 +4008,7 @@ { assert(new->isGPU); assert(!new->current_master); - xorg_list_add(&new->unattached_head, &pScreen->unattached_list); + xorg_list_add(&new->slave_head, &pScreen->slave_list); new->current_master = pScreen; } @@ -3959,7 +4016,9 @@ DetachUnboundGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->unattached_head); + assert(!slave->is_output_slave); + assert(!slave->is_offload_slave); + xorg_list_del(&slave->slave_head); slave->current_master = NULL; } @@ -3967,31 +4026,35 @@ AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new) { assert(new->isGPU); - xorg_list_add(&new->output_head, &pScreen->output_slave_list); - new->current_master = pScreen; + assert(!new->is_output_slave); + assert(new->current_master == pScreen); + new->is_output_slave = TRUE; + new->current_master->output_slaves++; } void DetachOutputGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->output_head); - slave->current_master = NULL; + assert(slave->is_output_slave); + slave->current_master->output_slaves--; + slave->is_output_slave = FALSE; } void AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new) { assert(new->isGPU); - xorg_list_add(&new->offload_head, &pScreen->offload_slave_list); - new->current_master = pScreen; + assert(!new->is_offload_slave); + assert(new->current_master == pScreen); + new->is_offload_slave = TRUE; } void DetachOffloadGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->offload_head); - slave->current_master = NULL; + assert(slave->is_offload_slave); + slave->is_offload_slave = FALSE; } diff -Nru xorg-server-hwe-16.04-1.18.4/dix/dixfonts.c xorg-server-hwe-16.04-1.19.3/dix/dixfonts.c --- xorg-server-hwe-16.04-1.18.4/dix/dixfonts.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/dixfonts.c 2017-03-15 18:05:25.000000000 +0000 @@ -65,6 +65,7 @@ #include "closestr.h" #include "dixfont.h" #include "xace.h" +#include #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" @@ -75,7 +76,7 @@ static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; static int num_fpes = 0; -static FPEFunctions *fpe_functions = (FPEFunctions *) 0; +static xfont2_fpe_funcs_rec const **fpe_functions; static int num_fpe_types = 0; static unsigned char *font_path_string; @@ -83,7 +84,7 @@ static int num_slept_fpes = 0; static int size_slept_fpes = 0; static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; +static xfont2_pattern_cache_ptr patternCache; static int FontToXError(int err) @@ -108,18 +109,18 @@ LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) { - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) + if (fpe_functions[pfont->fpe->type]->load_glyphs) + return (*fpe_functions[pfont->fpe->type]->load_glyphs) (client, pfont, 0, nchars, item_size, data); else return Successful; } void -dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, - FontEncoding fontEncoding, - unsigned long *glyphcount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ +GetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, + FontEncoding fontEncoding, + unsigned long *glyphcount, /* RETURN */ + CharInfoPtr *glyphs) /* RETURN */ { (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); } @@ -196,7 +197,7 @@ } static void -FontWakeup(void *data, int count, void *LastSelectMask) +FontWakeup(void *data, int count) { int i; FontPathElementPtr fpe; @@ -206,7 +207,7 @@ /* wake up any fpe's that may be waiting for information */ for (i = 0; i < num_slept_fpes; i++) { fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); + (void) (*fpe_functions[fpe->type]->wakeup_fpe) (fpe); } } @@ -222,7 +223,7 @@ { fpe->refcount--; if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); + (*fpe_functions[fpe->type]->free_fpe) (fpe); free((void *) fpe->name); free(fpe); } @@ -266,14 +267,14 @@ if (client->clientGone) { if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; } while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) + err = (*fpe_functions[fpe->type]->open_font) ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | @@ -352,8 +353,8 @@ goto bail; } if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); + xfont2_cache_font_pattern(patternCache, c->origFontName, c->origFontNameLen, + pfont); bail: if (err != Successful && c->client != serverClient) { SendErrorToClient(c->client, X_OpenFont, 0, @@ -398,7 +399,7 @@ ** having to create another instance of a font that already exists. */ - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); + cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; @@ -460,7 +461,7 @@ return Success; if (--pfont->refcnt == 0) { if (patternCache) - RemoveCachedFontPattern(patternCache, pfont); + xfont2_remove_cached_font_pattern(patternCache, pfont); /* * since the last reference is gone, ask each screen to free any * storage it may have allocated locally for it. @@ -476,7 +477,7 @@ XF86BigfontFreeFontShm(pfont); #endif fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); + (*fpe_functions[fpe->type]->close_font) (fpe, pfont); FreeFPE(fpe); } return Success; @@ -567,7 +568,7 @@ if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -580,10 +581,10 @@ fpe = c->fpe_list[c->current.current_fpe]; err = Successful; - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) { + if (!fpe_functions[fpe->type]->start_list_fonts_and_aliases) { /* This FPE doesn't support/require list_fonts_and_aliases */ - err = (*fpe_functions[fpe->type].list_fonts) + err = (*fpe_functions[fpe->type]->list_fonts) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -608,7 +609,7 @@ the FPEs. */ if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) + err = (*fpe_functions[fpe->type]->start_list_fonts_and_aliases) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); @@ -626,7 +627,7 @@ char *tmpname; name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) + err = (*fpe_functions[fpe->type]->list_next_font_or_alias) ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { @@ -647,11 +648,11 @@ if (err == Successful) { if (c->haveSaved) { if (c->savedName) - (void) AddFontNamesName(c->names, c->savedName, + (void) xfont2_add_font_names_name(c->names, c->savedName, c->savedNameLen); } else - (void) AddFontNamesName(c->names, name, namelen); + (void) xfont2_add_font_names_name(c->names, name, namelen); } /* @@ -676,7 +677,7 @@ int tmpnamelen; tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) + (void) (*fpe_functions[fpe->type]->list_next_font_or_alias) ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { @@ -782,7 +783,7 @@ FreeFPE(c->fpe_list[i]); free(c->fpe_list); free(c->savedName); - FreeFontNames(names); + xfont2_free_font_names(names); free(c); free(resolved); return TRUE; @@ -815,7 +816,7 @@ free(c); return BadAlloc; } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); + c->names = xfont2_make_font_names_record(max_names < 100 ? max_names : 100); if (!c->names) { free(c->fpe_list); free(c); @@ -858,7 +859,7 @@ if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -870,7 +871,7 @@ fpe = c->fpe_list[c->current.current_fpe]; err = Successful; if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) + err = (*fpe_functions[fpe->type]->start_list_fonts_with_info) (client, fpe, c->current.pattern, c->current.patlen, c->current.max_names, &c->current.private); if (err == Suspended) { @@ -885,7 +886,7 @@ if (err == Successful) { name = 0; pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) + err = (*fpe_functions[fpe->type]->list_next_font_with_info) (client, fpe, &name, &namelen, &pFontInfo, &numFonts, c->current.private); if (err == Suspended) { @@ -915,7 +916,7 @@ tmpname = 0; tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) + (void) (*fpe_functions[fpe->type]->list_next_font_with_info) (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, &numFonts, c->current.private); if (--aliascount <= 0) { @@ -1102,7 +1103,7 @@ if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); if (ClientIsAsleep(client)) { /* Client has died, but we cannot bail out right now. We @@ -1128,7 +1129,7 @@ the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr) 0; } } @@ -1380,7 +1381,7 @@ if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1394,7 +1395,7 @@ /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1520,7 +1521,7 @@ int i; for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) + if ((*fpe_functions[i]->name_check) (pathname)) return i; } return -1; @@ -1581,8 +1582,8 @@ return BadAlloc; } for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); + if (fpe_functions[i]->set_path_hook) + (*fpe_functions[i]->set_path_hook) (); } for (i = 0; i < npaths; i++) { len = (unsigned int) (*cp++); @@ -1601,7 +1602,7 @@ */ fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); if (fpe) { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); + err = (*fpe_functions[fpe->type]->reset_fpe) (fpe); if (err == Successful) { UseFPE(fpe); /* since it'll be decref'd later when freed * from the old list */ @@ -1633,7 +1634,7 @@ if (fpe->type == -1) err = BadValue; else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); + err = (*fpe_functions[fpe->type]->init_fpe) (fpe); if (err != Successful) { if (persist) { DebugF @@ -1658,7 +1659,7 @@ FreeFontPath(font_path_elements, num_fpes, FALSE); font_path_elements = fplist; if (patternCache) - EmptyFontPatternCache(patternCache); + xfont2_empty_font_pattern_cache(patternCache); num_fpes = valid_paths; return Success; @@ -1799,29 +1800,47 @@ for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + if (fpe_functions[fpe->type]->client_died) + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } } -void -InitFonts(void) +static int +register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs) { - patternCache = MakeFontPatternCache(); + xfont2_fpe_funcs_rec const **new; - register_fpe_functions(); + /* grow the list */ + new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(xfont2_fpe_funcs_ptr)); + if (!new) + return -1; + fpe_functions = new; + + fpe_functions[num_fpe_types] = funcs; + + return num_fpe_types++; } -_X_EXPORT -int -GetDefaultPointSize(void) +static unsigned long +get_server_generation(void) +{ + return serverGeneration; +} + +static void * +get_server_client(void) +{ + return serverClient; +} + +static int +get_default_point_size(void) { return 120; } -_X_EXPORT -FontResolutionPtr -GetClientResolutions(int *num) +static FontResolutionPtr +get_client_resolutions(int *num) { static struct _FontResolution res; ScreenPtr pScreen; @@ -1846,62 +1865,11 @@ return &res; } -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -_X_EXPORT -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - void FreeFonts(void) { if (patternCache) { - FreeFontPatternCache(patternCache); + xfont2_free_font_pattern_cache(patternCache); patternCache = 0; } FreeFontPath(font_path_elements, num_fpes, TRUE); @@ -1909,12 +1877,12 @@ num_fpes = 0; free(fpe_functions); num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; + fpe_functions = NULL; } /* convenience functions for FS interface */ -FontPtr +static FontPtr find_old_font(XID id) { void *pFont; @@ -1923,30 +1891,26 @@ return (FontPtr) pFont; } -_X_EXPORT -Font -GetNewFontClientID(void) +static Font +get_new_font_client_id(void) { return FakeClientID(0); } -_X_EXPORT -int -StoreFontClientFont(FontPtr pfont, Font id) +static int +store_font_Client_font(FontPtr pfont, Font id) { return AddResource(id, RT_NONE, (void *) pfont); } -_X_EXPORT -void -DeleteFontClientID(Font id) +static void +delete_font_client_id(Font id) { FreeResource(id, RT_NONE); } -_X_EXPORT -int -client_auth_generation(ClientPtr client) +static int +_client_auth_generation(ClientPtr client) { return 0; } @@ -1954,9 +1918,72 @@ static int fs_handlers_installed = 0; static unsigned int last_server_gen; -_X_EXPORT -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) +static void fs_block_handler(void *blockData, void *timeout) +{ + FontBlockHandlerProcPtr block_handler = blockData; + + (*block_handler)(timeout); +} + +struct fs_fd_entry { + struct xorg_list entry; + int fd; + void *data; + FontFdHandlerProcPtr handler; +}; + +static void +fs_fd_handler(int fd, int ready, void *data) +{ + struct fs_fd_entry *entry = data; + + entry->handler(fd, entry->data); +} + +static struct xorg_list fs_fd_list; + +static int +add_fs_fd(int fd, FontFdHandlerProcPtr handler, void *data) +{ + struct fs_fd_entry *entry = calloc(1, sizeof (struct fs_fd_entry)); + + if (!entry) + return FALSE; + + entry->fd = fd; + entry->data = data; + entry->handler = handler; + if (!SetNotifyFd(fd, fs_fd_handler, X_NOTIFY_READ, entry)) { + free(entry); + return FALSE; + } + xorg_list_add(&entry->entry, &fs_fd_list); + return TRUE; +} + +static void +remove_fs_fd(int fd) +{ + struct fs_fd_entry *entry, *temp; + + xorg_list_for_each_entry_safe(entry, temp, &fs_fd_list, entry) { + if (entry->fd == fd) { + xorg_list_del(&entry->entry); + free(entry); + break; + } + } + RemoveNotifyFd(fd); +} + +static void +adjust_fs_wait_for_delay(void *wt, unsigned long newdelay) +{ + AdjustWaitForDelay(wt, newdelay); +} + +static int +_init_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler) { /* if server has reset, make sure the b&w handlers are reinstalled */ if (last_server_gen < serverGeneration) { @@ -1964,26 +1991,63 @@ fs_handlers_installed = 0; } if (fs_handlers_installed == 0) { - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (void *) 0)) + if (!RegisterBlockAndWakeupHandlers(fs_block_handler, + FontWakeup, (void *) block_handler)) return AllocError; + xorg_list_init(&fs_fd_list); fs_handlers_installed++; } QueueFontWakeup(fpe); return Successful; } -_X_EXPORT -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, - Bool all) +static void +_remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler, + Bool all) { if (all) { /* remove the handlers if no one else is using them */ if (--fs_handlers_installed == 0) { - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (void *) 0); + RemoveBlockAndWakeupHandlers(fs_block_handler, FontWakeup, + (void *) block_handler); } } RemoveFontWakeup(fpe); } + +static const xfont2_client_funcs_rec xfont2_client_funcs = { + .version = XFONT2_CLIENT_FUNCS_VERSION, + .client_auth_generation = _client_auth_generation, + .client_signal = ClientSignal, + .delete_font_client_id = delete_font_client_id, + .verrorf = VErrorF, + .find_old_font = find_old_font, + .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, + .init_fs_handlers = _init_fs_handlers, + .register_fpe_funcs = register_fpe_funcs, + .remove_fs_handlers = _remove_fs_handlers, + .get_server_client = get_server_client, + .set_font_authorizations = set_font_authorizations, + .store_font_client_font = store_font_Client_font, + .make_atom = MakeAtom, + .valid_atom = ValidAtom, + .name_for_atom = NameForAtom, + .get_server_generation = get_server_generation, + .add_fs_fd = add_fs_fd, + .remove_fs_fd = remove_fs_fd, + .adjust_fs_wait_for_delay = adjust_fs_wait_for_delay, +}; + +xfont2_pattern_cache_ptr fontPatternCache; + +void +InitFonts(void) +{ + if (fontPatternCache) + xfont2_free_font_pattern_cache(fontPatternCache); + fontPatternCache = xfont2_make_font_pattern_cache(); + xfont2_init(&xfont2_client_funcs); +} diff -Nru xorg-server-hwe-16.04-1.18.4/dix/dixutils.c xorg-server-hwe-16.04-1.19.3/dix/dixutils.c --- xorg-server-hwe-16.04-1.18.4/dix/dixutils.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/dixutils.c 2017-03-15 18:05:25.000000000 +0000 @@ -360,8 +360,8 @@ } typedef struct _BlockHandler { - BlockHandlerProcPtr BlockHandler; - WakeupHandlerProcPtr WakeupHandler; + ServerBlockHandlerProcPtr BlockHandler; + ServerWakeupHandlerProcPtr WakeupHandler; void *blockData; Bool deleted; } BlockHandlerRec, *BlockHandlerPtr; @@ -378,21 +378,21 @@ * \param pReadMask nor how it represents the det of descriptors */ void -BlockHandler(void *pTimeout, void *pReadmask) +BlockHandler(void *pTimeout) { int i, j; ++inHandler; - for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], - pTimeout, pReadmask); - for (i = 0; i < screenInfo.numGPUScreens; i++) - (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], - pTimeout, pReadmask); for (i = 0; i < numHandlers; i++) if (!handlers[i].deleted) - (*handlers[i].BlockHandler) (handlers[i].blockData, - pTimeout, pReadmask); + (*handlers[i].BlockHandler) (handlers[i].blockData, pTimeout); + + for (i = 0; i < screenInfo.numGPUScreens; i++) + (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], pTimeout); + + for (i = 0; i < screenInfo.numScreens; i++) + (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], pTimeout); + if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { @@ -413,21 +413,18 @@ * \param pReadmask the resulting descriptor mask */ void -WakeupHandler(int result, void *pReadmask) +WakeupHandler(int result) { int i, j; ++inHandler; - for (i = numHandlers - 1; i >= 0; i--) - if (!handlers[i].deleted) - (*handlers[i].WakeupHandler) (handlers[i].blockData, - result, pReadmask); for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], - result, pReadmask); + (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], result); for (i = 0; i < screenInfo.numGPUScreens; i++) - (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], - result, pReadmask); + (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], result); + for (i = numHandlers - 1; i >= 0; i--) + if (!handlers[i].deleted) + (*handlers[i].WakeupHandler) (handlers[i].blockData, result); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { @@ -447,8 +444,8 @@ * get called until next time */ Bool -RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData) { BlockHandlerPtr new; @@ -470,8 +467,8 @@ } void -RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData) { int i; diff -Nru xorg-server-hwe-16.04-1.18.4/dix/events.c xorg-server-hwe-16.04-1.19.3/dix/events.c --- xorg-server-hwe-16.04-1.18.4/dix/events.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/events.c 2017-03-15 18:05:25.000000000 +0000 @@ -882,6 +882,8 @@ SyntheticMotion(pDev, pSprite->hot.x, pSprite->hot.y); } else { + ScreenPtr pScreen = pWin->drawable.pScreen; + #ifdef PANORAMIX if (!noPanoramiXExtension) { XineramaConfineCursorToWindow(pDev, pWin, generateEvents); @@ -893,6 +895,9 @@ : NullRegion; CheckPhysLimits(pDev, pSprite->current, generateEvents, confineToScreen, pWin->drawable.pScreen); + + if (*pScreen->CursorConfinedTo) + (*pScreen->CursorConfinedTo) (pDev, pScreen, pWin); } } @@ -1822,6 +1827,7 @@ REQUEST(xAllowEventsReq); REQUEST_SIZE_MATCH(xAllowEventsReq); + UpdateCurrentTime(); time = ClientTimeToServerTime(stuff->time); mouse = PickPointer(client); @@ -2891,7 +2897,7 @@ if (dev->deviceGrab.grab) { if (!dev->deviceGrab.fromPassiveGrab || - dev->deviceGrab.grab->type != XI_Enter || + dev->deviceGrab.grab->type != XI_FocusIn || dev->deviceGrab.grab->window == win || IsParent(dev->deviceGrab.grab->window, win)) return FALSE; @@ -2914,7 +2920,7 @@ rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, TRUE) != NULL); if (rc) - DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); + DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab); return rc; } @@ -3608,6 +3614,9 @@ else if (!PointerConfinedToScreen(dev)) { NewCurrentScreen(dev, newScreen, x, y); } + if (*newScreen->CursorWarpedTo) + (*newScreen->CursorWarpedTo) (dev, newScreen, client, + dest, pSprite, x, y); return Success; } @@ -4952,6 +4961,7 @@ return Success; if (!SameClient(grab, client)) return Success; + UpdateCurrentTime(); time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, device->deviceGrab.grabTime) == EARLIER)) @@ -5132,6 +5142,7 @@ GrabMask mask; REQUEST_SIZE_MATCH(xGrabKeyboardReq); + UpdateCurrentTime(); mask.core = KeyPressMask | KeyReleaseMask; @@ -5544,6 +5555,7 @@ int rc; REQUEST_SIZE_MATCH(xGrabButtonReq); + UpdateCurrentTime(); if ((stuff->pointerMode != GrabModeSync) && (stuff->pointerMode != GrabModeAsync)) { client->errorValue = stuff->pointerMode; @@ -5632,6 +5644,7 @@ DeviceIntPtr ptr; REQUEST_SIZE_MATCH(xUngrabButtonReq); + UpdateCurrentTime(); if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) { client->errorValue = stuff->modifiers; diff -Nru xorg-server-hwe-16.04-1.18.4/dix/getevents.c xorg-server-hwe-16.04-1.19.3/dix/getevents.c --- xorg-server-hwe-16.04-1.18.4/dix/getevents.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/getevents.c 2017-03-15 18:05:25.000000000 +0000 @@ -1092,6 +1092,7 @@ CARD32 ms = 0; DeviceEvent *event; RawDeviceEvent *raw; + enum DeviceEventSource source_type = EVENT_SOURCE_NORMAL; #if XSERVER_DTRACE if (XSERVER_INPUT_EVENT_ENABLED()) { @@ -1100,6 +1101,14 @@ } #endif + if (type == EnterNotify) { + source_type = EVENT_SOURCE_FOCUS; + type = KeyPress; + } else if (type == LeaveNotify) { + source_type = EVENT_SOURCE_FOCUS; + type = KeyRelease; + } + /* refuse events from disabled devices */ if (!pDev->enabled) return 0; @@ -1126,14 +1135,15 @@ ms = GetTimeInMillis(); - raw = &events->raw_event; - events++; - num_events++; - - init_raw(pDev, raw, ms, type, key_code); + if (source_type == EVENT_SOURCE_NORMAL) { + raw = &events->raw_event; + init_raw(pDev, raw, ms, type, key_code); + events++; + num_events++; + } event = &events->device_event; - init_device_event(event, pDev, ms); + init_device_event(event, pDev, ms, source_type); event->detail.key = key_code; if (type == KeyPress) { @@ -1468,7 +1478,7 @@ } event = &events->device_event; - init_device_event(event, pDev, ms); + init_device_event(event, pDev, ms, EVENT_SOURCE_NORMAL); if (type == MotionNotify) { event->type = ET_Motion; @@ -1804,7 +1814,7 @@ UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); event = &events->device_event; - init_device_event(event, pDev, GetTimeInMillis()); + init_device_event(event, pDev, GetTimeInMillis(), EVENT_SOURCE_NORMAL); event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut; clipValuators(pDev, &mask); @@ -1939,7 +1949,7 @@ event = &events->device_event; num_events++; - init_device_event(event, dev, ms); + init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL); switch (type) { case XI_TouchBegin: @@ -2054,7 +2064,7 @@ BUG_WARN(!dev->enabled); - init_device_event(event, dev, ms); + init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL); event->sourceid = ti->sourceid; event->type = ET_TouchEnd; @@ -2098,7 +2108,7 @@ #endif memset(&ev, 0, sizeof(DeviceEvent)); - init_device_event(&ev, pDev, time); + init_device_event(&ev, pDev, time, EVENT_SOURCE_NORMAL); ev.root_x = x; ev.root_y = y; ev.type = ET_Motion; diff -Nru xorg-server-hwe-16.04-1.18.4/dix/inpututils.c xorg-server-hwe-16.04-1.19.3/dix/inpututils.c --- xorg-server-hwe-16.04-1.18.4/dix/inpututils.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/inpututils.c 2017-03-15 18:05:25.000000000 +0000 @@ -636,6 +636,19 @@ mask->has_unaccelerated = FALSE; } +void +valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask, + int valuator, + int absolute, + double unaccel) +{ + BUG_WARN_MSG(mask->last_bit != -1 && !mask->has_unaccelerated, + "Do not mix valuator types, zero mask first\n"); + _valuator_mask_set_double(mask, valuator, absolute); + mask->has_unaccelerated = TRUE; + mask->unaccelerated[valuator] = unaccel; +} + /** * Set both accelerated and unaccelerated value for this mask. */ @@ -727,7 +740,8 @@ * device. */ void -init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms) +init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms, + enum DeviceEventSource source_type) { memset(event, 0, sizeof(DeviceEvent)); event->header = ET_Internal; @@ -735,6 +749,7 @@ event->time = ms; event->deviceid = dev->id; event->sourceid = dev->id; + event->source_type = source_type; } int diff -Nru xorg-server-hwe-16.04-1.18.4/dix/main.c xorg-server-hwe-16.04-1.19.3/dix/main.c --- xorg-server-hwe-16.04-1.18.4/dix/main.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/main.c 2017-03-15 18:05:25.000000000 +0000 @@ -96,7 +96,7 @@ #include "selection.h" #include #include -#include +#include #include "opaque.h" #include "servermd.h" #include "hotplug.h" @@ -120,14 +120,7 @@ extern void Dispatch(void); -#ifdef XQUARTZ -#include - -BOOL serverRunning = FALSE; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; - -#endif +CallbackListPtr RootWindowFinalizeCallback = NULL; int dix_main(int argc, char *argv[], char *envp[]) @@ -197,9 +190,9 @@ InitAtoms(); InitEvents(); - InitGlyphCaching(); + xfont2_init_glyph_caching(); dixResetRegistry(); - ResetFontPrivateIndex(); + InitFonts(); InitCallbackManager(); InitOutput(&screenInfo, argc, argv); @@ -230,9 +223,9 @@ FatalError("failed to create default stipple"); if (!CreateRootWindow(pScreen)) FatalError("failed to create root window"); + CallCallbacks(&RootWindowFinalizeCallback, pScreen); } - InitFonts(); if (SetDefaultFontPath(defaultFontPath) != Success) { ErrorF("[dix] failed to set default font path '%s'", defaultFontPath); @@ -287,24 +280,11 @@ } } -#ifdef XQUARTZ - /* Let the other threads know the server is done with its init */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = TRUE; - pthread_cond_broadcast(&serverRunningCond); - pthread_mutex_unlock(&serverRunningMutex); -#endif - NotifyParentProcess(); - Dispatch(); + InputThreadInit(); -#ifdef XQUARTZ - /* Let the other threads know the server is no longer running */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = FALSE; - pthread_mutex_unlock(&serverRunningMutex); -#endif + Dispatch(); UndisplayDevices(); DisableAllDevices(); @@ -329,6 +309,8 @@ CloseInput(); + InputThreadFini(); + for (i = 0; i < screenInfo.numScreens; i++) screenInfo.screens[i]->root = NullWindow; diff -Nru xorg-server-hwe-16.04-1.18.4/dix/Makefile.am xorg-server-hwe-16.04-1.19.3/dix/Makefile.am --- xorg-server-hwe-16.04-1.18.4/dix/Makefile.am 2016-07-15 16:17:45.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -61,13 +61,13 @@ if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libdix -dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) +dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) noinst_PROGRAMS = dix.O dix_O_SOURCES = -dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) +dix.O: dtrace-dix.o libdix.la $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) endif diff -Nru xorg-server-hwe-16.04-1.18.4/dix/Makefile.in xorg-server-hwe-16.04-1.19.3/dix/Makefile.in --- xorg-server-hwe-16.04-1.18.4/dix/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -94,9 +94,10 @@ subdir = dix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_miscconfig_DATA) \ @@ -400,6 +401,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -430,7 +434,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -525,6 +532,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -998,9 +1006,9 @@ @XSERVER_DTRACE_TRUE@ || cp Xserver-dtrace.h.in $@ # Generate dtrace object code for probes in libdix -@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) -@SPECIAL_DTRACE_OBJECTS_TRUE@dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dix.O: dtrace-dix.o libdix.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xorg-server-hwe-16.04-1.18.4/dix/pixmap.c xorg-server-hwe-16.04-1.19.3/dix/pixmap.c --- xorg-server-hwe-16.04-1.18.4/dix/pixmap.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/pixmap.c 2017-03-15 18:05:25.000000000 +0000 @@ -132,6 +132,13 @@ free(pPixmap); } +void PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap) +{ + int ihandle = -1; + ScreenPtr pScreen = slave_pixmap->drawable.pScreen; + pScreen->SetSharedPixmapBacking(slave_pixmap, ((void *)(long)ihandle)); +} + PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) { PixmapPtr spix; @@ -165,6 +172,14 @@ return spix; } +static void +PixmapDirtyDamageDestroy(DamagePtr damage, void *closure) +{ + PixmapDirtyUpdatePtr dirty = closure; + + dirty->damage = NULL; +} + Bool PixmapStartDirtyTracking(PixmapPtr src, PixmapPtr slave_dst, @@ -188,10 +203,10 @@ dirty_update->dst_x = dst_x; dirty_update->dst_y = dst_y; dirty_update->rotation = rotation; - dirty_update->damage = DamageCreate(NULL, NULL, + dirty_update->damage = DamageCreate(NULL, PixmapDirtyDamageDestroy, DamageReportNone, TRUE, src->drawable.pScreen, - src->drawable.pScreen); + dirty_update); if (rotation != RR_Rotate_0) { RRTransformCompute(x, y, @@ -239,7 +254,8 @@ xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { if (ent->src == src && ent->slave_dst == slave_dst) { - DamageDestroy(ent->damage); + if (ent->damage) + DamageDestroy(ent->damage); xorg_list_del(&ent->ent); free(ent); } diff -Nru xorg-server-hwe-16.04-1.18.4/dix/privates.c xorg-server-hwe-16.04-1.19.3/dix/privates.c --- xorg-server-hwe-16.04-1.18.4/dix/privates.c 2016-07-15 16:18:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/privates.c 2017-03-15 18:05:25.000000000 +0000 @@ -783,3 +783,12 @@ global_keys[t].allocated = 0; } } + +Bool +dixPrivatesCreated(DevPrivateType type) +{ + if (global_keys[type].created) + return TRUE; + else + return FALSE; +} diff -Nru xorg-server-hwe-16.04-1.18.4/dix/property.c xorg-server-hwe-16.04-1.19.3/dix/property.c --- xorg-server-hwe-16.04-1.18.4/dix/property.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/property.c 2017-03-15 18:05:25.000000000 +0000 @@ -108,11 +108,13 @@ static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) { - xEvent event = { + xEvent event; + UpdateCurrentTimeIf(); + event = (xEvent) { .u.property.window = pWin->drawable.id, .u.property.state = state, .u.property.atom = atom, - .u.property.time = currentTime.milliseconds + .u.property.time = currentTime.milliseconds, }; event.u.u.type = PropertyNotify; DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); @@ -355,14 +357,6 @@ } int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, void *value, Bool sendevent) -{ - return dixChangeWindowProperty(serverClient, pWin, property, type, format, - mode, len, value, sendevent); -} - -int DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName) { PropertyPtr pProp, prevProp; diff -Nru xorg-server-hwe-16.04-1.18.4/dix/ptrveloc.c xorg-server-hwe-16.04-1.19.3/dix/ptrveloc.c --- xorg-server-hwe-16.04-1.18.4/dix/ptrveloc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/ptrveloc.c 2017-03-15 18:05:25.000000000 +0000 @@ -165,7 +165,7 @@ * AccelSchemeProc(), but that seems impossible. Schemes don't get * switched often anyway. */ - OsBlockSignals(); + input_lock(); dev->valuator->accelScheme.AccelSchemeProc = NULL; FreeVelocityData(vel); free(vel); @@ -175,7 +175,7 @@ accelData); free(dev->valuator->accelScheme.accelData); dev->valuator->accelScheme.accelData = NULL; - OsReleaseSignals(); + input_unlock(); } } @@ -794,12 +794,12 @@ BasicComputeAcceleration(dev, vel, vel->last_velocity, threshold, acc); result += - 4.0f * BasicComputeAcceleration(dev, vel, + 4.0 * BasicComputeAcceleration(dev, vel, (vel->last_velocity + vel->velocity) / 2, threshold, acc); - result /= 6.0f; + result /= 6.0; DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n", vel->velocity, vel->last_velocity, result); } @@ -860,7 +860,7 @@ { double vel_dist; - acc = (acc - 1.0) * 0.1f + 1.0; /* without this, acc of 2 is unuseable */ + acc = (acc - 1.0) * 0.1 + 1.0; /* without this, acc of 2 is unuseable */ if (velocity <= threshold) return vel->min_acceleration; @@ -878,9 +878,9 @@ static inline double CalcPenumbralGradient(double x) { - x *= 2.0f; - x -= 1.0f; - return 0.5f + (x * sqrt(1.0 - x * x) + asin(x)) / M_PI; + x *= 2.0; + x -= 1.0; + return 0.5 + (x * sqrt(1.0 - x * x) + asin(x)) / M_PI; } /** @@ -916,23 +916,23 @@ { double res, nv; - if (acc > 1.0f) - acc -= 1.0f; /*this is so acc = 1 is no acceleration */ + if (acc > 1.0) + acc -= 1.0; /*this is so acc = 1 is no acceleration */ else - return 1.0f; + return 1.0; - nv = (velocity - threshold) * acc * 0.5f; + nv = (velocity - threshold) * acc * 0.5; if (nv < 0) { res = 0; } else if (nv < 2) { - res = CalcPenumbralGradient(nv * 0.25f) * 2.0f; + res = CalcPenumbralGradient(nv * 0.25) * 2.0; } else { - nv -= 2.0f; - res = nv * 2.0f / M_PI /* steepness of gradient at 0.5 */ - + 1.0f; /* gradient crosses 2|1 */ + nv -= 2.0; + res = nv * 2.0 / M_PI /* steepness of gradient at 0.5 */ + + 1.0; /* gradient crosses 2|1 */ } res += vel->min_acceleration; return res; @@ -949,7 +949,7 @@ { double res; - if (velocity >= threshold || threshold == 0.0f) + if (velocity >= threshold || threshold == 0.0) return acc; velocity /= threshold; /* should be [0..1[ now */ @@ -971,7 +971,7 @@ NoProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { - return 1.0f; + return 1.0; } static PointerAccelerationProfileFunc @@ -1091,7 +1091,7 @@ return; if (velocitydata->statistics.profile_number == AccelProfileNone && - velocitydata->const_acceleration == 1.0f) { + velocitydata->const_acceleration == 1.0) { return; /*we're inactive anyway, so skip the whole thing. */ } @@ -1119,8 +1119,8 @@ (double) dev->ptrfeed->ctrl.den); DebugAccelF("mult is %f\n", mult); - if (mult != 1.0f || velocitydata->const_acceleration != 1.0f) { - if (mult > 1.0f && soften) + if (mult != 1.0 || velocitydata->const_acceleration != 1.0) { + if (mult > 1.0 && soften) ApplySoftening(velocitydata, &dx, &dy); ApplyConstantDeceleration(velocitydata, &dx, &dy); diff -Nru xorg-server-hwe-16.04-1.18.4/dix/resource.c xorg-server-hwe-16.04-1.19.3/dix/resource.c --- xorg-server-hwe-16.04-1.18.4/dix/resource.c 2016-07-15 16:18:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/resource.c 2017-03-15 18:05:25.000000000 +0000 @@ -156,7 +156,7 @@ #define INITBUCKETS 64 #define INITHASHSIZE 6 -#define MAXHASHSIZE 11 +#define MAXHASHSIZE 16 typedef struct _Resource { struct _Resource *next; @@ -668,29 +668,14 @@ int HashResourceID(XID id, int numBits) { - id &= RESOURCE_ID_MASK; - switch (numBits) - { - case 6: - return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - if (numBits >= 11) - return ((int)(0x7FF & (id ^ (id>>11)))); - else - { - assert(numBits >= 0); - return id & ~((~0) << numBits); - } + static XID mask; + + if (!mask) + mask = RESOURCE_ID_MASK; + id &= mask; + if (numBits < 9) + return (id ^ (id >> numBits) ^ (id >> (numBits<<1))) & ~((~0) << numBits); + return (id ^ (id >> numBits)) & ~((~0) << numBits); } static XID @@ -1220,11 +1205,13 @@ if (res->id == id && res->type == rtype) break; } + if (client) { + client->errorValue = id; + } if (!res) return resourceTypes[rtype & TypeMask].errorValue; if (client) { - client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid == BadValue) @@ -1253,11 +1240,13 @@ if (res->id == id && (res->type & rclass)) break; } + if (client) { + client->errorValue = id; + } if (!res) return BadValue; if (client) { - client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid != Success) diff -Nru xorg-server-hwe-16.04-1.18.4/dix/selection.c xorg-server-hwe-16.04-1.19.3/dix/selection.c --- xorg-server-hwe-16.04-1.18.4/dix/selection.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/selection.c 2017-03-15 18:05:25.000000000 +0000 @@ -279,6 +279,9 @@ return BadAtom; } + if (stuff->time == CurrentTime) + UpdateCurrentTime(); + rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess); memset(&event, 0, sizeof(xEvent)); diff -Nru xorg-server-hwe-16.04-1.18.4/dix/touch.c xorg-server-hwe-16.04-1.19.3/dix/touch.c --- xorg-server-hwe-16.04-1.18.4/dix/touch.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dix/touch.c 2017-03-15 18:05:25.000000000 +0000 @@ -42,9 +42,6 @@ #define TOUCH_HISTORY_SIZE 100 -/* If a touch queue resize is needed, the device id's bit is set. */ -static unsigned char resize_waiting[(MAXDEVICES + 7) / 8]; - /** * Some documentation about touch points: * The driver submits touch events with it's own (unique) touch point ID. @@ -74,47 +71,27 @@ * @return Always True. If we fail to grow we probably will topple over soon * anyway and re-executing this won't help. */ + static Bool -TouchResizeQueue(ClientPtr client, void *closure) +TouchResizeQueue(DeviceIntPtr dev) { - int i; - - OsBlockSignals(); - - /* first two ids are reserved */ - for (i = 2; i < MAXDEVICES; i++) { - DeviceIntPtr dev; - DDXTouchPointInfoPtr tmp; - size_t size; - - if (!BitIsOn(resize_waiting, i)) - continue; + DDXTouchPointInfoPtr tmp; + size_t size; - ClearBit(resize_waiting, i); + /* Grow sufficiently so we don't need to do it often */ + size = dev->last.num_touches + dev->last.num_touches / 2 + 1; - /* device may have disappeared by now */ - dixLookupDevice(&dev, i, serverClient, DixWriteAccess); - if (!dev) - continue; - - /* Need to grow the queue means dropping events. Grow sufficiently so we - * don't need to do it often */ - size = dev->last.num_touches + dev->last.num_touches / 2 + 1; - - tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches)); - if (tmp) { - int j; - - dev->last.touches = tmp; - for (j = dev->last.num_touches; j < size; j++) - TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); - dev->last.num_touches = size; - } + tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches)); + if (tmp) { + int j; + dev->last.touches = tmp; + for (j = dev->last.num_touches; j < size; j++) + TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); + dev->last.num_touches = size; + return TRUE; } - OsReleaseSignals(); - - return TRUE; + return FALSE; } /** @@ -172,14 +149,20 @@ if (TouchFindByDDXID(dev, ddx_id, FALSE)) return NULL; - for (i = 0; i < dev->last.num_touches; i++) { - /* Only emulate pointer events on the first touch */ - if (dev->last.touches[i].active) - emulate_pointer = FALSE; - else if (!ti) /* ti is now first non-active touch rec */ - ti = &dev->last.touches[i]; + for (;;) { + for (i = 0; i < dev->last.num_touches; i++) { + /* Only emulate pointer events on the first touch */ + if (dev->last.touches[i].active) + emulate_pointer = FALSE; + else if (!ti) /* ti is now first non-active touch rec */ + ti = &dev->last.touches[i]; - if (!emulate_pointer && ti) + if (!emulate_pointer && ti) + break; + } + if (ti) + break; + if (!TouchResizeQueue(dev)) break; } @@ -194,21 +177,8 @@ next_client_id = 1; ti->client_id = client_id; ti->emulate_pointer = emulate_pointer; - return ti; - } - - /* If we get here, then we've run out of touches and we need to drop the - * event (we're inside the SIGIO handler here) schedule a WorkProc to - * grow the queue for us for next time. */ - ErrorFSigSafe("%s: not enough space for touch events (max %u touchpoints). " - "Dropping this event.\n", dev->name, dev->last.num_touches); - - if (!BitIsOn(resize_waiting, dev->id)) { - SetBit(resize_waiting, dev->id); - QueueWorkProc(TouchResizeQueue, serverClient, NULL); } - - return NULL; + return ti; } void @@ -1077,7 +1047,7 @@ InternalEvent *eventlist = InitEventList(GetMaximumEventsNum()); int i; - OsBlockSignals(); + input_lock(); mieqProcessInputEvents(); for (i = 0; i < dev->last.num_touches; i++) { DDXTouchPointInfoPtr ddxti = dev->last.touches + i; @@ -1091,7 +1061,7 @@ mieqProcessDeviceEvent(dev, eventlist + j, NULL); } } - OsReleaseSignals(); + input_unlock(); FreeEventList(eventlist, GetMaximumEventsNum()); } diff -Nru xorg-server-hwe-16.04-1.18.4/doc/dtrace/Makefile.in xorg-server-hwe-16.04-1.19.3/doc/dtrace/Makefile.in --- xorg-server-hwe-16.04-1.18.4/doc/dtrace/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/doc/dtrace/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -113,9 +113,10 @@ subdir = doc/dtrace ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_shelf_DATA_DIST) \ @@ -358,6 +359,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -388,7 +392,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -483,6 +490,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/doc/Makefile.in xorg-server-hwe-16.04-1.19.3/doc/Makefile.in --- xorg-server-hwe-16.04-1.18.4/doc/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/doc/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -110,9 +110,10 @@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) \ @@ -387,6 +388,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/doc/Xinput.xml xorg-server-hwe-16.04-1.19.3/doc/Xinput.xml --- xorg-server-hwe-16.04-1.18.4/doc/Xinput.xml 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/doc/Xinput.xml 2017-03-15 18:05:25.000000000 +0000 @@ -210,7 +210,7 @@ InitInput(argc,argv) { - int i, numdevs, ReadInput(); + int i, numdevs; DeviceIntPtr dev; LocalDevice localdevs[LOCAL_MAX_DEVS]; DeviceProc kbdproc, ptrproc, extproc; @@ -224,12 +224,6 @@ open_input_devices (&numdevs, localdevs); /************************************************************** - * Register a WakeupHandler to handle input when it is generated. - ***************************************************************/ - - RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL); - - /************************************************************** * Register the input devices with DIX. ***************************************************************/ diff -Nru xorg-server-hwe-16.04-1.18.4/doc/Xserver-spec.xml xorg-server-hwe-16.04-1.19.3/doc/Xserver-spec.xml --- xorg-server-hwe-16.04-1.18.4/doc/Xserver-spec.xml 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/doc/Xserver-spec.xml 2017-03-15 18:05:25.000000000 +0000 @@ -674,30 +674,22 @@ routine called BlockHandler().
- void BlockHandler(pTimeout, pReadmask) - pointer pTimeout; - pointer pReadmask; + void BlockHandler(void *pTimeout)
The types of the arguments are for agreement between the OS and DDX implementations, but the pTimeout is a pointer to the information -determining how long the block is allowed to last, and the -pReadmask is a pointer to the information describing the descriptors -that will be waited on. +determining how long the block is allowed to last. -In the sample server, pTimeout is a pointer, and pReadmask is -the address of the select() mask for reading. +In the sample server, pTimeout is a pointer. The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus:
- void xxxBlockHandler(pScreen, pTimeout, pReadmask) - ScreenPtr pScreen; - pointer pTimeout; - pointer pReadmask; + void xxxBlockHandler(ScreenPtr pScreen, void *pTimeout)
The arguments are a pointer to the Screen, and the arguments to the @@ -709,27 +701,20 @@ WakeupHandler().
- void WakeupHandler(result, pReadmask) - int result; - pointer pReadmask; + void WakeupHandler(int result)
Once again, the types are not specified by DIX. The result is the -success indicator for the thing that (may have) blocked, -and the pReadmask is a mask of the descriptors that came active. -In the sample server, result is the result from select() (or equivalent -operating system function), and pReadmask is -the address of the select() mask for reading. +success indicator for the thing that (may have) blocked. +In the sample server, result is the result from select() (or equivalent +operating system function).
The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus:
- void xxxWakeupHandler(pScreen, result, pReadmask) - ScreenPtr pScreen; - unsigned long result; - pointer pReadmask; + void xxxWakeupHandler(ScreenPtr pScreen, int result)
The arguments are the Screen, of the Screen, and the arguments to @@ -741,8 +726,8 @@
Bool RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -752,8 +737,8 @@
RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -761,18 +746,15 @@ RegisterBlockAndWakeupHandlers.
-These registered block handlers are called after the per-screen handlers: +These registered block handlers are called before the per-screen handlers:
- void (*BlockHandler) (blockData, pptv, pReadmask) - pointer blockData; - OsTimerPtr pptv; - pointer pReadmask; + void (*ServerBlockHandler) (void *blockData, void *pTimeout)
-Sometimes block handlers need to adjust the time in a OSTimePtr structure, +Sometimes block handlers need to adjust the time referenced by pTimeout, which on UNIX family systems is generally represented by a struct timeval consisting of seconds and microseconds in 32 bit values. As a convenience to reduce error prone struct timeval computations which @@ -780,20 +762,17 @@ millisecond wrapping through 32 bits,
- void AdjustWaitForDelay(pointer /*waitTime*, unsigned long /* newdelay */) + void AdjustWaitForDelay(void *pTimeout, unsigned long newdelay)
has been provided.
Any wakeup handlers registered with RegisterBlockAndWakeupHandlers will -be called before the Screen handlers: +be called after the Screen handlers:
- void (*WakeupHandler) (blockData, err, pReadmask) - pointer blockData; - int err; - pointer pReadmask; + void (*ServerWakeupHandler) (void *blockData, int result)
diff -Nru xorg-server-hwe-16.04-1.18.4/dri3/dri3int.h xorg-server-hwe-16.04-1.19.3/dri3/dri3int.h --- xorg-server-hwe-16.04-1.18.4/dri3/dri3int.h 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dri3/dri3int.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright © 2011 Daniel Stone - * - * 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. - * - * Author: Daniel Stone - */ - -extern Bool DRI2ModuleSetup(void); diff -Nru xorg-server-hwe-16.04-1.18.4/dri3/dri3_request.c xorg-server-hwe-16.04-1.19.3/dri3/dri3_request.c --- xorg-server-hwe-16.04-1.18.4/dri3/dri3_request.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dri3/dri3_request.c 2017-03-15 18:05:25.000000000 +0000 @@ -178,8 +178,8 @@ (*drawable->pScreen->DestroyPixmap) (pixmap); return rc; } - if (AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) - return Success; + if (!AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) + return BadAlloc; return Success; } @@ -230,7 +230,7 @@ WriteToClient(client, sizeof(rep), &rep); - return client->noClientException; + return Success; } static int @@ -296,7 +296,7 @@ WriteToClient(client, sizeof(rep), &rep); - return client->noClientException; + return Success; } int (*proc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { diff -Nru xorg-server-hwe-16.04-1.18.4/dri3/Makefile.in xorg-server-hwe-16.04-1.19.3/dri3/Makefile.in --- xorg-server-hwe-16.04-1.18.4/dri3/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/dri3/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -92,9 +92,10 @@ subdir = dri3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -383,6 +384,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -413,7 +417,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -508,6 +515,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/exa/exa.c xorg-server-hwe-16.04-1.19.3/exa/exa.c --- xorg-server-hwe-16.04-1.18.4/exa/exa.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/exa/exa.c 2017-03-15 18:05:25.000000000 +0000 @@ -702,8 +702,7 @@ } static void -ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask) +ExaBlockHandler(ScreenPtr pScreen, void *pTimeout) { ExaScreenPriv(pScreen); @@ -712,7 +711,7 @@ exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ @@ -732,13 +731,12 @@ } static void -ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, - void *pReadmask) +ExaWakeupHandler(ScreenPtr pScreen, int result) { ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); - (*pScreen->WakeupHandler) (pScreen, result, pReadmask); + (*pScreen->WakeupHandler) (pScreen, result); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { diff -Nru xorg-server-hwe-16.04-1.18.4/exa/Makefile.in xorg-server-hwe-16.04-1.19.3/exa/Makefile.in --- xorg-server-hwe-16.04-1.18.4/exa/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/exa/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -92,9 +92,10 @@ subdir = exa ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -387,6 +388,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/fb/fbimage.c xorg-server-hwe-16.04-1.19.3/fb/fbimage.c --- xorg-server-hwe-16.04-1.18.4/fb/fbimage.c 2016-07-15 16:18:03.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/fb/fbimage.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,8 +63,8 @@ fbReplicatePixel(i, pDrawable->bitsPerPixel), pGC->alu, TRUE, x, y, w, h, src, srcStride, leftPad); - src += srcStride * h; } + src += srcStride * h; } break; case ZPixmap: diff -Nru xorg-server-hwe-16.04-1.18.4/fb/Makefile.in xorg-server-hwe-16.04-1.19.3/fb/Makefile.in --- xorg-server-hwe-16.04-1.18.4/fb/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/fb/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -92,9 +92,10 @@ subdir = fb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -416,6 +417,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -446,7 +450,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -541,6 +548,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor.c xorg-server-hwe-16.04-1.19.3/glamor/glamor.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor.c 2016-07-19 17:14:58.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor.c 2017-03-15 18:05:25.000000000 +0000 @@ -110,7 +110,6 @@ ErrorF("XXX fail to create fbo.\n"); return; } - fbo->external = TRUE; glamor_pixmap_attach_fbo(pixmap, fbo); } @@ -238,21 +237,13 @@ return pixmap; } -void -glamor_destroy_textured_pixmap(PixmapPtr pixmap) +Bool +glamor_destroy_pixmap(PixmapPtr pixmap) { if (pixmap->refcnt == 1) { -#if GLAMOR_HAS_GBM - glamor_egl_destroy_pixmap_image(pixmap); -#endif glamor_pixmap_destroy_fbo(pixmap); } -} -Bool -glamor_destroy_pixmap(PixmapPtr pixmap) -{ - glamor_destroy_textured_pixmap(pixmap); return fbDestroyPixmap(pixmap); } @@ -262,23 +253,21 @@ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); - glamor_priv->tick++; glFlush(); - glamor_fbo_expire(glamor_priv); } static void -_glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask) +_glamor_block_handler(ScreenPtr screen, void *timeout) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + glamor_make_current(glamor_priv); + glFlush(); + screen->BlockHandler = glamor_priv->saved_procs.block_handler; - screen->BlockHandler(screen, timeout, readmask); + screen->BlockHandler(screen, timeout); glamor_priv->saved_procs.block_handler = screen->BlockHandler; screen->BlockHandler = _glamor_block_handler; - - glamor_make_current(glamor_priv); - glFlush(); } static void @@ -481,7 +470,7 @@ LogMessage(X_WARNING, "glamor%d: Failed to allocate screen private\n", screen->myNum); - goto fail; + goto free_glamor_private; } glamor_set_screen_private(screen, glamor_priv); @@ -491,7 +480,7 @@ LogMessage(X_WARNING, "glamor%d: Failed to allocate pixmap private\n", screen->myNum); - goto fail; + goto free_glamor_private; } if (!dixRegisterPrivateKey(&glamor_gc_private_key, PRIVATE_GC, @@ -499,12 +488,15 @@ LogMessage(X_WARNING, "glamor%d: Failed to allocate gc private\n", screen->myNum); - goto fail; + goto free_glamor_private; } glamor_priv->saved_procs.close_screen = screen->CloseScreen; screen->CloseScreen = glamor_close_screen; + glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_destroy_pixmap; + /* If we are using egl screen, call egl screen init to * register correct close screen function. */ if (flags & GLAMOR_USE_EGL_SCREEN) { @@ -523,6 +515,10 @@ gl_version = epoxy_gl_version(); + /* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */ + glamor_priv->is_core_profile = + gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + shading_version_string = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION); if (!shading_version_string) { @@ -577,6 +573,12 @@ goto fail; } + if (!glamor_priv->is_core_profile && + !epoxy_has_gl_extension("GL_ARB_texture_border_clamp")) { + ErrorF("GL_ARB_texture_border_clamp required\n"); + goto fail; + } + if (!glamor_check_instruction_count(gl_version)) goto fail; } else { @@ -589,6 +591,11 @@ ErrorF("GL_EXT_texture_format_BGRA8888 required\n"); goto fail; } + + if (!epoxy_has_gl_extension("GL_OES_texture_border_clamp")) { + ErrorF("GL_OES_texture_border_clamp required\n"); + goto fail; + } } glamor_priv->has_rw_pbo = FALSE; @@ -620,9 +627,7 @@ glamor_priv->has_dual_blend = epoxy_has_gl_extension("GL_ARB_blend_func_extended"); - /* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */ - glamor_priv->is_core_profile = - gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + glamor_priv->can_copyplane = (gl_version >= 30); glamor_setup_debug_output(screen); @@ -646,9 +651,15 @@ glamor_priv->max_fbo_size = MAX_FBO_SIZE; #endif + glamor_priv->has_texture_swizzle = + (epoxy_has_gl_extension("GL_ARB_texture_swizzle") || + (glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && gl_version >= 30)); + glamor_priv->one_channel_format = GL_ALPHA; - if (epoxy_has_gl_extension("GL_ARB_texture_rg") && epoxy_has_gl_extension("GL_ARB_texture_swizzle")) + if (epoxy_has_gl_extension("GL_ARB_texture_rg") && + glamor_priv->has_texture_swizzle) { glamor_priv->one_channel_format = GL_RED; + } glamor_set_debug_level(&glamor_debug_level); @@ -673,9 +684,6 @@ glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap; screen->CreatePixmap = glamor_create_pixmap; - glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap; - screen->DestroyPixmap = glamor_destroy_pixmap; - glamor_priv->saved_procs.get_spans = screen->GetSpans; screen->GetSpans = glamor_get_spans; @@ -711,8 +719,6 @@ ps->Glyphs = glamor_composite_glyphs; glamor_init_vbo(screen); - glamor_init_pixmap_fbo(screen); - glamor_init_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); @@ -725,6 +731,11 @@ return TRUE; fail: + /* Restore default CloseScreen and DestroyPixmap handlers */ + screen->CloseScreen = glamor_priv->saved_procs.close_screen; + screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap; + + free_glamor_private: free(glamor_priv); glamor_set_screen_private(screen, NULL); return FALSE; @@ -737,7 +748,6 @@ glamor_priv = glamor_get_screen_private(screen); glamor_fini_vbo(screen); - glamor_fini_pixmap_fbo(screen); glamor_pixmap_fini(screen); free(glamor_priv); @@ -829,15 +839,31 @@ return -1; } +_X_EXPORT int +glamor_shareable_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +{ + unsigned orig_usage_hint = pixmap->usage_hint; + int ret; + + /* + * The actual difference between a sharable and non sharable buffer + * is decided 4 call levels deep in glamor_make_pixmap_exportable() + * based on pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED + * 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; + + return ret; +} + int glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { 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; switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_composite_glyphs.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_composite_glyphs.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_composite_glyphs.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_composite_glyphs.c 2017-03-15 18:05:25.000000000 +0000 @@ -199,7 +199,8 @@ .vs_vars = ("attribute vec2 primitive;\n" "attribute vec2 source;\n" "varying vec2 glyph_pos;\n"), - .vs_exec = (GLAMOR_POS(gl_Position, primitive) + .vs_exec = (" vec2 pos = vec2(0,0);\n" + GLAMOR_POS(gl_Position, primitive.xy) " glyph_pos = source.xy * ATLAS_DIM_INV;\n"), .fs_vars = ("varying vec2 glyph_pos;\n"), .fs_exec = (" vec4 mask = texture2D(atlas, glyph_pos);\n"), diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_copy.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_copy.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_copy.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_copy.c 2017-03-15 18:05:25.000000000 +0000 @@ -220,11 +220,39 @@ glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); - fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); + if (bitplane) { + PixmapPtr src_pix = fbCreatePixmap(screen, dst_pixmap->drawable.width, + dst_pixmap->drawable.height, + dst->depth, 0); + + if (!src_pix) { + glamor_finish_access(src); + goto bail; + } + + src_pix->drawable.x = -dst->x; + src_pix->drawable.y = -dst->y; - glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, - dst_xoff, dst_yoff, - (uint8_t *) src_bits, src_stride * sizeof (FbBits)); + fbGetDrawable(&src_pix->drawable, src_bits, src_stride, src_bpp, src_xoff, + src_yoff); + + if (src->bitsPerPixel > 1) + fbCopyNto1(src, &src_pix->drawable, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + else + fbCopy1toN(src, &src_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); + } else { + 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, + (uint8_t *) src_bits, src_stride * sizeof (FbBits)); + } glamor_finish_access(src); return TRUE; @@ -325,6 +353,9 @@ if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) goto bail_ctx; + if (bitplane && !glamor_priv->can_copyplane) + goto bail_ctx; + if (bitplane) { prog = &glamor_priv->copy_plane_prog; copy_facet = &glamor_facet_copyplane; @@ -616,9 +647,9 @@ return glamor_copy_fbo_fbo_draw(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } - if (bitplane == 0) - return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, - reverse, upsidedown, bitplane, closure); + + return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); } else if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv) && dst_priv->type != GLAMOR_DRM_ONLY && bitplane == 0) { diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_core.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_core.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_core.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_core.c 2017-03-15 18:05:25.000000000 +0000 @@ -113,174 +113,6 @@ } } -/* - * When downloading a unsupported color format to CPU memory, - we need to shuffle the color elements and then use a supported - color format to read it back to CPU memory. - - For an example, the picture's format is PICT_b8g8r8a8, - Then the expecting color layout is as below (little endian): - 0 1 2 3 : address - a r g b - - Now the in GLES2 the supported color format is GL_RGBA, type is - GL_UNSIGNED_TYPE, then we need to shuffle the fragment - color as : - frag_color = sample(texture).argb; - before we use glReadPixel to get it back. - - For the uploading process, the shuffle is a revert shuffle. - We still use GL_RGBA, GL_UNSIGNED_BYTE to upload the color - to a texture, then let's see - 0 1 2 3 : address - a r g b : correct colors - R G B A : GL_RGBA with GL_UNSIGNED_BYTE - - Now we need to shuffle again, the mapping rule is - r = G, g = B, b = A, a = R. Then the uploading shuffle is as - below: - frag_color = sample(texture).gbar; -*/ - -void -glamor_init_finish_access_shaders(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - const char *vs_source = - "attribute vec4 v_position;\n" - "attribute vec4 v_texcoord0;\n" - "varying vec2 source_texture;\n" - "void main()\n" - "{\n" - " gl_Position = v_position;\n" - " source_texture = v_texcoord0.xy;\n" - "}\n"; - - const char *common_source = - GLAMOR_DEFAULT_PRECISION - "varying vec2 source_texture;\n" - "uniform sampler2D sampler;\n" - "uniform int revert;\n" - "uniform int swap_rb;\n" - "#define REVERT_NONE 0\n" - "#define REVERT_NORMAL 1\n" - "#define SWAP_NONE_DOWNLOADING 0\n" - "#define SWAP_DOWNLOADING 1\n" - "#define SWAP_UPLOADING 2\n" - "#define SWAP_NONE_UPLOADING 3\n"; - - const char *fs_source = - "void main()\n" - "{\n" - " vec4 color = texture2D(sampler, source_texture);\n" - " if (revert == REVERT_NONE) \n" - " { \n" - " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" - " gl_FragColor = color.bgra;\n" - " else \n" - " gl_FragColor = color.rgba;\n" - " } \n" - " else \n" - " { \n" - " if (swap_rb == SWAP_DOWNLOADING) \n" - " gl_FragColor = color.argb;\n" - " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" - " gl_FragColor = color.abgr;\n" - " else if (swap_rb == SWAP_UPLOADING)\n" - " gl_FragColor = color.gbar;\n" - " else if (swap_rb == SWAP_NONE_UPLOADING)\n" - " gl_FragColor = color.abgr;\n" - " } \n" - "}\n"; - - const char *set_alpha_source = - "void main()\n" - "{\n" - " vec4 color = texture2D(sampler, source_texture);\n" - " if (revert == REVERT_NONE) \n" - " { \n" - " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" - " gl_FragColor = vec4(color.bgr, 1);\n" - " else \n" - " gl_FragColor = vec4(color.rgb, 1);\n" - " } \n" - " else \n" - " { \n" - " if (swap_rb == SWAP_DOWNLOADING) \n" - " gl_FragColor = vec4(1, color.rgb);\n" - " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" - " gl_FragColor = vec4(1, color.bgr);\n" - " else if (swap_rb == SWAP_UPLOADING)\n" - " gl_FragColor = vec4(color.gba, 1);\n" - " else if (swap_rb == SWAP_NONE_UPLOADING)\n" - " gl_FragColor = vec4(color.abg, 1);\n" - " } \n" - "}\n"; - GLint fs_prog, vs_prog, avs_prog, set_alpha_prog; - GLint sampler_uniform_location; - char *source; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glamor_priv->finish_access_prog[0] = glCreateProgram(); - glamor_priv->finish_access_prog[1] = glCreateProgram(); - - vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); - - XNFasprintf(&source, "%s%s", common_source, fs_source); - fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source); - free(source); - - glAttachShader(glamor_priv->finish_access_prog[0], vs_prog); - glAttachShader(glamor_priv->finish_access_prog[0], fs_prog); - - avs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); - - XNFasprintf(&source, "%s%s", common_source, set_alpha_source); - set_alpha_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, - source); - free(source); - - glAttachShader(glamor_priv->finish_access_prog[1], avs_prog); - glAttachShader(glamor_priv->finish_access_prog[1], set_alpha_prog); - - glBindAttribLocation(glamor_priv->finish_access_prog[0], - GLAMOR_VERTEX_POS, "v_position"); - glBindAttribLocation(glamor_priv->finish_access_prog[0], - GLAMOR_VERTEX_SOURCE, "v_texcoord0"); - glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[0], - "finish access 0"); - - glBindAttribLocation(glamor_priv->finish_access_prog[1], - GLAMOR_VERTEX_POS, "v_position"); - glBindAttribLocation(glamor_priv->finish_access_prog[1], - GLAMOR_VERTEX_SOURCE, "v_texcoord0"); - glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[1], - "finish access 1"); - - glamor_priv->finish_access_revert[0] = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "revert"); - - glamor_priv->finish_access_swap_rb[0] = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "swap_rb"); - sampler_uniform_location = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "sampler"); - glUseProgram(glamor_priv->finish_access_prog[0]); - glUniform1i(sampler_uniform_location, 0); - glUniform1i(glamor_priv->finish_access_revert[0], 0); - glUniform1i(glamor_priv->finish_access_swap_rb[0], 0); - - glamor_priv->finish_access_revert[1] = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "revert"); - glamor_priv->finish_access_swap_rb[1] = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "swap_rb"); - sampler_uniform_location = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "sampler"); - glUseProgram(glamor_priv->finish_access_prog[1]); - glUniform1i(glamor_priv->finish_access_revert[1], 0); - glUniform1i(sampler_uniform_location, 0); - glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); -} static GCOps glamor_gc_ops = { .FillSpans = glamor_fill_spans, diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_dash.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_dash.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_dash.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_dash.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,6 +32,7 @@ static const char dash_vs_exec[] = " dash_offset = primitive.z / dash_length;\n" + " vec2 pos = vec2(0,0);\n" GLAMOR_POS(gl_Position, primitive.xy); static const char dash_fs_vars[] = diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl.c 2017-03-15 18:05:25.000000000 +0000 @@ -43,9 +43,7 @@ #include #endif -#define MESA_EGL_NO_X11_HEADERS -#include -#include +#include "glamor_egl.h" #include "glamor.h" #include "glamor_priv.h" @@ -78,6 +76,7 @@ int dri3_capable; CloseScreenProcPtr saved_close_screen; + DestroyPixmapProcPtr saved_destroy_pixmap; xf86FreeScreenProc *saved_free_screen; }; @@ -174,7 +173,7 @@ return TRUE; } -void * +struct gbm_device * glamor_egl_get_gbm_device(ScreenPtr screen) { #ifdef GLAMOR_HAS_GBM @@ -186,49 +185,6 @@ #endif } -unsigned int -glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h, Bool linear) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl; - EGLImageKHR image; - GLuint texture; - -#ifdef GLAMOR_HAS_GBM - struct gbm_bo *bo; - EGLNativePixmapType native_pixmap; - - glamor_egl = glamor_egl_get_screen_private(scrn); - bo = gbm_bo_create(glamor_egl->gbm, w, h, GBM_FORMAT_ARGB8888, -#ifdef GLAMOR_HAS_GBM_LINEAR - (linear ? GBM_BO_USE_LINEAR : 0) | -#endif - GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); - if (!bo) - return 0; - - /* If the following assignment raises an error or a warning - * then that means EGLNativePixmapType is not struct gbm_bo * - * on your platform: This code won't work and you should not - * compile with dri3 support enabled */ - native_pixmap = bo; - - image = eglCreateImageKHR(glamor_egl->display, - EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, - native_pixmap, NULL); - gbm_bo_destroy(bo); - if (image == EGL_NO_IMAGE_KHR) - return 0; - glamor_create_texture_from_image(screen, image, &texture); - eglDestroyImageKHR(glamor_egl->display, image); - - return texture; -#else - return 0; /* this path should never happen */ -#endif -} - Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) { @@ -334,7 +290,8 @@ } Bool -glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) +glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, + struct gbm_bo *bo) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -367,24 +324,7 @@ } #ifdef GLAMOR_HAS_GBM -int glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd); -void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name); -int -glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd) -{ - union gbm_bo_handle handle; - struct drm_prime_handle args; - - handle = gbm_bo_get_handle(bo); - args.handle = handle.u32; - args.flags = DRM_CLOEXEC; - if (ioctl(gbm_fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args)) - return FALSE; - *fd = args.fd; - return TRUE; -} - -void +static void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) { union gbm_bo_handle handle; @@ -468,7 +408,7 @@ #endif } -void * +struct gbm_bo * glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) { struct glamor_egl_screen_private *glamor_egl = @@ -507,8 +447,7 @@ glamor_get_name_from_bo(glamor_egl->fd, bo, &fd); } else { - if (glamor_get_fd_from_bo(glamor_egl->fd, bo, &fd)) { - } + fd = gbm_bo_get_fd(bo); } *stride = pixmap->devKind; *size = pixmap->devKind * gbm_bo_get_height(bo); @@ -587,20 +526,29 @@ #endif } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) +static Bool +glamor_egl_destroy_pixmap(PixmapPtr pixmap) { - struct glamor_pixmap_private *pixmap_priv = - glamor_get_pixmap_private(pixmap); - - if (pixmap_priv->image) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); - struct glamor_egl_screen_private *glamor_egl = - glamor_egl_get_screen_private(scrn); + ScreenPtr screen = pixmap->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + struct glamor_egl_screen_private *glamor_egl = + glamor_egl_get_screen_private(scrn); + Bool ret; - eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); - pixmap_priv->image = NULL; + if (pixmap->refcnt == 1) { + struct glamor_pixmap_private *pixmap_priv = + glamor_get_pixmap_private(pixmap); + + if (pixmap_priv->image) + eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); } + + screen->DestroyPixmap = glamor_egl->saved_destroy_pixmap; + ret = screen->DestroyPixmap(pixmap); + glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_egl_destroy_pixmap; + + return ret; } _X_EXPORT void @@ -622,12 +570,6 @@ glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); } -void -glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) -{ - glamor_destroy_textured_pixmap(pixmap); -} - static Bool glamor_egl_close_screen(ScreenPtr screen) { @@ -718,6 +660,9 @@ glamor_egl->saved_close_screen = screen->CloseScreen; screen->CloseScreen = glamor_egl_close_screen; + glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_egl_destroy_pixmap; + glamor_ctx->ctx = glamor_egl->context; glamor_ctx->display = glamor_egl->display; @@ -756,6 +701,11 @@ if (glamor_egl->display != EGL_NO_DISPLAY) { eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + /* + * Force the next glamor_make_current call to update the context + * (on hot unplug another GPU may still be using glamor) + */ + lastGLContext = NULL; eglTerminate(glamor_egl->display); } #ifdef GLAMOR_HAS_GBM @@ -816,7 +766,13 @@ ErrorF("couldn't get display device\n"); goto error; } - glamor_egl->display = eglGetDisplay(glamor_egl->gbm); + + glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, + glamor_egl->gbm); + if (!glamor_egl->display) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n"); + goto error; + } #else glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); #endif @@ -884,6 +840,11 @@ "Failed to make EGL context current\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_egl_extension(glamor_egl->display, "EGL_KHR_gl_texture_2D_image") && diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl.h xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl.h --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright © 2016 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: + * Adam Jackson + */ + +#ifndef GLAMOR_EGL_H +#define GLAMOR_EGL_H + +#define MESA_EGL_NO_X11_HEADERS +#include +#include + +/* + * Create an EGLDisplay from a native display type. This is a little quirky + * for a few reasons. + * + * 1: GetPlatformDisplayEXT and GetPlatformDisplay are the API you want to + * use, but have different function signatures in the third argument; this + * happens not to matter for us, at the moment, but it means epoxy won't alias + * them together. + * + * 2: epoxy 1.3 and earlier don't understand EGL client extensions, which + * means you can't call "eglGetPlatformDisplayEXT" directly, as the resolver + * will crash. + * + * 3: You can't tell whether you have EGL 1.5 at this point, because + * eglQueryString(EGL_VERSION) is a property of the display, which we don't + * have yet. So you have to query for extensions no matter what. Fortunately + * epoxy_has_egl_extension _does_ let you query for client extensions, so + * we don't have to write our own extension string parsing. + * + * 4. There is no EGL_KHR_platform_base to complement the EXT one, thus one + * needs to know EGL 1.5 is supported in order to use the eglGetPlatformDisplay + * function pointer. + * We can workaround this (circular dependency) by probing for the EGL 1.5 + * platform extensions (EGL_KHR_platform_gbm and friends) yet it doesn't seem + * like mesa will be able to adverise these (even though it can do EGL 1.5). + */ +static inline EGLDisplay +glamor_egl_get_display(EGLint type, void *native) +{ + /* In practise any EGL 1.5 implementation would support the EXT extension */ + if (epoxy_has_egl_extension(NULL, "EGL_EXT_platform_base")) { + PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT = + (void *) eglGetProcAddress("eglGetPlatformDisplayEXT"); + if (getPlatformDisplayEXT) + return getPlatformDisplayEXT(type, native, NULL); + } + + /* Welp, everything is awful. */ + return eglGetDisplay(native); +} + +#endif diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl_stubs.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl_stubs.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_egl_stubs.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_egl_stubs.c 2017-03-15 18:05:25.000000000 +0000 @@ -35,11 +35,6 @@ { } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) -{ -} - int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_fbo.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_fbo.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_fbo.c 2016-07-19 17:14:58.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_fbo.c 2017-03-15 18:05:25.000000000 +0000 @@ -30,107 +30,9 @@ #include "glamor_priv.h" -#define GLAMOR_CACHE_EXPIRE_MAX 100 - -#define GLAMOR_CACHE_DEFAULT 0 -#define GLAMOR_CACHE_EXACT_SIZE 1 - -//#define NO_FBO_CACHE 1 -#define FBO_CACHE_THRESHOLD (256*1024*1024) - -/* Loop from the tail to the head. */ -#define xorg_list_for_each_entry_reverse(pos, head, member) \ - for (pos = __container_of((head)->prev, pos, member); \ - &pos->member != (head); \ - pos = __container_of(pos->member.prev, pos, member)) - -#define xorg_list_for_each_entry_safe_reverse(pos, tmp, head, member) \ - for (pos = __container_of((head)->prev, pos, member), \ - tmp = __container_of(pos->member.prev, pos, member); \ - &pos->member != (head); \ - pos = tmp, tmp = __container_of(pos->member.prev, tmp, member)) - -inline static int -cache_wbucket(int size) -{ - int order = __fls(size / 32); - - if (order >= CACHE_BUCKET_WCOUNT) - order = CACHE_BUCKET_WCOUNT - 1; - return order; -} - -inline static int -cache_hbucket(int size) -{ - int order = __fls(size / 32); - - if (order >= CACHE_BUCKET_HCOUNT) - order = CACHE_BUCKET_HCOUNT - 1; - return order; -} - -static int -cache_format(GLenum format) -{ - switch (format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_RED: - return 2; - case GL_RGB: - return 1; - case GL_RGBA: - return 0; - default: - return -1; - } -} - -static glamor_pixmap_fbo * -glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, - int w, int h, GLenum format) -{ - struct xorg_list *cache; - glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL; - int n_format; - -#ifdef NO_FBO_CACHE - return NULL; -#else - n_format = cache_format(format); - if (n_format == -1) - return NULL; - cache = &glamor_priv->fbo_cache[n_format] - [cache_wbucket(w)] - [cache_hbucket(h)]; - - xorg_list_for_each_entry(fbo_entry, cache, list) { - if (fbo_entry->width == w && fbo_entry->height == h) { - - DEBUGF("Request w %d h %d format %x \n", w, h, format); - DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n", - fbo_entry, fbo_entry->width, fbo_entry->height, - fbo_entry->fb, fbo_entry->tex, fbo_entry->format); - assert(format == fbo_entry->format); - xorg_list_del(&fbo_entry->list); - ret_fbo = fbo_entry; - break; - } - } - - if (ret_fbo) - glamor_priv->fbo_cache_watermark -= ret_fbo->width * ret_fbo->height; - - assert(glamor_priv->fbo_cache_watermark >= 0); - - return ret_fbo; -#endif -} - -static void -glamor_purge_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) +void +glamor_destroy_fbo(glamor_screen_private *glamor_priv, + glamor_pixmap_fbo *fbo) { glamor_make_current(glamor_priv); @@ -142,40 +44,6 @@ free(fbo); } -static void -glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) -{ - struct xorg_list *cache; - int n_format; - -#ifdef NO_FBO_CACHE - glamor_purge_fbo(fbo); - return; -#else - n_format = cache_format(fbo->format); - - if (fbo->fb == 0 || fbo->external || n_format == -1 - || glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) { - glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX; - glamor_fbo_expire(glamor_priv); - glamor_purge_fbo(glamor_priv, fbo); - return; - } - - cache = &glamor_priv->fbo_cache[n_format] - [cache_wbucket(fbo->width)] - [cache_hbucket(fbo->height)]; - DEBUGF - ("Put cache entry %p to cache %p w %d h %d format %x fbo %d tex %d \n", - fbo, cache, fbo->width, fbo->height, fbo->format, fbo->fb, fbo->tex); - - glamor_priv->fbo_cache_watermark += fbo->width * fbo->height; - xorg_list_add(&fbo->list, cache); - fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX; -#endif -} - static int glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo) @@ -235,20 +103,14 @@ if (fbo == NULL) return NULL; - xorg_list_init(&fbo->list); - fbo->tex = tex; fbo->width = w; fbo->height = h; - fbo->external = FALSE; fbo->format = format; - if (flag == CREATE_PIXMAP_USAGE_SHARED) - fbo->external = TRUE; - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) { - glamor_purge_fbo(glamor_priv, fbo); + glamor_destroy_fbo(glamor_priv, fbo); fbo = NULL; } } @@ -256,79 +118,6 @@ return fbo; } -void -glamor_fbo_expire(glamor_screen_private *glamor_priv) -{ - struct xorg_list *cache; - glamor_pixmap_fbo *fbo_entry, *tmp; - int i, j, k; - - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - cache = &glamor_priv->fbo_cache[i][j][k]; - xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, - list) { - if (GLAMOR_TICK_AFTER(fbo_entry->expire, glamor_priv->tick)) { - break; - } - - glamor_priv->fbo_cache_watermark -= - fbo_entry->width * fbo_entry->height; - xorg_list_del(&fbo_entry->list); - DEBUGF("cache %p fbo %p expired %d current %d \n", cache, - fbo_entry, fbo_entry->expire, glamor_priv->tick); - glamor_purge_fbo(glamor_priv, fbo_entry); - } - } - -} - -void -glamor_init_pixmap_fbo(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - int i, j, k; - - glamor_priv = glamor_get_screen_private(screen); - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - xorg_list_init(&glamor_priv->fbo_cache[i][j][k]); - } - glamor_priv->fbo_cache_watermark = 0; -} - -void -glamor_fini_pixmap_fbo(ScreenPtr screen) -{ - struct xorg_list *cache; - glamor_screen_private *glamor_priv; - glamor_pixmap_fbo *fbo_entry, *tmp; - int i, j, k; - - glamor_priv = glamor_get_screen_private(screen); - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - cache = &glamor_priv->fbo_cache[i][j][k]; - xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, - list) { - xorg_list_del(&fbo_entry->list); - glamor_purge_fbo(glamor_priv, fbo_entry); - } - } -} - -void -glamor_destroy_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) -{ - xorg_list_del(&fbo->list); - glamor_pixmap_fbo_cache_put(glamor_priv, fbo); - -} - static int _glamor_create_tex(glamor_screen_private *glamor_priv, int w, int h, GLenum format) @@ -366,22 +155,8 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag) { - glamor_pixmap_fbo *fbo; - GLint tex = 0; - - if (flag == GLAMOR_CREATE_FBO_NO_FBO || flag == CREATE_PIXMAP_USAGE_SHARED) - goto new_fbo; - - fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format); - if (fbo) - return fbo; - new_fbo: - tex = _glamor_create_tex(glamor_priv, w, h, format); - if (!tex) - return NULL; - fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); - - return fbo; + GLint tex = _glamor_create_tex(glamor_priv, w, h, format); + return glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); } /** @@ -510,6 +285,7 @@ for (i = 0; i < priv->block_wcnt * priv->block_hcnt; i++) glamor_destroy_fbo(glamor_priv, priv->fbo_array[i]); free(priv->fbo_array); + priv->fbo_array = NULL; } else { fbo = glamor_pixmap_detach_fbo(priv); diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_font.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_font.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_font.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_font.c 2017-03-15 18:05:25.000000000 +0000 @@ -55,7 +55,7 @@ privates = calloc(glamor_font_screen_count, sizeof (glamor_font_t)); if (!privates) return NULL; - FontSetPrivate(font, glamor_font_private_index, privates); + xfont2_font_set_private(font, glamor_font_private_index, privates); } glamor_font = &privates[screen->myNum]; @@ -201,7 +201,7 @@ return TRUE; free(privates); - FontSetPrivate(font, glamor_font_private_index, NULL); + xfont2_font_set_private(font, glamor_font_private_index, NULL); return TRUE; } @@ -214,7 +214,7 @@ return TRUE; if (glamor_font_generation != serverGeneration) { - glamor_font_private_index = AllocateFontPrivateIndex(); + glamor_font_private_index = xfont2_allocate_font_private_index(); if (glamor_font_private_index == -1) return FALSE; glamor_font_screen_count = 0; diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_gradient.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_gradient.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_gradient.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_gradient.c 2017-03-15 18:05:25.000000000 +0000 @@ -603,7 +603,7 @@ * So, to get the correct v_s, we need to cacula1 the matrix: (A*T*inv(A)), and * we name this matrix T_s. * - * Firstly, because A is for the scale convertion, we find + * Firstly, because A is for the scale conversion, we find * -- -- * |1/w 0 0 | * A = | 0 1/h 0 | @@ -884,7 +884,7 @@ stops_count = src_picture->pSourcePict->radial.nstops + 2; - /* Because the max value of nstops is unkown, so create a program + /* Because the max value of nstops is unknown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= RADIAL_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][0]; @@ -1193,7 +1193,7 @@ stops_count = src_picture->pSourcePict->linear.nstops + 2; - /* Because the max value of nstops is unkown, so create a program + /* Because the max value of nstops is unknown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= LINEAR_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][0]; @@ -1403,7 +1403,7 @@ } else { /* The slope need to compute here. In shader, the viewport set will change - the orginal slope and the slope which is vertical to it will not be correct. */ + the original slope and the slope which is vertical to it will not be correct. */ slope = -(float) (src_picture->pSourcePict->linear.p2.x - src_picture->pSourcePict->linear.p1.x) / (float) (src_picture->pSourcePict->linear.p2.y diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor.h xorg-server-hwe-16.04-1.19.3/glamor/glamor.h --- xorg-server-hwe-16.04-1.18.4/glamor/glamor.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor.h 2017-03-15 18:05:25.000000000 +0000 @@ -40,6 +40,8 @@ #endif struct glamor_context; +struct gbm_bo; +struct gbm_device; /* * glamor_pixmap_type : glamor pixmap's type. @@ -114,7 +116,6 @@ extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type); -extern _X_EXPORT void glamor_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, @@ -143,18 +144,11 @@ /* The DDX is not supposed to call these three functions */ extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen); -extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr - screen, - int w, - int h, - Bool linear); extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, unsigned int, Bool, CARD16 *, CARD32 *); -extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap); - -extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen); +extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen); /* @glamor_supports_pixmap_import_export: Returns whether * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and @@ -187,6 +181,26 @@ PixmapPtr pixmap, CARD16 *stride, CARD32 *size); +/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing + * with other GPUs from a pixmap. + * + * @screen: Current screen pointer. + * @pixmap: The pixmap from which we want the fd. + * @stride, @size: Pointers to fill the stride and size of the + * buffer associated to the fd. + * + * The returned fd will point to a buffer which is suitable for sharing + * across GPUs (not using GPU specific tiling). + * The pixmap and the buffer associated by the fd will share the same + * content. + * The pixmap's stride may be modified by this function. + * Returns the fd on success, -1 on error. + * */ +extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, + CARD32 *size); + /** * @glamor_name_from_pixmap: Gets a gem name from a pixmap. * @@ -214,8 +228,8 @@ * * Returns the gbm_bo on success, NULL on error. * */ -extern _X_EXPORT void *glamor_gbm_bo_from_pixmap(ScreenPtr screen, - PixmapPtr pixmap); +extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap); /* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd. * @@ -322,13 +336,13 @@ * This function is similar to glamor_egl_create_textured_pixmap. */ extern _X_EXPORT Bool - glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo); + glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, + struct gbm_bo *bo); #endif extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx); -extern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT int glamor_create_gc(GCPtr gc); diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_largepixmap.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_largepixmap.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_largepixmap.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_largepixmap.c 2017-03-15 18:05:25.000000000 +0000 @@ -1259,7 +1259,7 @@ is_normal_mask_fbo = 1; } else { - /* This mask region has transform or repeatpad, we need clip it agains the previous + /* This mask region has transform or repeatpad, we need clip it against the previous * valid region rather than the mask region. */ if (!is_normal_source_fbo) clipped_mask_regions = diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_picture.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_picture.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_picture.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_picture.c 2017-03-15 18:05:25.000000000 +0000 @@ -1,4 +1,5 @@ /* + * Copyright © 2016 Broadcom * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * @@ -20,10 +21,19 @@ * 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. + */ + +/** + * @file glamor_picture.c * - * Authors: - * Zhigang Gong + * Implements temporary uploads of GL_MEMORY Pixmaps to a texture that + * is swizzled appropriately for a given Render picture format. + * laid * * + * This is important because GTK likes to use SHM Pixmaps for Render + * blending operations, and we don't want a blend operation to fall + * back to software (readback is more expensive than the upload we do + * here, and you'd have to re-upload the fallback output anyway). */ #include @@ -31,341 +41,218 @@ #include "glamor_priv.h" #include "mipict.h" -/* - * Map picture's format to the correct gl texture format and type. - * no_alpha is used to indicate whehter we need to wire alpha to 1. - * - * Although opengl support A1/GL_BITMAP, we still don't use it - * here, it seems that mesa has bugs when uploading a A1 bitmap. - * - * Return 0 if find a matched texture type. Otherwise return -1. - **/ -static int -glamor_get_tex_format_type_from_pictformat_gl(ScreenPtr pScreen, - PictFormatShort format, - GLenum *tex_format, - GLenum *tex_type, - int *no_alpha, - int *revert, - int *swap_rb, int is_upload) +static void byte_swap_swizzle(GLenum *swizzle) { - glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); - *no_alpha = 0; - *revert = REVERT_NONE; - *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; - switch (format) { - case PICT_a1: - *tex_format = glamor_priv->one_channel_format; - *tex_type = GL_UNSIGNED_BYTE; - *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; - break; - case PICT_b8g8r8x8: - *no_alpha = 1; - case PICT_b8g8r8a8: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8; - break; - - case PICT_x8r8g8b8: - *no_alpha = 1; - case PICT_a8r8g8b8: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; - break; - case PICT_x8b8g8r8: - *no_alpha = 1; - case PICT_a8b8g8r8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; - break; - case PICT_x2r10g10b10: - *no_alpha = 1; - case PICT_a2r10g10b10: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; - break; - case PICT_x2b10g10r10: - *no_alpha = 1; - case PICT_a2b10g10r10: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; - break; - - case PICT_r5g6b5: - *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5; - break; - case PICT_b5g6r5: - *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; - break; - case PICT_x1b5g5r5: - *no_alpha = 1; - case PICT_a1b5g5r5: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; + GLenum temp; - case PICT_x1r5g5b5: - *no_alpha = 1; - case PICT_a1r5g5b5: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case PICT_a8: - *tex_format = glamor_priv->one_channel_format; - *tex_type = GL_UNSIGNED_BYTE; - break; - case PICT_x4r4g4b4: - *no_alpha = 1; - case PICT_a4r4g4b4: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - break; - - case PICT_x4b4g4r4: - *no_alpha = 1; - case PICT_a4b4g4r4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - break; + temp = swizzle[0]; + swizzle[0] = swizzle[3]; + swizzle[3] = temp; - default: - return -1; - } - return 0; + temp = swizzle[1]; + swizzle[1] = swizzle[2]; + swizzle[2] = temp; } -#define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst) - -static int -glamor_get_tex_format_type_from_pictformat_gles2(ScreenPtr pScreen, - PictFormatShort format, - GLenum *tex_format, - GLenum *tex_type, - int *no_alpha, - int *revert, - int *swap_rb, int is_upload) +/** + * Returns the GL format and type for uploading our bits to a given PictFormat. + * + * We may need to tell the caller to translate the bits to another + * format, as in PICT_a1 (which GL doesn't support). We may also need + * to tell the GL to swizzle the texture on sampling, because GLES3 + * doesn't support the GL_UNSIGNED_INT_8_8_8_8{,_REV} types, so we + * don't have enough channel reordering options at upload time without + * it. + */ +static Bool +glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, + PictFormatShort format, + PictFormatShort *temp_format, + GLenum *tex_format, + GLenum *tex_type, + GLenum *swizzle) { glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); - int need_swap_rb = 0; + Bool is_little_endian = IMAGE_BYTE_ORDER == LSBFirst; - *no_alpha = 0; - *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; + *temp_format = format; + swizzle[0] = GL_RED; + swizzle[1] = GL_GREEN; + swizzle[2] = GL_BLUE; + swizzle[3] = GL_ALPHA; switch (format) { + case PICT_a1: + *tex_format = glamor_priv->one_channel_format; + *tex_type = GL_UNSIGNED_BYTE; + *temp_format = PICT_a8; + break; + case PICT_b8g8r8x8: - *no_alpha = 1; case PICT_b8g8r8a8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - need_swap_rb = 1; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_8_8_8_8; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + swizzle[0] = GL_GREEN; + swizzle[1] = GL_BLUE; + swizzle[2] = GL_ALPHA; + swizzle[3] = GL_RED; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + } break; case PICT_x8r8g8b8: - *no_alpha = 1; case PICT_a8r8g8b8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - need_swap_rb = 1; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + swizzle[0] = GL_BLUE; + swizzle[2] = GL_RED; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + break; + } break; case PICT_x8b8g8r8: - *no_alpha = 1; case PICT_a8b8g8r8: *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + } break; case PICT_x2r10g10b10: - *no_alpha = 1; case PICT_a2r10g10b10: - *tex_format = GL_RGBA; - /* glReadPixmap doesn't support GL_UNSIGNED_INT_10_10_10_2. - * we have to use GL_UNSIGNED_BYTE and do the conversion in - * shader latter.*/ - *tex_type = GL_UNSIGNED_BYTE; - if (is_upload == 1) { - if (!IS_LITTLE_ENDIAN) - *revert = REVERT_UPLOADING_10_10_10_2; - else - *revert = REVERT_UPLOADING_2_10_10_10; - } - else { - if (!IS_LITTLE_ENDIAN) { - *revert = REVERT_DOWNLOADING_10_10_10_2; - } - else { - *revert = REVERT_DOWNLOADING_2_10_10_10; - } + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + } else { + return FALSE; } - need_swap_rb = 1; - break; case PICT_x2b10g10r10: - *no_alpha = 1; case PICT_a2b10g10r10: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - if (is_upload == 1) { - if (!IS_LITTLE_ENDIAN) - *revert = REVERT_UPLOADING_10_10_10_2; - else - *revert = REVERT_UPLOADING_2_10_10_10; - } - else { - if (!IS_LITTLE_ENDIAN) { - *revert = REVERT_DOWNLOADING_10_10_10_2; - } - else { - *revert = REVERT_DOWNLOADING_2_10_10_10; - } + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + } else { + return FALSE; } break; case PICT_r5g6b5: *tex_format = GL_RGB; *tex_type = GL_UNSIGNED_SHORT_5_6_5; - *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; - break; - case PICT_b5g6r5: *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5; - need_swap_rb = IS_LITTLE_ENDIAN ? 1 : 0; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; + } else { + *tex_type = GL_UNSIGNED_SHORT_5_6_5; + swizzle[0] = GL_BLUE; + swizzle[2] = GL_RED; + } break; case PICT_x1b5g5r5: - *no_alpha = 1; case PICT_a1b5g5r5: *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; - if (IS_LITTLE_ENDIAN) { - *revert = - is_upload ? REVERT_UPLOADING_1_5_5_5 : - REVERT_DOWNLOADING_1_5_5_5; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + } else { + return FALSE; } - else - *revert = REVERT_NONE; break; case PICT_x1r5g5b5: - *no_alpha = 1; case PICT_a1r5g5b5: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; - if (IS_LITTLE_ENDIAN) { - *revert = - is_upload ? REVERT_UPLOADING_1_5_5_5 : - REVERT_DOWNLOADING_1_5_5_5; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + } else { + return FALSE; } - else - *revert = REVERT_NONE; - need_swap_rb = 1; - break; - - case PICT_a1: - *tex_format = glamor_priv->one_channel_format; - *tex_type = GL_UNSIGNED_BYTE; - *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; break; case PICT_a8: *tex_format = glamor_priv->one_channel_format; *tex_type = GL_UNSIGNED_BYTE; - *revert = REVERT_NONE; break; case PICT_x4r4g4b4: - *no_alpha = 1; case PICT_a4r4g4b4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; - need_swap_rb = 1; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; + } else { + /* XXX */ + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; + } break; case PICT_x4b4g4r4: - *no_alpha = 1; case PICT_a4b4g4r4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; + } else { + /* XXX */ + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; + } break; default: - LogMessageVerb(X_INFO, 0, - "fail to get matched format for %x \n", format); - return -1; + return FALSE; } - if (need_swap_rb) - *swap_rb = is_upload ? SWAP_UPLOADING : SWAP_DOWNLOADING; - else - *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; - return 0; -} - -static int -glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap, - PictFormatShort pict_format, - GLenum *format, - GLenum *type, - int *no_alpha, - int *revert, int *swap_rb, int is_upload) -{ - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); + if (!PICT_FORMAT_A(format)) + swizzle[3] = GL_ONE; - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - return glamor_get_tex_format_type_from_pictformat_gl(pixmap->drawable.pScreen, - pict_format, - format, type, - no_alpha, - revert, - swap_rb, - is_upload); - } else { - return glamor_get_tex_format_type_from_pictformat_gles2(pixmap->drawable.pScreen, - pict_format, - format, type, - no_alpha, - revert, - swap_rb, - is_upload); - } + return TRUE; } -static void * -_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, - int stride, int revert) +/** + * Takes a set of source bits with a given format and returns an + * in-memory pixman image of those bits in a destination format. + */ +static pixman_image_t * +glamor_get_converted_image(PictFormatShort dst_format, + PictFormatShort src_format, + void *src_bits, + int src_stride, + int w, int h) { - PictFormatShort dst_format, src_format; pixman_image_t *dst_image; pixman_image_t *src_image; - int src_stride; - - if (revert == REVERT_UPLOADING_A1) { - src_format = PICT_a1; - dst_format = PICT_a8; - src_stride = PixmapBytePad(w, 1); - } - else { - dst_format = PICT_a1; - src_format = PICT_a8; - src_stride = (((w * 8 + 7) / 8) + 3) & ~3; - } - dst_image = pixman_image_create_bits(dst_format, w, h, dst_bits, stride); + dst_image = pixman_image_create_bits(dst_format, w, h, NULL, 0); if (dst_image == NULL) { return NULL; } - src_image = pixman_image_create_bits(src_format, - w, h, src_bits, src_stride); + src_image = pixman_image_create_bits(src_format, w, h, src_bits, src_stride); if (src_image == NULL) { pixman_image_unref(dst_image); @@ -376,559 +263,113 @@ 0, 0, 0, 0, 0, 0, w, h); pixman_image_unref(src_image); - pixman_image_unref(dst_image); - return dst_bits; -} - -#define ADJUST_BITS(d, src_bits, dst_bits) (((dst_bits) == (src_bits)) ? (d) : \ - (((dst_bits) > (src_bits)) ? \ - (((d) << ((dst_bits) - (src_bits))) \ - + (( 1 << ((dst_bits) - (src_bits))) >> 1)) \ - : ((d) >> ((src_bits) - (dst_bits))))) - -#define GLAMOR_DO_CONVERT(src, dst, no_alpha, swap, \ - a_shift_src, a_bits_src, \ - b_shift_src, b_bits_src, \ - g_shift_src, g_bits_src, \ - r_shift_src, r_bits_src, \ - a_shift, a_bits, \ - b_shift, b_bits, \ - g_shift, g_bits, \ - r_shift, r_bits) \ - do { \ - typeof(src) a,b,g,r; \ - typeof(src) a_mask_src, b_mask_src, g_mask_src, r_mask_src;\ - a_mask_src = (((1 << (a_bits_src)) - 1) << a_shift_src);\ - b_mask_src = (((1 << (b_bits_src)) - 1) << b_shift_src);\ - g_mask_src = (((1 << (g_bits_src)) - 1) << g_shift_src);\ - r_mask_src = (((1 << (r_bits_src)) - 1) << r_shift_src);\ - if (no_alpha) \ - a = (a_mask_src) >> (a_shift_src); \ - else \ - a = ((src) & (a_mask_src)) >> (a_shift_src); \ - b = ((src) & (b_mask_src)) >> (b_shift_src); \ - g = ((src) & (g_mask_src)) >> (g_shift_src); \ - r = ((src) & (r_mask_src)) >> (r_shift_src); \ - a = ADJUST_BITS(a, a_bits_src, a_bits); \ - b = ADJUST_BITS(b, b_bits_src, b_bits); \ - g = ADJUST_BITS(g, g_bits_src, g_bits); \ - r = ADJUST_BITS(r, r_bits_src, r_bits); \ - if (swap == 0) \ - (*dst) = ((a) << (a_shift)) | ((b) << (b_shift)) | ((g) << (g_shift)) | ((r) << (r_shift)); \ - else \ - (*dst) = ((a) << (a_shift)) | ((r) << (b_shift)) | ((g) << (g_shift)) | ((b) << (r_shift)); \ - } while (0) - -static void * -_glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, - int swap_rb) -{ - int x, y; - unsigned int *words, *saved_words, *source_words; - int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || - swap_rb == SWAP_NONE_UPLOADING); - - source_words = src_bits; - words = dst_bits; - saved_words = words; - - for (y = 0; y < h; y++) { - DEBUGF("Line %d : ", y); - for (x = 0; x < w; x++) { - unsigned int pixel = source_words[x]; - - if (revert == REVERT_DOWNLOADING_2_10_10_10) - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 24, 8, 16, 8, 8, 8, 0, 8, - 30, 2, 20, 10, 10, 10, 0, 10); - else - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 30, 2, 20, 10, 10, 10, 0, 10, - 24, 8, 16, 8, 8, 8, 0, 8); - DEBUGF("%x:%x ", pixel, words[x]); - } - DEBUGF("\n"); - words += stride / sizeof(*words); - source_words += stride / sizeof(*words); - } - DEBUGF("\n"); - return saved_words; - -} - -static void * -_glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, int swap_rb) -{ - int x, y; - unsigned short *words, *saved_words, *source_words; - int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || - swap_rb == SWAP_NONE_UPLOADING); - - words = dst_bits; - source_words = src_bits; - saved_words = words; - - for (y = 0; y < h; y++) { - DEBUGF("Line %d : ", y); - for (x = 0; x < w; x++) { - unsigned short pixel = source_words[x]; - - if (revert == REVERT_DOWNLOADING_1_5_5_5) - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 0, 1, 1, 5, 6, 5, 11, 5, - 15, 1, 10, 5, 5, 5, 0, 5); - else - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 15, 1, 10, 5, 5, 5, 0, 5, - 0, 1, 1, 5, 6, 5, 11, 5); - DEBUGF("%04x:%04x ", pixel, words[x]); - } - DEBUGF("\n"); - words += stride / sizeof(*words); - source_words += stride / sizeof(*words); - } - DEBUGF("\n"); - return saved_words; -} - -/* - * This function is to convert an unsupported color format to/from a - * supported GL format. - * Here are the current scenarios: - * - * @no_alpha: - * If it is set, then we need to wire the alpha value to 1. - * @revert: - REVERT_DOWNLOADING_A1 : convert an Alpha8 buffer to a A1 buffer. - REVERT_UPLOADING_A1 : convert an A1 buffer to an Alpha8 buffer - REVERT_DOWNLOADING_2_10_10_10 : convert r10G10b10X2 to X2B10G10R10 - REVERT_UPLOADING_2_10_10_10 : convert X2B10G10R10 to R10G10B10X2 - REVERT_DOWNLOADING_1_5_5_5 : convert B5G5R5X1 to X1R5G5B5 - REVERT_UPLOADING_1_5_5_5 : convert X1R5G5B5 to B5G5R5X1 - @swap_rb: if we have the swap_rb set, then we need to swap the R and B's position. - * - */ - -static void * -glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, int swap_rb) -{ - if (revert == REVERT_DOWNLOADING_A1 || revert == REVERT_UPLOADING_A1) { - return _glamor_color_convert_a1_a8(src_bits, dst_bits, w, h, stride, - revert); - } - else if (revert == REVERT_DOWNLOADING_2_10_10_10 || - revert == REVERT_UPLOADING_2_10_10_10) { - return _glamor_color_revert_x2b10g10r10(src_bits, dst_bits, w, h, - stride, no_alpha, revert, - swap_rb); - } - else if (revert == REVERT_DOWNLOADING_1_5_5_5 || - revert == REVERT_UPLOADING_1_5_5_5) { - return _glamor_color_revert_x1b5g5r5(src_bits, dst_bits, w, h, stride, - no_alpha, revert, swap_rb); - } - else - ErrorF("convert a non-supported mode %x.\n", revert); - - return NULL; + return dst_image; } /** - * Upload pixmap to a specified texture. - * This texture may not be the one attached to it. - **/ -static Bool -__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, - GLenum format, - GLenum type, - int x, int y, int w, int h, - void *bits, int pbo) -{ - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - int non_sub = 0; - unsigned int iformat = 0; - - glamor_make_current(glamor_priv); - if (*tex == 0) { - glGenTextures(1, tex); - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) - iformat = gl_iformat_for_pixmap(pixmap); - else - iformat = format; - non_sub = 1; - assert(x == 0 && y == 0); - } - - glBindTexture(GL_TEXTURE_2D, *tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - - assert(pbo || bits != 0); - if (bits == NULL) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); - glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); - } - glamor_priv->suppress_gl_out_of_memory_logging = true; - if (non_sub) - glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, format, type, bits); - else - glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, format, type, bits); - glamor_priv->suppress_gl_out_of_memory_logging = false; - if (glGetError() == GL_OUT_OF_MEMORY) { - if (non_sub) { - glDeleteTextures(1, tex); - *tex = 0; - } - return FALSE; - } - - if (bits == NULL) - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - - return TRUE; -} - -static Bool -_glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, - GLenum type, int no_alpha, int revert, - int swap_rb, int x, int y, int w, int h, - int stride, void *bits, int pbo) + * Uploads a picture based on a GLAMOR_MEMORY pixmap to a texture in a + * temporary FBO. + */ +Bool +glamor_upload_picture_to_texture(PicturePtr picture) { + PixmapPtr pixmap = glamor_get_drawable_pixmap(picture->pDrawable); ScreenPtr screen = pixmap->drawable.pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - float dst_xscale, dst_yscale; - GLuint tex = 0; - int need_free_bits = 0; - - if (bits == NULL) - goto ready_to_upload; - - if (revert > REVERT_NORMAL) { - /* XXX if we are restoring the pixmap, then we may not need to allocate - * new buffer */ - void *converted_bits; + PictFormatShort converted_format; + void *bits = pixmap->devPrivate.ptr; + int stride = pixmap->devKind; + GLenum format, type; + GLenum swizzle[4]; + GLenum iformat; + Bool ret = TRUE; + Bool needs_swizzle; + pixman_image_t *converted_image = NULL; - if (pixmap->drawable.depth == 1) - stride = (((w * 8 + 7) / 8) + 3) & ~3; + assert(glamor_pixmap_is_memory(pixmap)); + assert(!pixmap_priv->fbo); - converted_bits = xallocarray(h, stride); + glamor_make_current(glamor_priv); - if (converted_bits == NULL) - return FALSE; - bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, - stride, no_alpha, revert, swap_rb); - if (bits == NULL) { - free(converted_bits); - ErrorF("Failed to convert pixmap no_alpha %d," - "revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb); - return FALSE; - } - no_alpha = 0; - revert = REVERT_NONE; - swap_rb = SWAP_NONE_UPLOADING; - need_free_bits = TRUE; + /* No handling of large pixmap pictures here (would need to make + * an FBO array and split the uploads across it). + */ + if (!glamor_check_fbo_size(glamor_priv, + pixmap->drawable.width, + pixmap->drawable.height)) { + return FALSE; } - ready_to_upload: - - /* Try fast path firstly, upload the pixmap to the texture attached - * to the fbo directly. */ - if (no_alpha == 0 - && revert == REVERT_NONE && swap_rb == SWAP_NONE_UPLOADING -#ifdef WALKAROUND_LARGE_TEXTURE_MAP - && glamor_pixmap_priv_is_small(pixmap_priv) -#endif - ) { - int fbo_x_off, fbo_y_off; - - assert(pixmap_priv->fbo->tex); - pixmap_priv_get_fbo_off(pixmap_priv, &fbo_x_off, &fbo_y_off); - - assert(x + fbo_x_off >= 0 && y + fbo_y_off >= 0); - assert(x + fbo_x_off + w <= pixmap_priv->fbo->width); - assert(y + fbo_y_off + h <= pixmap_priv->fbo->height); - if (!__glamor_upload_pixmap_to_texture(pixmap, &pixmap_priv->fbo->tex, - format, type, - x + fbo_x_off, y + fbo_y_off, - w, h, - bits, pbo)) { - if (need_free_bits) - free(bits); - return FALSE; - } - } else { - static const float texcoords_inv[8] = { 0, 0, - 1, 0, - 1, 1, - 0, 1 - }; - GLfloat *v; - char *vbo_offset; - - v = glamor_get_vbo_space(screen, 16 * sizeof(GLfloat), &vbo_offset); - - pixmap_priv_get_dest_scale(pixmap, pixmap_priv, &dst_xscale, &dst_yscale); - glamor_set_normalize_vcoords(pixmap_priv, dst_xscale, - dst_yscale, - x, y, - x + w, y + h, - v); - /* Slow path, we need to flip y or wire alpha to 1. */ - glamor_make_current(glamor_priv); - - if (!__glamor_upload_pixmap_to_texture(pixmap, &tex, - format, type, 0, 0, w, h, bits, - pbo)) { - if (need_free_bits) - free(bits); - return FALSE; - } - - memcpy(&v[8], texcoords_inv, 8 * sizeof(GLfloat)); - - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vbo_offset); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vbo_offset + 8 * sizeof(GLfloat)); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - - glamor_put_vbo_space(screen); - glamor_set_destination_pixmap_priv_nc(glamor_priv, pixmap, pixmap_priv); - glamor_set_alu(screen, GXcopy); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, tex); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glUseProgram(glamor_priv->finish_access_prog[no_alpha]); - glUniform1i(glamor_priv->finish_access_revert[no_alpha], revert); - glUniform1i(glamor_priv->finish_access_swap_rb[no_alpha], swap_rb); - - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDeleteTextures(1, &tex); - glBindFramebuffer(GL_FRAMEBUFFER, 0); + if (!glamor_get_tex_format_type_from_pictformat(screen, + picture->format, + &converted_format, + &format, + &type, + swizzle)) { + glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); + return FALSE; } - if (need_free_bits) - free(bits); - return TRUE; -} - -/* - * Prepare to upload a pixmap to texture memory. - * no_alpha equals 1 means the format needs to wire alpha to 1. - */ -static int -glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, - int revert, int swap_rb) -{ - int flag = 0; - glamor_pixmap_private *pixmap_priv; - glamor_screen_private *glamor_priv; - glamor_pixmap_fbo *fbo; - GLenum iformat; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); - - if (pixmap_priv->gl_fbo != GLAMOR_FBO_UNATTACHED) - return 0; - - if (pixmap_priv->fbo - && (pixmap_priv->fbo->width < pixmap->drawable.width - || pixmap_priv->fbo->height < pixmap->drawable.height)) { - fbo = glamor_pixmap_detach_fbo(pixmap_priv); - glamor_destroy_fbo(glamor_priv, fbo); + needs_swizzle = (swizzle[0] != GL_RED || + swizzle[1] != GL_GREEN || + swizzle[2] != GL_BLUE || + swizzle[3] != GL_ALPHA); + + if (!glamor_priv->has_texture_swizzle && needs_swizzle) { + glamor_fallback("Couldn't upload temporary picture due to missing " + "GL_ARB_texture_swizzle.\n"); + return FALSE; } - if (pixmap_priv->fbo && pixmap_priv->fbo->fb) - return 0; - - if (!(no_alpha || (revert == REVERT_NORMAL) - || (swap_rb != SWAP_NONE_UPLOADING))) { - /* We don't need a fbo, a simple texture uploading should work. */ + if (converted_format != picture->format) { + converted_image = glamor_get_converted_image(converted_format, + picture->format, + bits, stride, + pixmap->drawable.width, + pixmap->drawable.height); + if (!converted_image) + return FALSE; - flag = GLAMOR_CREATE_FBO_NO_FBO; + bits = pixman_image_get_data(converted_image); + stride = pixman_image_get_stride(converted_image); } - if ((flag == GLAMOR_CREATE_FBO_NO_FBO - && pixmap_priv->fbo && pixmap_priv->fbo->tex)) - return 0; - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) iformat = gl_iformat_for_pixmap(pixmap); else iformat = format; - if (!glamor_pixmap_ensure_fbo(pixmap, iformat, flag)) - return -1; + if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) + goto fail; - return 0; -} - -/* - * upload sub region to a large region. - * */ -static void -glamor_put_bits(char *dst_bits, int dst_stride, char *src_bits, - int src_stride, int bpp, int x, int y, int w, int h) -{ - int j; - int byte_per_pixel; + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - byte_per_pixel = bpp / 8; - src_bits += y * src_stride + (x * byte_per_pixel); + glamor_priv->suppress_gl_out_of_memory_logging = true; - for (j = y; j < y + h; j++) { - memcpy(dst_bits, src_bits, w * byte_per_pixel); - src_bits += src_stride; - dst_bits += dst_stride; + /* We can't use glamor_pixmap_loop() because GLAMOR_MEMORY pixmaps + * don't have initialized boxes. + */ + glBindTexture(GL_TEXTURE_2D, pixmap_priv->fbo->tex); + glTexImage2D(GL_TEXTURE_2D, 0, iformat, + pixmap->drawable.width, pixmap->drawable.height, 0, + format, type, bits); + + if (needs_swizzle) { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, swizzle[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, swizzle[1]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, swizzle[2]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, swizzle[3]); } -} -static Bool -glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, - int h, int stride, void *bits, int pbo, - PictFormatShort pict_format) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - GLenum format, type; - int no_alpha, revert, swap_rb; - glamor_pixmap_private *pixmap_priv; - Bool force_clip; - - if (glamor_get_tex_format_type_from_pixmap(pixmap, - pict_format, - &format, - &type, - &no_alpha, - &revert, &swap_rb, 1)) { - glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); - return FALSE; - } - if (glamor_pixmap_upload_prepare(pixmap, format, no_alpha, revert, swap_rb)) - return FALSE; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - force_clip = glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP - && !glamor_check_fbo_size(glamor_priv, w, h); - - if (glamor_pixmap_priv_is_large(pixmap_priv) || force_clip) { - RegionRec region; - BoxRec box; - int n_region; - glamor_pixmap_clipped_regions *clipped_regions; - void *sub_bits; - int i, j; - - sub_bits = xallocarray(h, stride); - if (sub_bits == NULL) - return FALSE; - box.x1 = x; - box.y1 = y; - box.x2 = x + w; - box.y2 = y + h; - RegionInitBoxes(®ion, &box, 1); - if (!force_clip) - clipped_regions = - glamor_compute_clipped_regions(pixmap, ®ion, &n_region, - 0, 0, 0); - else - clipped_regions = - glamor_compute_clipped_regions_ext(pixmap, ®ion, - &n_region, - pixmap_priv->block_w, - pixmap_priv->block_h, - 0, - 0); - DEBUGF("prepare upload %dx%d to a large pixmap %p\n", w, h, pixmap); - for (i = 0; i < n_region; i++) { - BoxPtr boxes; - int nbox; - int temp_stride; - void *temp_bits; - - assert(pbo == 0); - - glamor_set_pixmap_fbo_current(pixmap_priv, clipped_regions[i].block_idx); - - boxes = RegionRects(clipped_regions[i].region); - nbox = RegionNumRects(clipped_regions[i].region); - DEBUGF("split to %d boxes\n", nbox); - for (j = 0; j < nbox; j++) { - temp_stride = PixmapBytePad(boxes[j].x2 - boxes[j].x1, - pixmap->drawable.depth); - - if (boxes[j].x1 == x && temp_stride == stride) { - temp_bits = (char *) bits + (boxes[j].y1 - y) * stride; - } - else { - temp_bits = sub_bits; - glamor_put_bits(temp_bits, temp_stride, bits, stride, - pixmap->drawable.bitsPerPixel, - boxes[j].x1 - x, boxes[j].y1 - y, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1); - } - DEBUGF("upload x %d y %d w %d h %d temp stride %d \n", - boxes[j].x1 - x, boxes[j].y1 - y, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1, temp_stride); - if (_glamor_upload_bits_to_pixmap_texture - (pixmap, format, type, no_alpha, revert, swap_rb, - boxes[j].x1, boxes[j].y1, boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1, temp_stride, temp_bits, - pbo) == FALSE) { - RegionUninit(®ion); - free(sub_bits); - assert(0); - return FALSE; - } - } - RegionDestroy(clipped_regions[i].region); - } - free(sub_bits); - free(clipped_regions); - RegionUninit(®ion); - return TRUE; + glamor_priv->suppress_gl_out_of_memory_logging = false; + if (glGetError() == GL_OUT_OF_MEMORY) { + ret = FALSE; } - else - return _glamor_upload_bits_to_pixmap_texture(pixmap, format, type, - no_alpha, revert, swap_rb, - x, y, w, h, stride, bits, - pbo); -} - -/* Upload picture to texture. We may need to flip the y axis or - * wire alpha to 1. So we may conditional create fbo for the picture. - * */ -enum glamor_pixmap_status -glamor_upload_picture_to_texture(PicturePtr picture) -{ - PixmapPtr pixmap; - assert(picture->pDrawable); - pixmap = glamor_get_drawable_pixmap(picture->pDrawable); +fail: + if (converted_image) + pixman_image_unref(converted_image); - if (glamor_upload_sub_pixmap_to_texture(pixmap, 0, 0, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->devKind, - pixmap->devPrivate.ptr, 0, - picture->format)) - return GLAMOR_UPLOAD_DONE; - else - return GLAMOR_UPLOAD_FAILED; + return ret; } diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_priv.h xorg-server-hwe-16.04-1.19.3/glamor/glamor_priv.h --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_priv.h 2016-07-19 17:14:58.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_priv.h 2017-03-15 18:05:25.000000000 +0000 @@ -184,16 +184,7 @@ ScreenBlockHandlerProcPtr block_handler; }; -#define CACHE_FORMAT_COUNT 3 - -#define CACHE_BUCKET_WCOUNT 4 -#define CACHE_BUCKET_HCOUNT 4 - -#define GLAMOR_TICK_AFTER(t0, t1) \ - (((int)(t1) - (int)(t0)) < 0) - typedef struct glamor_screen_private { - unsigned int tick; enum glamor_gl_flavor gl_flavor; int glsl_version; Bool has_pack_invert; @@ -208,15 +199,13 @@ Bool use_quads; Bool has_vertex_array_object; Bool has_dual_blend; + Bool has_texture_swizzle; Bool is_core_profile; + Bool can_copyplane; int max_fbo_size; GLuint one_channel_format; - struct xorg_list - fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT]; - unsigned long fbo_cache_watermark; - /* glamor point shader */ glamor_program point_prog; @@ -286,11 +275,6 @@ [glamor_program_alpha_count] [SHADER_DEST_SWIZZLE_COUNT]; - /* shaders to restore a texture to another texture. */ - GLint finish_access_prog[2]; - GLint finish_access_revert[2]; - GLint finish_access_swap_rb[2]; - /* glamor gradient, 0 for small nstops, 1 for large nstops and 2 for dynamic generate. */ GLint gradient_prog[SHADER_GRADIENT_COUNT][3]; @@ -330,21 +314,10 @@ }; typedef struct glamor_pixmap_fbo { - struct xorg_list list; /**< linked list pointers when in the fbo cache */ - /** glamor_priv->tick number when this FBO will be expired from the cache. */ - unsigned int expire; GLuint tex; /**< GL texture name */ GLuint fb; /**< GL FBO name */ int width; /**< width in pixels */ int height; /**< height in pixels */ - /** - * Flag for when texture contents might be shared with a - * non-glamor user. - * - * This is used to avoid putting textures used by other clients - * into the FBO cache. - */ - Bool external; GLenum format; /**< GL format used to create the texture. */ GLenum type; /**< GL type used to create the texture. */ } glamor_pixmap_fbo; @@ -514,22 +487,6 @@ for (box_index = 0; box_index < glamor_pixmap_hcnt(priv) * \ glamor_pixmap_wcnt(priv); box_index++) \ -/** - * Pixmap upload status, used by glamor_render.c's support for - * temporarily uploading pixmaps to GL textures to get a Composite - * operation done. - */ -typedef enum glamor_pixmap_status { - /** initial status, don't need to do anything. */ - GLAMOR_NONE, - /** marked as need to be uploaded to gl texture. */ - GLAMOR_UPLOAD_PENDING, - /** the pixmap has been uploaded successfully. */ - GLAMOR_UPLOAD_DONE, - /** fail to upload the pixmap. */ - GLAMOR_UPLOAD_FAILED -} glamor_pixmap_status_t; - /* GC private structure. Currently holds only any computed dash pixmap */ typedef struct { @@ -588,10 +545,7 @@ void glamor_destroy_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo); void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); -void glamor_init_pixmap_fbo(ScreenPtr screen); -void glamor_fini_pixmap_fbo(ScreenPtr screen); Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); -void glamor_fbo_expire(glamor_screen_private *glamor_priv); /* Return whether 'picture' is alpha-only */ static inline Bool glamor_picture_is_alpha(PicturePtr picture) @@ -630,8 +584,6 @@ unsigned count); /* glamor_core.c */ -void glamor_init_finish_access_shaders(ScreenPtr screen); - Bool glamor_get_drawable_location(const DrawablePtr drawable); void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int *x, int *y); @@ -767,7 +719,7 @@ * Upload a picture to gl texture. Similar to the * glamor_upload_pixmap_to_texture. Used in rendering. **/ -enum glamor_pixmap_status glamor_upload_picture_to_texture(PicturePtr picture); +Bool glamor_upload_picture_to_texture(PicturePtr picture); void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); @@ -970,7 +922,6 @@ #define GLAMOR_PIXMAP_DYNAMIC_UPLOAD #define GLAMOR_GRADIENT_SHADER #define GLAMOR_TEXTURED_LARGE_PIXMAP 1 -#define WALKAROUND_LARGE_TEXTURE_MAP #if 0 #define MAX_FBO_SIZE 32 /* For test purpose only. */ #endif diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_program.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_program.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_program.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_program.c 2017-03-15 18:05:25.000000000 +0000 @@ -122,8 +122,7 @@ .vs_vars = ("uniform vec2 fill_offset;\n" "uniform vec2 fill_size_inv;\n" "varying vec2 fill_pos;\n"), - .fs_vars = ("uniform vec2 fill_size_inv;\n" - "varying vec2 fill_pos;\n") + .fs_vars = ("varying vec2 fill_pos;\n") }, { .location = glamor_program_location_font, diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_render.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_render.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_render.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_render.c 2017-03-15 18:05:25.000000000 +0000 @@ -533,16 +533,8 @@ repeat_type = picture->repeatType; switch (picture->repeatType) { case RepeatNone: - if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) { - /* XXX GLES2 doesn't support GL_CLAMP_TO_BORDER. */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_BORDER); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); break; case RepeatNormal: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -573,12 +565,12 @@ break; } - /* - * GLES2 doesn't support RepeatNone. We need to fix it anyway. - * - **/ + /* Handle RepeatNone in the shader when the source is missing the + * alpha channel, as GL will return an alpha for 1 if the texture + * is RGB (no alpha), which we use for 16bpp textures. + */ if (glamor_pixmap_priv_is_large(pixmap_priv) || - ((!PICT_FORMAT_A(picture->format) || glamor_priv->gl_flavor == GLAMOR_GL_ES2) && + (!PICT_FORMAT_A(picture->format) && repeat_type == RepeatNone && picture->transform)) { glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv); glUniform4fv(wh_location, 1, wh); @@ -809,8 +801,8 @@ { ScreenPtr screen = dest->pDrawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - enum glamor_pixmap_status source_status = GLAMOR_NONE; - enum glamor_pixmap_status mask_status = GLAMOR_NONE; + Bool source_needs_upload = FALSE; + Bool mask_needs_upload = FALSE; PictFormatShort saved_source_format = 0; struct shader_key key; GLfloat source_solid_color[4]; @@ -868,7 +860,10 @@ goto fail; } else { - key.mask = SHADER_MASK_TEXTURE_ALPHA; + if (PICT_FORMAT_A(mask->format)) + key.mask = SHADER_MASK_TEXTURE_ALPHA; + else + key.mask = SHADER_MASK_TEXTURE; } if (!mask->componentAlpha) { @@ -921,7 +916,7 @@ } if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - source_status = GLAMOR_UPLOAD_PENDING; + source_needs_upload = TRUE; #else glamor_fallback("no texture in source\n"); goto fail; @@ -937,7 +932,7 @@ } if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - mask_status = GLAMOR_UPLOAD_PENDING; + mask_needs_upload = TRUE; #else glamor_fallback("no texture in mask\n"); goto fail; @@ -946,8 +941,7 @@ } #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - if (source_status == GLAMOR_UPLOAD_PENDING - && mask_status == GLAMOR_UPLOAD_PENDING + if (source_needs_upload && mask_needs_upload && source_pixmap == mask_pixmap) { if (source->format != mask->format) { @@ -983,20 +977,17 @@ if (!PICT_FORMAT_A(mask->format) && PICT_FORMAT_A(saved_source_format)) key.mask = SHADER_MASK_TEXTURE; - - mask_status = GLAMOR_NONE; } - source_status = glamor_upload_picture_to_texture(source); - if (source_status != GLAMOR_UPLOAD_DONE) { + if (!glamor_upload_picture_to_texture(source)) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } + mask_needs_upload = FALSE; } else { - if (source_status == GLAMOR_UPLOAD_PENDING) { - source_status = glamor_upload_picture_to_texture(source); - if (source_status != GLAMOR_UPLOAD_DONE) { + if (source_needs_upload) { + if (!glamor_upload_picture_to_texture(source)) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } @@ -1007,9 +998,8 @@ } } - if (mask_status == GLAMOR_UPLOAD_PENDING) { - mask_status = glamor_upload_picture_to_texture(mask); - if (mask_status != GLAMOR_UPLOAD_DONE) { + if (mask_needs_upload) { + if (!glamor_upload_picture_to_texture(mask)) { glamor_fallback("Failed to upload mask texture.\n"); goto fail; } @@ -1156,7 +1146,7 @@ &key, &shader, &op_info, &saved_source_format, ca_state)) { glamor_fallback("glamor_composite_choose_shader failed\n"); - return ret; + goto fail; } if (ca_state == CA_TWO_PASS) { if (!glamor_composite_choose_shader(PictOpAdd, source, mask, dest, @@ -1166,7 +1156,7 @@ &key_ca, &shader_ca, &op_info_ca, &saved_source_format, ca_state)) { glamor_fallback("glamor_composite_choose_shader failed\n"); - return ret; + goto fail; } } @@ -1298,6 +1288,13 @@ source->format = saved_source_format; ret = TRUE; + +fail: + if (mask_pixmap && glamor_pixmap_is_memory(mask_pixmap)) + glamor_pixmap_destroy_fbo(mask_pixmap); + if (source_pixmap && glamor_pixmap_is_memory(source_pixmap)) + glamor_pixmap_destroy_fbo(source_pixmap); + return ret; } @@ -1337,11 +1334,6 @@ } if (dst) { -#if 0 /* Debug to compare it to pixman, Enable it if needed. */ - glamor_compare_pictures(screen, source, - dst, x_source, y_source, width, height, - 0, 3); -#endif return dst; } } @@ -1421,6 +1413,8 @@ /* Is the composite operation equivalent to a copy? */ if (!mask && !source->alphaMap && !dest->alphaMap && source->pDrawable && !source->transform + /* CopyArea is only defined with matching depths. */ + && dest->pDrawable->depth == source->pDrawable->depth && ((op == PictOpSrc && (source->format == dest->format || (PICT_FORMAT_COLOR(dest->format) @@ -1479,7 +1473,7 @@ && (mask_pixmap->drawable.width != width || mask_pixmap->drawable.height != height)))) { /* XXX if mask->pDrawable is the same as source->pDrawable, we have an opportunity - * to do reduce one convertion. */ + * to do reduce one conversion. */ temp_mask = glamor_convert_gradient_picture(screen, mask, extent->x1 + x_mask - x_dest - dest->pDrawable->x, @@ -1500,6 +1494,10 @@ ca_state = CA_DUAL_BLEND; } else { if (op == PictOpOver) { + if (glamor_pixmap_is_memory(mask_pixmap)) { + glamor_fallback("two pass not supported on memory pximaps\n"); + goto out; + } ca_state = CA_TWO_PASS; op = PictOpOutReverse; } @@ -1710,12 +1708,12 @@ source, source->pDrawable, source->pDrawable ? source->pDrawable->width : 0, source->pDrawable ? source->pDrawable->height : 0, mask, - (!mask) ? NULL : mask->pDrawable, (!mask - || !mask->pDrawable) ? 0 : - mask->pDrawable->width, (!mask - || !mask->pDrawable) ? 0 : mask-> - pDrawable->height, glamor_get_picture_location(source), - glamor_get_picture_location(mask), dest, dest->pDrawable, + (!mask) ? NULL : mask->pDrawable, + (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->width, + (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->height, + glamor_get_picture_location(source), + glamor_get_picture_location(mask), + dest, dest->pDrawable, dest->pDrawable->width, dest->pDrawable->height, glamor_get_picture_location(dest)); diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_spans.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_spans.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_spans.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_spans.c 2017-03-15 18:05:25.000000000 +0000 @@ -135,7 +135,7 @@ if (glamor_priv->glsl_version >= 130) glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, n); else { - glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox); + glamor_glDrawArrays_GL_QUADS(glamor_priv, n); } } } diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_sync.c xorg-server-hwe-16.04-1.19.3/glamor/glamor_sync.c --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_sync.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_sync.c 2017-03-15 18:05:25.000000000 +0000 @@ -97,6 +97,9 @@ #ifdef HAVE_XSHMFENCE if (!miSyncShmScreenInit(screen)) return FALSE; +#else + if (!miSyncSetup(screen)) + return FALSE; #endif screen_funcs = miSyncGetScreenFuncs(screen); diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/glamor_utils.h xorg-server-hwe-16.04-1.19.3/glamor/glamor_utils.h --- xorg-server-hwe-16.04-1.18.4/glamor/glamor_utils.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/glamor_utils.h 2017-03-15 18:05:25.000000000 +0000 @@ -334,21 +334,6 @@ DEBUGF("normalized tx %f ty %f \n", (texcoord)[0], (texcoord)[1]); \ } while(0) -#define glamor_set_transformed_normalize_tri_tcoords(priv, \ - matrix, \ - xscale, \ - yscale, \ - vtx, \ - texcoords) \ - do { \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords, (vtx)[0], (vtx)[1]); \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+2, (vtx)[2], (vtx)[3]); \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+4, (vtx)[4], (vtx)[5]); \ - } while (0) - #define glamor_set_transformed_normalize_tcoords_ext( priv, \ matrix, \ xscale, \ @@ -367,38 +352,6 @@ texcoords + 3 * stride, tx1, ty2); \ } while (0) -#define glamor_set_transformed_normalize_tcoords( priv, \ - matrix, \ - xscale, \ - yscale, \ - tx1, ty1, tx2, ty2, \ - texcoords) \ - do { \ - glamor_set_transformed_normalize_tcoords_ext( priv, \ - matrix, \ - xscale, \ - yscale, \ - tx1, ty1, tx2, ty2, \ - texcoords, \ - 2); \ - } while (0) - -#define glamor_set_normalize_tri_tcoords(xscale, \ - yscale, \ - vtx, \ - texcoords) \ - do { \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[0], (vtx)[1], \ - texcoords); \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[2], (vtx)[3], \ - texcoords+2); \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[4], (vtx)[5], \ - texcoords+4); \ - } while (0) - #define glamor_set_repeat_transformed_normalize_tcoords_ext(pixmap, priv, \ repeat_type, \ matrix, \ @@ -508,15 +461,6 @@ x2, y2, vertices, stride); \ } while(0) -#define glamor_set_normalize_tcoords(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices) \ - do { \ - glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices, 2); \ - } while(0) - #define glamor_set_repeat_normalize_tcoords_ext(pixmap, priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ @@ -543,17 +487,6 @@ stride); \ } while(0) -#define glamor_set_repeat_normalize_tcoords(priv, repeat_type, \ - xscale, yscale, \ - _x1_, _y1_, _x2_, _y2_, \ - vertices) \ - do { \ - glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ - xscale, yscale, \ - _x1_, _y1_, _x2_, _y2_, \ - vertices, 2); \ - } while(0) - #define glamor_set_normalize_tcoords_tri_stripe(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ @@ -568,51 +501,6 @@ (vertices)[5] = (vertices)[7]; \ } while(0) -#define glamor_set_tcoords(x1, y1, x2, y2, vertices) \ - do { \ - (vertices)[0] = (x1); \ - (vertices)[2] = (x2); \ - (vertices)[4] = (vertices)[2]; \ - (vertices)[6] = (vertices)[0]; \ - (vertices)[1] = (y1); \ - (vertices)[5] = (y2); \ - (vertices)[3] = (vertices)[1]; \ - (vertices)[7] = (vertices)[5]; \ - } while(0) - -#define glamor_set_tcoords_ext(x1, y1, x2, y2, vertices, stride) \ - do { \ - (vertices)[0] = (x1); \ - (vertices)[1*stride] = (x2); \ - (vertices)[2*stride] = (vertices)[1*stride]; \ - (vertices)[3*stride] = (vertices)[0]; \ - (vertices)[1] = (y1); \ - (vertices)[2*stride + 1] = (y2); \ - (vertices)[1*stride + 1] = (vertices)[1]; \ - (vertices)[3*stride + 1] = (vertices)[2*stride + 1]; \ - } while(0) - -#define glamor_set_normalize_one_vcoord(xscale, yscale, x, y, \ - vertices) \ - do { \ - (vertices)[0] = v_from_x_coord_x(xscale, x); \ - (vertices)[1] = v_from_x_coord_y(yscale, y); \ - } while(0) - -#define glamor_set_normalize_tri_vcoords(xscale, yscale, vtx, \ - vertices) \ - do { \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[0], (vtx)[1], \ - vertices); \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[2], (vtx)[3], \ - vertices+2); \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[4], (vtx)[5], \ - vertices+4); \ - } while(0) - #define glamor_set_tcoords_tri_strip(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ @@ -646,25 +534,6 @@ (vertices)[3 * stride + 1] = _t5_; \ } while(0) -#define glamor_set_normalize_vcoords(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices) \ - do { \ - glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices, 2); \ - } while(0) - -#define glamor_set_const_ext(params, nparam, vertices, nverts, stride) \ - do { \ - int _i_ = 0, _j_ = 0; \ - for(; _i_ < nverts; _i_++) { \ - for(_j_ = 0; _j_ < nparam; _j_++) { \ - vertices[stride*_i_ + _j_] = params[_j_]; \ - } \ - } \ - } while(0) - #define glamor_set_normalize_vcoords_tri_strip(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ @@ -767,17 +636,8 @@ #define REVERT_NONE 0 #define REVERT_NORMAL 1 -#define REVERT_DOWNLOADING_A1 2 #define REVERT_UPLOADING_A1 3 -#define REVERT_DOWNLOADING_2_10_10_10 4 -#define REVERT_UPLOADING_2_10_10_10 5 -#define REVERT_DOWNLOADING_1_5_5_5 7 -#define REVERT_UPLOADING_1_5_5_5 8 -#define REVERT_DOWNLOADING_10_10_10_2 9 -#define REVERT_UPLOADING_10_10_10_2 10 -#define SWAP_NONE_DOWNLOADING 0 -#define SWAP_DOWNLOADING 1 #define SWAP_UPLOADING 2 #define SWAP_NONE_UPLOADING 3 @@ -861,425 +721,6 @@ } static inline void -_glamor_dump_pixmap_bits(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned char *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2d ", (p[j / 8] & (1 << (j % 8))) >> (j % 8)); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_byte(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned char *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_sword(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned short *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind / 2; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_word(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned int *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind / 4; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -glamor_dump_pixmap(PixmapPtr pixmap, int x, int y, int w, int h) -{ - w = ((x + w) > (pixmap)->drawable.width) ? ((pixmap)->drawable.width - x) : w; - h = ((y + h) > (pixmap)->drawable.height) ? ((pixmap)->drawable.height - y) : h; - - glamor_prepare_access(&(pixmap)->drawable, GLAMOR_ACCESS_RO); - switch ((pixmap)->drawable.depth) { - case 8: - _glamor_dump_pixmap_byte(pixmap, x, y, w, h); - break; - case 15: - case 16: - _glamor_dump_pixmap_sword(pixmap, x, y, w, h); - break; - - case 24: - case 32: - _glamor_dump_pixmap_word(pixmap, x, y, w, h); - break; - case 1: - _glamor_dump_pixmap_bits(pixmap, x, y, w, h); - break; - default: - ErrorF("dump depth %d, not implemented.\n", (pixmap)->drawable.depth); - } - glamor_finish_access(&(pixmap)->drawable); -} - -static inline void -_glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, - int x, int y, int w, int h, - PictFormatShort short_format, int all, int diffs) -{ - int i, j; - unsigned char *p1 = pixmap1->devPrivate.ptr; - unsigned char *p2 = pixmap2->devPrivate.ptr; - int line_need_printed = 0; - int test_code = 0xAABBCCDD; - int little_endian = 0; - unsigned char *p_test; - int bpp = pixmap1->drawable.depth == 8 ? 1 : 4; - int stride = pixmap1->devKind; - - assert(pixmap1->devKind == pixmap2->devKind); - - ErrorF("stride:%d, width:%d, height:%d\n", stride, w, h); - - p1 = p1 + y * stride + x; - p2 = p2 + y * stride + x; - - if (all) { - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - - for (j = 0; j < stride; j++) { - if (j % bpp == 0) - ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); - else - ErrorF("%2x:%2x ", p1[j], p2[j]); - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } - else { - if (short_format == PICT_a8r8g8b8) { - p_test = (unsigned char *) &test_code; - little_endian = (*p_test == 0xDD); - bpp = 4; - - for (i = 0; i < h; i++) { - line_need_printed = 0; - - for (j = 0; j < stride; j++) { - if (p1[j] != p2[j] && - (p1[j] - p2[j] > diffs || p2[j] - p1[j] > diffs)) { - if (line_need_printed) { - if (little_endian) { - switch (j % 4) { - case 2: - ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 1: - ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 0: - ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 3: - ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - } - } - else { - switch (j % 4) { - case 1: - ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 2: - ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 3: - ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 0: - ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - } - } - } - else { - line_need_printed = 1; - j = -1; - ErrorF("line %3d: ", i); - continue; - } - } - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } //more format can be added here. - else { // the default format, just print. - for (i = 0; i < h; i++) { - line_need_printed = 0; - - for (j = 0; j < stride; j++) { - if (p1[j] != p2[j]) { - if (line_need_printed) { - ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); - } - else { - line_need_printed = 1; - j = -1; - ErrorF("line %3d: ", i); - continue; - } - } - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } - } -} - -static inline void -glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, - int x, int y, int w, int h, int all, int diffs) -{ - assert(pixmap1->drawable.depth == pixmap2->drawable.depth); - - if (glamor_prepare_access(&pixmap1->drawable, GLAMOR_ACCESS_RO) && - glamor_prepare_access(&pixmap2->drawable, GLAMOR_ACCESS_RO)) { - _glamor_compare_pixmaps(pixmap1, pixmap2, x, y, w, h, -1, all, diffs); - } - glamor_finish_access(&pixmap1->drawable); - glamor_finish_access(&pixmap2->drawable); -} - -/* This function is used to compare two pictures. - If the picture has no drawable, we use fb functions to generate it. */ -static inline void -glamor_compare_pictures(ScreenPtr screen, - PicturePtr fst_picture, - PicturePtr snd_picture, - int x_source, int y_source, - int width, int height, int all, int diffs) -{ - PixmapPtr fst_pixmap; - PixmapPtr snd_pixmap; - int fst_generated, snd_generated; - int error; - int fst_type = -1; - int snd_type = -1; // -1 represent has drawable. - - if (fst_picture->format != snd_picture->format) { - ErrorF("Different picture format can not compare!\n"); - return; - } - - if (!fst_picture->pDrawable) { - fst_type = fst_picture->pSourcePict->type; - } - - if (!snd_picture->pDrawable) { - snd_type = snd_picture->pSourcePict->type; - } - - if ((fst_type != -1) && (snd_type != -1) && (fst_type != snd_type)) { - ErrorF("Different picture type will never be same!\n"); - return; - } - - fst_generated = snd_generated = 0; - - if (!fst_picture->pDrawable) { - PicturePtr pixman_pic; - PixmapPtr pixmap = NULL; - PictFormatShort format; - - format = fst_picture->format; - - pixmap = glamor_create_pixmap(screen, - width, height, - PIXMAN_FORMAT_DEPTH(format), - GLAMOR_CREATE_PIXMAP_CPU); - - pixman_pic = CreatePicture(0, - &(pixmap)->drawable, - PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH - (format), format), 0, 0, - serverClient, &error); - - fbComposite(PictOpSrc, fst_picture, NULL, pixman_pic, - x_source, y_source, 0, 0, 0, 0, width, height); - - glamor_destroy_pixmap(pixmap); - - fst_picture = pixman_pic; - fst_generated = 1; - } - - if (!snd_picture->pDrawable) { - PicturePtr pixman_pic; - PixmapPtr pixmap = NULL; - PictFormatShort format; - - format = snd_picture->format; - - pixmap = glamor_create_pixmap(screen, - width, height, - PIXMAN_FORMAT_DEPTH(format), - GLAMOR_CREATE_PIXMAP_CPU); - - pixman_pic = CreatePicture(0, - &(pixmap)->drawable, - PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH - (format), format), 0, 0, - serverClient, &error); - - fbComposite(PictOpSrc, snd_picture, NULL, pixman_pic, - x_source, y_source, 0, 0, 0, 0, width, height); - - glamor_destroy_pixmap(pixmap); - - snd_picture = pixman_pic; - snd_generated = 1; - } - - fst_pixmap = glamor_get_drawable_pixmap(fst_picture->pDrawable); - snd_pixmap = glamor_get_drawable_pixmap(snd_picture->pDrawable); - - if (fst_pixmap->drawable.depth != snd_pixmap->drawable.depth) { - if (fst_generated) - miDestroyPicture(fst_picture); - if (snd_generated) - miDestroyPicture(snd_picture); - - ErrorF("Different pixmap depth can not compare!\n"); - return; - } - - if ((fst_type == SourcePictTypeLinear) || - (fst_type == SourcePictTypeRadial) || - (fst_type == SourcePictTypeConical) || - (snd_type == SourcePictTypeLinear) || - (snd_type == SourcePictTypeRadial) || - (snd_type == SourcePictTypeConical)) { - x_source = y_source = 0; - } - - if (glamor_prepare_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO) && - glamor_prepare_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO)) { - _glamor_compare_pixmaps(fst_pixmap, snd_pixmap, - x_source, y_source, - width, height, fst_picture->format, - all, diffs); - } - glamor_finish_access(&fst_pixmap->drawable); - glamor_finish_access(&snd_pixmap->drawable); - - if (fst_generated) - miDestroyPicture(fst_picture); - if (snd_generated) - miDestroyPicture(snd_picture); - - return; -} - -#ifdef __i386__ -static inline unsigned long -__fls(unsigned long x) -{ - asm("bsr %1,%0":"=r"(x) - : "rm"(x)); - return x; -} -#else -static inline unsigned long -__fls(unsigned long x) -{ - int n; - - if (x == 0) - return (0); - n = 0; - if (x <= 0x0000FFFF) { - n = n + 16; - x = x << 16; - } - if (x <= 0x00FFFFFF) { - n = n + 8; - x = x << 8; - } - if (x <= 0x0FFFFFFF) { - n = n + 4; - x = x << 4; - } - if (x <= 0x3FFFFFFF) { - n = n + 2; - x = x << 2; - } - if (x <= 0x7FFFFFFF) { - n = n + 1; - } - return 31 - n; -} -#endif - -static inline void glamor_make_current(glamor_screen_private *glamor_priv) { if (lastGLContext != &glamor_priv->ctx) { diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/Makefile.am xorg-server-hwe-16.04-1.19.3/glamor/Makefile.am --- xorg-server-hwe-16.04-1.18.4/glamor/Makefile.am 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -54,6 +54,8 @@ glamor_xv.c endif -libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c +libglamor_egl_stubs_la_SOURCES = \ + glamor_egl_stubs.c \ + glamor_egl.h sdk_HEADERS = glamor.h diff -Nru xorg-server-hwe-16.04-1.18.4/glamor/Makefile.in xorg-server-hwe-16.04-1.19.3/glamor/Makefile.in --- xorg-server-hwe-16.04-1.18.4/glamor/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glamor/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -95,9 +95,10 @@ subdir = glamor ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -417,6 +418,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -447,7 +451,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -542,6 +549,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -606,7 +614,10 @@ glamor_vbo.c glamor_window.c glamor_fbo.c \ glamor_compositerects.c glamor_utils.c glamor_utils.h \ glamor_sync.c glamor.h $(am__append_1) -libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c +libglamor_egl_stubs_la_SOURCES = \ + glamor_egl_stubs.c \ + glamor_egl.h + sdk_HEADERS = glamor.h all: all-am diff -Nru xorg-server-hwe-16.04-1.18.4/glx/createcontext.c xorg-server-hwe-16.04-1.19.3/glx/createcontext.c --- xorg-server-hwe-16.04-1.18.4/glx/createcontext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/createcontext.c 2017-03-15 18:05:25.000000000 +0000 @@ -315,16 +315,8 @@ ctx->id = req->context; ctx->share_id = req->shareList; ctx->idExists = True; - ctx->currentClient = False; ctx->isDirect = req->isDirect; - ctx->hasUnflushedCommands = False; ctx->renderMode = GL_RENDER; - ctx->feedbackBuf = NULL; - ctx->feedbackBufSize = 0; - ctx->selectBuf = NULL; - ctx->selectBufSize = 0; - ctx->drawPriv = NULL; - ctx->readPriv = NULL; ctx->resetNotificationStrategy = reset; #ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB ctx->releaseBehavior = flush; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/extension_string.c xorg-server-hwe-16.04-1.19.3/glx/extension_string.c --- xorg-server-hwe-16.04-1.18.4/glx/extension_string.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/extension_string.c 2017-03-15 18:05:25.000000000 +0000 @@ -85,14 +85,15 @@ { GLX(EXT_fbconfig_packed_float), VER(0,0), N, }, { 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_stereo_tree), VER(0,0), N, }, - { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, + { GLX(EXT_texture_from_pixmap), VER(0,0), N, }, { GLX(EXT_visual_info), VER(0,0), Y, }, { GLX(EXT_visual_rating), VER(0,0), Y, }, { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, { GLX(OML_swap_method), VER(0,0), Y, }, - { GLX(SGI_make_current_read), VER(1,3), N, }, + { GLX(SGI_make_current_read), VER(1,3), Y, }, { GLX(SGI_swap_control), VER(0,0), N, }, { GLX(SGIS_multisample), VER(0,0), Y, }, { GLX(SGIX_fbconfig), VER(1,3), Y, }, diff -Nru xorg-server-hwe-16.04-1.18.4/glx/extension_string.h xorg-server-hwe-16.04-1.19.3/glx/extension_string.h --- xorg-server-hwe-16.04-1.18.4/glx/extension_string.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/extension_string.h 2017-03-15 18:05:25.000000000 +0000 @@ -47,6 +47,7 @@ EXT_create_context_es2_profile_bit, EXT_fbconfig_packed_float_bit, EXT_import_context_bit, + EXT_libglvnd_bit, EXT_stereo_tree_bit, EXT_texture_from_pixmap_bit, EXT_visual_info_bit, diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxcmds.c xorg-server-hwe-16.04-1.19.3/glx/glxcmds.c --- xorg-server-hwe-16.04-1.18.4/glx/glxcmds.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxcmds.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,6 +45,7 @@ #include "indirect_dispatch.h" #include "indirect_table.h" #include "indirect_util.h" +#include "protocol-versions.h" static char GLXServerVendorName[] = "SGI"; @@ -145,7 +146,7 @@ return TRUE; } -static int +int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, __GLXdrawable ** drawable, int *err) { @@ -313,16 +314,8 @@ glxc->id = gcId; glxc->share_id = shareList; glxc->idExists = GL_TRUE; - glxc->currentClient = NULL; glxc->isDirect = isDirect; - glxc->hasUnflushedCommands = GL_FALSE; glxc->renderMode = GL_RENDER; - glxc->feedbackBuf = NULL; - glxc->feedbackBufSize = 0; - glxc->selectBuf = NULL; - glxc->selectBufSize = 0; - glxc->drawPriv = NULL; - glxc->readPriv = NULL; /* The GLX_ARB_create_context_robustness spec says: * @@ -643,10 +636,9 @@ if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) need_flush = GL_FALSE; #endif - if (prevglxc->hasUnflushedCommands && need_flush) { + if (need_flush) { if (__glXForceCurrent(cl, tag, (int *) &error)) { glFlush(); - prevglxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -797,8 +789,8 @@ .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .majorVersion = glxMajorVersion, - .minorVersion = glxMinorVersion + .majorVersion = SERVER_GLX_MAJOR_VERSION, + .minorVersion = SERVER_GLX_MINOR_VERSION }; if (client->swapped) { @@ -929,7 +921,6 @@ ** in both streams are completed before the copy is executed. */ glFinish(); - tagcx->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -1113,7 +1104,10 @@ WRITE_PAIR(GLX_VISUAL_ID, modes->visualID); WRITE_PAIR(GLX_FBCONFIG_ID, modes->fbconfigID); - WRITE_PAIR(GLX_X_RENDERABLE, GL_TRUE); + WRITE_PAIR(GLX_X_RENDERABLE, + (modes->drawableType & (GLX_WINDOW_BIT | GLX_PIXMAP_BIT) + ? GL_TRUE + : GL_FALSE)); WRITE_PAIR(GLX_RGBA, (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE); @@ -1703,7 +1697,6 @@ ** in both streams are completed before the swap is executed. */ glFinish(); - glxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -1900,7 +1893,6 @@ ** in both streams are completed before the swap is executed. */ glFinish(); - glxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -2123,7 +2115,6 @@ left -= cmdlen; commandsDone++; } - glxc->hasUnflushedCommands = GL_TRUE; return Success; } @@ -2334,7 +2325,6 @@ ** Skip over the header and execute the command. */ (*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); - glxc->hasUnflushedCommands = GL_TRUE; /* ** Reset for the next RenderLarge series. @@ -2443,6 +2433,10 @@ return Success; } +#ifndef GLX_VENDOR_NAMES_EXT +#define GLX_VENDOR_NAMES_EXT 0x20F6 +#endif + int __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) { @@ -2454,7 +2448,6 @@ char *buf; __GLXscreen *pGlxScreen; int err; - char ver_str[16]; REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); @@ -2466,15 +2459,17 @@ ptr = GLXServerVendorName; break; case GLX_VERSION: - /* Return to the server version rather than the screen version - * to prevent confusion when they do not match. - */ - snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); - ptr = ver_str; + ptr = "1.4"; break; case GLX_EXTENSIONS: ptr = pGlxScreen->GLXextensions; break; + case GLX_VENDOR_NAMES_EXT: + if (pGlxScreen->glvnd) { + ptr = pGlxScreen->glvnd; + break; + } + /* else fall through */ default: return BadValue; } diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxcontext.h xorg-server-hwe-16.04-1.19.3/glx/glxcontext.h --- xorg-server-hwe-16.04-1.18.4/glx/glxcontext.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxcontext.h 2017-03-15 18:05:25.000000000 +0000 @@ -94,11 +94,6 @@ GLboolean isDirect; /* - ** This flag keeps track of whether there are unflushed GL commands. - */ - GLboolean hasUnflushedCommands; - - /* ** Current rendering mode for this context. */ GLenum renderMode; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxdrawable.h xorg-server-hwe-16.04-1.19.3/glx/glxdrawable.h --- xorg-server-hwe-16.04-1.18.4/glx/glxdrawable.h 2016-07-15 16:17:34.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxdrawable.h 2017-03-15 18:05:25.000000000 +0000 @@ -74,4 +74,7 @@ unsigned long eventMask; }; +extern int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, + __GLXdrawable **drawable, int *err); + #endif /* !__GLX_drawable_h__ */ diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxdri2.c xorg-server-hwe-16.04-1.19.3/glx/glxdri2.c --- xorg-server-hwe-16.04-1.18.4/glx/glxdri2.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxdri2.c 2017-03-15 18:05:25.000000000 +0000 @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -40,7 +39,6 @@ #include #define _XF86DRI_SERVER_ -#include #include #include @@ -75,8 +73,6 @@ const __DRIswapControlExtension *swapControl; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; - - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -100,21 +96,6 @@ }; static void -__glXDRIdrawableDestroy(__GLXdrawable * drawable) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - const __DRIcoreExtension *core = private->screen->core; - - FreeResource(private->dri2_id, FALSE); - - (*core->destroyDrawable) (private->driDrawable); - - __glXDrawableRelease(drawable); - - free(private); -} - -static void copy_box(__GLXdrawable * drawable, int dst, int src, int x, int y, int w, int h) @@ -136,6 +117,24 @@ } } +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + +static void +__glXDRIdrawableDestroy(__GLXdrawable * drawable) +{ + __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; + const __DRIcoreExtension *core = private->screen->core; + + FreeResource(private->dri2_id, FALSE); + + (*core->destroyDrawable) (private->driDrawable); + + __glXDrawableRelease(drawable); + + free(private); +} + static void __glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable, int x, int y, int w, int h) @@ -296,7 +295,7 @@ } if (ret) { - *error = cl->client->noClientException; + *error = -1; return TRUE; } @@ -341,32 +340,6 @@ __glXDRIreleaseTexImage }; -static void -__glXDRIscreenDestroy(__GLXscreen * baseScreen) -{ - int i; - - ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen); - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - - (*screen->core->destroyScreen) (screen->driScreen); - - dlclose(screen->driver); - - __glXScreenDestroy(baseScreen); - - if (screen->driConfigs) { - for (i = 0; screen->driConfigs[i] != NULL; i++) - free((__DRIconfig **) screen->driConfigs[i]); - free(screen->driConfigs); - } - - pScrn->EnterVT = screen->enterVT; - pScrn->LeaveVT = screen->leaveVT; - - free(screen); -} - static Bool dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, const uint32_t *attribs, @@ -779,8 +752,11 @@ static void dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate) { + __GLXDRIdrawable *private = (__GLXDRIdrawable *) loaderPrivate; (void) driDrawable; - __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate); + + copy_box(loaderPrivate, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft, + 0, 0, private->width, private->height); } static const __DRIdri2LoaderExtension loaderExtension = { @@ -847,18 +823,19 @@ * @param screen The screen where glx_enable_bits are to be set. */ static void -initializeExtensions(__GLXDRIscreen * screen) +initializeExtensions(__GLXscreen * screen) { - ScreenPtr pScreen = screen->base.pScreen; + ScreenPtr pScreen = screen->pScreen; + __GLXDRIscreen *dri = (__GLXDRIscreen *)screen; const __DRIextension **extensions; int i; - extensions = screen->core->getExtensions(screen->driScreen); + 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"); - if (screen->dri2->base.version >= 3) { + if (dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, @@ -876,10 +853,8 @@ if (DRI2HasSwapControl(pScreen)) { __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control"); LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); + LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control\n"); } /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */ @@ -902,27 +877,21 @@ } for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_make_current_read"); - - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); - } - if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ + 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 && extensions[i]->version >= 3) { - screen->flush = (__DRI2flushExtension *) extensions[i]; + dri->flush = (__DRI2flushExtension *) extensions[i]; } if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 && - screen->dri2->base.version >= 3) { + dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_robustness"); LogMessage(X_INFO, @@ -940,16 +909,49 @@ } } -/* white lie */ -extern glx_func_ptr glXGetProcAddressARB(const char *); +static void +__glXDRIscreenDestroy(__GLXscreen * baseScreen) +{ + int i; + + ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen); + __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; + + (*screen->core->destroyScreen) (screen->driScreen); + + dlclose(screen->driver); + + __glXScreenDestroy(baseScreen); + + if (screen->driConfigs) { + for (i = 0; screen->driConfigs[i] != NULL; i++) + free((__DRIconfig **) screen->driConfigs[i]); + free(screen->driConfigs); + } + + pScrn->EnterVT = screen->enterVT; + pScrn->LeaveVT = screen->leaveVT; + + free(screen); +} + +enum { + GLXOPT_VENDOR_LIBRARY, +}; + +static const OptionInfoRec GLXOptions[] = { + { GLXOPT_VENDOR_LIBRARY, "GlxVendorLibrary", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE }, +}; static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; - size_t buffer_size; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + const char *glvnd = NULL; + OptionInfoPtr options; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -968,7 +970,7 @@ screen->base.swapInterval = __glXDRIdrawableSwapInterval; screen->base.pScreen = pScreen; - __glXInitExtensionEnableBits(screen->glx_enable_bits); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1, @@ -988,39 +990,23 @@ goto handle_error; } - initializeExtensions(screen); + initializeExtensions(&screen->base); - screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, - GLX_WINDOW_BIT | - GLX_PIXMAP_BIT | - GLX_PBUFFER_BIT); + screen->base.fbconfigs = glxConvertConfigs(screen->core, + screen->driConfigs); - __glXScreenInit(&screen->base, pScreen); + options = xnfalloc(sizeof(GLXOptions)); + memcpy(options, GLXOptions, sizeof(GLXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); + glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY); + if (glvnd) + screen->base.glvnd = xnfstrdup(glvnd); + free(options); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - - /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled - * drivers support the required extensions for GLX 1.4. The extensions - * we're assuming are: - * - * - GLX_SGI_make_current_read (1.3) - * - GLX_SGIX_fbconfig (1.3) - * - GLX_SGIX_pbuffer (1.3) - * - GLX_ARB_multisample (1.4) - */ - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; + if (!screen->base.glvnd) + screen->base.glvnd = strdup("mesa"); + + __glXScreenInit(&screen->base, pScreen); screen->enterVT = pScrn->EnterVT; pScrn->EnterVT = glxDRIEnterVT; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxdricommon.c xorg-server-hwe-16.04-1.19.3/glx/glxdricommon.c --- xorg-server-hwe-16.04-1.18.4/glx/glxdricommon.c 2016-07-15 16:17:45.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxdricommon.c 2017-03-15 18:05:25.000000000 +0000 @@ -122,14 +122,28 @@ } } +static Bool +render_type_is_pbuffer_only(unsigned renderType) +{ + /* The GL_ARB_color_buffer_float spec says: + * + * "Note that floating point rendering is only supported for + * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the + * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the + * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." + */ + return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT + | __DRI_ATTRIB_FLOAT_BIT)); +} + static __GLXconfig * createModeFromConfig(const __DRIcoreExtension * core, const __DRIconfig * driConfig, - unsigned int visualType, unsigned int drawableType) + unsigned int visualType) { __GLXDRIconfig *config; GLint renderType = 0; - unsigned int attrib, value; + unsigned int attrib, value, drawableType = GLX_PBUFFER_BIT; int i; config = calloc(1, sizeof *config); @@ -173,8 +187,10 @@ } } + if (!render_type_is_pbuffer_only(renderType)) + drawableType |= GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + config->config.next = NULL; - config->config.xRenderable = GL_TRUE; config->config.visualType = visualType; config->config.renderType = renderType; config->config.drawableType = drawableType; @@ -183,23 +199,9 @@ return &config->config; } -static Bool -render_type_is_pbuffer_only(unsigned renderType) -{ - /* The GL_ARB_color_buffer_float spec says: - * - * "Note that floating point rendering is only supported for - * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the - * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the - * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." - */ - return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT - | __DRI_ATTRIB_FLOAT_BIT)); -} - __GLXconfig * glxConvertConfigs(const __DRIcoreExtension * core, - const __DRIconfig ** configs, unsigned int drawableType) + const __DRIconfig ** configs) { __GLXconfig head, *tail; int i; @@ -208,17 +210,7 @@ head.next = NULL; for (i = 0; configs[i]; i++) { - unsigned renderType = 0; - if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, - &renderType)) { - if (render_type_is_pbuffer_only(renderType) && - !(drawableType & GLX_PBUFFER_BIT)) - continue; - } - /* Add all the others */ - tail->next = createModeFromConfig(core, - configs[i], GLX_TRUE_COLOR, - drawableType); + tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR); if (tail->next == NULL) break; @@ -226,17 +218,7 @@ } for (i = 0; configs[i]; i++) { - unsigned int renderType = 0; - if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, - &renderType)) { - if (render_type_is_pbuffer_only(renderType) && - !(drawableType & GLX_PBUFFER_BIT)) - continue; - } - /* Add all the others */ - tail->next = createModeFromConfig(core, - configs[i], GLX_DIRECT_COLOR, - drawableType); + tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR); if (tail->next == NULL) break; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxdricommon.h xorg-server-hwe-16.04-1.19.3/glx/glxdricommon.h --- xorg-server-hwe-16.04-1.18.4/glx/glxdricommon.h 2016-07-15 16:17:34.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxdricommon.h 2017-03-15 18:05:25.000000000 +0000 @@ -33,8 +33,7 @@ }; __GLXconfig *glxConvertConfigs(const __DRIcoreExtension * core, - const __DRIconfig ** configs, - unsigned int drawableType); + const __DRIconfig ** configs); extern const __DRIsystemTimeExtension systemTimeExtension; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxdriswrast.c xorg-server-hwe-16.04-1.19.3/glx/glxdriswrast.c --- xorg-server-hwe-16.04-1.18.4/glx/glxdriswrast.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxdriswrast.c 2017-03-15 18:05:25.000000000 +0000 @@ -89,6 +89,9 @@ GCPtr swapgc; /* GC for swapping the color buffers */ }; +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + static void __glXDRIdrawableDestroy(__GLXdrawable * drawable) { @@ -210,28 +213,6 @@ __glXDRIreleaseTexImage }; -static void -__glXDRIscreenDestroy(__GLXscreen * baseScreen) -{ - int i; - - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - - (*screen->core->destroyScreen) (screen->driScreen); - - dlclose(screen->driver); - - __glXScreenDestroy(baseScreen); - - if (screen->driConfigs) { - for (i = 0; screen->driConfigs[i] != NULL; i++) - free((__DRIconfig **) screen->driConfigs[i]); - free(screen->driConfigs); - } - - free(screen); -} - static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, @@ -391,15 +372,16 @@ }; static void -initializeExtensions(__GLXDRIscreen * screen) +initializeExtensions(__GLXscreen * screen) { const __DRIextension **extensions; + __GLXDRIscreen *dri = (__GLXDRIscreen *)screen; int i; __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); + LogMessage(X_INFO, "IGLX: enabled GLX_MESA_copy_sub_buffer\n"); - if (screen->swrast->base.version >= 3) { + if (dri->swrast->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, @@ -414,19 +396,18 @@ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_fbconfig_packed_float"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_texture_from_pixmap"); - extensions = screen->core->getExtensions(screen->driScreen); + extensions = dri->core->getExtensions(dri->driScreen); for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { - screen->copySubBuffer = + dri->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ + dri->texBuffer = (const __DRItexBufferExtension *) extensions[i]; } #ifdef __DRI2_FLUSH_CONTROL @@ -439,15 +420,33 @@ } } -/* white lie */ -extern glx_func_ptr glXGetProcAddressARB(const char *); +static void +__glXDRIscreenDestroy(__GLXscreen * baseScreen) +{ + int i; + + __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; + + (*screen->core->destroyScreen) (screen->driScreen); + + dlclose(screen->driver); + + __glXScreenDestroy(baseScreen); + + if (screen->driConfigs) { + for (i = 0; screen->driConfigs[i] != NULL; i++) + free((__DRIconfig **) screen->driConfigs[i]); + free(screen->driConfigs); + } + + free(screen); +} static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; - size_t buffer_size; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -459,7 +458,7 @@ screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; - __glXInitExtensionEnableBits(screen->glx_enable_bits); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); screen->driver = glxProbeDriver(driverName, (void **) &screen->core, @@ -476,38 +475,23 @@ &screen->driConfigs, screen); if (screen->driScreen == NULL) { - LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed\n"); + LogMessage(X_ERROR, "IGLX error: Calling driver entry point failed\n"); goto handle_error; } - initializeExtensions(screen); + initializeExtensions(&screen->base); - screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, - GLX_WINDOW_BIT | - GLX_PIXMAP_BIT | - GLX_PBUFFER_BIT); + screen->base.fbconfigs = glxConvertConfigs(screen->core, + screen->driConfigs); +#if !defined(XQUARTZ) && !defined(WIN32) + screen->base.glvnd = strdup("mesa"); +#endif __glXScreenInit(&screen->base, pScreen); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - __glXsetGetProcAddress(glXGetProcAddressARB); - LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); + LogMessage(X_INFO, "IGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxext.c xorg-server-hwe-16.04-1.19.3/glx/glxext.c --- xorg-server-hwe-16.04-1.18.4/glx/glxext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxext.c 2017-03-15 18:05:25.000000000 +0000 @@ -136,7 +136,6 @@ (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { /* flush the context */ glFlush(); - c->hasUnflushedCommands = GL_FALSE; /* just force a re-bind the next time through */ (*c->loseCurrent) (c); lastGLContext = NULL; @@ -337,6 +336,23 @@ return False; } +static void +GetGLXDrawableBytes(void *value, XID id, ResourceSizePtr size) +{ + __GLXdrawable *draw = value; + + size->resourceSize = 0; + size->pixmapRefSize = 0; + size->refCnt = 1; + + if (draw->type == GLX_DRAWABLE_PIXMAP) { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, }; + pixmapSizeFunc((PixmapPtr)draw->pDraw, draw->pDraw->id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + /* ** Initialize the GLX extension. */ @@ -366,6 +382,8 @@ if (!__glXContextRes || !__glXDrawableRes) return; + SetResourceTypeSizeFunc(__glXDrawableRes, GetGLXDrawableBytes); + if (!dixRegisterPrivateKey (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) return; @@ -380,8 +398,6 @@ glxScreen = p->screenProbe(pScreen); if (glxScreen != NULL) { - if (glxScreen->GLXminor < glxMinorVersion) - glxMinorVersion = glxScreen->GLXminor; LogMessage(X_INFO, "GLX: Initialized %s GL provider for screen %d\n", p->name, i); diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxscreens.c xorg-server-hwe-16.04-1.19.3/glx/glxscreens.c --- xorg-server-hwe-16.04-1.18.4/glx/glxscreens.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxscreens.c 2017-03-15 18:05:25.000000000 +0000 @@ -154,27 +154,6 @@ "GL_SGIX_shadow_ambient " "GL_SUN_slice_accum "; -/* -** We have made the simplifying assuption that the same extensions are -** supported across all screens in a multi-screen system. -*/ -unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; -unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; -static char GLXServerExtensions[] = - "GLX_ARB_multisample " - "GLX_EXT_visual_info " - "GLX_EXT_visual_rating " - "GLX_EXT_import_context " - "GLX_EXT_texture_from_pixmap " - "GLX_OML_swap_method " - "GLX_SGI_make_current_read " -#ifndef __APPLE__ - "GLX_SGIS_multisample " -#endif - "GLX_SGIX_fbconfig " - "GLX_SGIX_pbuffer " - "GLX_MESA_copy_sub_buffer "; - static Bool glxCloseScreen(ScreenPtr pScreen) { @@ -329,16 +308,7 @@ pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = strdup(GLServerExtensions); - pGlxScreen->GLXextensions = strdup(GLXServerExtensions); - - /* All GLX providers must support all of the functionality required for at - * least GLX 1.2. If the provider supports a higher version, the GLXminor - * version can be changed in the provider's screen-probe routine. For - * most providers, the screen-probe routine is the caller of this - * function. - */ - pGlxScreen->GLXmajor = 1; - pGlxScreen->GLXminor = 2; + pGlxScreen->GLXextensions = NULL; pGlxScreen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = glxCloseScreen; @@ -413,11 +383,23 @@ } dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen); + + if (pGlxScreen->glvnd) + __glXEnableExtension(pGlxScreen->glx_enable_bits, "GLX_EXT_libglvnd"); + + i = __glXGetExtensionString(pGlxScreen->glx_enable_bits, NULL); + if (i > 0) { + pGlxScreen->GLXextensions = xnfalloc(i); + (void) __glXGetExtensionString(pGlxScreen->glx_enable_bits, + pGlxScreen->GLXextensions); + } + } void __glXScreenDestroy(__GLXscreen * screen) { + free(screen->glvnd); free(screen->GLXextensions); free(screen->GLextensions); free(screen->visuals); diff -Nru xorg-server-hwe-16.04-1.18.4/glx/glxscreens.h xorg-server-hwe-16.04-1.19.3/glx/glxscreens.h --- xorg-server-hwe-16.04-1.18.4/glx/glxscreens.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/glxscreens.h 2017-03-15 18:05:25.000000000 +0000 @@ -35,6 +35,8 @@ * Silicon Graphics, Inc. */ +#include "extension_string.h" + typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { __GLXconfig *next; @@ -76,7 +78,6 @@ /* SGIX_fbconfig / GLX 1.3 */ GLint drawableType; GLint renderType; - GLint xRenderable; GLint fbconfigID; /* SGIX_pbuffer / GLX 1.3 */ @@ -140,19 +141,9 @@ GLint numVisuals; char *GLextensions; - char *GLXextensions; - - /** - * \name GLX version supported by this screen. - * - * Since the GLX version advertised by the server is for the whole server, - * the GLX protocol code uses the minimum version supported on all screens. - */ - /*@{ */ - unsigned GLXmajor; - unsigned GLXminor; - /*@} */ + char *glvnd; + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; Bool (*CloseScreen) (ScreenPtr pScreen); }; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/Makefile.am xorg-server-hwe-16.04-1.19.3/glx/Makefile.am --- xorg-server-hwe-16.04-1.18.4/glx/Makefile.am 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -1,4 +1,4 @@ -if AIGLX_DRI_LOADER +if DRI2 GLXDRI_LIBRARY = libglxdri.la endif @@ -20,13 +20,10 @@ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 \ -I$(top_srcdir)/mi \ -I$(top_srcdir)/present -if DRI2_AIGLX -AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/dri2 -endif - indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ @@ -39,8 +36,7 @@ indirect_table.c libglxdri_la_SOURCES = - -if DRI2_AIGLX +if DRI2 libglxdri_la_SOURCES += glxdri2.c endif diff -Nru xorg-server-hwe-16.04-1.18.4/glx/Makefile.in xorg-server-hwe-16.04-1.19.3/glx/Makefile.in --- xorg-server-hwe-16.04-1.18.4/glx/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -88,14 +88,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@DRI2_AIGLX_TRUE@am__append_1 = -I$(top_srcdir)/hw/xfree86/dri2 -@DRI2_AIGLX_TRUE@am__append_2 = glxdri2.c +@DRI2_TRUE@am__append_1 = glxdri2.c subdir = glx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,10 +129,10 @@ am__v_lt_1 = libglxdri_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libglxdri_la_SOURCES_DIST = glxdri2.c -@DRI2_AIGLX_TRUE@am__objects_2 = glxdri2.lo +@DRI2_TRUE@am__objects_2 = glxdri2.lo am_libglxdri_la_OBJECTS = $(am__objects_2) libglxdri_la_OBJECTS = $(am_libglxdri_la_OBJECTS) -@AIGLX_DRI_LOADER_TRUE@am_libglxdri_la_rpath = +@DRI2_TRUE@am_libglxdri_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -370,6 +370,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -400,7 +403,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -495,6 +501,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -542,7 +549,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@AIGLX_DRI_LOADER_TRUE@GLXDRI_LIBRARY = libglxdri.la +@DRI2_TRUE@GLXDRI_LIBRARY = libglxdri.la noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @@ -555,11 +562,15 @@ # none yet #sdk_HEADERS = -AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support \ +AM_CPPFLAGS = \ + -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ - -I$(top_srcdir)/hw/xfree86/dri -I$(top_srcdir)/mi \ - -I$(top_srcdir)/present $(am__append_1) + -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 \ + -I$(top_srcdir)/mi \ + -I$(top_srcdir)/present + indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ @@ -571,7 +582,7 @@ indirect_size_get.h \ indirect_table.c -libglxdri_la_SOURCES = $(am__append_2) +libglxdri_la_SOURCES = $(am__append_1) libglxdri_la_LIBADD = $(DLOPEN_LIBS) libglx_la_SOURCES = \ $(indirect_sources) \ diff -Nru xorg-server-hwe-16.04-1.18.4/glx/single2.c xorg-server-hwe-16.04-1.19.3/glx/single2.c --- xorg-server-hwe-16.04-1.18.4/glx/single2.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/single2.c 2017-03-15 18:05:25.000000000 +0000 @@ -71,7 +71,6 @@ cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -102,7 +101,6 @@ cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -225,7 +223,6 @@ } glFlush(); - cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -245,7 +242,6 @@ /* Do a local glFinish */ glFinish(); - cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ client = cl->client; diff -Nru xorg-server-hwe-16.04-1.18.4/glx/single2swap.c xorg-server-hwe-16.04-1.19.3/glx/single2swap.c --- xorg-server-hwe-16.04-1.18.4/glx/single2swap.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/single2swap.c 2017-03-15 18:05:25.000000000 +0000 @@ -72,7 +72,6 @@ cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -107,7 +106,6 @@ cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -245,7 +243,6 @@ } glFlush(); - cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -268,7 +265,6 @@ /* Do a local glFinish */ glFinish(); - cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ __GLX_BEGIN_REPLY(0); diff -Nru xorg-server-hwe-16.04-1.18.4/glx/singlepix.c xorg-server-hwe-16.04-1.19.3/glx/singlepix.c --- xorg-server-hwe-16.04-1.18.4/glx/singlepix.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/singlepix.c 2017-03-15 18:05:25.000000000 +0000 @@ -86,7 +86,6 @@ __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - cx->hasUnflushedCommands = GL_FALSE; return Success; } diff -Nru xorg-server-hwe-16.04-1.18.4/glx/singlepixswap.c xorg-server-hwe-16.04-1.19.3/glx/singlepixswap.c --- xorg-server-hwe-16.04-1.18.4/glx/singlepixswap.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/glx/singlepixswap.c 2017-03-15 18:05:25.000000000 +0000 @@ -98,7 +98,6 @@ __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - cx->hasUnflushedCommands = GL_FALSE; return Success; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/config/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/config/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/config/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/config/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/dmx/config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -437,6 +438,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -467,7 +471,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -562,6 +569,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/config/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/config/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/config/man/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/config/man/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/dmx/config/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/config/scanner.c xorg-server-hwe-16.04-1.19.3/hw/dmx/config/scanner.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/config/scanner.c 2016-07-18 19:16:17.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/config/scanner.c 2017-03-15 18:06:11.000000000 +0000 @@ -7,8 +7,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -141,7 +141,15 @@ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -174,7 +182,7 @@ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ @@ -344,11 +352,17 @@ int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -382,7 +396,7 @@ 1, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -414,14 +428,14 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[30] = +static yyconst YY_CHAR yy_meta[30] = { 0, 1, 1, 2, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1 } ; -static yyconst flex_int16_t yy_base[77] = +static yyconst flex_uint16_t yy_base[77] = { 0, 0, 101, 0, 100, 104, 107, 101, 107, 98, 0, 0, 92, 0, 28, 107, 29, 86, 80, 86, 83, @@ -445,7 +459,7 @@ 75, 0, 72, 72, 72, 72 } ; -static yyconst flex_int16_t yy_nxt[137] = +static yyconst flex_uint16_t yy_nxt[137] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 11, 17, 11, 11, 11, 11, 18, 19, 11, @@ -547,7 +561,7 @@ static int getcomment(int token, const char *text, int leng); static int lineno = 1; -#line 551 "scanner.c" +#line 565 "scanner.c" #define INITIAL 0 #define OTHER 1 @@ -581,11 +595,11 @@ FILE *yyget_in (void ); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * _in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * _out_str ); yy_size_t yyget_leng (void ); @@ -593,7 +607,7 @@ int yyget_lineno (void ); -void yyset_lineno (int line_number ); +void yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -607,8 +621,12 @@ #endif #endif +#ifndef YY_NO_UNPUT + static void yyunput (int c,char *buf_ptr ); +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -629,7 +647,12 @@ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -716,7 +739,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -729,9 +752,9 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -762,9 +785,9 @@ { #line 63 "scanner.l" -#line 766 "scanner.c" +#line 789 "scanner.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -781,7 +804,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -926,7 +949,7 @@ #line 84 "scanner.l" ECHO; YY_BREAK -#line 930 "scanner.c" +#line 953 "scanner.c" case YY_END_OF_BUFFER: { @@ -1067,9 +1090,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1098,7 +1121,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1111,7 +1134,7 @@ else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1201,15 +1224,15 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1234,10 +1257,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1255,9 +1278,11 @@ return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -1267,10 +1292,10 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1292,6 +1317,8 @@ (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1443,7 +1470,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1598,7 +1625,7 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -1615,7 +1642,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -1723,7 +1750,7 @@ static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1734,7 +1761,7 @@ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ @@ -1789,29 +1816,29 @@ } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -1819,9 +1846,9 @@ return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -1881,7 +1908,8 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1890,7 +1918,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1900,11 +1928,12 @@ void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1917,7 +1946,7 @@ void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxfont.c xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxfont.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxfont.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxfont.c 2017-03-15 18:05:25.000000000 +0000 @@ -46,6 +46,7 @@ #include "dmxlog.h" #include +#include #include "dixfont.h" #include "dixstruct.h" @@ -447,7 +448,7 @@ dmxFontPrivPtr pFontPriv; if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); pFontPriv = malloc(sizeof(dmxFontPrivRec)); if (!pFontPriv) return FALSE; @@ -460,7 +461,7 @@ pFontPriv->refcnt = 0; } - FontSetPrivate(pFont, dmxFontPrivateIndex, (void *) pFontPriv); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, (void *) pFontPriv); if (dmxScreen->beDisplay) { if (!dmxBELoadFont(pScreen, pFont)) @@ -504,7 +505,7 @@ if (!pFontPriv->refcnt) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); } else if (pFontPriv->font[pScreen->myNum]) { if (dmxScreen->beDisplay) @@ -563,7 +564,7 @@ ) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); } } } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxinput.c xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxinput.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxinput.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxinput.c 2017-03-15 18:05:25.000000000 +0000 @@ -123,3 +123,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) { } + +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxinput.h xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxinput.h --- xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxinput.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxinput.h 2017-03-15 18:05:25.000000000 +0000 @@ -47,9 +47,6 @@ #ifndef DMXINPUT_H #define DMXINPUT_H -/** Maximum number of file descriptors for SIGIO handling */ -#define DMX_MAX_SIGIO_FDS 4 - struct _DMXInputInfo; /** Reason why window layout was updated. */ @@ -69,15 +66,6 @@ /** An opaque structure that is only exposed in the dmx/input layer. */ typedef struct _DMXLocalInputInfo *DMXLocalInputInfoPtr; -/** State of the SIGIO engine */ -typedef enum { - DMX_NOSIGIO = 0, /**< Device does not use SIGIO at all. */ - DMX_USESIGIO, /**< Device can use SIGIO, but is not - * (e.g., because the VT is switch - * away). */ - DMX_ACTIVESIGIO /**< Device is currently using SIGIO. */ -} dmxSigioState; - /** DMXInputInfo is typedef'd in \a dmx.h so that all routines can have * access to the global pointers. However, the elements are only * available to input-related routines. */ @@ -102,12 +90,6 @@ ProcessInputEventsProc processInputEvents; UpdateWindowInfoProc updateWindowInfo; - /* Local input information */ - dmxSigioState sigioState; /**< Current stat */ - int sigioFdCount; /**< Number of fds in use */ - int sigioFd[DMX_MAX_SIGIO_FDS]; /**< List of fds */ - Bool sigioAdded[DMX_MAX_SIGIO_FDS]; /**< Active fds */ - /** True if a VT switch is pending, but has not yet happened. */ int vt_switch_pending; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxscrinit.c xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxscrinit.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxscrinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxscrinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -58,6 +58,8 @@ #include "mipointer.h" #include "micmap.h" +#include + extern Bool dmxCloseScreen(ScreenPtr pScreen); static Bool dmxSaveScreen(ScreenPtr pScreen, int what); @@ -187,7 +189,7 @@ if (dmxGeneration != serverGeneration) { /* Allocate font private index */ - dmxFontPrivateIndex = AllocateFontPrivateIndex(); + dmxFontPrivateIndex = xfont2_allocate_font_private_index(); if (dmxFontPrivateIndex == -1) return FALSE; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxsync.c xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxsync.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/dmxsync.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/dmxsync.c 2017-03-15 18:05:25.000000000 +0000 @@ -99,13 +99,13 @@ } static void -dmxSyncBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +dmxSyncBlockHandler(void *blockData, void *timeout) { TimerForce(dmxSyncTimer); } static void -dmxSyncWakeupHandler(void *blockData, int result, void *pReadMask) +dmxSyncWakeupHandler(void *blockData, int result) { } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/doc/dmx.xml xorg-server-hwe-16.04-1.19.3/hw/dmx/doc/dmx.xml --- xorg-server-hwe-16.04-1.18.4/hw/dmx/doc/dmx.xml 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/doc/dmx.xml 2017-03-15 18:05:25.000000000 +0000 @@ -944,14 +944,9 @@ devReadInput() Each device will have some function that gets called to read its -physical input. These may be called in a number of different ways. In -the case of synchronous I/O, they will be called from a DDX -wakeup-handler that gets called after the server detects that new input is -available. In the case of asynchronous I/O, they will be called from a -(SIGIO) signal handler triggered when new input is available. This -function should do at least two things: make sure that input events get -enqueued, and make sure that the cursor gets moved for motion events -(except if these are handled later by the driver's own event queue +physical input. This function should do at least two things: make sure that +input events get enqueued, and make sure that the cursor gets moved for motion +events (except if these are handled later by the driver's own event queue processing function, which cannot be done when using the MI event queue handling). diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/doc/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/doc/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/doc/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/doc/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -131,9 +131,10 @@ subdir = hw/dmx/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) \ @@ -348,6 +349,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -378,7 +382,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -473,6 +480,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/doxygen/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/doxygen/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/doxygen/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/doxygen/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -112,9 +112,10 @@ subdir = hw/dmx/doxygen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) \ @@ -329,6 +330,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/examples/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/examples/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/examples/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/examples/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -96,9 +96,10 @@ subdir = hw/dmx/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -458,6 +459,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -488,7 +492,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -583,6 +590,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/glxProxy/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/glxProxy/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/glxProxy/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/glxProxy/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/dmx/glxProxy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -364,6 +365,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -394,7 +398,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -489,6 +496,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxcommon.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxcommon.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxcommon.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxcommon.c 2017-03-15 18:05:25.000000000 +0000 @@ -480,17 +480,26 @@ return NULL; } +static void +dmxCommonFdNotify(int fd, int ready, void *data) +{ + /* This should process input on this fd, but instead all + * of that is delayed until the block and wakeup handlers are called + */ + ; +} + static void * dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure) { - AddEnabledDevice(XConnectionNumber(dmxScreen->beDisplay)); + SetNotifyFd(XConnectionNumber(dmxScreen->beDisplay), dmxCommonFdNotify, X_NOTIFY_READ, closure); return NULL; } static void * dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure) { - RemoveEnabledDevice(XConnectionNumber(dmxScreen->beDisplay)); + RemoveNotifyFd(XConnectionNumber(dmxScreen->beDisplay)); return NULL; } @@ -504,7 +513,7 @@ priv->eventMask |= DMX_POINTER_EVENT_MASK; if (!priv->be) { XSelectInput(priv->display, priv->window, priv->eventMask); - AddEnabledDevice(XConnectionNumber(priv->display)); + SetNotifyFd(XConnectionNumber(priv->display), dmxCommonFdNotify,X_NOTIFY_READ, pDev); } else { dmxPropertyIterate(priv->be, dmxCommonXSelect, priv); @@ -523,7 +532,7 @@ priv->eventMask &= ~DMX_POINTER_EVENT_MASK; if (!priv->be) { - RemoveEnabledDevice(XConnectionNumber(priv->display)); + RemoveNotifyFd(XConnectionNumber(priv->display)); XSelectInput(priv->display, priv->window, priv->eventMask); } else { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxevents.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxevents.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxevents.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxevents.c 2017-03-15 18:05:25.000000000 +0000 @@ -47,7 +47,6 @@ #include "dmxcommon.h" #include "dmxcursor.h" #include "dmxmotion.h" -#include "dmxsigio.h" #include "dmxmap.h" #include @@ -227,25 +226,25 @@ && pScreen->myNum == dmxScreen->index) { /* Screen is old screen */ if (block) - OsBlockSIGIO(); + input_lock(); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - OsReleaseSIGIO(); + input_unlock(); } else { /* Screen is new */ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n", pScreen->myNum, dmxScreen->index, localX, localY); if (block) - OsBlockSIGIO(); + input_lock(); mieqProcessInputEvents(); miPointerSetScreen(inputInfo.pointer, dmxScreen->index, localX, localY); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - OsReleaseSIGIO(); + input_unlock(); } #if 00 miPointerGetPosition(inputInfo.pointer, &localX, &localY); @@ -387,12 +386,12 @@ } if (block) - OsBlockSIGIO(); + input_lock(); valuator_mask_set_range(&mask, firstAxis, axesCount, v); QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); } static int @@ -489,10 +488,10 @@ case XI_DeviceKeyPress: case XI_DeviceKeyRelease: if (block) - OsBlockSIGIO(); + input_lock(); QueueKeyboardEvents(pDevice, event, ke->keycode); if (block) - OsReleaseSIGIO(); + input_unlock(); break; case XI_DeviceButtonPress: case XI_DeviceButtonRelease: @@ -500,11 +499,11 @@ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - OsBlockSIGIO(); + input_lock(); QueuePointerEvents(pDevice, event, ke->keycode, POINTER_ABSOLUTE, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); break; case XI_ProximityIn: case XI_ProximityOut: @@ -512,10 +511,10 @@ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - OsBlockSIGIO(); + input_lock(); QueueProximityEvents(pDevice, event, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); break; break; @@ -586,7 +585,7 @@ * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be * allowed to move outside the global boundaires). * - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be + * If \a block is set to \a DMX_BLOCK, then the input thread will be * blocked around calls to \a enqueueMotion(). */ void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount, @@ -690,7 +689,7 @@ * KeyRelease event, then the \a keySym is also specified. * * FIXME: make the code do what the comment says, or remove this comment. - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be + * If \a block is set to \a DMX_BLOCK, then the input thread will be * blocked around calls to dmxeqEnqueue(). */ void diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxinputinit.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxinputinit.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxinputinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxinputinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,7 +63,6 @@ #include "usb-other.h" #include "usb-common.h" -#include "dmxsigio.h" #include "dmxarg.h" #include "inputstr.h" @@ -434,7 +433,6 @@ dmxDeviceOnOff(DeviceIntPtr pDevice, int what) { GETDMXINPUTFROMPDEVICE; - int fd; DMXLocalInitInfo info; int i; Atom btn_labels[MAX_BUTTONS] = { 0 }; /* FIXME */ @@ -523,8 +521,8 @@ break; case DEVICE_ON: if (!pDev->on) { - if (dmxLocal->on && (fd = dmxLocal->on(pDev)) >= 0) - dmxSigioRegister(dmxInput, fd); + if (dmxLocal->on) + dmxLocal->on(pDev); pDev->on = TRUE; } break; @@ -534,7 +532,6 @@ * detached screen (DEVICE_OFF), and then again at server * generation time (DEVICE_CLOSE). */ if (pDev->on) { - dmxSigioUnregister(dmxInput); if (dmxLocal->off) dmxLocal->off(pDev); pDev->on = FALSE; @@ -633,7 +630,7 @@ } static void -dmxBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +dmxBlockHandler(void *blockData, void *timeout) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; static unsigned long generation = 0; @@ -654,7 +651,6 @@ if (!dmxInput->vt_switched) dmxLog(dmxFatal, "dmxSwitchReturn called, but not switched\n"); - dmxSigioEnableInput(); for (i = 0; i < dmxInput->numDevs; i++) if (dmxInput->devs[i]->vt_post_switch) dmxInput->devs[i]->vt_post_switch(dmxInput->devs[i]->private); @@ -662,7 +658,7 @@ } static void -dmxWakeupHandler(void *blockData, int result, void *pReadMask) +dmxWakeupHandler(void *blockData, int result) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; int i; @@ -676,7 +672,6 @@ dmxInput->vt_switch_pending = 0; for (i = 0; i < dmxInput->numDevs; i++) { if (dmxInput->devs[i]->vt_switch) { - dmxSigioDisableInput(); if (!dmxInput->devs[i]->vt_switch(dmxInput->devs[i]->private, dmxInput->vt_switched, dmxSwitchReturn, dmxInput)) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxsigio.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxsigio.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxsigio.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxsigio.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -/* - * Copyright 2002-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 - * - * Provides an interface for handling SIGIO signals for input devices. */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "inputstr.h" -#include "dmxinputinit.h" -#include "dmxsigio.h" -#include "dmxevents.h" -#include -#include -#include - -static int dmxFdCount = 0; -static Bool dmxInputEnabled = TRUE; - -/* Define equivalents for non-POSIX systems (e.g., SGI IRIX, Solaris) */ -#ifndef O_ASYNC -#ifdef FASYNC -#define O_ASYNC FASYNC -#else -#define O_ASYNC 0 -#endif -#endif -#ifndef O_NONBLOCK -#define O_NONBLOCK FNONBLK -#endif - -static void -dmxSigioHandler(int sig) -{ - int i, j; - DMXInputInfo *dmxInput; - - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) { - if (dmxInput->sigioState == DMX_ACTIVESIGIO) { - for (j = 0; j < dmxInput->numDevs; j++) { - DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j]; - - if (dmxLocal->collect_events) { - dmxLocal->collect_events(&dmxLocal->pDevice->public, - dmxMotion, - dmxEnqueue, - dmxCheckSpecialKeys, DMX_NO_BLOCK); - } - } - } - } -} - -static void -dmxSigioHook(void) -{ - struct sigaction a; - sigset_t s; - - memset(&a, 0, sizeof(a)); - a.sa_handler = dmxSigioHandler; - sigemptyset(&a.sa_mask); - sigaddset(&a.sa_mask, SIGIO); - sigaddset(&a.sa_mask, SIGALRM); - sigaddset(&a.sa_mask, SIGVTALRM); - sigaction(SIGIO, &a, 0); - - sigemptyset(&s); - sigprocmask(SIG_SETMASK, &s, 0); -} - -static void -dmxSigioUnhook(void) -{ - struct sigaction a; - - memset(&a, 0, sizeof(a)); - a.sa_handler = SIG_IGN; - sigemptyset(&a.sa_mask); - sigaction(SIGIO, &a, 0); -} - -static void -dmxSigioAdd(DMXInputInfo * dmxInput) -{ - int flags; - int i; - - switch (dmxInput->sigioState) { - case DMX_NOSIGIO: - return; - case DMX_USESIGIO: - dmxInput->sigioState = DMX_ACTIVESIGIO; - break; - case DMX_ACTIVESIGIO: - return; - } - - for (i = 0; i < dmxInput->sigioFdCount; i++) { - if (!dmxInput->sigioAdded[i]) { - int fd = dmxInput->sigioFd[i]; - - fcntl(fd, F_SETOWN, getpid()); - flags = fcntl(fd, F_GETFL); - flags |= O_ASYNC | O_NONBLOCK; - fcntl(fd, F_SETFL, flags); - - AddEnabledDevice(fd); - dmxInput->sigioAdded[i] = TRUE; - - if (++dmxFdCount == 1) - dmxSigioHook(); - } - } -} - -static void -dmxSigioRemove(DMXInputInfo * dmxInput) -{ - int flags; - int i; - - switch (dmxInput->sigioState) { - case DMX_NOSIGIO: - return; - case DMX_USESIGIO: - return; - case DMX_ACTIVESIGIO: - dmxInput->sigioState = DMX_USESIGIO; - break; - } - - for (i = 0; i < dmxInput->sigioFdCount; i++) { - if (dmxInput->sigioAdded[i]) { - int fd = dmxInput->sigioFd[i]; - - dmxInput->sigioAdded[i] = FALSE; - RemoveEnabledDevice(fd); - - flags = fcntl(fd, F_GETFL); - flags &= ~(O_ASYNC | O_NONBLOCK); - fcntl(fd, F_SETFL, flags); - - if (!--dmxFdCount) - dmxSigioUnhook(); - } - } -} - -/** Enable SIGIO handling. This instantiates the handler with the OS. */ -void -dmxSigioEnableInput(void) -{ - int i; - DMXInputInfo *dmxInput; - - dmxInputEnabled = TRUE; - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) - dmxSigioAdd(dmxInput); -} - -/** Disable SIGIO handling. This removes the hanlder from the OS. */ -void -dmxSigioDisableInput(void) -{ - int i; - DMXInputInfo *dmxInput; - - dmxInputEnabled = FALSE; - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) - dmxSigioRemove(dmxInput); -} - -/** Make a note that the input device described in \a dmxInput will be - * using the file descriptor \a fd for SIGIO signals. Calls - * AddEnabledDevice ifi SIGIO handling has been enabled with - * #dmxSigioEnableInput(). */ -void -dmxSigioRegister(DMXInputInfo * dmxInput, int fd) -{ - dmxInput->sigioState = DMX_USESIGIO; - if (dmxInput->sigioFdCount >= DMX_MAX_SIGIO_FDS) - dmxLog(dmxFatal, "Too many SIGIO file descriptors (%d >= %d)\n", - dmxInput->sigioFdCount, DMX_MAX_SIGIO_FDS); - - dmxInput->sigioFd[dmxInput->sigioFdCount++] = fd; - if (dmxInputEnabled) - dmxSigioAdd(dmxInput); -} - -/** Remove the notes that \a dmxInput is using any file descriptors for - * SIGIO signals. Calls RemoveEnabledDevice. */ -void -dmxSigioUnregister(DMXInputInfo * dmxInput) -{ - if (dmxInput->sigioState == DMX_NOSIGIO) - return; - dmxSigioRemove(dmxInput); - dmxInput->sigioState = DMX_NOSIGIO; - dmxInput->sigioFdCount = 0; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxsigio.h xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxsigio.h --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/dmxsigio.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/dmxsigio.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +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 SIGIO handling support. \see dmxsigio.c */ - -#ifndef _DMXSIGIO_H_ -#define _DMXSIGIO_H_ -extern void dmxSigioEnableInput(void); -extern void dmxSigioDisableInput(void); -extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd); -extern void dmxSigioUnregister(DMXInputInfo * dmxInput); -#endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-keyboard.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-keyboard.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-keyboard.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-keyboard.c 2017-03-15 18:05:25.000000000 +0000 @@ -158,7 +158,6 @@ #include #include #include -#include #include #include #include @@ -505,7 +504,7 @@ { myPrivate *priv = PRIV; - signal(sig, kbdLinuxVTSignalHandler); + OsSignal(sig, kbdLinuxVTSignalHandler); if (priv) { ioctl(priv->fd, VT_RELDISP, VT_ACKACQ); priv->switched = !priv->switched; @@ -537,7 +536,7 @@ VT.acqsig = SIGUSR1; if (ioctl(fd, VT_SETMODE, &VT)) FATAL0("kbdLinuxActivate: VT_SETMODE VT_PROCESS failed\n"); - signal(SIGUSR1, kbdLinuxVTSignalHandler); + OsSignal(SIGUSR1, kbdLinuxVTSignalHandler); } return Success; } @@ -821,7 +820,7 @@ * 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 SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void kbdLinuxRead(DevicePtr pDev, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-ms.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-ms.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-ms.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-ms.c 2017-03-15 18:05:25.000000000 +0000 @@ -76,6 +76,7 @@ #include #include #include +#include /*****************************************************************************/ /* Define some macros to make it easier to move this file to another @@ -120,10 +121,11 @@ msLinuxReadBytes(int fd, unsigned char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; tot = 0; + poll_fd.fd = fd; + poll_fd.events = POLLIN; while (len) { n = read(fd, buf, len); if (n > 0) { @@ -133,11 +135,7 @@ } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } @@ -191,7 +189,7 @@ * 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 SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void msLinuxRead(DevicePtr pDev, @@ -246,7 +244,8 @@ if (tcgetattr(priv->fd, &priv->tty) < 0) FATAL1("msLinuxInit: tcgetattr failed (%s)\n", strerror(errno)); - write(priv->fd, "*n", 2); /* 1200 baud */ + i = write(priv->fd, "*n", 2); /* 1200 baud */ + (void) i; usleep(100000); } @@ -256,6 +255,7 @@ { GETPRIV; struct termios nTty; + int i; if (priv->fd < 0) msLinuxInit(pDev); @@ -273,7 +273,8 @@ cfsetospeed(&nTty, B1200); if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0) FATAL1("msLinuxInit: tcsetattr failed (%s)\n", strerror(errno)); - write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */ + i = write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */ + (void) i; return priv->fd; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-ps2.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-ps2.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/lnx-ps2.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/lnx-ps2.c 2017-03-15 18:05:25.000000000 +0000 @@ -73,6 +73,7 @@ #include #include #include +#include /*****************************************************************************/ /* Define some macros to make it easier to move this file to another @@ -116,9 +117,10 @@ ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; + poll_fd.fd = fd; + poll_fd.events = POLLIN; tot = 0; while (len) { n = read(fd, buf, len); @@ -129,11 +131,7 @@ } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } @@ -187,7 +185,7 @@ * 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 SIGIO handling as appropriate 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, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/dmx/input/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -34,8 +34,6 @@ dmxinputinit.h \ dmxarg.c \ dmxarg.h \ - dmxsigio.c \ - dmxsigio.h \ dmxevents.c \ dmxevents.h \ dmxxinput.c \ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/input/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/dmx/input ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -122,9 +123,9 @@ 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 dmxsigio.c \ - dmxsigio.h dmxevents.c dmxevents.h dmxxinput.c dmxmotion.c \ - dmxmotion.h dmxmap.c dmxmap.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) \ @@ -133,8 +134,8 @@ am__objects_3 = dmxdummy.$(OBJEXT) dmxbackend.$(OBJEXT) \ dmxconsole.$(OBJEXT) dmxcommon.$(OBJEXT) am__objects_4 = dmxinputinit.$(OBJEXT) dmxarg.$(OBJEXT) \ - dmxsigio.$(OBJEXT) dmxevents.$(OBJEXT) dmxxinput.$(OBJEXT) \ - dmxmotion.$(OBJEXT) dmxmap.$(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) libdmxinput_a_OBJECTS = $(am_libdmxinput_a_OBJECTS) @@ -379,6 +380,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -409,7 +413,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -504,6 +511,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -582,8 +590,6 @@ dmxinputinit.h \ dmxarg.c \ dmxarg.h \ - dmxsigio.c \ - dmxsigio.h \ dmxevents.c \ dmxevents.h \ dmxxinput.c \ @@ -667,7 +673,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxinputinit.Po@am__quote@ @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)/dmxsigio.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@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/usb-common.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/usb-common.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/usb-common.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/usb-common.c 2017-03-15 18:05:25.000000000 +0000 @@ -77,7 +77,7 @@ /** Read an event from the \a pDev device. If the event is a motion * event, enqueue it with the \a motion function. Otherwise, enqueue * the event with the \a enqueue function. The \a block type is passed - * to the functions so that they may block SIGIO handling as appropriate + * to the functions so that they may block the input thread as appropriate * to the caller of this function. * * Since USB devices return EV_KEY events for buttons and keys, \a diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/input/usb-keyboard.c xorg-server-hwe-16.04-1.19.3/hw/dmx/input/usb-keyboard.c --- xorg-server-hwe-16.04-1.18.4/hw/dmx/input/usb-keyboard.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/input/usb-keyboard.c 2017-03-15 18:05:25.000000000 +0000 @@ -379,7 +379,7 @@ * 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 SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void kbdUSBRead(DevicePtr pDev, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/dmx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -422,6 +423,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -452,7 +456,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -556,6 +563,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/dmx/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/dmx/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/dmx/man/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/dmx/man/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/dmx/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr.c 2017-03-15 18:05:25.000000000 +0000 @@ -36,13 +36,6 @@ #include "scrnintstr.h" #include "ephyrlog.h" -#ifdef XF86DRI -#include -#include "ephyrdri.h" -#include "ephyrdriext.h" -#include "ephyrglxext.h" -#endif /* XF86DRI */ - #ifdef GLAMOR #include "glamor.h" #endif @@ -54,7 +47,6 @@ KdKeyboardInfo *ephyrKbd; KdPointerInfo *ephyrMouse; -EphyrKeySyms ephyrKeySyms; Bool ephyrNoDRI = FALSE; Bool ephyrNoXV = FALSE; @@ -345,17 +337,35 @@ } static void -ephyrInternalDamageBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) -{ - ScreenPtr pScreen = (ScreenPtr) data; +ephyrXcbProcessEvents(Bool queued_only); - ephyrInternalDamageRedisplay(pScreen); +static Bool +ephyrEventWorkProc(ClientPtr client, void *closure) +{ + ephyrXcbProcessEvents(TRUE); + return TRUE; } static void -ephyrInternalDamageWakeupHandler(void *data, int i, void *LastSelectMask) +ephyrScreenBlockHandler(ScreenPtr pScreen, void *timeout) { - /* FIXME: Not needed ? */ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; + + pScreen->BlockHandler = scrpriv->BlockHandler; + (*pScreen->BlockHandler)(pScreen, timeout); + scrpriv->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = ephyrScreenBlockHandler; + + if (scrpriv->pDamage) + ephyrInternalDamageRedisplay(pScreen); + + if (hostx_has_queued_event()) { + if (!QueueWorkProc(ephyrEventWorkProc, NULL, NULL)) + FatalError("cannot queue event processing in ephyr block handler"); + AdjustWaitForDelay(timeout, 0); + } } Bool @@ -370,11 +380,6 @@ (DamageDestroyFunc) 0, DamageReportNone, TRUE, pScreen, pScreen); - if (!RegisterBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, - ephyrInternalDamageWakeupHandler, - (void *) pScreen)) - return FALSE; - pPixmap = (*pScreen->GetScreenPixmap) (pScreen); DamageRegister(&pPixmap->drawable, scrpriv->pDamage); @@ -390,10 +395,7 @@ EphyrScrPriv *scrpriv = screen->driver; DamageDestroy(scrpriv->pDamage); - - RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, - ephyrInternalDamageWakeupHandler, - (void *) pScreen); + scrpriv->pDamage = NULL; } #ifdef RANDR @@ -508,6 +510,14 @@ screen->width = newwidth; screen->height = newheight; + scrpriv->win_width = screen->width; + scrpriv->win_height = screen->height; +#ifdef GLAMOR + ephyr_glamor_set_window_size(scrpriv->glamor, + scrpriv->win_width, + scrpriv->win_height); +#endif + if (!ephyrMapFramebuffer(screen)) goto bail4; @@ -518,12 +528,18 @@ else ephyrUnsetInternalDamage(screen->pScreen); + ephyrSetScreenSizes(screen->pScreen); + if (scrpriv->shadow) { if (!KdShadowSet(screen->pScreen, scrpriv->randr, ephyrShadowUpdate, ephyrWindowLinear)) goto bail4; } else { +#ifdef GLAMOR + if (ephyr_glamor) + ephyr_glamor_create_screen_resources(pScreen); +#endif /* Without shadow fb ( non rotated ) we need * to use damage to efficiently update display * via signal regions what to copy from 'fb'. @@ -532,8 +548,6 @@ goto bail4; } - ephyrSetScreenSizes(screen->pScreen); - /* * Set frame buffer mapping */ @@ -611,7 +625,9 @@ size.width = newwidth; size.height = newheight; + hostx_size_set_from_configure(TRUE); ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size); + hostx_size_set_from_configure(FALSE); if (ret) { RROutputPtr output; @@ -658,16 +674,6 @@ } } #endif /*XV*/ -#ifdef XF86DRI - if (!ephyrNoDRI && !hostx_has_extension(&xcb_xf86dri_id)) { - EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n"); - ephyrNoDRI = TRUE; - } - if (!ephyrNoDRI) { - ephyrDRIExtensionInit(pScreen); - ephyrHijackGLXExtension(); - } -#endif return TRUE; } @@ -676,6 +682,10 @@ Bool ephyrFinishInitScreen(ScreenPtr pScreen) { + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; + /* FIXME: Calling this even if not using shadow. * Seems harmless enough. But may be safer elsewhere. */ @@ -687,6 +697,9 @@ return FALSE; #endif + scrpriv->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = ephyrScreenBlockHandler; + return TRUE; } @@ -754,6 +767,7 @@ if (scrpriv->shadow) { KdShadowFbFree(screen); } + scrpriv->BlockHandler = NULL; } void @@ -836,11 +850,11 @@ static void ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); ephyrCursorScreen = pScreen; miPointerWarpCursor(inputInfo.pointer, pScreen, x, y); - OsReleaseSIGIO(); + input_unlock(); } miPointerScreenFuncRec ephyrPointerScreenFuncs = { @@ -849,40 +863,6 @@ ephyrWarpCursor, }; -#ifdef XF86DRI -/** - * find if the remote window denoted by a_remote - * is paired with an internal Window within the Xephyr server. - * If the remove window is paired with an internal window, send an - * expose event to the client insterested in the internal window expose event. - * - * Pairing happens when a drawable inside Xephyr is associated with - * a GL surface in a DRI environment. - * Look at the function ProcXF86DRICreateDrawable in ephyrdriext.c to - * know a paired window is created. - * - * This is useful to make GL drawables (only windows for now) handle - * expose events and send those events to clients. - */ -static void -ephyrExposePairedWindow(int a_remote) -{ - EphyrWindowPair *pair = NULL; - RegionRec reg; - ScreenPtr screen; - - if (!findWindowPairFromRemote(a_remote, &pair)) { - EPHYR_LOG("did not find a pair for this window\n"); - return; - } - screen = pair->local->drawable.pScreen; - RegionNull(®); - RegionCopy(®, &pair->local->clipList); - screen->WindowExposures(pair->local, ®); - RegionUninit(®); -} -#endif /* XF86DRI */ - static KdScreenInfo * screen_from_window(Window w) { @@ -939,16 +919,6 @@ scrpriv->win_height); } else { EPHYR_LOG_ERROR("failed to get host screen\n"); -#ifdef XF86DRI - /* - * We only receive expose events when the expose event - * have be generated for a drawable that is a host X - * window managed by Xephyr. Host X windows managed by - * Xephyr exists for instance when Xephyr is asked to - * create a GL drawable in a DRI environment. - */ - ephyrExposePairedWindow(expose->window); -#endif /* XF86DRI */ } } @@ -974,25 +944,10 @@ else { int x = 0, y = 0; -#ifdef XF86DRI - EphyrWindowPair *pair = NULL; -#endif EPHYR_LOG("enqueuing mouse motion:%d\n", screen->pScreen->myNum); x = motion->event_x; y = motion->event_y; EPHYR_LOG("initial (x,y):(%d,%d)\n", x, y); -#ifdef XF86DRI - EPHYR_LOG("is this window peered by a gl drawable ?\n"); - if (findWindowPairFromRemote(motion->event, &pair)) { - EPHYR_LOG("yes, it is peered\n"); - x += pair->local->drawable.x; - y += pair->local->drawable.y; - } - else { - EPHYR_LOG("no, it is not peered\n"); - } - EPHYR_LOG("final (x,y):(%d,%d)\n", x, y); -#endif /* convert coords into desktop-wide coordinates. * fill_pointer_events will convert that back to @@ -1182,13 +1137,15 @@ #endif /* RANDR */ } -void -ephyrPoll(void) +static void +ephyrXcbProcessEvents(Bool queued_only) { xcb_connection_t *conn = hostx_get_xcbconn(); + xcb_generic_event_t *expose = NULL, *configure = NULL; while (TRUE) { - xcb_generic_event_t *xev = xcb_poll_for_event(conn); + xcb_generic_event_t *xev = hostx_get_event(queued_only); + if (!xev) { /* If our XCB connection has died (for example, our window was * closed), exit now. @@ -1208,7 +1165,9 @@ break; case XCB_EXPOSE: - ephyrProcessExpose(xev); + free(expose); + expose = xev; + xev = NULL; break; case XCB_MOTION_NOTIFY: @@ -1232,17 +1191,37 @@ break; case XCB_CONFIGURE_NOTIFY: - ephyrProcessConfigureNotify(xev); + free(configure); + configure = xev; + xev = NULL; break; } - if (ephyr_glamor) - ephyr_glamor_process_event(xev); + if (xev) { + if (ephyr_glamor) + ephyr_glamor_process_event(xev); - free(xev); + free(xev); + } + } + + if (configure) { + ephyrProcessConfigureNotify(configure); + free(configure); + } + + if (expose) { + ephyrProcessExpose(expose); + free(expose); } } +static void +ephyrXcbNotify(int fd, int ready, void *data) +{ + ephyrXcbProcessEvents(FALSE); +} + void ephyrCardFini(KdCardInfo * card) { @@ -1334,6 +1313,7 @@ MouseEnable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE; + SetNotifyFd(hostx_get_fd(), ephyrXcbNotify, X_NOTIFY_READ, NULL); return Success; } @@ -1341,6 +1321,7 @@ MouseDisable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = FALSE; + RemoveNotifyFd(hostx_get_fd()); return; } @@ -1365,16 +1346,29 @@ static Status EphyrKeyboardInit(KdKeyboardInfo * ki) { + KeySymsRec keySyms; + CARD8 modmap[MAP_LENGTH]; + XkbControlsRec controls; + ki->driverPrivate = (EphyrKbdPrivate *) calloc(sizeof(EphyrKbdPrivate), 1); - hostx_load_keymap(); - if (!ephyrKeySyms.minKeyCode) { - ErrorF("Couldn't load keymap from host\n"); - return BadAlloc; - } - ki->minScanCode = ephyrKeySyms.minKeyCode; - ki->maxScanCode = ephyrKeySyms.maxKeyCode; - free(ki->name); + + if (hostx_load_keymap(&keySyms, modmap, &controls)) { + XkbApplyMappingChange(ki->dixdev, &keySyms, + keySyms.minKeyCode, + keySyms.maxKeyCode - keySyms.minKeyCode + 1, + modmap, serverClient); + XkbDDXChangeControls(ki->dixdev, &controls, &controls); + free(keySyms.map); + } + + ki->minScanCode = keySyms.minKeyCode; + ki->maxScanCode = keySyms.maxKeyCode; + + if (ki->name != NULL) { + free(ki->name); + } + ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdri.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdri.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdri.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdri.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,356 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include "hostx.h" -#include "ephyrdri.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "dixstruct.h" -#include "pixmapstr.h" - -#ifndef TRUE -#define TRUE 1 -#endif /*TRUE*/ -#ifndef FALSE -#define FALSE 0 -#endif /*FALSE*/ - Bool -ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - xcb_xf86dri_query_direct_rendering_capable_cookie_t cookie; - xcb_xf86dri_query_direct_rendering_capable_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_is_capable, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_query_direct_rendering_capable(conn, - hostx_get_screen()); - reply = xcb_xf86dri_query_direct_rendering_capable_reply(conn, cookie, NULL); - if (reply) { - is_ok = TRUE; - *a_is_capable = reply->is_capable; - free(reply); - } - EPHYR_LOG("leave. is_capable:%d, is_ok=%d\n", *a_is_capable, is_ok); - - return is_ok; -} - -Bool -ephyrDRIOpenConnection(int a_screen, - drm_handle_t * a_sarea, char **a_bus_id_string) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - xcb_xf86dri_open_connection_cookie_t cookie; - xcb_xf86dri_open_connection_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_bus_id_string, FALSE); - EPHYR_LOG("enter. screen:%d\n", a_screen); - cookie = xcb_xf86dri_open_connection(conn, hostx_get_screen()); - reply = xcb_xf86dri_open_connection_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_sarea = reply->sarea_handle_low; - if (sizeof(drm_handle_t) == 8) { - int shift = 32; - *a_sarea |= ((drm_handle_t) reply->sarea_handle_high) << shift; - } - *a_bus_id_string = malloc(reply->bus_id_len + 1); - if (!*a_bus_id_string) - goto out; - memcpy(*a_bus_id_string, xcb_xf86dri_open_connection_bus_id(reply), reply->bus_id_len); - *a_bus_id_string[reply->bus_id_len] = '\0'; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave. bus_id_string:%s, is_ok:%d\n", *a_bus_id_string, is_ok); - return is_ok; -} - -Bool -ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_auth_connection_cookie_t cookie; - xcb_xf86dri_auth_connection_reply_t *reply; - Bool is_ok = FALSE; - - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_auth_connection(conn, screen, a_magic); - reply = xcb_xf86dri_auth_connection_reply(conn, cookie, NULL); - is_ok = reply->authenticated; - free(reply); - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRICloseConnection(int a_screen) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - xcb_xf86dri_close_connection(conn, screen); - EPHYR_LOG("leave\n"); - return TRUE; -} - -Bool -ephyrDRIGetClientDriverName(int a_screen, - int *a_ddx_driver_major_version, - int *a_ddx_driver_minor_version, - int *a_ddx_driver_patch_version, - char **a_client_driver_name) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_get_client_driver_name_cookie_t cookie; - xcb_xf86dri_get_client_driver_name_reply_t *reply; - Bool is_ok = FALSE; - - EPHYR_RETURN_VAL_IF_FAIL(a_ddx_driver_major_version - && a_ddx_driver_minor_version - && a_ddx_driver_patch_version - && a_client_driver_name, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_get_client_driver_name(conn, screen); - reply = xcb_xf86dri_get_client_driver_name_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ddx_driver_major_version = reply->client_driver_major_version; - *a_ddx_driver_minor_version = reply->client_driver_minor_version; - *a_ddx_driver_patch_version = reply->client_driver_patch_version; - *a_client_driver_name = malloc(reply->client_driver_name_len + 1); - if (!*a_client_driver_name) - goto out; - memcpy(*a_client_driver_name, - xcb_xf86dri_get_client_driver_name_client_driver_name(reply), - reply->client_driver_name_len); - (*a_client_driver_name)[reply->client_driver_name_len] = '\0'; - is_ok = TRUE; - EPHYR_LOG("major:%d, minor:%d, patch:%d, name:%s\n", - *a_ddx_driver_major_version, - *a_ddx_driver_minor_version, - *a_ddx_driver_patch_version, *a_client_driver_name); - out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRICreateContext(int a_screen, - int a_visual_id, - CARD32 ctxt_id, drm_context_t * a_hw_ctxt) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - Bool is_ok = FALSE; - xcb_xf86dri_create_context_cookie_t cookie; - xcb_xf86dri_create_context_reply_t *reply; - - ctxt_id = xcb_generate_id(conn); - - EPHYR_LOG("enter. screen:%d, visual:%d\n", a_screen, a_visual_id); - cookie = xcb_xf86dri_create_context(conn, screen, a_visual_id, ctxt_id); - reply = xcb_xf86dri_create_context_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_hw_ctxt = reply->hw_context; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRIDestroyContext(int a_screen, int a_context_id) -{ - xcb_connection_t *conn = hostx_get_xcbconn (); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - xcb_xf86dri_destroy_context(conn, screen, a_context_id); - EPHYR_LOG("leave\n"); - return TRUE; -} - -Bool -ephyrDRICreateDrawable(int a_screen, - int a_drawable, drm_drawable_t * a_hw_drawable) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_create_drawable_cookie_t cookie; - xcb_xf86dri_create_drawable_reply_t *reply; - - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_create_drawable(conn, screen, a_drawable); - reply = xcb_xf86dri_create_drawable_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_hw_drawable = reply->hw_drawable_handle; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRIDestroyDrawable(int a_screen, int a_drawable) -{ - EPHYR_LOG("enter\n"); - EPHYR_LOG_ERROR("not implemented yet\n"); - EPHYR_LOG("leave\n"); - return FALSE; -} - -Bool -ephyrDRIGetDrawableInfo(int a_screen, - int a_drawable, - unsigned int *a_index, - unsigned int *a_stamp, - int *a_x, - int *a_y, - int *a_w, - int *a_h, - int *a_num_clip_rects, - drm_clip_rect_t ** a_clip_rects, - int *a_back_x, - int *a_back_y, - int *a_num_back_clip_rects, - drm_clip_rect_t ** a_back_clip_rects) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_get_drawable_info_cookie_t cookie; - xcb_xf86dri_get_drawable_info_reply_t *reply = NULL; - EphyrHostWindowAttributes attrs; - - EPHYR_RETURN_VAL_IF_FAIL(a_x && a_y && a_w && a_h - && a_num_clip_rects, FALSE); - - EPHYR_LOG("enter\n"); - memset(&attrs, 0, sizeof(attrs)); - if (!hostx_get_window_attributes(a_drawable, &attrs)) { - EPHYR_LOG_ERROR("failed to query host window attributes\n"); - goto out; - } - cookie = xcb_xf86dri_get_drawable_info(conn, screen, a_drawable); - reply = xcb_xf86dri_get_drawable_info_reply(conn, cookie, NULL); - if (!reply) { - EPHYR_LOG_ERROR ("XF86DRIGetDrawableInfo ()\n"); - goto out; - } - *a_index = reply->drawable_table_index; - *a_stamp = reply->drawable_table_stamp; - *a_x = reply->drawable_origin_X; - *a_y = reply->drawable_origin_Y; - *a_w = reply->drawable_size_W; - *a_h = reply->drawable_size_H; - *a_num_clip_rects = reply->num_clip_rects; - *a_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); - memcpy(*a_clip_rects, xcb_xf86dri_get_drawable_info_clip_rects(reply), - *a_num_clip_rects * sizeof(drm_clip_rect_t)); - EPHYR_LOG("host x,y,w,h: (%d,%d,%d,%d)\n", *a_x, *a_y, *a_w, *a_h); - if (*a_num_clip_rects) { - free(*a_back_clip_rects); - *a_back_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); - memmove(*a_back_clip_rects, - *a_clip_rects, *a_num_clip_rects * sizeof(drm_clip_rect_t)); - *a_num_back_clip_rects = *a_num_clip_rects; - } - EPHYR_LOG("num back clip rects:%d, num clip rects:%d\n", - *a_num_clip_rects, *a_num_back_clip_rects); - *a_back_x = *a_x; - *a_back_y = *a_y; - *a_w = attrs.width; - *a_h = attrs.height; - - is_ok = TRUE; - out: - EPHYR_LOG("leave. index:%d, stamp:%d, x,y:(%d,%d), w,y:(%d,%d)\n", - *a_index, *a_stamp, *a_x, *a_y, *a_w, *a_h); - free(reply); - return is_ok; -} - -Bool -ephyrDRIGetDeviceInfo(int a_screen, - drm_handle_t * a_frame_buffer, - int *a_fb_origin, - int *a_fb_size, - int *a_fb_stride, - int *a_dev_private_size, void **a_dev_private) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn (); - int screen = hostx_get_screen(); - xcb_xf86dri_get_device_info_cookie_t cookie; - xcb_xf86dri_get_device_info_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_get_device_info(conn, screen); - reply = xcb_xf86dri_get_device_info_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_frame_buffer = reply->framebuffer_handle_low; - if (sizeof(drm_handle_t) == 8) { - int shift = 32; - *a_frame_buffer |= ((drm_handle_t)reply->framebuffer_handle_high) << shift; - } - *a_fb_origin = reply->framebuffer_origin_offset; - *a_fb_size = reply->framebuffer_size; - *a_fb_stride = reply->framebuffer_stride; - *a_dev_private_size = reply->device_private_size; - *a_dev_private = calloc(reply->device_private_size, 1); - if (!*a_dev_private) - goto out; - memcpy(*a_dev_private, - xcb_xf86dri_get_device_info_device_private(reply), - reply->device_private_size); - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdriext.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdriext.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdriext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdriext.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1376 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * This file is heavily copied from hw/xfree86/dri/xf86dri.c - * - * Authors: - * Dodji Seketeli - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#define _XF86DRI_SERVER_ -#include -#include -#include -#include -#include -#include "misc.h" -#include "privates.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "swaprep.h" -#include "ephyrdri.h" -#include "ephyrdriext.h" -#include "hostx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "protocol-versions.h" - -typedef struct { - int foo; -} EphyrDRIWindowPrivRec; -typedef EphyrDRIWindowPrivRec *EphyrDRIWindowPrivPtr; - -typedef struct { - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; - MoveWindowProcPtr MoveWindow; - PositionWindowProcPtr PositionWindow; - ClipNotifyProcPtr ClipNotify; -} EphyrDRIScreenPrivRec; -typedef EphyrDRIScreenPrivRec *EphyrDRIScreenPrivPtr; - -static int DRIErrorBase; - -static Bool ephyrDRIScreenInit(ScreenPtr a_screen); -static Bool ephyrDRICreateWindow(WindowPtr a_win); -static Bool ephyrDRIDestroyWindow(WindowPtr a_win); -static void ephyrDRIMoveWindow(WindowPtr a_win, - int a_x, int a_y, - WindowPtr a_siblings, VTKind a_kind); -static Bool ephyrDRIPositionWindow(WindowPtr a_win, int x, int y); -static void ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y); - -static Bool EphyrMirrorHostVisuals(ScreenPtr a_screen); -static Bool destroyHostPeerWindow(const WindowPtr a_win); -static Bool findWindowPairFromLocal(WindowPtr a_local, - EphyrWindowPair ** a_pair); - -static unsigned char DRIReqCode = 0; - -static DevPrivateKeyRec ephyrDRIWindowKeyRec; - -#define ephyrDRIWindowKey (&ephyrDRIWindowKeyRec) -static DevPrivateKeyRec ephyrDRIScreenKeyRec; - -#define ephyrDRIScreenKey (&ephyrDRIScreenKeyRec) - -#define GET_EPHYR_DRI_WINDOW_PRIV(win) ((EphyrDRIWindowPrivPtr) \ - dixLookupPrivate(&(win)->devPrivates, ephyrDRIWindowKey)) -#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \ - dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey)) - -static Bool -ephyrDRIScreenInit(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_screen, FALSE); - - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(a_screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv, FALSE); - - screen_priv->CreateWindow = a_screen->CreateWindow; - screen_priv->DestroyWindow = a_screen->DestroyWindow; - screen_priv->MoveWindow = a_screen->MoveWindow; - screen_priv->PositionWindow = a_screen->PositionWindow; - screen_priv->ClipNotify = a_screen->ClipNotify; - - a_screen->CreateWindow = ephyrDRICreateWindow; - a_screen->DestroyWindow = ephyrDRIDestroyWindow; - a_screen->MoveWindow = ephyrDRIMoveWindow; - a_screen->PositionWindow = ephyrDRIPositionWindow; - a_screen->ClipNotify = ephyrDRIClipNotify; - - is_ok = TRUE; - - return is_ok; -} - -static Bool -ephyrDRICreateWindow(WindowPtr a_win) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->CreateWindow, FALSE); - - EPHYR_LOG("enter. win:%p\n", a_win); - - screen->CreateWindow = screen_priv->CreateWindow; - is_ok = (*screen->CreateWindow) (a_win); - screen->CreateWindow = ephyrDRICreateWindow; - - if (is_ok) { - dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); - } - return is_ok; -} - -static Bool -ephyrDRIDestroyWindow(WindowPtr a_win) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->DestroyWindow, FALSE); - - screen->DestroyWindow = screen_priv->DestroyWindow; - if (screen->DestroyWindow) { - is_ok = (*screen->DestroyWindow) (a_win); - } - screen->DestroyWindow = ephyrDRIDestroyWindow; - - if (is_ok) { - EphyrDRIWindowPrivPtr win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - - if (win_priv) { - destroyHostPeerWindow(a_win); - free(win_priv); - dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); - EPHYR_LOG("destroyed the remote peer window\n"); - } - } - return is_ok; -} - -static void -ephyrDRIMoveWindow(WindowPtr a_win, - int a_x, int a_y, WindowPtr a_siblings, VTKind a_kind) -{ - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrBox geo; - int x = 0, y = 0; /*coords relative to parent window */ - - EPHYR_RETURN_IF_FAIL(a_win); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_IF_FAIL(screen); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->MoveWindow); - - screen->MoveWindow = screen_priv->MoveWindow; - if (screen->MoveWindow) { - (*screen->MoveWindow) (a_win, a_x, a_y, a_siblings, a_kind); - } - screen->MoveWindow = ephyrDRIMoveWindow; - - EPHYR_LOG("window: %p\n", a_win); - if (!a_win->parent) { - EPHYR_LOG("cannot move root window\n"); - return; - } - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - return; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - return; - } - /*compute position relative to parent window */ - x = a_win->drawable.x - a_win->parent->drawable.x; - y = a_win->drawable.y - a_win->parent->drawable.y; - /*set the geometry to pass to hostx_set_window_geometry */ - memset(&geo, 0, sizeof(geo)); - geo.x = x; - geo.y = y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - hostx_set_window_geometry(pair->remote, &geo); -} - -static Bool -ephyrDRIPositionWindow(WindowPtr a_win, int a_x, int a_y) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrBox geo; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->PositionWindow, FALSE); - - screen->PositionWindow = screen_priv->PositionWindow; - if (screen->PositionWindow) { - (*screen->PositionWindow) (a_win, a_x, a_y); - } - screen->PositionWindow = ephyrDRIPositionWindow; - - EPHYR_LOG("window: %p\n", a_win); - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - is_ok = TRUE; - goto out; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - goto out; - } - /*set the geometry to pass to hostx_set_window_geometry */ - memset(&geo, 0, sizeof(geo)); - geo.x = a_x; - geo.y = a_y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - hostx_set_window_geometry(pair->remote, &geo); - is_ok = TRUE; - - out: - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - /*do cleanup here */ - return is_ok; -} - -static void -ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) -{ - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrRect *rects = NULL; - int i = 0; - - EPHYR_RETURN_IF_FAIL(a_win); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_IF_FAIL(screen); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->ClipNotify); - - screen->ClipNotify = screen_priv->ClipNotify; - if (screen->ClipNotify) { - (*screen->ClipNotify) (a_win, a_x, a_y); - } - screen->ClipNotify = ephyrDRIClipNotify; - - EPHYR_LOG("window: %p\n", a_win); - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - goto out; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - goto out; - } - rects = calloc(RegionNumRects(&a_win->clipList), sizeof(EphyrRect)); - for (i = 0; i < RegionNumRects(&a_win->clipList); i++) { - memmove(&rects[i], - &RegionRects(&a_win->clipList)[i], sizeof(EphyrRect)); - rects[i].x1 -= a_win->drawable.x; - rects[i].x2 -= a_win->drawable.x; - rects[i].y1 -= a_win->drawable.y; - rects[i].y2 -= a_win->drawable.y; - } - /* - * push the clipping region of this window - * to the peer window in the host - */ - hostx_set_window_bounding_rectangles - (pair->remote, rects, RegionNumRects(&a_win->clipList)); - - out: - free(rects); - rects = NULL; - - EPHYR_LOG("leave.\n"); - /*do cleanup here */ -} - -/** - * Duplicates a visual of a_screen - * In screen a_screen, for depth a_depth, find a visual which - * bitsPerRGBValue and colormap size equal - * a_bits_per_rgb_values and a_colormap_entries. - * The ID of that duplicated visual is set to a_new_id. - * That duplicated visual is then added to the list of visuals - * of the screen. - */ -static Bool -EphyrDuplicateVisual(unsigned int a_screen, - short a_depth, - short a_class, - short a_bits_per_rgb_values, - short a_colormap_entries, - unsigned int a_red_mask, - unsigned int a_green_mask, - unsigned int a_blue_mask, unsigned int a_new_id) -{ - Bool is_ok = FALSE, found_visual = FALSE, found_depth = FALSE; - ScreenPtr screen = NULL; - VisualRec new_visual, *new_visuals = NULL; - int i = 0; - - EPHYR_LOG("enter\n"); - if (a_screen >= screenInfo.numScreens) { - EPHYR_LOG_ERROR("bad screen number\n"); - goto out; - } - memset(&new_visual, 0, sizeof(VisualRec)); - - /*get the screen pointed to by a_screen */ - screen = screenInfo.screens[a_screen]; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - - /* - * In that screen, first look for an existing visual that has the - * same characteristics as those passed in parameter - * to this function and copy it. - */ - for (i = 0; i < screen->numVisuals; i++) { - if (screen->visuals[i].bitsPerRGBValue == a_bits_per_rgb_values && - screen->visuals[i].ColormapEntries == a_colormap_entries) { - /*copy the visual found */ - memcpy(&new_visual, &screen->visuals[i], sizeof(new_visual)); - new_visual.vid = a_new_id; - new_visual.class = a_class; - new_visual.redMask = a_red_mask; - new_visual.greenMask = a_green_mask; - new_visual.blueMask = a_blue_mask; - found_visual = TRUE; - EPHYR_LOG("found a visual that matches visual id: %d\n", a_new_id); - break; - } - } - if (!found_visual) { - EPHYR_LOG("did not find any visual matching %d\n", a_new_id); - goto out; - } - /* - * be prepare to extend screen->visuals to add new_visual to it - */ - new_visuals = calloc(screen->numVisuals + 1, sizeof(VisualRec)); - memmove(new_visuals, - screen->visuals, screen->numVisuals * sizeof(VisualRec)); - memmove(&new_visuals[screen->numVisuals], &new_visual, sizeof(VisualRec)); - /* - * Now, in that same screen, update the screen->allowedDepths member. - * In that array, each element represents the visuals applicable to - * a given depth. So we need to add an entry matching the new visual - * that we are going to add to screen->visuals - */ - for (i = 0; i < screen->numDepths; i++) { - VisualID *vids = NULL; - DepthPtr cur_depth = NULL; - - /*find the entry matching a_depth */ - if (screen->allowedDepths[i].depth != a_depth) - continue; - cur_depth = &screen->allowedDepths[i]; - /* - * extend the list of visual IDs in that entry, - * so to add a_new_id in there. - */ - vids = reallocarray(cur_depth->vids, - cur_depth->numVids + 1, sizeof(VisualID)); - if (!vids) { - EPHYR_LOG_ERROR("failed to realloc numids\n"); - goto out; - } - vids[cur_depth->numVids] = a_new_id; - /* - * Okay now commit our change. - * Do really update screen->allowedDepths[i] - */ - cur_depth->numVids++; - cur_depth->vids = vids; - found_depth = TRUE; - } - if (!found_depth) { - EPHYR_LOG_ERROR("failed to update screen[%d]->allowedDepth\n", - a_screen); - goto out; - } - /* - * Commit our change to screen->visuals - */ - free(screen->visuals); - screen->visuals = new_visuals; - screen->numVisuals++; - new_visuals = NULL; - - is_ok = TRUE; - out: - free(new_visuals); - new_visuals = NULL; - - EPHYR_LOG("leave\n"); - return is_ok; -} - -/** - * Duplicates the visuals of the host X server. - * This is necessary to have visuals that have the same - * ID as those of the host X. It is important to have that for - * GLX. - */ -static Bool -EphyrMirrorHostVisuals(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - EphyrHostVisualInfo *visuals = NULL; - int nb_visuals = 0, i = 0; - - EPHYR_LOG("enter\n"); - if (!hostx_get_visuals_info(&visuals, &nb_visuals)) { - EPHYR_LOG_ERROR("failed to get host visuals\n"); - goto out; - } - for (i = 0; i < nb_visuals; i++) { - if (!EphyrDuplicateVisual(a_screen->myNum, - visuals[i].depth, - visuals[i].class, - visuals[i].bits_per_rgb, - visuals[i].colormap_size, - visuals[i].red_mask, - visuals[i].green_mask, - visuals[i].blue_mask, visuals[i].visualid)) { - EPHYR_LOG_ERROR("failed to duplicate host visual %d\n", - (int) visuals[i].visualid); - } - } - - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static int -ProcXF86DRIQueryVersion(register ClientPtr client) -{ - xXF86DRIQueryVersionReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .majorVersion = SERVER_XF86DRI_MAJOR_VERSION, - .minorVersion = SERVER_XF86DRI_MINOR_VERSION, - .patchVersion = SERVER_XF86DRI_PATCH_VERSION - }; - - REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); - - EPHYR_LOG("enter\n"); - - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - swaps(&rep.majorVersion); - swaps(&rep.minorVersion); - swapl(&rep.patchVersion); - } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) -{ - xXF86DRIQueryDirectRenderingCapableReply rep; - Bool isCapable; - - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIQueryDirectRenderingCapable(stuff->screen, &isCapable)) { - return BadValue; - } - - if (!client->local || client->swapped) - isCapable = 0; - - rep = (xXF86DRIQueryDirectRenderingCapableReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .isCapable = isCapable - }; - - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - } - - WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), - &rep); - EPHYR_LOG("leave\n"); - - return Success; -} - -static int -ProcXF86DRIOpenConnection(register ClientPtr client) -{ - xXF86DRIOpenConnectionReply rep; - drm_handle_t hSAREA; - char *busIdString = NULL; - CARD32 busIdStringLength = 0; - - REQUEST(xXF86DRIOpenConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIOpenConnection(stuff->screen, &hSAREA, &busIdString)) { - return BadValue; - } - - if (busIdString) - busIdStringLength = strlen(busIdString); - - rep = (xXF86DRIOpenConnectionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - - SIZEOF(xGenericReply) + - pad_to_int32(busIdStringLength)), - .hSAREALow = (CARD32) (hSAREA & 0xffffffff), -#if defined(LONG64) && !defined(__linux__) - .hSAREAHigh = (CARD32) (hSAREA >> 32), -#else - .hSAREAHigh = 0, -#endif - .busIdStringLength = busIdStringLength - }; - - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); - if (busIdStringLength) - WriteToClient(client, busIdStringLength, busIdString); - free(busIdString); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIAuthConnection(register ClientPtr client) -{ - xXF86DRIAuthConnectionReply rep; - - REQUEST(xXF86DRIAuthConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep = (xXF86DRIAuthConnectionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .authenticated = 1 - }; - - if (!ephyrDRIAuthConnection(stuff->screen, stuff->magic)) { - ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); - rep.authenticated = 0; - } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRICloseConnection(register ClientPtr client) -{ - REQUEST(xXF86DRICloseConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - /* - DRICloseConnection( screenInfo.screens[stuff->screen]); - */ - - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIGetClientDriverName(register ClientPtr client) -{ - xXF86DRIGetClientDriverNameReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .clientDriverNameLength = 0 - }; - char *clientDriverName; - - REQUEST(xXF86DRIGetClientDriverNameReq); - REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - ephyrDRIGetClientDriverName(stuff->screen, - (int *) &rep.ddxDriverMajorVersion, - (int *) &rep.ddxDriverMinorVersion, - (int *) &rep.ddxDriverPatchVersion, - &clientDriverName); - if (clientDriverName) - rep.clientDriverNameLength = strlen(clientDriverName); - rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.clientDriverNameLength)); - - WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); - if (rep.clientDriverNameLength) - WriteToClient(client, rep.clientDriverNameLength, clientDriverName); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRICreateContext(register ClientPtr client) -{ - xXF86DRICreateContextReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - ScreenPtr pScreen; - VisualPtr visual; - int i = 0; - - REQUEST(xXF86DRICreateContextReq); - REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - pScreen = screenInfo.screens[stuff->screen]; - visual = pScreen->visuals; - - /* Find the requested X visual */ - for (i = 0; i < pScreen->numVisuals; i++, visual++) - if (visual->vid == stuff->visual) - break; - if (i == pScreen->numVisuals) { - /* No visual found */ - return BadValue; - } - - if (!ephyrDRICreateContext(stuff->screen, - stuff->visual, - stuff->context, - (drm_context_t *) &rep.hHWContext)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDestroyContext(register ClientPtr client) -{ - REQUEST(xXF86DRIDestroyContextReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); - EPHYR_LOG("enter\n"); - - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIDestroyContext(stuff->screen, stuff->context)) { - return BadValue; - } - - EPHYR_LOG("leave\n"); - return Success; -} - -static Bool -getWindowVisual(const WindowPtr a_win, VisualPtr * a_visual) -{ - int i = 0, visual_id = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_win - && a_win->drawable.pScreen - && a_win->drawable.pScreen->visuals, FALSE); - - visual_id = wVisual(a_win); - for (i = 0; i < a_win->drawable.pScreen->numVisuals; i++) { - if (a_win->drawable.pScreen->visuals[i].vid == visual_id) { - *a_visual = &a_win->drawable.pScreen->visuals[i]; - return TRUE; - } - } - return FALSE; -} - -#define NUM_WINDOW_PAIRS 256 -static EphyrWindowPair window_pairs[NUM_WINDOW_PAIRS]; - -static Bool -appendWindowPairToList(WindowPtr a_local, int a_remote) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_local, FALSE); - - EPHYR_LOG("(local,remote):(%p, %d)\n", a_local, a_remote); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].local == NULL) { - window_pairs[i].local = a_local; - window_pairs[i].remote = a_remote; - return TRUE; - } - } - return FALSE; -} - -static Bool -findWindowPairFromLocal(WindowPtr a_local, EphyrWindowPair ** a_pair) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_pair && a_local, FALSE); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].local == a_local) { - *a_pair = &window_pairs[i]; - EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); - return TRUE; - } - } - return FALSE; -} - -Bool -findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_pair, FALSE); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].remote == a_remote) { - *a_pair = &window_pairs[i]; - EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); - return TRUE; - } - } - return FALSE; -} - -static Bool -createHostPeerWindow(const WindowPtr a_win, int *a_peer_win) -{ - Bool is_ok = FALSE; - VisualPtr visual = NULL; - EphyrBox geo; - - EPHYR_RETURN_VAL_IF_FAIL(a_win && a_peer_win, FALSE); - EPHYR_RETURN_VAL_IF_FAIL(a_win->drawable.pScreen, FALSE); - - EPHYR_LOG("enter. a_win '%p'\n", a_win); - if (!getWindowVisual(a_win, &visual)) { - EPHYR_LOG_ERROR("failed to get window visual\n"); - goto out; - } - if (!visual) { - EPHYR_LOG_ERROR("failed to create visual\n"); - goto out; - } - memset(&geo, 0, sizeof(geo)); - geo.x = a_win->drawable.x; - geo.y = a_win->drawable.y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - if (!hostx_create_window(a_win->drawable.pScreen->myNum, - &geo, visual->vid, a_peer_win)) { - EPHYR_LOG_ERROR("failed to create host peer window\n"); - goto out; - } - if (!appendWindowPairToList(a_win, *a_peer_win)) { - EPHYR_LOG_ERROR("failed to append window to pair list\n"); - goto out; - } - is_ok = TRUE; - out: - EPHYR_LOG("leave:remote win%d\n", *a_peer_win); - return is_ok; -} - -static Bool -destroyHostPeerWindow(const WindowPtr a_win) -{ - Bool is_ok = FALSE; - EphyrWindowPair *pair = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - - EPHYR_LOG("enter\n"); - - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to find peer to local window\n"); - goto out; - } - hostx_destroy_window(pair->remote); - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static int -ProcXF86DRICreateDrawable(ClientPtr client) -{ - xXF86DRICreateDrawableReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - DrawablePtr drawable = NULL; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - int rc = 0, remote_win = 0; - - REQUEST(xXF86DRICreateDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, - DixReadAccess); - if (rc != Success) - return rc; - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); - return BadImplementation; - } - EPHYR_LOG("lookedup drawable %p\n", drawable); - window = (WindowPtr) drawable; - if (findWindowPairFromLocal(window, &pair) && pair) { - remote_win = pair->remote; - EPHYR_LOG("found window '%p' paire with remote '%d'\n", - window, remote_win); - } - else if (!createHostPeerWindow(window, &remote_win)) { - EPHYR_LOG_ERROR("failed to create host peer window\n"); - return BadAlloc; - } - - if (!ephyrDRICreateDrawable(stuff->screen, - remote_win, - (drm_drawable_t *) &rep.hHWDrawable)) { - EPHYR_LOG_ERROR("failed to create dri drawable\n"); - return BadValue; - } - - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(window); - if (!win_priv) { - win_priv = calloc(1, sizeof(EphyrDRIWindowPrivRec)); - if (!win_priv) { - EPHYR_LOG_ERROR("failed to allocate window private\n"); - return BadAlloc; - } - dixSetPrivate(&window->devPrivates, ephyrDRIWindowKey, win_priv); - EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win); - } - - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDestroyDrawable(register ClientPtr client) -{ - DrawablePtr drawable = NULL; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - int rc = 0; - - REQUEST(xXF86DRIDestroyDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, - stuff->drawable, client, 0, DixReadAccess); - if (rc != Success) - return rc; - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); - return BadImplementation; - } - window = (WindowPtr) drawable; - if (!findWindowPairFromLocal(window, &pair) && pair) { - EPHYR_LOG_ERROR("failed to find pair window\n"); - return BadImplementation; - } - if (!ephyrDRIDestroyDrawable(stuff->screen, - pair->remote /*drawable in host x */ )) { - EPHYR_LOG_ERROR("failed to destroy dri drawable\n"); - return BadImplementation; - } - pair->local = NULL; - pair->remote = 0; - - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIGetDrawableInfo(register ClientPtr client) -{ - xXF86DRIGetDrawableInfoReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - DrawablePtr drawable; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - int X = 0, Y = 0, W = 0, H = 0, backX = 0, backY = 0, rc = 0, i = 0; - drm_clip_rect_t *clipRects = NULL; - drm_clip_rect_t *backClipRects = NULL; - - REQUEST(xXF86DRIGetDrawableInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, - DixReadAccess); - if (rc != Success || !drawable) { - EPHYR_LOG_ERROR("could not get drawable\n"); - return rc; - } - - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non windows type drawables are not yes supported\n"); - return BadImplementation; - } - window = (WindowPtr) drawable; - memset(&pair, 0, sizeof(pair)); - if (!findWindowPairFromLocal(window, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to find remote peer drawable\n"); - return BadMatch; - } - EPHYR_LOG("clip list of xephyr gl drawable:\n"); - for (i = 0; i < RegionNumRects(&window->clipList); i++) { - EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", - RegionRects(&window->clipList)[i].x1, - RegionRects(&window->clipList)[i].y1, - RegionRects(&window->clipList)[i].x2, - RegionRects(&window->clipList)[i].y2); - } - - if (!ephyrDRIGetDrawableInfo(stuff->screen, - pair->remote /*the drawable in hostx */ , - (unsigned int *) &rep.drawableTableIndex, - (unsigned int *) &rep.drawableTableStamp, - (int *) &X, - (int *) &Y, - (int *) &W, - (int *) &H, - (int *) &rep.numClipRects, - &clipRects, - &backX, - &backY, - (int *) &rep.numBackClipRects, - &backClipRects)) { - return BadValue; - } - EPHYR_LOG("num clip rects:%d, num back clip rects:%d\n", - (int) rep.numClipRects, (int) rep.numBackClipRects); - - rep.drawableX = X; - rep.drawableY = Y; - rep.drawableWidth = W; - rep.drawableHeight = H; - rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - SIZEOF(xGenericReply)); - - rep.backX = backX; - rep.backY = backY; - - if (rep.numClipRects) { - if (clipRects) { - ScreenPtr pScreen = screenInfo.screens[stuff->screen]; - - EPHYR_LOG("clip list of host gl drawable:\n"); - for (i = 0; i < rep.numClipRects; i++) { - clipRects[i].x1 = max(clipRects[i].x1, 0); - clipRects[i].y1 = max(clipRects[i].y1, 0); - clipRects[i].x2 = min(clipRects[i].x2, - pScreen->width + clipRects[i].x1); - clipRects[i].y2 = min(clipRects[i].y2, - pScreen->width + clipRects[i].y1); - - EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", - clipRects[i].x1, clipRects[i].y1, - clipRects[i].x2, clipRects[i].y2); - } - } - else { - rep.numClipRects = 0; - } - } - else { - EPHYR_LOG("got zero host gl drawable clipping rects\n"); - } - rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; - backClipRects = clipRects; - rep.numBackClipRects = rep.numClipRects; - if (rep.numBackClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - EPHYR_LOG("num host clip rects:%d\n", (int) rep.numClipRects); - EPHYR_LOG("num host back clip rects:%d\n", (int) rep.numBackClipRects); - - rep.length = bytes_to_int32(rep.length); - - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); - - if (rep.numClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numClipRects, - clipRects); - } - - if (rep.numBackClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numBackClipRects, - backClipRects); - } - free(clipRects); - clipRects = NULL; - - EPHYR_LOG("leave\n"); - - return Success; -} - -static int -ProcXF86DRIGetDeviceInfo(register ClientPtr client) -{ - xXF86DRIGetDeviceInfoReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - drm_handle_t hFrameBuffer; - void *pDevPrivate; - - REQUEST(xXF86DRIGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIGetDeviceInfo(stuff->screen, - &hFrameBuffer, - (int *) &rep.framebufferOrigin, - (int *) &rep.framebufferSize, - (int *) &rep.framebufferStride, - (int *) &rep.devPrivateSize, &pDevPrivate)) { - return BadValue; - } - - rep.hFrameBufferLow = (CARD32) (hFrameBuffer & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hFrameBufferHigh = (CARD32) (hFrameBuffer >> 32); -#else - rep.hFrameBufferHigh = 0; -#endif - - if (rep.devPrivateSize) { - rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.devPrivateSize)); - } - - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); - if (rep.length) { - WriteToClient(client, rep.devPrivateSize, pDevPrivate); - } - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDispatch(register ClientPtr client) -{ - REQUEST(xReq); - EPHYR_LOG("enter\n"); - - switch (stuff->data) { - case X_XF86DRIQueryVersion:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIQueryVersion(client); - } - case X_XF86DRIQueryDirectRenderingCapable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIQueryDirectRenderingCapable(client); - } - } - - if (!client->local) - return DRIErrorBase + XF86DRIClientNotLocal; - - switch (stuff->data) { - case X_XF86DRIOpenConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIOpenConnection(client); - } - case X_XF86DRICloseConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICloseConnection(client); - } - case X_XF86DRIGetClientDriverName:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetClientDriverName(client); - } - case X_XF86DRICreateContext:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICreateContext(client); - } - case X_XF86DRIDestroyContext:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIDestroyContext(client); - } - case X_XF86DRICreateDrawable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICreateDrawable(client); - } - case X_XF86DRIDestroyDrawable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIDestroyDrawable(client); - } - case X_XF86DRIGetDrawableInfo:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetDrawableInfo(client); - } - case X_XF86DRIGetDeviceInfo:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetDeviceInfo(client); - } - case X_XF86DRIAuthConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIAuthConnection(client); - } - /* {Open,Close}FullScreen are deprecated now */ - default:{ - EPHYR_LOG("leave\n"); - return BadRequest; - } - } -} - -static int -SProcXF86DRIQueryVersion(register ClientPtr client) -{ - REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length); - return ProcXF86DRIQueryVersion(client); -} - -static int -SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) -{ - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - swaps(&stuff->length); - swapl(&stuff->screen); - return ProcXF86DRIQueryDirectRenderingCapable(client); -} - -static int -SProcXF86DRIDispatch(register ClientPtr client) -{ - REQUEST(xReq); - - EPHYR_LOG("enter\n"); - /* - * Only local clients are allowed DRI access, but remote clients still need - * these requests to find out cleanly. - */ - switch (stuff->data) { - case X_XF86DRIQueryVersion:{ - EPHYR_LOG("leave\n"); - return SProcXF86DRIQueryVersion(client); - } - case X_XF86DRIQueryDirectRenderingCapable:{ - EPHYR_LOG("leave\n"); - return SProcXF86DRIQueryDirectRenderingCapable(client); - } - default:{ - EPHYR_LOG("leave\n"); - return DRIErrorBase + XF86DRIClientNotLocal; - } - } -} - -Bool -ephyrDRIExtensionInit(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - ExtensionEntry *extEntry = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_LOG("enter\n"); - if (!hostx_has_extension(&xcb_xf86dri_id)) { - EPHYR_LOG("host does not have DRI extension\n"); - goto out; - } - EPHYR_LOG("host X does have DRI extension\n"); - if (!hostx_has_extension(&xcb_shape_id)) { - EPHYR_LOG("host does not have XShape extension\n"); - goto out; - } - EPHYR_LOG("host X does have XShape extension\n"); - -#ifdef XF86DRI_EVENTS - EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvents"); - if (!EventType) { - EPHYR_LOG_ERROR("failed to register DRI event resource type\n"); - goto out; - } -#endif - - if ((extEntry = AddExtension(XF86DRINAME, - XF86DRINumberEvents, - XF86DRINumberErrors, - ProcXF86DRIDispatch, - SProcXF86DRIDispatch, - NULL, StandardMinorOpcode))) { - DRIReqCode = (unsigned char) extEntry->base; - DRIErrorBase = extEntry->errorBase; - } - else { - EPHYR_LOG_ERROR("failed to register DRI extension\n"); - goto out; - } - if (!dixRegisterPrivateKey(&ephyrDRIScreenKeyRec, PRIVATE_SCREEN, 0)) - goto out; - if (!dixRegisterPrivateKey(&ephyrDRIWindowKeyRec, PRIVATE_WINDOW, 0)) - goto out; - screen_priv = calloc(1, sizeof(EphyrDRIScreenPrivRec)); - if (!screen_priv) { - EPHYR_LOG_ERROR("failed to allocate screen_priv\n"); - goto out; - } - dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv); - - if (!ephyrDRIScreenInit(a_screen)) { - EPHYR_LOG_ERROR("ephyrDRIScreenInit() failed\n"); - goto out; - } - EphyrMirrorHostVisuals(a_screen); - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdriext.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdriext.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdriext.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdriext.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ -#ifndef __EPHYRDRIEXT_H__ -#define __EPHYRDRIEXT_H__ - -typedef struct { - WindowPtr local; - int remote; -} EphyrWindowPair; - -Bool ephyrDRIExtensionInit(ScreenPtr a_screen); - -Bool findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair); - -#endif /*__EPHYRDRIEXT_H__*/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdri.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdri.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrdri.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrdri.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ - -#ifndef __EPHYRDRI_H__ -#define __EPHYRDRI_H__ - -#include - -Bool ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable); -Bool ephyrDRIOpenConnection(int screen, drm_handle_t * a_sarea, - char **a_bus_id_string); -Bool ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic); -Bool ephyrDRICloseConnection(int a_screen); -Bool ephyrDRIGetClientDriverName(int a_screen, - int *a_ddx_driver_major_version, - int *a_ddx_driver_minor_version, - int *a_ddx_driver_patch_version, - char **a_client_driver_name); -Bool ephyrDRICreateContext(int a_screen, - int a_visual_id, - CARD32 ctx_id, drm_context_t * a_hw_ctx); -Bool ephyrDRIDestroyContext(int a_screen, int a_context_id); -Bool ephyrDRICreateDrawable(int a_screen, - int a_drawable, drm_drawable_t * a_hw_drawable); -Bool ephyrDRIDestroyDrawable(int a_screen, int a_drawable); -Bool ephyrDRIGetDrawableInfo(int a_screen, int /*Drawable */ a_drawable, - unsigned int *a_index, - unsigned int *a_stamp, - int *a_x, - int *a_y, - int *a_w, - int *a_h, - int *a_num_clip_rects, - drm_clip_rect_t ** a_clip_rects, - int *a_back_x, - int *a_back_y, - int *num_back_clip_rects, - drm_clip_rect_t ** a_back_clip_rects); -Bool ephyrDRIGetDeviceInfo(int a_screen, - drm_handle_t * a_frame_buffer, - int *a_fb_origin, - int *a_fb_size, - int *a_fb_stride, - int *a_dev_private_size, void **a_dev_private); -#endif /*__EPHYRDRI_H__*/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr_glamor_glx.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr_glamor_glx.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr_glamor_glx.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr_glamor_glx.c 2017-03-15 18:05:25.000000000 +0000 @@ -57,6 +57,7 @@ static XVisualInfo *visual_info; static GLXFBConfig fb_config; Bool ephyr_glamor_gles2; +Bool ephyr_glamor_skip_present; /** @} */ /** @@ -220,6 +221,13 @@ { GLint old_vao; + /* Skip presenting the output in this mode. Presentation is + * expensive, and if we're just running the X Test suite headless, + * nobody's watching. + */ + if (ephyr_glamor_skip_present) + return; + glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx); if (glamor->vao) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrglxext.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrglxext.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrglxext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrglxext.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,854 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "extnsionst.h" -#include "ephyrglxext.h" -#include "ephyrhostglx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include -#include "glx/glxserver.h" -#include "glx/indirect_table.h" -#include "glx/indirect_util.h" -#include "glx/unpack.h" -#include "hostx.h" - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -int ephyrGLXQueryVersion(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXQueryVersionSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXGetVisualConfigsSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXClientInfo(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXClientInfoSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateNewContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateNewContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc); - -Bool -ephyrHijackGLXExtension(void) -{ - const void *(*dispatch_functions)[2]; - - if (!hostx_has_extension(&xcb_glx_id)) { - EPHYR_LOG("host X does not have GLX\n"); - return FALSE; - } - EPHYR_LOG("host X does have GLX\n"); - - if (!Single_dispatch_info.dispatch_functions) { - EPHYR_LOG_ERROR("could not get dispatch functions table\n"); - return FALSE; - } - /* - * hijack some single entry point dispatch functions - */ - dispatch_functions = Single_dispatch_info.dispatch_functions; - EPHYR_RETURN_VAL_IF_FAIL(dispatch_functions, FALSE); - - dispatch_functions[X_GLXQueryVersion][0] = ephyrGLXQueryVersion; - dispatch_functions[X_GLXQueryVersion][1] = ephyrGLXQueryVersionSwap; - - dispatch_functions[X_GLXGetVisualConfigs][0] = ephyrGLXGetVisualConfigs; - dispatch_functions[X_GLXGetVisualConfigs][1] = ephyrGLXGetVisualConfigsSwap; - dispatch_functions[X_GLXClientInfo][0] = ephyrGLXClientInfo; - dispatch_functions[X_GLXClientInfo][1] = ephyrGLXClientInfoSwap; - - dispatch_functions[X_GLXQueryServerString][0] = ephyrGLXQueryServerString; - dispatch_functions[X_GLXQueryServerString][1] = - ephyrGLXQueryServerStringSwap; - - dispatch_functions[X_GLXCreateContext][0] = ephyrGLXCreateContext; - dispatch_functions[X_GLXCreateContext][1] = ephyrGLXCreateContextSwap; - - dispatch_functions[X_GLXCreateNewContext][0] = ephyrGLXCreateNewContext; - dispatch_functions[X_GLXCreateNewContext][1] = ephyrGLXCreateNewContextSwap; - - dispatch_functions[X_GLXDestroyContext][0] = ephyrGLXDestroyContext; - dispatch_functions[X_GLXDestroyContext][1] = ephyrGLXDestroyContextSwap; - - dispatch_functions[X_GLXMakeCurrent][0] = ephyrGLXMakeCurrent; - dispatch_functions[X_GLXMakeCurrent][1] = ephyrGLXMakeCurrentSwap; - - dispatch_functions[X_GLXIsDirect][0] = ephyrGLXIsDirect; - dispatch_functions[X_GLXIsDirect][1] = ephyrGLXIsDirectSwap; - - dispatch_functions[73][0] = ephyrGLXGetString; - dispatch_functions[73][1] = ephyrGLXGetStringSwap; - - dispatch_functions[61][0] = ephyrGLXGetIntegerv; - dispatch_functions[61][1] = ephyrGLXGetIntegervSwap; - - dispatch_functions[X_GLXMakeContextCurrent][0] = - ephyrGLXMakeContextCurrent; - dispatch_functions[X_GLXMakeContextCurrent][1] = - ephyrGLXMakeContextCurrentSwap; - - /* - * hijack some vendor priv entry point dispatch functions - */ - dispatch_functions = VendorPriv_dispatch_info.dispatch_functions; - dispatch_functions[92][0] = ephyrGLXGetFBConfigsSGIX; - dispatch_functions[92][1] = ephyrGLXGetFBConfigsSGIXSwap; - - dispatch_functions[89][0] = ephyrGLXMakeCurrentReadSGI; - dispatch_functions[89][1] = ephyrGLXMakeCurrentReadSGISwap; - - EPHYR_LOG("hijacked glx entry points to forward requests to host X\n"); - - - return TRUE; -} - -/********************* - * implementation of - * hijacked GLX entry - * points - ********************/ - -int -ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc) -{ - ClientPtr client = a_cl->client; - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; - xGLXQueryVersionReply reply; - int major, minor; - int res = BadImplementation; - - EPHYR_LOG("enter\n"); - - major = req->majorVersion; - minor = req->minorVersion; - - if (!ephyrHostGLXQueryVersion(&major, &minor)) { - EPHYR_LOG_ERROR("ephyrHostGLXQueryVersion() failed\n"); - goto out; - } - EPHYR_LOG("major:%d, minor:%d\n", major, minor); - reply = (xGLXQueryVersionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .majorVersion = major, - .minorVersion = minor - }; - - if (client->swapped) { - __glXSwapQueryVersionReply(client, &reply); - } - else { - WriteToClient(client, sz_xGLXQueryVersionReply, &reply); - } - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXQueryVersionSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->majorVersion); - __GLX_SWAP_INT(&req->minorVersion); - return ephyrGLXQueryVersion(a_cl, a_pc); -} - -static int -ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) a_pc; - ClientPtr client = a_cl->client; - xGLXGetVisualConfigsReply reply; - int32_t *props_buf = NULL, num_visuals = 0, - num_props = 0, res = BadImplementation, i = 0, - props_per_visual_size = 0, props_buf_size = 0; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - EPHYR_LOG("enter\n"); - - if (!ephyrHostGLXGetVisualConfigs(req->screen, - &num_visuals, - &num_props, - &props_buf_size, &props_buf)) { - EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); - goto out; - } - EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - - reply = (xGLXGetVisualConfigsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2, - .numVisuals = num_visuals, - .numProps = num_props - }; - - if (a_do_swap) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numVisuals); - __GLX_SWAP_INT(&reply.numProps); - __GLX_SWAP_INT_ARRAY(props_buf, num_props); - } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); - props_per_visual_size = props_buf_size / num_visuals; - for (i = 0; i < num_visuals; i++) { - WriteToClient(client, - props_per_visual_size, - (char *) props_buf + i * props_per_visual_size); - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(props_buf); - props_buf = NULL; - - return res; -} - -static int -ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) a_pc; - ClientPtr client = a_cl->client; - xGLXGetVisualConfigsReply reply; - int32_t *props_buf = NULL, num_visuals = 0, - num_props = 0, res = BadImplementation, i = 0, - props_per_visual_size = 0, props_buf_size = 0; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - EPHYR_LOG("enter\n"); - - if (!ephyrHostGLXVendorPrivGetFBConfigsSGIX(req->screen, - &num_visuals, - &num_props, - &props_buf_size, &props_buf)) { - EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); - goto out; - } - EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - - reply = (xGLXGetVisualConfigsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = props_buf_size >> 2, - .numVisuals = num_visuals, - .numProps = num_props - }; - - if (a_do_swap) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numVisuals); - __GLX_SWAP_INT(&reply.numProps); - __GLX_SWAP_INT_ARRAY(props_buf, num_props); - } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); - props_per_visual_size = props_buf_size / num_visuals; - for (i = 0; i < num_visuals; i++) { - WriteToClient(client, - props_per_visual_size, - &((char *) props_buf)[i * props_per_visual_size]); - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(props_buf); - props_buf = NULL; - - return res; -} - -int -ephyrGLXGetVisualConfigs(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetVisualConfigsSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, TRUE); -} - -int -ephyrGLXClientInfo(__GLXclientState * a_cl, GLbyte * a_pc) -{ - int res = BadImplementation; - xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; - - EPHYR_LOG("enter\n"); - if (!ephyrHostGLXSendClientInfo(req->major, req->minor, (char *) req + 1)) { - EPHYR_LOG_ERROR("failed to send client info to host\n"); - goto out; - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXClientInfoSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->major); - __GLX_SWAP_INT(&req->minor); - __GLX_SWAP_INT(&req->numbytes); - - return ephyrGLXClientInfo(a_cl, a_pc); -} - -int -ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) a_pc; - xGLXQueryServerStringReply reply; - char *server_string = NULL; - int length = 0; - - EPHYR_LOG("enter\n"); - if (!ephyrHostGLXQueryServerString(req->screen, - req->name, - &server_string)) { - EPHYR_LOG_ERROR("failed to query string from host\n"); - goto out; - } - EPHYR_LOG("string: %s\n", server_string); - length = strlen(server_string) + 1; - reply = (xGLXQueryServerStringReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = __GLX_PAD(length) >> 2, - .n = length - }; - - WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); - WriteToClient(client, (int) (reply.length << 2), server_string); - - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(server_string); - server_string = NULL; - - return res; -} - -int -ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - EPHYR_LOG_ERROR("not yet implemented\n"); - return BadImplementation; -} - -int -ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap) -{ - int res = BadImplementation; - EphyrHostWindowAttributes host_w_attrs; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue); - EPHYR_LOG("enter\n"); - - if (a_do_swap) { - __GLX_SWAP_SHORT(&a_req->length); - __GLX_SWAP_INT(&a_req->context); - __GLX_SWAP_INT(&a_req->visual); - __GLX_SWAP_INT(&a_req->screen); - __GLX_SWAP_INT(&a_req->shareList); - } - - EPHYR_LOG("context creation requested. localid:%d, " - "screen:%d, visual:%d, direct:%d\n", - (int) a_req->context, (int) a_req->screen, - (int) a_req->visual, (int) a_req->isDirect); - - memset(&host_w_attrs, 0, sizeof(host_w_attrs)); - if (!hostx_get_window_attributes(hostx_get_window(a_req->screen), - &host_w_attrs)) { - EPHYR_LOG_ERROR("failed to get host window attrs\n"); - goto out; - } - - EPHYR_LOG("host window visual id: %d\n", host_w_attrs.visualid); - - if (!ephyrHostGLXCreateContext(a_req->screen, - host_w_attrs.visualid, - a_req->context, - a_req->shareList, 0, - a_req->isDirect, X_GLXCreateContext)) { - EPHYR_LOG_ERROR("ephyrHostGLXCreateContext() failed\n"); - goto out; - } - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -static int -ephyrGLXCreateNewContextReal(xGLXCreateNewContextReq * a_req, Bool a_do_swap) -{ - int res = BadImplementation; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue); - EPHYR_LOG("enter\n"); - - if (a_do_swap) { - __GLX_SWAP_SHORT(&a_req->length); - __GLX_SWAP_INT(&a_req->context); - __GLX_SWAP_INT(&a_req->fbconfig); - __GLX_SWAP_INT(&a_req->screen); - __GLX_SWAP_INT(&a_req->renderType); - __GLX_SWAP_INT(&a_req->shareList); - } - - EPHYR_LOG("context creation requested. localid:%d, " - "screen:%d, fbconfig:%d, renderType:%d, direct:%d\n", - (int) a_req->context, (int) a_req->screen, - (int) a_req->fbconfig, (int) a_req->renderType, - (int) a_req->isDirect); - - if (!ephyrHostGLXCreateContext(a_req->screen, - a_req->fbconfig, - a_req->context, - a_req->shareList, a_req->renderType, - a_req->isDirect, X_GLXCreateNewContext)) { - EPHYR_LOG_ERROR("ephyrHostGLXCreateNewContext() failed\n"); - goto out; - } - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXCreateContext(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - - return ephyrGLXCreateContextReal(req, FALSE); -} - -int -ephyrGLXCreateContextSwap(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - - return ephyrGLXCreateContextReal(req, TRUE); -} - -int -ephyrGLXCreateNewContext(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - - return ephyrGLXCreateNewContextReal(req, FALSE); -} - -int -ephyrGLXCreateNewContextSwap(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - - return ephyrGLXCreateNewContextReal(req, TRUE); -} - -static int -ephyrGLXDestroyContextReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) a_pc; - - EPHYR_LOG("enter. id:%d\n", (int) req->context); - if (!ephyrHostDestroyContext(req->context)) { - EPHYR_LOG_ERROR("ephyrHostDestroyContext() failed\n"); - client->errorValue = req->context; - goto out; - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXDestroyContextReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXDestroyContextReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLXDrawable write, - GLXDrawable read, GLXContextTag ctx, - GLXContextTag old_ctx, Bool a_do_swap) -{ - int res = BadImplementation; - xGLXMakeCurrentReply reply; - DrawablePtr drawableR = NULL, drawableW = NULL; - GLXContextTag new_ctx = 0; - - EPHYR_LOG("enter\n"); - res = dixLookupDrawable(&drawableW, write, a_cl->client, 0, DixReadAccess); - EPHYR_RETURN_VAL_IF_FAIL(drawableW, BadValue); - EPHYR_RETURN_VAL_IF_FAIL(drawableW->pScreen, BadValue); - EPHYR_LOG("screen nummber requested:%d\n", drawableW->pScreen->myNum); - - if (read != write) { - res = dixLookupDrawable(&drawableR, read, a_cl->client, 0, - DixReadAccess); - EPHYR_RETURN_VAL_IF_FAIL(drawableR, BadValue); - EPHYR_RETURN_VAL_IF_FAIL(drawableR->pScreen, BadValue); - } - else { - drawableR = drawableW; - } - - if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawableW->pScreen->myNum), - hostx_get_window(drawableR->pScreen->myNum), - ctx, old_ctx, (int *) &new_ctx)) { - EPHYR_LOG_ERROR("ephyrHostGLXMakeCurrent() failed\n"); - goto out; - } - reply = (xGLXMakeCurrentReply) { - .type = X_Reply, - .sequenceNumber = a_cl->client->sequence, - .length = 0, - .contextTag = new_ctx - }; - if (a_do_swap) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.contextTag); - } - WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, &reply); - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, - req->context, req->oldContextTag, TRUE); -} - -int -ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, - req->context, req->oldContextTag, TRUE); -} - -int -ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readdrawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag, TRUE); -} - -static int -ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - ClientPtr client = NULL; - int context_tag = 0, name = 0, res = BadImplementation, length = 0; - char *string = NULL; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, BadValue); - - EPHYR_LOG("enter\n"); - - client = a_cl->client; - - if (a_do_swap) { - __GLX_SWAP_INT(a_pc + 4); - __GLX_SWAP_INT(a_pc + __GLX_SINGLE_HDR_SIZE); - } - context_tag = __GLX_GET_SINGLE_CONTEXT_TAG(a_pc); - a_pc += __GLX_SINGLE_HDR_SIZE; - name = *(GLenum *) (a_pc + 0); - EPHYR_LOG("context_tag:%d, name:%d\n", context_tag, name); - if (!ephyrHostGLXGetString(context_tag, name, &string)) { - EPHYR_LOG_ERROR("failed to get string from server\n"); - goto out; - } - if (string) { - length = strlen(string) + 1; - EPHYR_LOG("got string:'%s', size:%d\n", string, length); - } - else { - EPHYR_LOG("got string: string (null)\n"); - } - __GLX_BEGIN_REPLY(length); - __GLX_PUT_SIZE(length); - __GLX_SEND_HEADER(); - if (a_do_swap) { - __GLX_SWAP_REPLY_SIZE(); - __GLX_SWAP_REPLY_HEADER(); - } - WriteToClient(client, length, string); - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetStringReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetStringReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXGetIntegervReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - xGLXSingleReq *const req = (xGLXSingleReq *) a_pc; - GLenum int_name; - int value = 0; - GLint answer_buf_room[200]; - GLint *buf = NULL; - - EPHYR_LOG("enter\n"); - - a_pc += __GLX_SINGLE_HDR_SIZE; - - int_name = *(GLenum *) (a_pc + 0); - if (!ephyrHostGetIntegerValue(req->contextTag, int_name, &value)) { - EPHYR_LOG_ERROR("ephyrHostGetIntegerValue() failed\n"); - goto out; - } - buf = __glXGetAnswerBuffer(a_cl, sizeof(value), - answer_buf_room, sizeof(answer_buf_room), 4); - - if (!buf) { - EPHYR_LOG_ERROR("failed to allocate reply buffer\n"); - res = BadAlloc; - goto out; - } - __glXSendReply(a_cl->client, buf, 1, sizeof(value), GL_FALSE, 0); - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetIntegervReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetIntegervReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXIsDirectReq *req = (xGLXIsDirectReq *) a_pc; - xGLXIsDirectReply reply; - int is_direct = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, FALSE); - - EPHYR_LOG("enter\n"); - - if (!ephyrHostIsContextDirect(req->context, (int *) &is_direct)) { - EPHYR_LOG_ERROR("ephyrHostIsContextDirect() failed\n"); - goto out; - } - reply = (xGLXIsDirectReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .isDirect = is_direct - }; - - WriteToClient(client, sz_xGLXIsDirectReply, &reply); - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXIsDirectReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXIsDirectReal(a_cl, a_pc, TRUE); -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrglxext.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrglxext.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrglxext.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrglxext.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ -#ifndef __EPHYR_GLXEXT_H__ -#define __EPHYR_GLXEXT_H__ - -#include -Bool ephyrHijackGLXExtension(void); - -#endif /*__EPHYR_GLXEXT_H__*/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyr.h 2017-03-15 18:05:25.000000000 +0000 @@ -27,7 +27,6 @@ #define _EPHYR_H_ #include #include -#include #include #include @@ -85,6 +84,8 @@ int mynum; /* Screen number */ unsigned long cmap[256]; + ScreenBlockHandlerProcPtr BlockHandler; + /** * Per-screen Xlib-using state for glamor (private to * ephyr_glamor_glx.c) @@ -168,9 +169,6 @@ Bool ephyrCreateColormap(ColormapPtr pmap); -void - ephyrPoll(void); - #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrhostglx.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrhostglx.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrhostglx.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrhostglx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,490 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * a lots of the content of this file has been adapted from the mesa source - * code. - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include "ephyrhostglx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "hostx.h" - -static int glx_major, glx_minor; - -enum VisualConfRequestType { - EPHYR_GET_FB_CONFIG, - EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, - EPHYR_GET_VISUAL_CONFIGS -}; - -static Bool ephyrHostGLXGetVisualConfigsInternal - (enum VisualConfRequestType a_type, - xcb_glx_get_visual_configs_reply_t *reply, - int32_t a_screen, - int32_t *a_num_visuals, - int32_t *a_num_props, - int32_t *a_props_buf_size, - int32_t **a_props_buf); - -Bool -ephyrHostGLXQueryVersion(int *a_major, int *a_minor) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_query_version_cookie_t cookie; - xcb_glx_query_version_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_major && a_minor, FALSE); - EPHYR_LOG("enter\n"); - - if (glx_major) { - *a_major = glx_major; - *a_minor = glx_minor; - return TRUE; - } - - /* Send the glXQueryVersion request */ - cookie = xcb_glx_query_version(conn, 2, 1); - reply = xcb_glx_query_version_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_major = reply->major_version; - *a_minor = reply->minor_version; - free(reply); - - EPHYR_LOG("major:%d, minor:%d\n", *a_major, *a_minor); - - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXGetString(int a_context_tag, - int a_string_name, - char **a_string) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_get_string_cookie_t cookie; - xcb_glx_get_string_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_string(conn, a_context_tag, a_string_name); - reply = xcb_glx_get_string_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_string = malloc(reply->n + 1); - memcpy(*a_string, xcb_glx_get_string_string(reply), reply->n); - (*a_string)[reply->n] = '\0'; - free(reply); - is_ok = TRUE; -out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool ephyrHostGLXQueryServerString(int a_screen_number, - int a_string_name, - char **a_string) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int default_screen = hostx_get_screen(); - xcb_glx_query_server_string_cookie_t cookie; - xcb_glx_query_server_string_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_query_server_string(conn, default_screen, a_string_name); - reply = xcb_glx_query_server_string_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_string = malloc(reply->str_len + 1); - memcpy(*a_string, xcb_glx_query_server_string_string(reply), reply->str_len); - (*a_string)[reply->str_len] = '\0'; - free(reply); - is_ok = TRUE; -out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static Bool -ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, - xcb_glx_get_visual_configs_reply_t *reply, - int32_t a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf) -{ - Bool is_ok = FALSE; - int num_props = 0, num_visuals = 0, props_buf_size = 0; - int props_per_visual_size = 0; - int32_t *props_buf = NULL; - - if (!reply->num_visuals) { - EPHYR_LOG_ERROR("screen does not support GL rendering\n"); - goto out; - } - num_visuals = reply->num_visuals; - - num_props = reply->num_properties; - - if (a_type != EPHYR_GET_VISUAL_CONFIGS) { - num_props *= 2; - } - props_per_visual_size = num_props * sizeof(uint32_t); - props_buf_size = props_per_visual_size * reply->num_visuals; - props_buf = malloc(props_buf_size); - if (!props_buf) - goto out; - memcpy(props_buf, xcb_glx_get_visual_configs_property_list(reply), - props_buf_size); - - *a_num_visuals = num_visuals; - *a_num_props = reply->num_properties; - *a_props_buf_size = props_buf_size; - *a_props_buf = props_buf; - is_ok = TRUE; - -out: - return is_ok; -} - -Bool -ephyrHostGLXGetVisualConfigs(int32_t a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, int32_t ** a_props_buf) -{ - Bool is_ok = FALSE; - xcb_glx_get_visual_configs_cookie_t cookie; - xcb_glx_get_visual_configs_reply_t *reply; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_visual_configs(conn, screen); - reply = xcb_glx_get_visual_configs_reply(conn, cookie, NULL); - if (!reply) - goto out; - is_ok = ephyrHostGLXGetVisualConfigsInternal - (EPHYR_GET_VISUAL_CONFIGS, - reply, - a_screen, - a_num_visuals, - a_num_props, - a_props_buf_size, - a_props_buf); - -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf) -{ - Bool is_ok=FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_glx_vendor_private_with_reply_cookie_t cookie; - union { - xcb_glx_vendor_private_with_reply_reply_t *vprep; - xcb_glx_get_visual_configs_reply_t *rep; - } reply; - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_vendor_private_with_reply(conn, - X_GLXvop_GetFBConfigsSGIX, - 0, 4, (uint8_t *)&screen); - reply.vprep = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); - if (!reply.vprep) - goto out; - is_ok = ephyrHostGLXGetVisualConfigsInternal - (EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, - reply.rep, - a_screen, - a_num_visuals, - a_num_props, - a_props_buf_size, - a_props_buf); -out: - free(reply.vprep); - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, - const char *a_extension_list) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int size; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_extension_list, FALSE); - - size = strlen (a_extension_list) + 1; - xcb_glx_client_info(conn, a_major, a_minor, size, a_extension_list); - - return TRUE; -} - -Bool -ephyrHostGLXCreateContext(int a_screen, - int a_generic_id, - int a_context_id, - int a_share_list_ctxt_id, - int a_render_type, - Bool a_direct, - int code) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_context_id = 0; - - EPHYR_LOG("enter. screen:%d, generic_id:%d, contextid:%d, rendertype:%d, " - "direct:%d\n", a_screen, a_generic_id, a_context_id, - a_render_type, a_direct); - - if (!hostx_allocate_resource_id_peer(a_context_id, &remote_context_id)) { - EPHYR_LOG_ERROR("failed to peer the context id %d host X", - remote_context_id); - goto out; - } - - switch (code) { - case X_GLXCreateContext: { - xcb_glx_create_context(conn, - remote_context_id, - a_generic_id, - hostx_get_screen(), - a_share_list_ctxt_id, - a_direct); - } - - case X_GLXCreateNewContext: { - xcb_glx_create_new_context(conn, - remote_context_id, - a_generic_id, - hostx_get_screen(), - a_render_type, - a_share_list_ctxt_id, - a_direct); - } - - default: - /* This should never be reached !*/ - EPHYR_LOG("Internal error! Invalid CreateContext code!\n"); - } - - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostDestroyContext(int a_ctxt_id) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_ctxt_id = 0; - - EPHYR_LOG("enter:%d\n", a_ctxt_id); - - if (!hostx_get_resource_id_peer(a_ctxt_id, &remote_ctxt_id)) { - EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); - goto out; - } - EPHYR_LOG("host context id:%d\n", remote_ctxt_id); - - xcb_glx_destroy_context(conn, remote_ctxt_id); - - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, - int a_glx_ctxt_id, int a_old_ctxt_tag, int *a_ctxt_tag) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_glx_ctxt_id = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_ctxt_tag, FALSE); - - EPHYR_LOG("enter. drawable:%d, read:%d, context:%d, oldtag:%d\n", - a_drawable, a_readable, a_glx_ctxt_id, a_old_ctxt_tag); - - if (!hostx_get_resource_id_peer(a_glx_ctxt_id, &remote_glx_ctxt_id)) { - EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); - goto out; - } - - /* If both drawables are the same, use the old MakeCurrent request. - * Otherwise, if we have GLX 1.3 or higher, use the MakeContextCurrent - * request which supports separate read and draw targets. Failing that, - * try the SGI MakeCurrentRead extension. Logic cribbed from Mesa. */ - if (a_drawable == a_readable) { - xcb_glx_make_current_cookie_t cookie; - xcb_glx_make_current_reply_t *reply; - cookie = xcb_glx_make_current(conn, - a_drawable, - remote_glx_ctxt_id, - a_old_ctxt_tag); - reply = xcb_glx_make_current_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ctxt_tag = reply->context_tag; - free(reply); - } - else if (glx_major > 1 || glx_minor >= 3) { - xcb_glx_make_context_current_cookie_t cookie; - xcb_glx_make_context_current_reply_t *reply; - cookie = xcb_glx_make_context_current(conn, - a_old_ctxt_tag, - a_drawable, - a_readable, - remote_glx_ctxt_id); - reply = xcb_glx_make_context_current_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ctxt_tag = reply->context_tag; - free(reply); - } - else { - xcb_glx_vendor_private_with_reply_cookie_t cookie; - xcb_glx_vendor_private_with_reply_reply_t *reply; - uint32_t data[3] = { - a_drawable, a_readable, remote_glx_ctxt_id, - }; - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_vendor_private_with_reply(conn, - X_GLXvop_MakeCurrentReadSGI, - a_old_ctxt_tag, - sizeof(data), - (uint8_t *)data); - reply = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); - - *a_ctxt_tag = reply->retval; - - free(reply); - } - - EPHYR_LOG("context tag:%d\n", *a_ctxt_tag); - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int size = 0; - xcb_glx_get_integerv_cookie_t cookie; - xcb_glx_get_integerv_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_val, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_integerv(conn, a_current_context_tag, a_int); - reply = xcb_glx_get_integerv_reply(conn, cookie, NULL); - if (!reply) - goto out; - size = reply->n; - if (!size) { - EPHYR_LOG_ERROR("X_GLsop_GetIngerv failed\n"); - goto out; - } - *a_val = reply->datum; - is_ok = TRUE; - -out: - free(reply); - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_is_direct_cookie_t cookie; - xcb_glx_is_direct_reply_t *reply = NULL; - int remote_glx_ctxt_id = 0; - - EPHYR_LOG("enter\n"); - if (!hostx_get_resource_id_peer (a_ctxt_id, &remote_glx_ctxt_id)) { - EPHYR_LOG_ERROR ("failed to get remote glx ctxt id\n"); - goto out; - } - - /* Send the glXIsDirect request */ - cookie = xcb_glx_is_direct(conn, remote_glx_ctxt_id); - reply = xcb_glx_is_direct_reply(conn, cookie, NULL); - if (!reply) { - EPHYR_LOG_ERROR("fail in reading reply from host\n"); - goto out; - } - *a_is_direct = reply->is_direct; - is_ok = TRUE; - -out: - free(reply); - EPHYR_LOG("leave\n"); - return is_ok; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrhostglx.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrhostglx.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrhostglx.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrhostglx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * 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 OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd 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. - * - * Authors: - * Dodji Seketeli - */ -#ifndef __EPHYRHOSTGLX_H__ -#define __EPHYRHOSTGLX_H__ - -enum EphyrHostGLXGetStringOps { - EPHYR_HOST_GLX_UNDEF, - EPHYR_HOST_GLX_QueryServerString, - EPHYR_HOST_GLX_GetString, -}; - -Bool ephyrHostGLXQueryVersion(int *a_maj, int *a_min); -Bool ephyrHostGLXGetString(int a_context_tag, - int a_string_name, - char **a_string); -Bool ephyrHostGLXQueryServerString(int a_screen_number, - int a_string_name, - char **a_string); -Bool ephyrHostGLXGetVisualConfigs(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf); -Bool - -ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf); -Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, - const char *a_extension_list); -Bool ephyrHostGLXCreateContext(int a_screen, - int a_generic_id, - int a_context_id, - int a_share_list_ctxt_id, - int a_render_type, - Bool a_direct, - int code); - -Bool ephyrHostDestroyContext(int a_ctxt_id); - -Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id, - int a_olg_ctxt_tag, int *a_ctxt_tag); - -Bool ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val); - -Bool ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct); - -#endif /*__EPHYRHOSTGLX_H__*/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrinit.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrinit.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -36,11 +36,8 @@ extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; -extern Bool ephyr_glamor, ephyr_glamor_gles2; +extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present; -#ifdef GLXEXT -extern Bool ephyrNoDRI; -#endif extern Bool ephyrNoXV; #ifdef KDRIVE_EVDEV @@ -94,29 +91,30 @@ KdKeyboardInfo *ki; KdPointerInfo *pi; - KdAddKeyboardDriver(&EphyrKeyboardDriver); #ifdef KDRIVE_EVDEV KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); -#endif - KdAddPointerDriver(&EphyrMouseDriver); -#ifdef KDRIVE_EVDEV KdAddPointerDriver(&LinuxEvdevMouseDriver); #endif - if (!kdHasKbd) { - ki = KdNewKeyboard(); - if (!ki) - FatalError("Couldn't create Xephyr keyboard\n"); - ki->driver = &EphyrKeyboardDriver; - KdAddKeyboard(ki); - } + if (!SeatId) { + KdAddKeyboardDriver(&EphyrKeyboardDriver); + KdAddPointerDriver(&EphyrMouseDriver); + + if (!kdHasKbd) { + ki = KdNewKeyboard(); + if (!ki) + FatalError("Couldn't create Xephyr keyboard\n"); + ki->driver = &EphyrKeyboardDriver; + KdAddKeyboard(ki); + } - if (!kdHasPointer) { - pi = KdNewPointer(); - if (!pi) - FatalError("Couldn't create Xephyr pointer\n"); - pi->driver = &EphyrMouseDriver; - KdAddPointer(pi); + if (!kdHasPointer) { + pi = KdNewPointer(); + if (!pi) + FatalError("Couldn't create Xephyr pointer\n"); + pi->driver = &EphyrMouseDriver; + KdAddPointer(pi); + } } KdInitInput(); @@ -150,13 +148,11 @@ #ifdef GLAMOR ErrorF("-glamor Enable 2D acceleration using glamor\n"); ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n"); + ErrorF("-glamor-skip-present Skip presenting the output when using glamor (for internal testing optimization)\n"); #endif ErrorF ("-fakexa Simulate acceleration using software rendering\n"); ErrorF("-verbosity Set log verbosity level\n"); -#ifdef GLXEXT - ErrorF("-nodri do not use DRI\n"); -#endif ErrorF("-noxv do not use XV\n"); ErrorF("-name [name] define the name in the WM_CLASS property\n"); ErrorF @@ -293,6 +289,10 @@ ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } + else if (!strcmp (argv[i], "-glamor-skip-present")) { + ephyr_glamor_skip_present = TRUE; + return 1; + } #endif else if (!strcmp(argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit; @@ -314,13 +314,6 @@ exit(1); } } -#ifdef GLXEXT - else if (!strcmp(argv[i], "-nodri")) { - ephyrNoDRI = TRUE; - EPHYR_LOG("no direct rendering enabled\n"); - return 1; - } -#endif else if (!strcmp(argv[i], "-noxv")) { ephyrNoXV = TRUE; EPHYR_LOG("no XVideo enabled\n"); @@ -369,6 +362,13 @@ EphyrWantNoHostGrab = 1; return 1; } + else if (!strcmp(argv[i], "-sharevts") || + !strcmp(argv[i], "-novtswitch")) { + return 1; + } + else if (!strcmp(argv[i], "-layout")) { + return 2; + } return KdProcessArgument(argc, argv, i); } @@ -378,6 +378,9 @@ { EPHYR_DBG("mark"); + if (SeatId) + hostx_use_sw_cursor(); + if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrvideo.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrvideo.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/ephyrvideo.c 2016-07-15 16:18:15.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/ephyrvideo.c 2017-03-15 18:05:25.000000000 +0000 @@ -462,7 +462,7 @@ if (a_this->host_adaptors) a_this->num_adaptors = a_this->host_adaptors->num_adaptors; - if (a_this->num_adaptors < 0) { + if (a_this->num_adaptors <= 0) { EPHYR_LOG_ERROR("failed to get number of host adaptors\n"); goto out; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/hostx.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/hostx.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/hostx.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/hostx.c 2017-03-15 18:05:25.000000000 +0000 @@ -52,10 +52,7 @@ #include #include #include -#ifdef XF86DRI -#include -#include -#endif /* XF86DRI */ +#include #ifdef GLAMOR #include #include "glamor.h" @@ -73,6 +70,7 @@ xcb_gcontext_t gc; xcb_render_pictformat_t argb_format; xcb_cursor_t empty_cursor; + xcb_generic_event_t *saved_event; int depth; Bool use_sw_cursor; Bool use_fullscreen; @@ -82,6 +80,7 @@ KdScreenInfo **screens; long damage_debug_msec; + Bool size_set_from_configure; }; /* memset ( missing> ) instead of below */ @@ -90,14 +89,13 @@ static int HostXWantDamageDebug = 0; -extern EphyrKeySyms ephyrKeySyms; - extern Bool EphyrWantResize; char *ephyrResName = NULL; int ephyrResNameFromCmd = 0; char *ephyrTitle = NULL; Bool ephyr_glamor = FALSE; +extern Bool ephyr_glamor_skip_present; Bool hostx_has_extension(xcb_extension_t *extension) @@ -883,6 +881,7 @@ xallocarray(scrpriv->ximg->stride, buffer_height); } + if (!HostX.size_set_from_configure) { uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; uint32_t values[2] = {width, height}; @@ -900,7 +899,10 @@ &size_hints); } - xcb_map_window(HostX.conn, scrpriv->win); +#ifdef GLAMOR + if (!ephyr_glamor_skip_present) +#endif + xcb_map_window(HostX.conn, scrpriv->win); /* Set explicit window position if it was informed in * -screen option (WxH+X or WxH+X+Y). Otherwise, accept the @@ -1086,18 +1088,142 @@ nanosleep(&tspec, NULL); } -void -hostx_load_keymap(void) +Bool +hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls) { int min_keycode, max_keycode; - + int map_width; + size_t i, j; + int keymap_len; + xcb_keysym_t *keymap; + xcb_keycode_t *modifier_map; + xcb_get_keyboard_mapping_cookie_t mapping_c; + xcb_get_keyboard_mapping_reply_t *mapping_r; + xcb_get_modifier_mapping_cookie_t modifier_c; + xcb_get_modifier_mapping_reply_t *modifier_r; + xcb_xkb_use_extension_cookie_t use_c; + xcb_xkb_use_extension_reply_t *use_r; + xcb_xkb_get_controls_cookie_t controls_c; + xcb_xkb_get_controls_reply_t *controls_r; + + /* First of all, collect host X server's + * min_keycode and max_keycode, which are + * independent from XKB support. */ min_keycode = xcb_get_setup(HostX.conn)->min_keycode; max_keycode = xcb_get_setup(HostX.conn)->max_keycode; EPHYR_DBG("min: %d, max: %d", min_keycode, max_keycode); - ephyrKeySyms.minKeyCode = min_keycode; - ephyrKeySyms.maxKeyCode = max_keycode; + keySyms->minKeyCode = min_keycode; + keySyms->maxKeyCode = max_keycode; + + /* Check for XKB availability in host X server */ + if (!hostx_has_extension(&xcb_xkb_id)) { + EPHYR_LOG_ERROR("XKB extension is not supported in host X server."); + return FALSE; + } + + use_c = xcb_xkb_use_extension(HostX.conn, + XCB_XKB_MAJOR_VERSION, + XCB_XKB_MINOR_VERSION); + use_r = xcb_xkb_use_extension_reply(HostX.conn, use_c, NULL); + + if (!use_r) { + EPHYR_LOG_ERROR("Couldn't use XKB extension."); + return FALSE; + } else if (!use_r->supported) { + EPHYR_LOG_ERROR("XKB extension is not supported in host X server."); + free(use_r); + return FALSE; + } + + free(use_r); + + /* Send all needed XCB requests at once, + * and process the replies as needed. */ + mapping_c = xcb_get_keyboard_mapping(HostX.conn, + min_keycode, + max_keycode - min_keycode + 1); + modifier_c = xcb_get_modifier_mapping(HostX.conn); + controls_c = xcb_xkb_get_controls(HostX.conn, + XCB_XKB_ID_USE_CORE_KBD); + + mapping_r = xcb_get_keyboard_mapping_reply(HostX.conn, + mapping_c, + NULL); + + if (!mapping_r) { + EPHYR_LOG_ERROR("xcb_get_keyboard_mapping_reply() failed."); + return FALSE; + } + + map_width = mapping_r->keysyms_per_keycode; + keymap = xcb_get_keyboard_mapping_keysyms(mapping_r); + keymap_len = xcb_get_keyboard_mapping_keysyms_length(mapping_r); + + keySyms->mapWidth = map_width; + keySyms->map = calloc(keymap_len, sizeof(KeySym)); + + if (!keySyms->map) { + EPHYR_LOG_ERROR("Failed to allocate KeySym map."); + free(mapping_r); + return FALSE; + } + + for (i = 0; i < keymap_len; i++) { + keySyms->map[i] = keymap[i]; + } + + free(mapping_r); + + modifier_r = xcb_get_modifier_mapping_reply(HostX.conn, + modifier_c, + NULL); + + if (!modifier_r) { + EPHYR_LOG_ERROR("xcb_get_modifier_mapping_reply() failed."); + return FALSE; + } + + modifier_map = xcb_get_modifier_mapping_keycodes(modifier_r); + memset(modmap, 0, sizeof(CARD8) * MAP_LENGTH); + + for (j = 0; j < 8; j++) { + for (i = 0; i < modifier_r->keycodes_per_modifier; i++) { + CARD8 keycode; + + if ((keycode = modifier_map[j * modifier_r->keycodes_per_modifier + i])) { + modmap[keycode] |= 1 << j; + } + } + } + + free(modifier_r); + + controls_r = xcb_xkb_get_controls_reply(HostX.conn, + controls_c, + NULL); + + if (!controls_r) { + EPHYR_LOG_ERROR("xcb_xkb_get_controls_reply() failed."); + return FALSE; + } + + controls->enabled_ctrls = controls_r->enabledControls; + + for (i = 0; i < XkbPerKeyBitArraySize; i++) { + controls->per_key_repeat[i] = controls_r->perKeyRepeat[i]; + } + + free(controls_r); + + return TRUE; +} + +void +hostx_size_set_from_configure(Bool ss) +{ + HostX.size_set_from_configure = ss; } xcb_connection_t * @@ -1106,6 +1232,31 @@ return HostX.conn; } +xcb_generic_event_t * +hostx_get_event(Bool queued_only) +{ + xcb_generic_event_t *xev; + + if (HostX.saved_event) { + xev = HostX.saved_event; + HostX.saved_event = NULL; + } else { + if (queued_only) + xev = xcb_poll_for_queued_event(HostX.conn); + else + xev = xcb_poll_for_event(HostX.conn); + } + return xev; +} + +Bool +hostx_has_queued_event(void) +{ + if (!HostX.saved_event) + HostX.saved_event = xcb_poll_for_queued_event(HostX.conn); + return HostX.saved_event != NULL; +} + int hostx_get_screen(void) { @@ -1113,6 +1264,12 @@ } int +hostx_get_fd(void) +{ + return xcb_get_file_descriptor(HostX.conn); +} + +int hostx_get_window(int a_screen_number) { EphyrScrPriv *scrpriv; @@ -1339,80 +1496,6 @@ return is_ok; } -#ifdef XF86DRI -typedef struct { - int is_valid; - int local_id; - int remote_id; -} ResourcePair; - -#define RESOURCE_PEERS_SIZE 1024*10 -static ResourcePair resource_peers[RESOURCE_PEERS_SIZE]; - -int -hostx_allocate_resource_id_peer(int a_local_resource_id, - int *a_remote_resource_id) -{ - int i = 0; - ResourcePair *peer = NULL; - - /* - * first make sure a resource peer - * does not exist already for - * a_local_resource_id - */ - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (resource_peers[i].is_valid - && resource_peers[i].local_id == a_local_resource_id) { - peer = &resource_peers[i]; - break; - } - } - /* - * find one free peer entry, an feed it with - */ - if (!peer) { - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (!resource_peers[i].is_valid) { - peer = &resource_peers[i]; - break; - } - } - if (peer) { - peer->remote_id = xcb_generate_id(HostX.conn); - peer->local_id = a_local_resource_id; - peer->is_valid = TRUE; - } - } - if (peer) { - *a_remote_resource_id = peer->remote_id; - return TRUE; - } - return FALSE; -} - -int -hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id) -{ - int i = 0; - ResourcePair *peer = NULL; - - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (resource_peers[i].is_valid - && resource_peers[i].local_id == a_local_resource_id) { - peer = &resource_peers[i]; - break; - } - } - if (peer) { - *a_remote_resource_id = peer->remote_id; - return TRUE; - } - return FALSE; -} - -#endif /* XF86DRI */ - #ifdef GLAMOR Bool ephyr_glamor_init(ScreenPtr screen) @@ -1433,13 +1516,25 @@ return TRUE; } +static int +ephyrSetPixmapVisitWindow(WindowPtr window, void *data) +{ + ScreenPtr screen = window->drawable.pScreen; + + if (screen->GetWindowPixmap(window) == data) { + screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); + return WT_WALKCHILDREN; + } + return WT_DONTWALKCHILDREN; +} + Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; - PixmapPtr screen_pixmap; + PixmapPtr old_screen_pixmap, screen_pixmap; uint32_t tex; if (!ephyr_glamor) @@ -1456,8 +1551,8 @@ * * Thus, delete the current screen pixmap, and put a fresh one in. */ - screen_pixmap = pScreen->GetScreenPixmap(pScreen); - pScreen->DestroyPixmap(screen_pixmap); + old_screen_pixmap = pScreen->GetScreenPixmap(pScreen); + pScreen->DestroyPixmap(old_screen_pixmap); screen_pixmap = pScreen->CreatePixmap(pScreen, pScreen->width, @@ -1466,6 +1561,8 @@ GLAMOR_CREATE_NO_LARGE); pScreen->SetScreenPixmap(screen_pixmap); + if (pScreen->root && pScreen->SetWindowPixmap) + TraverseTree(pScreen->root, ephyrSetPixmapVisitWindow, old_screen_pixmap); /* Tell the GLX code what to GL texture to read from. */ tex = glamor_get_pixmap_texture(screen_pixmap); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/hostx.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/hostx.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/hostx.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/hostx.h 2017-03-15 18:05:25.000000000 +0000 @@ -44,11 +44,6 @@ typedef struct EphyrHostXVars EphyrHostXVars; typedef struct { - int minKeyCode; - int maxKeyCode; -} EphyrKeySyms; - -typedef struct { VisualID visualid; int screen; int depth; @@ -153,12 +148,21 @@ hostx_paint_rect(KdScreenInfo *screen, int sx, int sy, int dx, int dy, int width, int height); +Bool +hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls); + void - hostx_load_keymap(void); +hostx_size_set_from_configure(Bool); xcb_connection_t * hostx_get_xcbconn(void); +xcb_generic_event_t * +hostx_get_event(Bool queued_only); + +Bool +hostx_has_queued_event(void); + int hostx_get_screen(void); @@ -184,18 +188,6 @@ int hostx_has_extension(xcb_extension_t *extension); -#ifdef XF86DRI -int hostx_lookup_peer_window(void *a_local_window, - int *a_host_peer /*out parameter */ ); -int - -hostx_allocate_resource_id_peer(int a_local_resource_id, - int *a_remote_resource_id); -int - hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id); -int hostx_has_dri(void); - -int hostx_has_glx(void); -#endif /* XF86DRI */ +int hostx_get_fd(void); #endif /*_XLIBS_STUFF_H_*/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -46,19 +46,6 @@ $() endif -if DRI -DRI_SRCS = \ - ephyrdriext.c \ - ephyrdriext.h \ - ephyrdri.c \ - ephyrdri.h \ - ephyrglxext.c \ - ephyrglxext.h \ - ephyrhostglx.c \ - ephyrhostglx.h \ - $() -endif - bin_PROGRAMS = Xephyr Xephyr_SOURCES = \ @@ -72,7 +59,6 @@ hostx.c \ hostx.h \ $(XV_SRCS) \ - $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -114,9 +114,10 @@ subdir = hw/kdrive/ephyr ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -135,18 +136,14 @@ PROGRAMS = $(bin_PROGRAMS) am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c os.c \ ephyrinit.c ephyrcursor.c hostx.c hostx.h ephyrvideo.c \ - ephyrdriext.c ephyrdriext.h ephyrdri.c ephyrdri.h \ - ephyrglxext.c ephyrglxext.h ephyrhostglx.c ephyrhostglx.h \ ephyr_glamor_glx.c ephyr_glamor_glx.h ephyr_glamor_xv.c @XV_TRUE@am__objects_1 = ephyrvideo.$(OBJEXT) -@DRI_TRUE@am__objects_2 = ephyrdriext.$(OBJEXT) ephyrdri.$(OBJEXT) \ -@DRI_TRUE@ ephyrglxext.$(OBJEXT) ephyrhostglx.$(OBJEXT) -@GLAMOR_TRUE@@XV_TRUE@am__objects_3 = ephyr_glamor_xv.$(OBJEXT) -@GLAMOR_TRUE@am__objects_4 = ephyr_glamor_glx.$(OBJEXT) \ -@GLAMOR_TRUE@ $(am__objects_3) +@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) \ ephyrinit.$(OBJEXT) ephyrcursor.$(OBJEXT) hostx.$(OBJEXT) \ - $(am__objects_1) $(am__objects_2) $(am__objects_4) + $(am__objects_1) $(am__objects_3) Xephyr_OBJECTS = $(am_Xephyr_OBJECTS) @GLAMOR_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/glamor/libglamor.la \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor_egl_stubs.la @@ -436,6 +433,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -466,7 +466,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -561,6 +564,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -620,17 +624,6 @@ @GLAMOR_TRUE@ $(GLAMOR_XV_SRCS) \ @GLAMOR_TRUE@ $() -@DRI_TRUE@DRI_SRCS = \ -@DRI_TRUE@ ephyrdriext.c \ -@DRI_TRUE@ ephyrdriext.h \ -@DRI_TRUE@ ephyrdri.c \ -@DRI_TRUE@ ephyrdri.h \ -@DRI_TRUE@ ephyrglxext.c \ -@DRI_TRUE@ ephyrglxext.h \ -@DRI_TRUE@ ephyrhostglx.c \ -@DRI_TRUE@ ephyrhostglx.h \ -@DRI_TRUE@ $() - Xephyr_SOURCES = \ ephyr.c \ ephyr.h \ @@ -642,7 +635,6 @@ hostx.c \ hostx.h \ $(XV_SRCS) \ - $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() @@ -757,10 +749,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_glx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_xv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrcursor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdri.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdriext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrglxext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrhostglx.Po@am__quote@ @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@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/man/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/man/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/kdrive/ephyr/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/os.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/os.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/ephyr/os.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/ephyr/os.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,5 +45,4 @@ KdOsFuncs EphyrOsFuncs = { .Init = EphyrInit, - .pollEvents = ephyrPoll, }; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/fake/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/fake/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/fake/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/fake/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/kdrive/fake ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -362,6 +363,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -392,7 +396,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -487,6 +494,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/fake/mouse.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/fake/mouse.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/fake/mouse.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/fake/mouse.c 2017-03-15 18:05:25.000000000 +0000 @@ -27,7 +27,6 @@ #include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/fbdev/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/fbdev/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/fbdev/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/fbdev/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/kdrive/fbdev ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -363,6 +364,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -488,6 +495,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/evdev.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/evdev.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/evdev.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/evdev.c 2017-03-15 18:05:25.000000000 +0000 @@ -27,7 +27,6 @@ #include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -220,7 +219,8 @@ close(fd); - pi->name = strdup("Evdev mouse"); + if (!pi->name) + pi->name = strdup("Evdev mouse"); return Success; } @@ -390,7 +390,8 @@ close(fd); - ki->name = strdup("Evdev keyboard"); + if (!ki->name) + ki->name = strdup("Evdev keyboard"); readMapping(ki); @@ -442,6 +443,7 @@ { struct input_event event; Kevdev *ke; + int i; if (!ki) return; @@ -456,22 +458,26 @@ event.type = EV_LED; event.code = LED_CAPSL; event.value = leds & (1 << 0) ? 1 : 0; - write(ke->fd, (char *) &event, sizeof(event)); + 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; - write(ke->fd, (char *) &event, sizeof(event)); + 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; - write(ke->fd, (char *) &event, sizeof(event)); + 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; - write(ke->fd, (char *) &event, sizeof(event)); + i = write(ke->fd, (char *) &event, sizeof(event)); + (void) i; } static void diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/linux.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/linux.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/linux.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/linux.c 2017-03-15 18:05:25.000000000 +0000 @@ -25,7 +25,6 @@ #endif #include "kdrive.h" #include -#include #include #include #include @@ -169,53 +168,44 @@ } } -static void -LinuxApmBlock(void *blockData, OSTimePtr pTimeout, void *pReadmask) -{ -} - static Bool LinuxApmRunning; static void -LinuxApmWakeup(void *blockData, int result, void *pReadmask) +LinuxApmNotify(int fd, int mask, void *blockData) { - fd_set *readmask = (fd_set *) pReadmask; - - if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { - apm_event_t event; - Bool running = LinuxApmRunning; - int cmd = APM_IOC_SUSPEND; - - while (read(LinuxApmFd, &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(LinuxApmFd, cmd, 0); + 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 @@ -242,8 +232,7 @@ if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); - RegisterBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); - AddEnabledDevice(LinuxApmFd); + SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL); } /* @@ -273,8 +262,7 @@ } enabled = FALSE; if (LinuxApmFd >= 0) { - RemoveBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); - RemoveEnabledDevice(LinuxApmFd); + RemoveNotifyFd(LinuxApmFd); close(LinuxApmFd); LinuxApmFd = -1; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -95,9 +95,10 @@ subdir = hw/kdrive/linux ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -364,6 +365,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -394,7 +398,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -489,6 +496,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/mouse.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/mouse.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/mouse.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/mouse.c 2017-03-15 18:05:25.000000000 +0000 @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -47,23 +47,15 @@ static Bool MouseWaitForReadable(int fd, int timeout) { - fd_set set; - struct timeval tv, *tp; + struct pollfd poll_fd; int n; CARD32 done; done = GetTimeInMillis() + timeout; + poll_fd.fd = fd; + poll_fd.events = POLLIN; for (;;) { - FD_ZERO(&set); - FD_SET(fd, &set); - if (timeout == -1) - tp = 0; - else { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - tp = &tv; - } - n = select(fd + 1, &set, 0, 0, tp); + n = xserver_poll(&poll_fd, 1, timeout); if (n > 0) return TRUE; if (n < 0 && (errno == EAGAIN || errno == EINTR)) { @@ -139,20 +131,12 @@ static Bool MouseWaitForWritable(int fd, int timeout) { - fd_set set; - struct timeval tv, *tp; + struct pollfd poll_fd; int n; - FD_ZERO(&set); - FD_SET(fd, &set); - if (timeout == -1) - tp = 0; - else { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - tp = &tv; - } - n = select(fd + 1, 0, &set, 0, tp); + poll_fd.fd = fd; + poll_fd.events = POLLOUT; + n = xserver_poll(&poll_fd, 1, timeout); if (n > 0) return TRUE; return FALSE; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/ms.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/ms.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/ms.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/ms.c 2017-03-15 18:05:25.000000000 +0000 @@ -26,9 +26,9 @@ #endif #include #include +#include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -37,9 +37,10 @@ MsReadBytes(int fd, char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; + poll_fd.fd = fd; + poll_fd.events = POLLIN; tot = 0; while (len) { n = read(fd, buf, len); @@ -50,11 +51,7 @@ } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/ps2.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/ps2.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/ps2.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/ps2.c 2017-03-15 18:05:25.000000000 +0000 @@ -25,7 +25,7 @@ #endif #include #include -#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -34,10 +34,11 @@ Ps2ReadBytes(int fd, char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; tot = 0; + poll_fd.fd = fd; + poll_fd.events = POLLIN; while (len) { n = read(fd, buf, len); if (n > 0) { @@ -47,11 +48,7 @@ } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/tslib.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/tslib.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/linux/tslib.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/linux/tslib.c 2017-03-15 18:05:25.000000000 +0000 @@ -36,7 +36,6 @@ #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -90,9 +90,10 @@ subdir = hw/kdrive ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -363,6 +364,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -488,6 +495,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kdrive.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kdrive.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kdrive.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kdrive.c 2017-03-15 18:05:25.000000000 +0000 @@ -43,7 +43,13 @@ #include #endif -#include +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) +#include +#endif + +/* This stub can be safely removed once we can + * split input and GPU parts in hotplug.h et al. */ +#include typedef struct _kdDepths { CARD8 depth; @@ -81,6 +87,11 @@ DDXPointRec kdOrigin; Bool kdHasPointer = FALSE; Bool kdHasKbd = FALSE; +const char *kdGlobalXkbRules = NULL; +const char *kdGlobalXkbModel = NULL; +const char *kdGlobalXkbLayout = NULL; +const char *kdGlobalXkbVariant = NULL; +const char *kdGlobalXkbOptions = NULL; static Bool kdCaughtSignal = FALSE; @@ -447,6 +458,11 @@ ("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n"); ErrorF ("-keybd driver [,,options] Specify the keyboard driver and its options\n"); + ErrorF("-xkb-rules Set default XkbRules value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-model Set default XkbModel value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-layout Set default XkbLayout value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-variant Set default XkbVariant value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-options Set default XkbOptions value (can be overriden by -keybd options)\n"); ErrorF("-zaphod Disable cursor screen switching\n"); ErrorF("-2button Emulate 3 button mouse\n"); ErrorF("-3button Disable 3 button mouse emulation\n"); @@ -555,6 +571,46 @@ sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) { return 1; } + if (!strcmp(argv[i], "-xkb-rules")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-rules.\n"); + } + kdGlobalXkbRules = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-model")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-model.\n"); + } + kdGlobalXkbModel = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-layout")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-layout.\n"); + } + kdGlobalXkbLayout = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-variant")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-variant.\n"); + } + kdGlobalXkbVariant = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-options")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-options.\n"); + } + kdGlobalXkbOptions = argv[i + 1]; + return 2; + } if (!strcmp(argv[i], "-mouse") || !strcmp(argv[i], "-pointer")) { if (i + 1 >= argc) UseMsg(); @@ -1125,6 +1181,11 @@ KdAddScreen(pScreenInfo, screen, argc, argv); OsRegisterSigWrapper(KdSignalWrapper); + +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Enable input hot-plugging */ + config_pre_init(); +#endif } void @@ -1143,3 +1204,36 @@ { 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 +void +NewGPUDeviceRequest(struct OdevAttributes *attribs) +{ +} + +void +DeleteGPUDeviceRequest(struct OdevAttributes *attribs) +{ +} +#endif + +struct xf86_platform_device * +xf86_find_platform_device_by_devnum(int major, int minor) +{ + return NULL; +} + +#ifdef SYSTEMD_LOGIND +void +systemd_logind_vtenter(void) +{ +} + +void +systemd_logind_release_fd(int major, int minor, int fd) +{ + close(fd); +} +#endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kdrive.h xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kdrive.h --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kdrive.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kdrive.h 2017-03-15 18:05:25.000000000 +0000 @@ -527,12 +527,10 @@ KdScreenToPointerCoords(int *x, int *y); void - -KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask); +KdBlockHandler(ScreenPtr pScreen, void *timeout); void - -KdWakeupHandler(ScreenPtr pScreen, unsigned long result, void *readmask); +KdWakeupHandler(ScreenPtr pScreen, int result); void KdDisableInput(void); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kinfo.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kinfo.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kinfo.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kinfo.c 2017-03-15 18:05:25.000000000 +0000 @@ -134,6 +134,7 @@ free(pi->name); free(pi->path); input_option_free_list(&pi->options); + pi->next = NULL; free(pi); } @@ -145,6 +146,9 @@ free(ki->xkbRules); free(ki->xkbModel); free(ki->xkbLayout); + free(ki->xkbVariant); + free(ki->xkbOptions); + input_option_free_list(&ki->options); ki->next = NULL; free(ki); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kinput.c xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kinput.c --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/kinput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/kinput.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,9 +32,8 @@ #if HAVE_X11_XF86KEYSYM_H #include #endif -#include #include -#ifdef sun +#ifdef __sun #include /* needed for FNONBLOCK & FASYNC */ #endif @@ -51,6 +50,15 @@ #include "inpututils.h" #include "optionstr.h" +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) +#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 { @@ -93,37 +101,11 @@ extern Bool kdRawPointerCoordinates; -static void -KdSigio(int sig) -{ - int i; - - for (i = 0; i < kdNumInputFds; i++) - (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); -} - -#ifdef DEBUG_SIGIO - -void -KdAssertSigioBlocked(char *where) -{ - sigset_t set, old; - - sigemptyset(&set); - sigprocmask(SIG_BLOCK, &set, &old); - if (!sigismember(&old, SIGIO)) { - ErrorF("SIGIO not blocked at %s\n", where); - KdBacktrace(0); - } -} - -#else - -#define KdAssertSigioBlocked(s) - -#endif - -static int kdnFds; +extern const char *kdGlobalXkbRules; +extern const char *kdGlobalXkbModel; +extern const char *kdGlobalXkbLayout; +extern const char *kdGlobalXkbVariant; +extern const char *kdGlobalXkbOptions; #ifdef FNONBLOCK #define NOBLOCK FNONBLOCK @@ -153,43 +135,28 @@ } static void -KdAddFd(int fd) +KdNotifyFd(int fd, int ready, void *data) { - struct sigaction act; - sigset_t set; + int i = (int) (intptr_t) data; + (*kdInputFds[i].read)(fd, kdInputFds[i].closure); +} - kdnFds++; - fcntl(fd, F_SETOWN, getpid()); +static void +KdAddFd(int fd, int i) +{ KdNonBlockFd(fd); - AddEnabledDevice(fd); - memset(&act, '\0', sizeof act); - act.sa_handler = KdSigio; - sigemptyset(&act.sa_mask); - sigaddset(&act.sa_mask, SIGIO); - sigaddset(&act.sa_mask, SIGALRM); - sigaddset(&act.sa_mask, SIGVTALRM); - sigaction(SIGIO, &act, 0); - sigemptyset(&set); - sigprocmask(SIG_SETMASK, &set, 0); + InputThreadRegisterDev(fd, KdNotifyFd, (void *) (intptr_t) i); } static void KdRemoveFd(int fd) { - struct sigaction act; int flags; - kdnFds--; - RemoveEnabledDevice(fd); + InputThreadUnregisterDev(fd); flags = fcntl(fd, F_GETFL); flags &= ~(FASYNC | NOBLOCK); fcntl(fd, F_SETFL, flags); - if (kdnFds == 0) { - memset(&act, '\0', sizeof act); - act.sa_handler = SIG_IGN; - sigemptyset(&act.sa_mask); - sigaction(SIGIO, &act, 0); - } } Bool @@ -202,9 +169,9 @@ kdInputFds[kdNumInputFds].enable = 0; kdInputFds[kdNumInputFds].disable = 0; kdInputFds[kdNumInputFds].closure = closure; - kdNumInputFds++; if (kdInputEnabled) - KdAddFd(fd); + KdAddFd(fd, kdNumInputFds); + kdNumInputFds++; return TRUE; } @@ -241,7 +208,7 @@ KdPointerInfo *pi; int found = 0, i = 0; - OsBlockSIGIO(); + input_lock(); for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->driver && ki->driver->Disable) @@ -324,7 +291,7 @@ NoticeEventTime (&ev, pi->dixdev); } - OsReleaseSIGIO(); + input_unlock(); } static KdKeyboardDriver * @@ -391,7 +358,8 @@ #endif if (!pi->driver) { if (!pi->driverPrivate) { - ErrorF("no driver specified for %s\n", pi->name); + ErrorF("no driver specified for pointer device \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); return BadImplementation; } @@ -711,7 +679,8 @@ #endif if (!ki->driver) { if (!ki->driverPrivate) { - ErrorF("no driver specified!\n"); + ErrorF("no driver specified for keyboard device \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); return BadImplementation; } @@ -731,10 +700,6 @@ return BadImplementation; } - if ((*ki->driver->Init) (ki) != Success) { - return !Success; - } - memset(&rmlvo, 0, sizeof(rmlvo)); rmlvo.rules = ki->xkbRules; rmlvo.model = ki->xkbModel; @@ -747,6 +712,10 @@ return BadImplementation; } + if ((*ki->driver->Init) (ki) != Success) { + return !Success; + } + xiclass = AtomFromName(XI_KEYBOARD); AssignTypeAndName(pDevice, xiclass, ki->name ? ki->name : "Generic KDrive Keyboard"); @@ -885,11 +854,13 @@ ki->bellDuration = 200; ki->next = NULL; ki->options = NULL; - ki->xkbRules = strdup(XKB_DFLT_RULES); - ki->xkbModel = strdup(XKB_DFLT_MODEL); - ki->xkbLayout = strdup(XKB_DFLT_LAYOUT); - ki->xkbVariant = strdup(XKB_DFLT_VARIANT); - ki->xkbOptions = strdup(XKB_DFLT_OPTIONS); + ki->name = strdup("Generic Keyboard"); + ki->path = NULL; + ki->xkbRules = strdup(kdGlobalXkbRules ? kdGlobalXkbRules : XKB_DFLT_RULES); + ki->xkbModel = strdup(kdGlobalXkbModel ? kdGlobalXkbModel : XKB_DFLT_MODEL); + ki->xkbLayout = strdup(kdGlobalXkbLayout ? kdGlobalXkbLayout : XKB_DFLT_LAYOUT); + ki->xkbVariant = strdup(kdGlobalXkbVariant ? kdGlobalXkbVariant :XKB_DFLT_VARIANT); + ki->xkbOptions = strdup(kdGlobalXkbOptions ? kdGlobalXkbOptions : XKB_DFLT_OPTIONS); return ki; } @@ -1068,22 +1039,68 @@ const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); - if (strcasecmp(key, "XkbRules") == 0) + if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_rules") == 0 || +#endif + strcasecmp(key, "XkbRules") == 0) ki->xkbRules = strdup(value); - else if (strcasecmp(key, "XkbModel") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_model") == 0 || +#endif + strcasecmp(key, "XkbModel") == 0) ki->xkbModel = strdup(value); - else if (strcasecmp(key, "XkbLayout") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_layout") == 0 || +#endif + strcasecmp(key, "XkbLayout") == 0) ki->xkbLayout = strdup(value); - else if (strcasecmp(key, "XkbVariant") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_variant") == 0 || +#endif + strcasecmp(key, "XkbVariant") == 0) ki->xkbVariant = strdup(value); - else if (strcasecmp(key, "XkbOptions") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_options") == 0 || +#endif + strcasecmp(key, "XkbOptions") == 0) ki->xkbOptions = strdup(value); - else if (!strcasecmp(key, "device")) + else if (!strcasecmp(key, "device")) { + if (ki->path != NULL) + free(ki->path); ki->path = strdup(value); + } +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + else if (!strcasecmp(key, "path")) { + if (ki->path != NULL) + free(ki->path); + ki->path = strdup(value); + } + else if (!strcasecmp(key, "name")) { + free(ki->name); + ki->name = strdup(value); + } +#endif + else if (!strcasecmp(key, "driver")) + ki->driver = KdFindKeyboardDriver(value); else 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 * @@ -1160,22 +1177,48 @@ const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); - if (!strcmp(key, "emulatemiddle")) + if (!strcasecmp(key, "emulatemiddle")) pi->emulateMiddleButton = TRUE; - else if (!strcmp(key, "noemulatemiddle")) + else if (!strcasecmp(key, "noemulatemiddle")) pi->emulateMiddleButton = FALSE; - else if (!strcmp(key, "transformcoord")) + else if (!strcasecmp(key, "transformcoord")) pi->transformCoordinates = TRUE; - else if (!strcmp(key, "rawcoord")) + else if (!strcasecmp(key, "rawcoord")) pi->transformCoordinates = FALSE; - else if (!strcasecmp(key, "device")) + else if (!strcasecmp(key, "device")) { + if (pi->path != NULL) + free(pi->path); pi->path = strdup(value); + } +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + else if (!strcasecmp(key, "path")) { + if (pi->path != NULL) + free(pi->path); + pi->path = strdup(value); + } + else if (!strcasecmp(key, "name")) { + free(pi->name); + pi->name = strdup(value); + } +#endif else if (!strcasecmp(key, "protocol")) pi->protocol = strdup(value); + else if (!strcasecmp(key, "driver")) + pi->driver = KdFindPointerDriver(value); else 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 * @@ -1262,6 +1305,9 @@ KdKeyboardInfo *ki; struct KdConfigDevice *dev; + if (kdConfigPointers || kdConfigKeyboards) + InputThreadPreInit(); + kdInputEnabled = TRUE; for (dev = kdConfigPointers; dev; dev = dev->next) { @@ -1280,11 +1326,21 @@ } mieqInit(); + +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Enable input hot-plugging */ + config_init(); +#endif } void KdCloseInput(void) { +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Input hot-plugging is enabled */ + config_fini(); +#endif + mieqFini(); } @@ -1740,7 +1796,7 @@ int key; KdKeyboardInfo *ki; - OsBlockSIGIO(); + input_lock(); for (ki = kdKeyboards; ki; ki = ki->next) { for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) { @@ -1751,7 +1807,7 @@ } } - OsReleaseSIGIO(); + input_unlock(); #endif } @@ -1905,7 +1961,7 @@ } void -KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask) +KdBlockHandler(ScreenPtr pScreen, void *timeo) { KdPointerInfo *pi; int myTimeout = 0; @@ -1931,28 +1987,17 @@ } void -KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask) +KdWakeupHandler(ScreenPtr pScreen, int result) { - int result = (int) lresult; - fd_set *pReadmask = (fd_set *) readmask; - int i; KdPointerInfo *pi; - if (kdInputEnabled && result > 0) { - for (i = 0; i < kdNumInputFds; i++) - if (FD_ISSET(kdInputFds[i].fd, pReadmask)) { - OsBlockSIGIO(); - (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); - OsReleaseSIGIO(); - } - } for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { pi->timeoutPending = FALSE; - OsBlockSIGIO(); + input_lock(); KdReceiveTimeout(pi); - OsReleaseSIGIO(); + input_unlock(); } } } @@ -2049,10 +2094,10 @@ static void KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); KdCurScreen = pScreen->myNum; miPointerWarpCursor(pDev, pScreen, x, y); - OsReleaseSIGIO(); + input_unlock(); } miPointerScreenFuncRec kdPointerScreenFuncs = { @@ -2112,24 +2157,29 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { - InputOption *option = NULL; + InputOption *option = NULL, *optionsdup = NULL; KdPointerInfo *pi = NULL; KdKeyboardInfo *ki = NULL; nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); + optionsdup = input_option_new(optionsdup, key, value); if (strcmp(key, "type") == 0) { if (strcmp(value, "pointer") == 0) { pi = KdNewPointer(); - if (!pi) + if (!pi) { + input_option_free_list(&optionsdup); return BadAlloc; + } } else if (strcmp(value, "keyboard") == 0) { ki = KdNewKeyboard(); - if (!ki) + if (!ki) { + input_option_free_list(&optionsdup); return BadAlloc; + } } else { ErrorF("unrecognised device type!\n"); @@ -2139,81 +2189,110 @@ #ifdef CONFIG_HAL else if (strcmp(key, "_source") == 0 && strcmp(value, "server/hal") == 0) { - ErrorF("Ignoring device from HAL.\n"); - return BadValue; + if (SeatId) { + /* Input hot-plugging is enabled */ + if (attrs->flags & ATTR_POINTER) { + pi = KdNewPointer(); + if (!pi) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + else if (attrs->flags & ATTR_KEYBOARD) { + ki = KdNewKeyboard(); + if (!ki) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + } + else { + ErrorF("Ignoring device from HAL.\n"); + input_option_free_list(&optionsdup); + return BadValue; + } } #endif #ifdef CONFIG_UDEV else if (strcmp(key, "_source") == 0 && strcmp(value, "server/udev") == 0) { - ErrorF("Ignoring device from udev.\n"); - return BadValue; - } -#endif - } - - if (!ki && !pi) { - ErrorF("unrecognised device identifier!\n"); - return BadValue; - } - - /* FIXME: change this code below to use KdParseKbdOptions and - * KdParsePointerOptions */ - nt_list_for_each_entry(option, options, list.next) { - const char *key = input_option_get_key(option); - const char *value = input_option_get_value(option); - - if (strcmp(key, "device") == 0) { - if (pi && value) - pi->path = strdup(value); - else if (ki && value) - ki->path = strdup(value); - } - else if (strcmp(key, "driver") == 0) { - if (pi) { - pi->driver = KdFindPointerDriver(value); - if (!pi->driver) { - ErrorF("couldn't find driver!\n"); - KdFreePointer(pi); - return BadValue; + if (SeatId) { + /* Input hot-plugging is enabled */ + if (attrs->flags & ATTR_POINTER) { + pi = KdNewPointer(); + if (!pi) { + input_option_free_list(&optionsdup); + return BadAlloc; + } } - pi->options = options; - } - else if (ki) { - ki->driver = KdFindKeyboardDriver(value); - if (!ki->driver) { - ErrorF("couldn't find driver!\n"); - KdFreeKeyboard(ki); - return BadValue; + else if (attrs->flags & ATTR_KEYBOARD) { + ki = KdNewKeyboard(); + if (!ki) { + input_option_free_list(&optionsdup); + return BadAlloc; + } } - ki->options = options; + } + else { + ErrorF("Ignoring device from udev.\n"); + input_option_free_list(&optionsdup); + return BadValue; } } +#endif } if (pi) { + pi->options = optionsdup; + KdParsePointerOptions(pi); + + if (!pi->driver) { + ErrorF("couldn't find driver for pointer device \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); + KdFreePointer(pi); + return BadValue; + } + if (KdAddPointer(pi) != Success || ActivateDevice(pi->dixdev, TRUE) != Success || EnableDevice(pi->dixdev, TRUE) != TRUE) { - ErrorF("couldn't add or enable pointer\n"); + ErrorF("couldn't add or enable pointer \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); + KdFreePointer(pi); return BadImplementation; } + + *pdev = pi->dixdev; } else if (ki) { + ki->options = optionsdup; + KdParseKbdOptions(ki); + + if (!ki->driver) { + ErrorF("couldn't find driver for keyboard device \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); + KdFreeKeyboard(ki); + return BadValue; + } + if (KdAddKeyboard(ki) != Success || ActivateDevice(ki->dixdev, TRUE) != Success || EnableDevice(ki->dixdev, TRUE) != TRUE) { - ErrorF("couldn't add or enable keyboard\n"); + ErrorF("couldn't add or enable keyboard \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); + KdFreeKeyboard(ki); return BadImplementation; } - } - if (pi) { - *pdev = pi->dixdev; - } - else if (ki) { *pdev = ki->dixdev; } + else { + ErrorF("unrecognised device identifier: %s\n", + input_option_get_value(input_option_find(optionsdup, + "device"))); + input_option_free_list(&optionsdup); + return BadValue; + } return Success; } @@ -2223,3 +2302,8 @@ { RemoveDevice(pDev, TRUE); } + +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -23,3 +23,11 @@ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c + +if CONFIG_UDEV +libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +else +if CONFIG_HAL +libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +endif +endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/kdrive/src/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/kdrive/src/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/kdrive/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -109,7 +110,9 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libkdrive_la_LIBADD = +@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@libkdrive_la_DEPENDENCIES = $(top_builddir)/config/libconfig.la +@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 \ $(top_srcdir)/mi/miinitext.c @@ -358,6 +361,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -388,7 +394,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -483,6 +492,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -552,6 +562,8 @@ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c +@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +@CONFIG_UDEV_TRUE@libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la all: all-am .SUFFIXES: diff -Nru xorg-server-hwe-16.04-1.18.4/hw/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/Makefile.in 2016-07-19 17:27:26.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -90,9 +90,10 @@ subdir = hw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -363,6 +364,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -488,6 +495,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/vfb/InitOutput.c xorg-server-hwe-16.04-1.19.3/hw/vfb/InitOutput.c --- xorg-server-hwe-16.04-1.18.4/hw/vfb/InitOutput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/vfb/InitOutput.c 2017-03-15 18:05:25.000000000 +0000 @@ -471,7 +471,7 @@ /* this flushes any changes to the screens out to the mmapped file */ static void -vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) +vfbBlockHandler(void *blockData, void *timeout) { int i; @@ -492,7 +492,7 @@ } static void -vfbWakeupHandler(void *blockData, int result, void *pReadmask) +vfbWakeupHandler(void *blockData, int result) { } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/vfb/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/vfb/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/vfb/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/vfb/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/vfb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -405,6 +406,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -435,7 +439,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -536,6 +543,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/vfb/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/vfb/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/vfb/man/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/vfb/man/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/vfb/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -94,9 +94,10 @@ subdir = hw/xfree86/common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -417,6 +418,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -447,7 +451,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -542,6 +549,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86AutoConfig.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86AutoConfig.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86AutoConfig.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86AutoConfig.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,7 +45,7 @@ #include "xf86sbusBus.h" #endif -#ifdef sun +#ifdef __sun #include #include #endif @@ -149,6 +149,15 @@ char buf[1024]; ConfigStatus ret; + /* Make sure config rec is there */ + if (xf86allocateConfig() != NULL) { + ret = CONFIG_OK; /* OK so far */ + } + else { + xf86Msg(X_ERROR, "Couldn't allocate Config record.\n"); + return FALSE; + } + listPossibleVideoDrivers(deviceList, 20); for (p = deviceList; *p; p++) { @@ -202,7 +211,7 @@ #ifdef XSERVER_PLATFORM_BUS i = xf86PlatformMatchDriver(matches, nmatches); #endif -#ifdef sun +#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))) { @@ -271,7 +280,7 @@ matches[i++] = xnfstrdup("modesetting"); #endif -#if !defined(sun) +#if !defined(__sun) /* Fallback to platform default frame buffer driver */ if (i < (nmatches - 1)) { #if !defined(__linux__) && defined(__sparc__) @@ -280,13 +289,13 @@ matches[i++] = xnfstrdup("fbdev"); #endif } -#endif /* !sun */ +#endif /* !__sun */ /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) matches[i++] = xnfstrdup("vesa"); -#elif defined(__sparc__) && !defined(sun) +#elif defined(__sparc__) && !defined(__sun) matches[i++] = xnfstrdup("sunffb"); #endif } @@ -389,8 +398,7 @@ /* for each other driver found, copy the first screen, insert it * into the list of screens and set the driver */ - i = 0; - while (i++ < num_matches) { + for (i = 1; i < num_matches; i++) { if (!copyScreen(slp[0].screen, ptr, i, matches[i])) return NULL; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Bus.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Bus.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Bus.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Bus.c 2017-03-15 18:05:25.000000000 +0000 @@ -78,7 +78,8 @@ Bool foundScreen = FALSE; #ifdef XSERVER_PLATFORM_BUS - if (drv->platformProbe != NULL) { + /* xf86platformBus.c does not support Xorg -configure */ + if (!xf86DoConfigure && drv->platformProbe != NULL) { foundScreen = xf86platformProbeDev(drv); } if (ServerIsNotSeat0() && foundScreen) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86cmap.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86cmap.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86cmap.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86cmap.c 2017-03-15 18:05:25.000000000 +0000 @@ -29,7 +29,7 @@ #include #endif -#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) +#if defined(_XOPEN_SOURCE) || defined(__sun) && defined(__SVR4) #include #else #define _XOPEN_SOURCE /* to get prototype for pow on some systems */ @@ -49,6 +49,7 @@ #include "xf86_OSproc.h" #include "xf86str.h" #include "micmap.h" +#include "xf86RandR12.h" #include "xf86Crtc.h" #ifdef XFreeXDGA @@ -132,9 +133,6 @@ Bool xf86ColormapAllocatePrivates(ScrnInfoPtr pScrn) { - /* If we support a better colormap system, then pretend we succeeded. */ - if (xf86_crtc_supports_gamma(pScrn)) - return TRUE; if (!dixRegisterPrivateKey(&CMapScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; @@ -157,11 +155,8 @@ int *indices; int elements; - /* If we support a better colormap system, then pretend we succeeded. */ - if (xf86_crtc_supports_gamma(pScrn)) - return TRUE; - - if (!maxColors || !sigRGBbits || !loadPalette) + if (!maxColors || !sigRGBbits || + (!loadPalette && !xf86_crtc_supports_gamma(pScrn))) return FALSE; elements = 1 << sigRGBbits; @@ -230,6 +225,15 @@ return FALSE; } + if (xf86_crtc_supports_gamma(pScrn)) { + pScrn->LoadPalette = xf86RandR12LoadPalette; + + if (!xf86RandR12InitGamma(pScrn, elements)) { + CMapUnwrapScreen(pScreen); + return FALSE; + } + } + /* Force the initial map to be loaded */ SetInstalledmiColormap(pScreen, NULL); CMapInstallColormap(pDefMap); @@ -1005,19 +1009,6 @@ CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) { - if (crtc->gammaSize != size) - return BadValue; - - RRCrtcGammaSet(crtc, red, green, blue); - - return Success; - } - } - if (!CMapScreenKeyRegistered) return BadImplementation; @@ -1077,16 +1068,8 @@ int xf86GetGammaRampSize(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) - return crtc->gammaSize; - } - if (!CMapScreenKeyRegistered) return 0; @@ -1104,29 +1087,10 @@ unsigned short *red, unsigned short *green, unsigned short *blue) { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; LOCO *entry; int shift, sigbits; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) { - if (crtc->gammaSize < size) - return BadValue; - - if (!RRCrtcGammaGet(crtc)) - return BadImplementation; - - memcpy(red, crtc->gammaRed, size * sizeof(*red)); - memcpy(green, crtc->gammaGreen, size * sizeof(*green)); - memcpy(blue, crtc->gammaBlue, size * sizeof(*blue)); - - return Success; - } - } - if (!CMapScreenKeyRegistered) return BadImplementation; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Config.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Config.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Config.c 2016-07-19 17:14:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Config.c 2017-03-15 18:05:25.000000000 +0000 @@ -710,7 +710,6 @@ FLAG_LOG, FLAG_RENDER_COLORMAP_MODE, FLAG_RANDR, - FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, FLAG_USE_DEFAULT_FONT_PATH, @@ -763,8 +762,6 @@ {0}, FALSE}, {FLAG_RANDR, "RandR", OPTV_BOOLEAN, {0}, FALSE}, - {FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, - {0}, FALSE}, {FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -828,27 +825,6 @@ xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } - if (xf86SIGIOSupported()) { - xf86Info.useSIGIO = - xf86ReturnOptValBool(FlagOptions, FLAG_USE_SIGIO, - USE_SIGIO_BY_DEFAULT); - if (xf86IsOptionSet(FlagOptions, FLAG_USE_SIGIO)) { - from = X_CONFIG; - } - else { - from = X_DEFAULT; - } - if (!xf86Info.useSIGIO) { - xf86Msg(from, "Disabling SIGIO handlers for input devices\n"); - } - else if (from == X_CONFIG) { - xf86Msg(from, "Enabling SIGIO handlers for input devices\n"); - } - } - else { - xf86Info.useSIGIO = FALSE; - } - if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); @@ -938,13 +914,6 @@ } #endif - xf86Info.aiglx = TRUE; - xf86Info.aiglxFrom = X_DEFAULT; - if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { - xf86Info.aiglx = value; - xf86Info.aiglxFrom = X_CONFIG; - } - #ifdef GLXEXT xf86Info.glxVisuals = XF86_GlxVisualsTypical; xf86Info.glxVisualsFrom = X_DEFAULT; @@ -963,10 +932,6 @@ } } - if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { - xf86Info.aiglx = value; - xf86Info.aiglxFrom = X_CONFIG; - } if (xf86Info.iglxFrom != X_CMDLINE) { if (xf86GetOptValBool(FlagOptions, FLAG_IGLX, &value)) { enableIndirectGLX = value; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Cursor.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Cursor.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Cursor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Cursor.c 2017-03-15 18:05:25.000000000 +0000 @@ -221,7 +221,7 @@ if (pScreen == pCursorScreen) miPointerGetPosition(dev, &px, &py); - OsBlockSIGIO(); + input_lock(); Switched = (*pScr->SwitchMode) (pScr, mode); if (Switched) { pScr->currentMode = mode; @@ -260,7 +260,7 @@ pScr->frameY1 = pScr->virtualY - 1; } } - OsReleaseSIGIO(); + input_unlock(); if (pScr->AdjustFrame) (*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0); @@ -452,11 +452,11 @@ static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); miPointerWarpCursor(pDev, pScreen, x, y); xf86Info.currentScreen = pScreen; - OsReleaseSIGIO(); + input_unlock(); } void * diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Events.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Events.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Events.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Events.c 2017-03-15 18:05:25.000000000 +0000 @@ -54,7 +54,6 @@ #endif #include -#include #include #include #include "misc.h" @@ -101,8 +100,6 @@ switches when using the DRI automatic full screen mode.*/ -extern fd_set EnabledDevices; - #ifdef XF86PM extern void (*xf86OSPMClose) (void); #endif @@ -245,64 +242,23 @@ /* ARGSUSED */ void -xf86Wakeup(void *blockData, int err, void *pReadmask) +xf86Wakeup(void *blockData, int err) { - fd_set *LastSelectMask = (fd_set *) pReadmask; - fd_set devicesWithInput; - InputInfoPtr pInfo; - - if (err >= 0) { - - XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices); - if (XFD_ANYSET(&devicesWithInput)) { - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->read_input && pInfo->fd >= 0 && - (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { - OsBlockSIGIO(); - - /* - * Remove the descriptior from the set because more than one - * device may share the same file descriptor. - */ - FD_CLR(pInfo->fd, &devicesWithInput); - - pInfo->read_input(pInfo); - OsReleaseSIGIO(); - } - pInfo = pInfo->next; - } - } - } - - if (err >= 0) { /* we don't want the handlers called if select() */ - IHPtr ih, ih_tmp; /* returned with an error condition, do we? */ - - nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) { - if (ih->enabled && ih->fd >= 0 && ih->ihproc && - (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) { - ih->ihproc(ih->fd, ih->data); - } - } - } - if (xf86VTSwitchPending()) xf86VTSwitch(); } /* - * xf86SigioReadInput -- - * signal handler for the SIGIO signal. + * xf86ReadInput -- + * input thread handler */ + static void -xf86SigioReadInput(int fd, void *closure) +xf86ReadInput(int fd, int ready, void *closure) { - int errno_save = errno; InputInfoPtr pInfo = closure; pInfo->read_input(pInfo); - - errno = errno_save; } /* @@ -312,9 +268,7 @@ void xf86AddEnabledDevice(InputInfoPtr pInfo) { - if (!xf86InstallSIGIOHandler(pInfo->fd, xf86SigioReadInput, pInfo)) { - AddEnabledDevice(pInfo->fd); - } + InputThreadRegisterDev(pInfo->fd, xf86ReadInput, pInfo); } /* @@ -324,9 +278,7 @@ void xf86RemoveEnabledDevice(InputInfoPtr pInfo) { - if (!xf86RemoveSIGIOHandler(pInfo->fd)) { - RemoveEnabledDevice(pInfo->fd); - } + InputThreadUnregisterDev(pInfo->fd); } static int *xf86SignalIntercept = NULL; @@ -402,9 +354,9 @@ for (i = keyc->xkbInfo->desc->min_key_code; i < keyc->xkbInfo->desc->max_key_code; i++) { if (key_is_down(pDev, i, KEY_POSTED)) { - OsBlockSIGIO(); + input_lock(); QueueKeyboardEvents(pDev, KeyRelease, i); - OsReleaseSIGIO(); + input_unlock(); } } } @@ -448,9 +400,10 @@ if (property_name == BAD_RESOURCE) FatalError("Failed to retrieve \"HAS_VT\" atom\n"); for (i = 0; i < xf86NumScreens; i++) { - ChangeWindowProperty(xf86ScrnToScreen(xf86Screens[i])->root, - property_name, XA_INTEGER, 32, - PropModeReplace, 1, &value, TRUE); + dixChangeWindowProperty(serverClient, + xf86ScrnToScreen(xf86Screens[i])->root, + property_name, XA_INTEGER, 32, + PropModeReplace, 1, &value, TRUE); } } @@ -486,7 +439,7 @@ for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86DisableInputDeviceForVTSwitch(pInfo); - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(xf86Screens[i]); for (i = 0; i < xf86NumGPUScreens; i++) @@ -544,7 +497,7 @@ else xf86EnableGeneralHandler(ih); } - OsReleaseSIGIO(); + input_unlock(); } void @@ -602,7 +555,7 @@ xf86UpdateHasVTProperty(TRUE); - OsReleaseSIGIO(); + input_unlock(); } /* @@ -635,6 +588,16 @@ /* Input handler registration */ +static void +xf86InputHandlerNotify(int fd, int ready, void *data) +{ + IHPtr ih = data; + + if (ih->enabled && ih->fd >= 0 && ih->ihproc) { + ih->ihproc(ih->fd, ih->data); + } +} + static void * addInputHandler(int fd, InputHandlerProc proc, void *data) { @@ -652,6 +615,11 @@ ih->data = data; ih->enabled = TRUE; + if (!SetNotifyFd(fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih)) { + free(ih); + return NULL; + } + ih->next = InputHandlers; InputHandlers = ih; @@ -663,10 +631,8 @@ { IHPtr ih = addInputHandler(fd, proc, data); - if (ih) { - AddEnabledDevice(fd); + if (ih) ih->is_input = TRUE; - } return ih; } @@ -675,8 +641,6 @@ { IHPtr ih = addInputHandler(fd, proc, data); - if (ih) - AddGeneralSocket(fd); return ih; } @@ -706,6 +670,8 @@ { IHPtr p; + if (ih->fd >= 0) + RemoveNotifyFd(ih->fd); if (ih == InputHandlers) InputHandlers = ih->next; else { @@ -730,8 +696,6 @@ ih = handler; fd = ih->fd; - if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); removeInputHandler(ih); return fd; @@ -749,8 +713,6 @@ ih = handler; fd = ih->fd; - if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); removeInputHandler(ih); return fd; @@ -767,7 +729,7 @@ ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); + RemoveNotifyFd(ih->fd); } void @@ -781,7 +743,7 @@ ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); + RemoveNotifyFd(ih->fd); } void @@ -795,7 +757,7 @@ ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) - AddEnabledDevice(ih->fd); + SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } void @@ -809,7 +771,7 @@ ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) - AddGeneralSocket(ih->fd); + SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } /* diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Globals.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Globals.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Globals.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Globals.c 2017-03-15 18:05:25.000000000 +0000 @@ -98,7 +98,7 @@ .vtno = -1, .lastEventTime = -1, .vtRequestsPending = FALSE, -#ifdef sun +#ifdef __sun .vtPendingNum = -1, #endif .dontVTSwitch = FALSE, @@ -201,5 +201,4 @@ Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif -RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; Bool xorgHWAccess = FALSE; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86.h 2017-03-15 18:05:25.000000000 +0000 @@ -61,10 +61,6 @@ #define xf86ScreenKey (&xf86ScreenKeyRec) -extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec; - -#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec) - extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern _X_EXPORT const unsigned char byte_reversed[256]; extern _X_EXPORT Bool fbSlotClaimed; @@ -97,6 +93,10 @@ #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(); } + /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES @@ -306,8 +306,6 @@ extern _X_EXPORT Bool xf86ServerIsResetting(void); extern _X_EXPORT Bool -xf86ServerIsInitialising(void); -extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void); extern _X_EXPORT Bool xf86CaughtSignal(void); @@ -353,9 +351,6 @@ extern _X_EXPORT Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn); -extern _X_EXPORT int -xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, void *value); extern _X_EXPORT Bool xf86IsUnblank(int mode); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Helper.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Helper.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Helper.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Helper.c 2017-03-15 18:05:25.000000000 +0000 @@ -54,7 +54,6 @@ #include "xf86Xinput.h" #include "xf86InPriv.h" #include "mivalidate.h" -#include "xf86Crtc.h" /* For xf86GetClocks */ #if defined(CSRG_BASED) || defined(__GNU__) @@ -908,11 +907,7 @@ scrp->gamma.green = 1.0; scrp->gamma.blue = 1.0; } - /* Pretend we succeeded if we support better a gamma system. - * This avoids a confusing message. - */ - if (xf86_crtc_supports_gamma(scrp)) - return TRUE; + xf86DrvMsg(scrp->scrnIndex, from, "Using gamma correction (%.1f, %.1f, %.1f)\n", scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue); @@ -1516,12 +1511,6 @@ } Bool -xf86ServerIsInitialising(void) -{ - return xf86Initialising; -} - -Bool xf86ServerIsOnlyDetecting(void) { return xf86DoConfigure; @@ -1725,11 +1714,9 @@ } free(options); /* - * XXX quick hack to report correctly for OSs that can't do SilkenMouse - * yet. Should handle this differently so that alternate async methods - * work correctly with this too. + * Use silken mouse if requested and if we have threaded input */ - pScrn->silkenMouse = useSM && xf86Info.useSIGIO && xf86SIGIOSupported(); + pScrn->silkenMouse = useSM && InputThreadEnable; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n", pScrn->silkenMouse ? "enabled" : "disabled"); @@ -1823,81 +1810,6 @@ return FALSE; } -int -xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, void *value) -{ - RootWinPropPtr pNewProp = NULL, pRegProp; - Bool existing = FALSE; - - DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n", - ScrnIndex, (long)property, (long)type, format, len, value); - - if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) { - return BadMatch; - } - - if (xf86RegisteredPropertiesTable && - xf86RegisteredPropertiesTable[ScrnIndex]) { - for (pNewProp = xf86RegisteredPropertiesTable[ScrnIndex]; - pNewProp; pNewProp = pNewProp->next) { - if (strcmp(pNewProp->name, NameForAtom(property)) == 0) - break; - } - } - - if (!pNewProp) { - if ((pNewProp = (RootWinPropPtr) malloc(sizeof(RootWinProp))) == NULL) { - return BadAlloc; - } - /* - * We will put this property at the end of the list so that - * the changes are made in the order they were requested. - */ - pNewProp->next = NULL; - } - else { - free((void *) pNewProp->name); - existing = TRUE; - } - - pNewProp->name = xnfstrdup(NameForAtom(property)); - pNewProp->type = type; - pNewProp->format = format; - pNewProp->size = len; - pNewProp->data = value; - - DebugF("new property filled\n"); - - if (xf86RegisteredPropertiesTable == NULL) { - DebugF("creating xf86RegisteredPropertiesTable[] size %d\n", - xf86NumScreens); - xf86RegisteredPropertiesTable = - xnfcalloc(sizeof(RootWinProp), xf86NumScreens); - } - - DebugF("xf86RegisteredPropertiesTable %p\n", - (void *) xf86RegisteredPropertiesTable); - DebugF("xf86RegisteredPropertiesTable[%d] %p\n", - ScrnIndex, (void *) xf86RegisteredPropertiesTable[ScrnIndex]); - - if (!existing) { - if (xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { - xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp; - } - else { - pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; - while (pRegProp->next != NULL) { - DebugF("- next %p\n", (void *) pRegProp); - pRegProp = pRegProp->next; - } - pRegProp->next = pNewProp; - } - } - DebugF("xf86RegisterRootWindowProperty succeeded\n"); - return Success; -} - Bool xf86IsUnblank(int mode) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Init.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Init.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Init.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Init.c 2017-03-15 18:05:25.000000000 +0000 @@ -297,50 +297,6 @@ return privsElevated; } -static Bool -xf86CreateRootWindow(WindowPtr pWin) -{ - int ret = TRUE; - int err = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - RootWinPropPtr pProp; - CreateWindowProcPtr create_window = (CreateWindowProcPtr) - dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); - - DebugF("xf86CreateRootWindow(%p)\n", pWin); - - /* Unhook this function ... */ - pScreen->CreateWindow = create_window; - dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); - - /* ... and call the previous CreateWindow fuction, if any */ - if (NULL != pScreen->CreateWindow) { - ret = (*pScreen->CreateWindow) (pWin); - } - - /* Now do our stuff */ - if (xf86RegisteredPropertiesTable != NULL) { - if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { - for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; - pProp != NULL && err == Success; pProp = pProp->next) { - Atom prop; - - prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); - err = dixChangeWindowProperty(serverClient, pWin, - prop, pProp->type, - pProp->format, PropModeReplace, - pProp->size, pProp->data, FALSE); - } - - /* Look at err */ - ret &= (err == Success); - - } - } - - return ret; -} - static void InstallSignalHandlers(void) { @@ -352,23 +308,66 @@ OsRegisterSigWrapper(xf86SigWrapper); } else { - signal(SIGSEGV, SIG_DFL); - signal(SIGILL, SIG_DFL); + OsSignal(SIGSEGV, SIG_DFL); + OsSignal(SIGILL, SIG_DFL); #ifdef SIGEMT - signal(SIGEMT, SIG_DFL); + OsSignal(SIGEMT, SIG_DFL); #endif - signal(SIGFPE, SIG_DFL); - signal(SIGBUS, SIG_DFL); - signal(SIGSYS, SIG_DFL); - signal(SIGXCPU, SIG_DFL); - signal(SIGXFSZ, SIG_DFL); + OsSignal(SIGFPE, SIG_DFL); + OsSignal(SIGBUS, SIG_DFL); + OsSignal(SIGSYS, SIG_DFL); + OsSignal(SIGXCPU, SIG_DFL); + OsSignal(SIGXFSZ, SIG_DFL); } } -/* The memory storing the initial value of the XFree86_has_VT root window - * property. This has to remain available until server start-up, so we just - * use a global. */ -static CARD32 HasVTValue = 1; +static void +AddSeatId(CallbackListPtr *pcbl, void *data, void *screen) +{ + ScreenPtr pScreen = screen; + Atom SeatAtom = MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE); + int err; + + err = dixChangeWindowProperty(serverClient, pScreen->root, SeatAtom, + XA_STRING, 8, PropModeReplace, + strlen(data) + 1, data, FALSE); + + if (err != Success) + xf86DrvMsg(pScreen->myNum, X_WARNING, + "Failed to register seat property\n"); +} + +static void +AddVTAtoms(CallbackListPtr *pcbl, void *data, void *screen) +{ +#define VT_ATOM_NAME "XFree86_VT" + int err, HasVT = 1; + ScreenPtr pScreen = screen; + Atom VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); + Atom HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, + TRUE); + + err = dixChangeWindowProperty(serverClient, pScreen->root, VTAtom, + XA_INTEGER, 32, PropModeReplace, 1, + &xf86Info.vtno, FALSE); + + err |= dixChangeWindowProperty(serverClient, pScreen->root, HasVTAtom, + XA_INTEGER, 32, PropModeReplace, 1, + &HasVT, FALSE); + + if (err != Success) + xf86DrvMsg(pScreen->myNum, X_WARNING, + "Failed to register VT properties\n"); +} + +static Bool +xf86ScreenInit(ScreenPtr pScreen, int argc, char **argv) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + + pScrn->pScreen = pScreen; + return pScrn->ScreenInit (pScreen, argc, argv); +} /* * InitOutput -- @@ -711,64 +710,6 @@ } formatsDone = TRUE; - if (xf86Info.vtno >= 0) { -#define VT_ATOM_NAME "XFree86_VT" - Atom VTAtom = -1; - Atom HasVTAtom = -1; - CARD32 *VT = NULL; - CARD32 *HasVT = &HasVTValue; - int ret; - - /* This memory needs to stay available until the screen has been - initialized, and we can create the property for real. - */ - if ((VT = malloc(sizeof(CARD32))) == NULL) { - FatalError - ("Unable to make VT property - out of memory. Exiting...\n"); - } - *VT = xf86Info.vtno; - - VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); - HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, - sizeof(HAS_VT_ATOM_NAME) - 1, TRUE); - - for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; - i++) { - ret = - xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - VTAtom, XA_INTEGER, 32, 1, - VT); - if (ret == Success) - ret = xf86RegisterRootWindowProperty(xf86Screens[i] - ->scrnIndex, - HasVTAtom, XA_INTEGER, - 32, 1, HasVT); - if (ret != Success) - xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, - "Failed to register VT properties\n"); - } - } - - if (SeatId) { - Atom SeatAtom; - - SeatAtom = - MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE); - - for (i = 0; i < xf86NumScreens; i++) { - int ret; - - ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - SeatAtom, XA_STRING, 8, - strlen(SeatId) + 1, - SeatId); - if (ret != Success) { - xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, - "Failed to register seat property\n"); - } - } - } - /* If a screen uses depth 24, show what the pixmap format is */ for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->depth == 24) { @@ -802,6 +743,12 @@ xf86EnableIO(); } + if (xf86Info.vtno >= 0) + AddCallback(&RootWindowFinalizeCallback, AddVTAtoms, NULL); + + if (SeatId) + AddCallback(&RootWindowFinalizeCallback, AddSeatId, SeatId); + /* * Use the previously collected parts to setup pScreenInfo */ @@ -824,7 +771,7 @@ ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif xf86AccessEnter(); - OsBlockSIGIO(); + input_lock(); sigio_blocked = TRUE; } } @@ -833,8 +780,7 @@ if (!xf86ColormapAllocatePrivates(xf86Screens[i])) FatalError("Cannot register DDX private keys"); - if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) + if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0)) FatalError("Cannot register DDX private keys"); for (i = 0; i < xf86NumGPUScreens; i++) { @@ -854,7 +800,7 @@ pScrn->SetOverscan = NULL; pScrn->DriverFunc = NULL; pScrn->pScreen = NULL; - scr_index = AddGPUScreen(pScrn->ScreenInit, argc, argv); + scr_index = AddGPUScreen(xf86ScreenInit, argc, argv); xf86VGAarbiterUnlock(pScrn); if (scr_index == i) { dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates, @@ -882,7 +828,7 @@ xf86Screens[i]->SetOverscan = NULL; xf86Screens[i]->DriverFunc = NULL; xf86Screens[i]->pScreen = NULL; - scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); + scr_index = AddScreen(xf86ScreenInit, argc, argv); xf86VGAarbiterUnlock(xf86Screens[i]); if (scr_index == i) { /* @@ -905,11 +851,6 @@ DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", i, xf86Screens[i]->pScreen->CreateWindow); - dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, - xf86CreateRootWindowKey, - xf86Screens[i]->pScreen->CreateWindow); - xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow; - if (PictureGetSubpixelOrder(xf86Screens[i]->pScreen) == SubPixelUnknown) { xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC); @@ -932,14 +873,14 @@ xf86VGAarbiterWrapFunctions(); if (sigio_blocked) - OsReleaseSIGIO(); + input_unlock(); xf86InitOrigins(); xf86Resetting = FALSE; xf86Initialising = FALSE; - RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, xf86Wakeup, + RegisterBlockAndWakeupHandlers((ServerBlockHandlerProcPtr) NoopDDA, xf86Wakeup, NULL); } @@ -955,6 +896,9 @@ xf86Info.vtRequestsPending = FALSE; + /* Enable threaded input */ + InputThreadPreInit(); + mieqInit(); /* Initialize all configured input devices */ @@ -989,7 +933,7 @@ { static Bool beenHere = FALSE; - signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ + OsSignal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ if (!beenHere) { umask(022); @@ -1078,7 +1022,7 @@ { int i; - OsBlockSIGIO(); + input_lock(); /* * try to restore the original video state @@ -1158,6 +1102,16 @@ ErrorF("%s\n", DEFAULT_LIBRARY_PATH); } +static void +xf86CheckPrivs(const char *option, const char *arg) +{ + if (xf86PrivsElevated() && !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); + } +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is @@ -1178,55 +1132,29 @@ } /* First the options that are not allowed with elevated privileges */ - if (!strcmp(argv[i], "-modulepath") || !strcmp(argv[i], "-logfile")) { - if (xf86PrivsElevated()) { - FatalError("The '%s' option cannot be used with " - "elevated privileges.\n", argv[i]); - } - else if (!strcmp(argv[i], "-modulepath")) { - char *mp; - - CHECK_FOR_REQUIRED_ARGUMENT(); - mp = strdup(argv[i + 1]); - if (!mp) - FatalError("Can't allocate memory for ModulePath\n"); - xf86ModulePath = mp; - xf86ModPathFrom = X_CMDLINE; - return 2; - } - else if (!strcmp(argv[i], "-logfile")) { - char *lf; - - CHECK_FOR_REQUIRED_ARGUMENT(); - lf = strdup(argv[i + 1]); - if (!lf) - FatalError("Can't allocate memory for LogFile\n"); - xf86LogFile = lf; - xf86LogFileFrom = X_CMDLINE; - return 2; - } + if (!strcmp(argv[i], "-modulepath")) { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86CheckPrivs(argv[i], argv[i + 1]); + xf86ModulePath = argv[i + 1]; + xf86ModPathFrom = X_CMDLINE; + return 2; + } + if (!strcmp(argv[i], "-logfile")) { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86CheckPrivs(argv[i], argv[i + 1]); + xf86LogFile = argv[i + 1]; + xf86LogFileFrom = X_CMDLINE; + return 2; } if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config")) { CHECK_FOR_REQUIRED_ARGUMENT(); - if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tWith elevated privileges, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default " __XCONFIGFILE__ " search path.\n\n", - argv[i], argv[i]); - } + xf86CheckPrivs(argv[i], argv[i + 1]); xf86ConfigFile = argv[i + 1]; return 2; } if (!strcmp(argv[i], "-configdir")) { CHECK_FOR_REQUIRED_ARGUMENT(); - if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tWith elevated privileges, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default " __XCONFIGDIR__ " search path.\n\n", - argv[i], argv[i]); - } + xf86CheckPrivs(argv[i], argv[i + 1]); xf86ConfigDir = argv[i + 1]; return 2; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Module.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Module.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Module.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Module.h 2017-03-15 18:05:25.000000000 +0000 @@ -62,7 +62,6 @@ #define ABI_CLASS_VIDEODRV "X.Org Video Driver" #define ABI_CLASS_XINPUT "X.Org XInput driver" #define ABI_CLASS_EXTENSION "X.Org Server Extension" -#define ABI_CLASS_FONT "X.Org Font Renderer" #define ABI_MINOR_MASK 0x0000FFFF #define ABI_MAJOR_MASK 0xFFFF0000 @@ -80,10 +79,9 @@ * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(20, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(22, 1) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0) -#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(23, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 1) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) #define MODINFOSTRING1 0xef23fdc5 #define MODINFOSTRING2 0x10dc023a @@ -122,7 +120,6 @@ #define MOD_CLASS_NONE NULL #define MOD_CLASS_VIDEODRV "X.Org Video Driver" #define MOD_CLASS_XINPUT "X.Org XInput Driver" -#define MOD_CLASS_FONT "X.Org Font Renderer" #define MOD_CLASS_EXTENSION "X.Org Server Extension" /* This structure is expected to be returned by the initfunc */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Option.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Option.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Option.c 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Option.c 2017-03-15 18:05:25.000000000 +0000 @@ -84,7 +84,7 @@ if (device && device->options) { tmp = xf86optionListDup(device->options); if (pScrn->options) - xf86optionListMerge(pScrn->options, tmp); + pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86platformBus.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86platformBus.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86platformBus.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86platformBus.c 2017-03-15 18:05:25.000000000 +0000 @@ -114,7 +114,15 @@ static Bool xf86IsPrimaryPlatform(struct xf86_platform_device *plat) { - return ((primaryBus.type == BUS_PLATFORM) && (plat == primaryBus.id.plat)); + if (primaryBus.type == BUS_PLATFORM) + return plat == primaryBus.id.plat; +#ifdef XSERVER_LIBPCIACCESS + if (primaryBus.type == BUS_PCI) + if (plat->pdev) + if (MATCH_PCI_DEVICES(primaryBus.id.pci, plat->pdev)) + return TRUE; +#endif + return FALSE; } static void @@ -418,6 +426,19 @@ return foundScreen; } +static Bool +isGPUDevice(GDevPtr gdev) +{ + int i; + + for (i = 0; i < gdev->myScreenSection->num_gpu_devices; i++) { + if (gdev == gdev->myScreenSection->gpu_devices[i]) + return TRUE; + } + + return FALSE; +} + int xf86platformProbeDev(DriverPtr drvp) { @@ -450,9 +471,8 @@ if (j == xf86_num_platform_devices) continue; - foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0); - if (!foundScreen) - continue; + foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], + isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); } /* if autoaddgpu devices is enabled then go find any unclaimed platform diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86PM.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86PM.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86PM.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86PM.c 2017-03-15 18:05:25.000000000 +0000 @@ -107,7 +107,7 @@ DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); @@ -135,7 +135,7 @@ xf86Screens[i]->EnterVT(xf86Screens[i]); } } - OsReleaseSIGIO(); + input_unlock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); @@ -182,13 +182,13 @@ } break; default: - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); } } - OsReleaseSIGIO(); + input_unlock(); break; } } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Priv.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Priv.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Priv.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Priv.h 2017-03-15 18:05:25.000000000 +0000 @@ -86,14 +86,12 @@ extern _X_EXPORT DriverPtr *xf86DriverList; extern _X_EXPORT int xf86NumDrivers; extern _X_EXPORT Bool xf86Resetting; -extern _X_EXPORT Bool xf86Initialising; +extern Bool xf86Initialising; extern _X_EXPORT int xf86NumScreens; extern _X_EXPORT const char *xf86VisualNames[]; extern _X_EXPORT int xf86Verbose; /* verbosity level */ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ -extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; - extern ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */ extern int xf86NumGPUScreens; #ifndef DEFAULT_VERBOSE @@ -139,7 +137,7 @@ /* xf86Events.c */ extern _X_EXPORT void -xf86Wakeup(void *blockData, int err, void *pReadmask); +xf86Wakeup(void *blockData, int err); extern _X_HIDDEN int xf86SigWrapper(int signo); extern _X_EXPORT void diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Privstr.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Privstr.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Privstr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Privstr.h 2017-03-15 18:05:25.000000000 +0000 @@ -55,7 +55,7 @@ /* event handler part */ int lastEventTime; Bool vtRequestsPending; -#ifdef sun +#ifdef __sun int vtPendingNum; #endif Bool dontVTSwitch; @@ -80,15 +80,12 @@ Bool miscModInDevEnabled; /* Allow input devices to be * changed */ Bool miscModInDevAllowNonLocal; - Bool useSIGIO; /* Use SIGIO for handling - input device events */ + Bool useSIGIO; /* Use SIGIO for handling DRI1 swaps */ Pix24Flags pixmap24; MessageType pix24From; Bool pmFlag; Bool disableRandR; MessageType randRFrom; - Bool aiglx; - MessageType aiglxFrom; MessageType iglxFrom; XF86_GlxVisuals glxVisuals; MessageType glxVisualsFrom; @@ -116,16 +113,6 @@ } DPMSRec, *DPMSPtr; #endif -/* Information for root window properties. */ -typedef struct _RootWinProp { - struct _RootWinProp *next; - const char *name; - Atom type; - short format; - long size; - void *data; -} RootWinProp, *RootWinPropPtr; - /* 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 -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86str.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86str.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86str.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86str.h 2017-03-15 18:05:25.000000000 +0000 @@ -678,7 +678,7 @@ /* Allow screens to be enabled/disabled individually */ Bool vtSema; - /* hw cursor moves at SIGIO time */ + /* hw cursor moves from input thread */ Bool silkenMouse; /* Storage for clockRanges and adjustFlags for use with the VidMode ext */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86VGAarbiter.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86VGAarbiter.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86VGAarbiter.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86VGAarbiter.c 2017-03-15 18:05:25.000000000 +0000 @@ -105,7 +105,7 @@ xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { int vga_count; - int rsrc_decodes; + int rsrc_decodes = 0; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (vga_no_arb) @@ -265,23 +265,21 @@ } static void -VGAarbiterBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout) { SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); - pScreen->BlockHandler(pScreen, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, pTimeout); VGAPut(); SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); } static void -VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, - void *pReadmask) +VGAarbiterWakeupHandler(ScreenPtr pScreen, int result) { SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); - pScreen->WakeupHandler(pScreen, result, pReadmask); + pScreen->WakeupHandler(pScreen, result); VGAPut(); SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86VGAarbiterPriv.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86VGAarbiterPriv.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86VGAarbiterPriv.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86VGAarbiterPriv.h 2017-03-15 18:05:25.000000000 +0000 @@ -146,10 +146,8 @@ } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ -static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask); -static void VGAarbiterWakeupHandler(ScreenPtr pScreen, - unsigned long result, void *pReadmask); +static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout); +static void VGAarbiterWakeupHandler(ScreenPtr pScreen, int result); static Bool VGAarbiterCloseScreen(ScreenPtr pScreen); static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Xinput.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Xinput.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/common/xf86Xinput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/common/xf86Xinput.c 2017-03-15 18:05:25.000000000 +0000 @@ -110,8 +110,16 @@ static int xf86InputDevicePostInit(DeviceIntPtr dev); -static InputInfoPtr *new_input_devices; -static int new_input_devices_count; +typedef struct { + struct xorg_list node; + InputInfoPtr pInfo; +} PausedInputDeviceRec; +typedef PausedInputDeviceRec *PausedInputDevicePtr; + +static struct xorg_list new_input_devices_list = { + .next = &new_input_devices_list, + .prev = &new_input_devices_list, +}; /** * Eval config and modify DeviceVelocityRec accordingly @@ -130,7 +138,7 @@ /* common settings (available via device properties) */ tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0); - if (tempf > 1.0) { + if (tempf != 1.0) { xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n", devname, tempf); prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION); @@ -540,21 +548,24 @@ if (xorg_list_is_empty(patterns)) return TRUE; - /* If there are patterns but no attribute, reject the match */ - if (!attr) - return FALSE; - /* - * Otherwise, iterate the list of patterns ensuring each entry has a + * Iterate the list of patterns ensuring each entry has a * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { char *const *cur; - Bool match = FALSE; + Bool is_negated = group->is_negated; + Bool match = is_negated; + + /* If there's a pattern but no attribute, we reject the match for a + * MatchFoo directive, and accept it for a NoMatchFoo directive + */ + if (!attr) + return is_negated; for (cur = group->values; *cur; cur++) if ((*compare) (attr, *cur) == 0) { - match = TRUE; + match = !is_negated; break; } if (!match) @@ -632,7 +643,7 @@ /* MatchIs* booleans */ if (iclass->is_keyboard.set && - iclass->is_keyboard.val != ! !(attrs->flags & ATTR_KEYBOARD)) + iclass->is_keyboard.val != ! !(attrs->flags & (ATTR_KEY|ATTR_KEYBOARD))) return FALSE; if (iclass->is_pointer.set && iclass->is_pointer.val != ! !(attrs->flags & ATTR_POINTER)) @@ -643,6 +654,9 @@ if (iclass->is_tablet.set && iclass->is_tablet.val != ! !(attrs->flags & ATTR_TABLET)) return FALSE; + if (iclass->is_tablet_pad.set && + iclass->is_tablet_pad.val != ! !(attrs->flags & ATTR_TABLET_PAD)) + return FALSE; if (iclass->is_touchpad.set && iclass->is_touchpad.val != ! !(attrs->flags & ATTR_TOUCHPAD)) return FALSE; @@ -819,6 +833,22 @@ *min = minor(st.st_rdev); } +static inline InputDriverPtr +xf86LoadInputDriver(const char *driver_name) +{ + InputDriverPtr drv = NULL; + + /* Memory leak for every attached device if we don't + * test if the module is already loaded first */ + drv = xf86LookupInputDriver(driver_name); + if (!drv) { + if (xf86LoadOneModule(driver_name, NULL)) + drv = xf86LookupInputDriver(driver_name); + } + + return drv; +} + /** * Create a new input device, activate and enable it. * @@ -845,15 +875,33 @@ int rval; char *path = NULL; - /* Memory leak for every attached device if we don't - * test if the module is already loaded first */ - drv = xf86LookupInputDriver(pInfo->driver); - if (!drv) - if (xf86LoadOneModule(pInfo->driver, NULL)) - drv = xf86LookupInputDriver(pInfo->driver); + drv = xf86LoadInputDriver(pInfo->driver); if (!drv) { xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver); - rval = BadName; + + if (strlen(FALLBACK_INPUT_DRIVER) > 0) { + xf86Msg(X_INFO, "Falling back to input driver `%s'\n", + FALLBACK_INPUT_DRIVER); + drv = xf86LoadInputDriver(FALLBACK_INPUT_DRIVER); + if (drv) { + free(pInfo->driver); + pInfo->driver = strdup(FALLBACK_INPUT_DRIVER); + } + } + if (!drv) { + rval = BadName; + goto unwind; + } + } + + xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, + pInfo->name); + + if (!drv->PreInit) { + xf86Msg(X_ERROR, + "Input driver `%s' has no PreInit function (ignoring)\n", + drv->driverName); + rval = BadImplementation; goto unwind; } @@ -867,11 +915,10 @@ if (fd != -1) { if (paused) { /* Put on new_input_devices list for delayed probe */ - new_input_devices = xnfreallocarray(new_input_devices, - new_input_devices_count + 1, - sizeof(pInfo)); - new_input_devices[new_input_devices_count] = pInfo; - new_input_devices_count++; + PausedInputDevicePtr new_device = xnfalloc(sizeof *new_device); + new_device->pInfo = pInfo; + + xorg_list_append(&new_device->node, &new_input_devices_list); systemd_logind_release_fd(pInfo->major, pInfo->minor, fd); free(path); return BadMatch; @@ -884,20 +931,11 @@ free(path); - xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, - pInfo->name); - - if (!drv->PreInit) { - xf86Msg(X_ERROR, - "Input driver `%s' has no PreInit function (ignoring)\n", - drv->driverName); - rval = BadImplementation; - goto unwind; - } - xf86AddInput(drv, pInfo); + input_lock(); rval = drv->PreInit(drv, pInfo, 0); + input_unlock(); if (rval != Success) { xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name); @@ -925,18 +963,18 @@ /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86VTOwner()) { - OsBlockSignals(); + input_lock(); EnableDevice(dev, TRUE); if (!dev->enabled) { - OsReleaseSignals(); xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); rval = BadMatch; + input_unlock(); goto unwind; } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); - OsReleaseSignals(); + input_unlock(); } *pdev = dev; @@ -1069,7 +1107,7 @@ if (pInfo) /* need to get these before RemoveDevice */ drv = pInfo->drv; - OsBlockSignals(); + input_lock(); RemoveDevice(pDev, TRUE); if (!isMaster && pInfo != NULL) { @@ -1078,7 +1116,22 @@ else xf86DeleteInput(pInfo, 0); } - OsReleaseSignals(); + input_unlock(); +} + +void +RemoveInputDeviceTraces(const char *config_info) +{ + PausedInputDevicePtr d, tmp; + + xorg_list_for_each_entry_safe(d, tmp, &new_input_devices_list, node) { + const char *ci = xf86findOptionValue(d->pInfo->options, "config_info"); + if (!ci || strcmp(ci, config_info) != 0) + continue; + + xorg_list_del(&d->node); + free(d); + } } /* @@ -1509,29 +1562,27 @@ void xf86InputEnableVTProbe(void) { - int i, is_auto = 0; - InputOption *option = NULL; + int is_auto = 0; DeviceIntPtr pdev; + PausedInputDevicePtr d, tmp; - for (i = 0; i < new_input_devices_count; i++) { - InputInfoPtr pInfo = new_input_devices[i]; + xorg_list_for_each_entry_safe(d, tmp, &new_input_devices_list, node) { + InputInfoPtr pInfo = d->pInfo; + const char *value = xf86findOptionValue(pInfo->options, "_source"); is_auto = 0; - nt_list_for_each_entry(option, pInfo->options, list.next) { - const char *key = input_option_get_key(option); - const char *value = input_option_get_value(option); - - if (strcmp(key, "_source") == 0 && - (strcmp(value, "server/hal") == 0 || - strcmp(value, "server/udev") == 0 || - strcmp(value, "server/wscons") == 0)) - is_auto = 1; - } + if (value && + (strcmp(value, "server/hal") == 0 || + strcmp(value, "server/udev") == 0 || + strcmp(value, "server/wscons") == 0)) + is_auto = 1; + xf86NewInputDevice(pInfo, &pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); + xorg_list_del(&d->node); + free(d); } - new_input_devices_count = 0; } /* end of xf86Xinput.c */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/ddc.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/ddc.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/ddc.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/ddc.c 2017-03-15 18:05:25.000000000 +0000 @@ -149,7 +149,7 @@ return NULL; s_end = s_ptr + NUM; s_pos = s_ptr + s_start; - d_block = malloc(EDID1_LEN); + d_block = calloc(1, EDID1_LEN); if (!d_block) return NULL; d_pos = d_block; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/ddcProperty.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/ddcProperty.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/ddcProperty.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/ddcProperty.c 2017-03-15 18:05:25.000000000 +0000 @@ -27,6 +27,7 @@ #include "xf86.h" #include "xf86DDC.h" +#include "xf86Priv.h" #include #include "property.h" #include "propertyst.h" @@ -34,40 +35,35 @@ #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" -static void -edidMakeAtom(int i, const char *name, CARD8 *data, int size) +static int +edidSize(const xf86MonPtr DDC) { - Atom atom; - unsigned char *atom_data; + int ret = 128; + + if (DDC->flags & EDID_COMPLETE_RAWDATA) + ret += DDC->no_sections * 128; + + return ret; +} - if (!(atom_data = malloc(size * sizeof(CARD8)))) - return; +static void +setRootWindowEDID(ScreenPtr pScreen, xf86MonPtr DDC) +{ + Atom atom = MakeAtom(EDID1_ATOM_NAME, strlen(EDID1_ATOM_NAME), TRUE); - atom = MakeAtom(name, strlen(name), TRUE); - memcpy(atom_data, data, size); - xf86RegisterRootWindowProperty(i, atom, XA_INTEGER, 8, size, atom_data); + dixChangeWindowProperty(serverClient, pScreen->root, atom, XA_INTEGER, + 8, PropModeReplace, edidSize(DDC), DDC->rawData, + FALSE); } static void -addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) +addEDIDProp(CallbackListPtr *pcbl, void *scrn, void *screen) { - int scrnIndex = pScrn->scrnIndex; + ScreenPtr pScreen = screen; + ScrnInfoPtr pScrn = scrn; - if (DDC->flags & MONITOR_DISPLAYID) { - /* Don't bother, use RANDR already */ - return; - } - else if (DDC->ver.version == 1) { - int size = 128 + - (DDC->flags & EDID_COMPLETE_RAWDATA ? DDC->no_sections * 128 : 0); - - edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC->rawData, size); - } - else { - xf86DrvMsg(scrnIndex, X_PROBED, "unexpected EDID version %d.%d\n", - DDC->ver.version, DDC->ver.revision); - return; - } + if (xf86ScreenToScrn(pScreen) == pScrn) + setRootWindowEDID(pScreen, pScrn->monitor->DDC); } Bool @@ -76,11 +72,12 @@ if (!pScrn || !pScrn->monitor || !DDC) return FALSE; - if (DDC->flags & MONITOR_DISPLAYID); - else - xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC); + xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC); - addRootWindowProperties(pScrn, DDC); + if (xf86Initialising) + AddCallback(&RootWindowFinalizeCallback, addEDIDProp, pScrn); + else + setRootWindowEDID(pScrn->pScreen, DDC); return TRUE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/edid.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/edid.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/edid.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/edid.h 2017-03-15 18:05:25.000000000 +0000 @@ -537,7 +537,6 @@ #define MONITOR_EDID_COMPLETE_RAWDATA 0x01 /* old, don't use */ #define EDID_COMPLETE_RAWDATA 0x01 -#define MONITOR_DISPLAYID 0x02 /* * For DisplayID devices, only the scrnIndex, flags, and rawData fields diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ddc/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ddc/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/ddc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -384,6 +385,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -414,7 +418,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -509,6 +516,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/glxmodule.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/glxmodule.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/glxmodule.c 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/glxmodule.c 2017-03-15 18:05:25.000000000 +0000 @@ -80,13 +80,9 @@ setupDone = TRUE; - xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", - xf86Info.aiglx ? "enabled" : "disabled"); - if (xf86Info.aiglx) { - provider = LoaderSymbol("__glXDRI2Provider"); - if (provider) - GlxPushProvider(provider); - } + provider = LoaderSymbol("__glXDRI2Provider"); + if (provider) + GlxPushProvider(provider); LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/Makefile.am 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -29,7 +29,7 @@ libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS) -if AIGLX_DRI_LOADER +if DRI2 libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la if NO_UNDEFINED libglx_la_LIBADD += $(LIBDRM_LIBS) $(PIXMAN_LIBS) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dixmods/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dixmods/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -88,15 +88,16 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@AIGLX_DRI_LOADER_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = $(LIBDRM_LIBS) $(PIXMAN_LIBS) +@DRI2_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la +@DRI2_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = $(LIBDRM_LIBS) $(PIXMAN_LIBS) @NO_UNDEFINED_TRUE@am__append_3 = libfb.la subdir = hw/xfree86/dixmods ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -159,8 +160,9 @@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(libfb_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) +@DRI2_TRUE@@NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = \ +@DRI2_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) \ +@DRI2_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) libglx_la_DEPENDENCIES = $(top_builddir)/glx/libglx.la \ $(am__DEPENDENCIES_1) $(am__append_1) $(am__DEPENDENCIES_2) am_libglx_la_OBJECTS = glxmodule.lo @@ -426,6 +428,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -456,7 +461,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -551,6 +559,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/ddxDesign.xml xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/ddxDesign.xml --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/ddxDesign.xml 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/ddxDesign.xml 2017-03-15 18:05:25.000000000 +0000 @@ -2054,18 +2054,6 @@
- Bool xf86ServerIsInitialising(); - -
- Returns TRUE if the server is at the beginning of - a generation and is in the process of initialising, and - FALSE otherwise. -
- -
- -
- Bool xf86ServerIsOnlyProbing();
@@ -5560,10 +5548,6 @@ ABI_CLASS_EXTENSION requires the extension module ABI - - ABI_CLASS_FONT - requires the font module ABI - @@ -5583,7 +5567,6 @@ ABI_VIDEODRV_VERSION ABI_XINPUT_VERSION ABI_EXTENSION_VERSION - ABI_FONT_VERSION @@ -5603,7 +5586,6 @@ MOD_CLASS_NONE MOD_CLASS_VIDEODRV MOD_CLASS_XINPUT - MOD_CLASS_FONT MOD_CLASS_EXTENSION diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -14,5 +14,4 @@ EXTRA_DIST = \ Registry \ exa-driver.txt \ - README.DRIcomp \ README.modes diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -110,9 +110,10 @@ subdir = hw/xfree86/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) \ @@ -327,6 +328,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -357,7 +361,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -452,6 +459,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -529,7 +537,6 @@ EXTRA_DIST = \ Registry \ exa-driver.txt \ - README.DRIcomp \ README.modes all: all-am diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/README.DRIcomp xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/README.DRIcomp --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/doc/README.DRIcomp 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/doc/README.DRIcomp 1970-01-01 00:00:00.000000000 +0000 @@ -1,551 +0,0 @@ - DRI Compilation Guide - - VA Linux Systems, Inc. Professional Services - Graphics. - - 21 April 2001 - -1. Preamble - -1.1 Copyright - -Copyright 2000-2001 by VA Linux Systems, Inc. All Rights Reserved. - -Permission is granted to make and distribute verbatim copies of this document -provided the copyright notice and this permission notice are preserved on all -copies. - -1.2 Trademarks - -OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics, -Inc. Unix is a registered trademark of The Open Group. The `X' device and X -Window System are trademarks of The Open Group. XFree86 is a trademark of -The XFree86 Project. Linux is a registered trademark of Linus Torvalds. -Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and -Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd. -3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter- -active, Incorporated. Matrox is a registered trademark of Matrox Electronic -Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo- -gies, Inc. All other trademarks mentioned are the property of their respec- -tive owners. - -2. Introduction - -This document describes how to download, compile and install the DRI. The -DRI provides 3D graphics hardware acceleration for the XFree86 project. This -information is intended for experienced Linux developers. Beginners are -probably better off installing precompiled packages. - -Edits, corrections and updates to this document may be mailed to . - -Last updated on 13 February 2002 by Brian Paul. - -3. Prerequisites - -You'll need the following: - - o An installation of XFree86 4.1 or later. The DRI tree has been pruned - down to minimize its size. But in order to build the DRI tree you need - to have recent X header files, etc. already installed. If you don't - have XFree86 4.1 (or later) installed you can probably install it from - RPMs (or another package format). Or, you can download XFree86 as - sources and compile/install it yourself. - - o At least 200MB of free disk space. If you compile for debugging (the -g - option) then you'll need about 600MB. - - o GCC compiler and related tools. - - o ssh (secure shell) if you're a DRI developer and don't want to use - anonymous CVS download. - - o A 2.4.x Linux Kernel. See below for details. - - o FreeBSD support is not currently being maintained and may not work. - -The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How- -ever, limited support for Alpha and PowerPC support is underway. - -For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library -(libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be -downloaded from the DRI website. You can compile them yourself, but it's -often a painful process. - -For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll -also need AGP support in your Linux kernel, either built-in or as a loadable -module. - -4. Linux Kernel Preparation - -Only the Linux 2.4.x kernels are currently supported by the DRI hardware -drivers. 2.5.x kernels may work, but aren't tested. - -Most of the DRI drivers require AGP support and using Intel Pentium III SSE -optimizations also requires an up-to-date Linux kernel. Configuring your -kernel correctly is very important, as features such as SSE optimizations -will be disabled if your kernel does not support them. Thus, if you have a -Pentium III processor, you must configure your kernel for the Pentium III -processor family. - -Building a new Linux kernel can be difficult for beginners but there are -resources on the Internet to help. This document assumes experience with -configuring, building and installing Linux kernels. - -Linux kernels can be downloaded from www.kernel.org - -Here are the basic steps for kernel setup. - - o Download the needed kernel and put it in /usr/src. Create a directory - for the source and unpack it. For example: - - cd /usr/src - rm -f linux - mkdir linux-2.4.x - ln -s linux-2.4.x linux - bzcat linux-2.4.x.tar.bz2 | tar xf - - - It is critical that /usr/src/linux point to your new kernel sources, - otherwise the kernel headers will not be used when building the DRI. - This will almost certainly cause compilation problems. - - o Read /usr/src/linux/Documentation/Changes. This file lists the minimum - requirements for all software packages required to build the kernel. - You must upgrade at least gcc, make, binutils and modutils to at least - the versions specified in this file. The other packages may not be - needed. If you are upgrading from Linux 2.2.x you must upgrade your - modutils package for Linux 2.4.x. - - o Configure your kernel. You might, for example, use make menuconfig and - do the following: - - o Go to Code maturity level options - - o Enable Prompt for development and/or incomplete code/drivers - - o hit ESC to return to the top-level menu - - o Go to Processor type and features - - o Select your processor type from Processor Family - - o hit ESC to return to the top-level menu - - o Go to Character devices - - o Disable Direct Rendering Manager (XFree86 DRI support) since we'll - use the DRI code from the XFree86/DRI tree and will compile it - there. - - o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW) - - o Hit SPACE twice to build AGP support into the kernel - - o Enable all chipsets' support for AGP - - o Configure the rest of the kernel as required for your system (i.e. Eth- - ernet, SCSI, etc) - - o Exit, saving your kernel configuration. - - o Edit your /etc/lilo.conf file. Make sure you have an image entry as - follows (or similar): - - image=/boot/vmlinuz - label=linux.2.4.x - read-only - root=/dev/hda1 - - The important part is that you have /boot/vmlinuz without a trailing - version number. If this is the first entry in your /etc/lilo.conf AND - you haven't set a default, then this will be your default kernel. - - o Compile the new kernel. - - cd /usr/src/linux-2.4.x - make dep - make bzImage - make modules - make modules_install - make install - - Note that last make command will automatically run lilo for you. - - o Now reboot to use the new kernel. - -5. CPU Architectures - -In general, nothing special has to be done to use the DRI on different CPU -architectures. There are, however, a few optimizations that are CPU-depen- -dent. Mesa will determine at runtime which CPU-dependent optimizations -should be used and enable them where appropriate. - -5.1 Intel Pentium III Features - -The Pentium III SSE instructions are used in optimized vertex transformation -functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent -kernel (such as 2.4.0-test11 or later) both at compile time and runtime. - -5.2 AMD 3DNow! Features - -AMD's 3DNow! instructions are used in optimized vertex transformation func- -tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of -Linux. - -5.3 Alpha Features - -On newer Alpha processors a significant performance increase can be seen with -the addition of the -mcpu= option to GCC. This option is dependent on the -architecture of the processor. For example, -mcpu=ev6 will build specifi- -cally for the EV6 based AXP's, giving both byte and word alignment access to -the DRI/Mesa drivers. - -To enable this optimization edit your xc/config/host.def file and add the -line: - -#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 - -Additional speed improvements to 3D rendering can be achieved by installing -Compaq's Math Libraries (CPML) which can be obtained from http://www.sup- -port.compaq.com/alpha-tools/software/index.html - -Once installed, you can add this line to your host.def to build with the CPML -libraries: - -#define UseCompaqMathLibrary YES - -The host.def file is explained below. - -6. Downloading the XFree86/DRI CVS Sources - -The DRI project is hosted by SourceForge. The DRI source code, which is a -subset of the XFree86 source tree, is kept in a CVS repository there. - -The DRI CVS sources may be accessed either anonymously or as a registered -SourceForge user. It's recommended that you become a registered SourceForge -user so that you may submit non-anonymous bug reports and can participate in -the mailing lists. - -6.1 Anonymous CVS download: - - 1. Create a directory to store the CVS files: - - cd ~ - mkdir DRI-CVS - - You could put your CVS directory in a different place but we'll use - ~/DRI-CVS/ here. - - 2. Check out the CVS sources: - - cd ~/DRI-CVS - cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login - (hit ENTER when prompted for a password) - cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc - - The -z3 flag causes compression to be used in order to reduce the down- - load time. - -6.2 Registered CVS download: - - 1. Create a directory to store the CVS files: - - cd ~ - mkdir DRI-CVS - - You could put your CVS directory in a different place but we'll use - ~/DRI-CVS/ here. - - 2. Set the CVS_RSH environment variable: - - setenv CVS_RSH ssh // if using csh or tcsh - export CVS_RSH=ssh // if using sh or bash - - 3. Check out the CVS sources: - - cd ~/DRI-CVS - cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc - - Replace YOURID with your CVS login name. You'll be prompted to enter - your sourceforge password. - - The -z3 flag causes compression to be used in order to reduce the down- - load time. - -6.3 Updating your CVS sources - -In the future you'll want to occasionally update your local copy of the DRI -source code to get the latest changes. This can be done with: - - cd ~/DRI-CVS - cvs -z3 update -dA xc - -The -d flag causes any new subdirectories to be created and -A causes most -recent trunk sources to be fetched, not branch sources. - -7. Mesa - -Most of the DRI 3D drivers are based on Mesa (the free implementation of the -OpenGL API). The relevant files from Mesa are already included in the -XFree86/DRI source tree. There is no need to download or install the Mesa -source files separately. - -Sometimes a newer version of Mesa will be available than the version included -in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor- -ward. It can be an error-prone undertaking, especially for beginners, and is -not generally recommended. The DRI developers will upgrade Mesa when appro- -priate. - -8. Compiling the XFree86/DRI tree - -8.1 Make a build tree - -Rather than placing object files and library files right in the source tree, -they're instead put into a parallel build tree. The build tree is made with -the lndir command: - - cd ~/DRI-CVS - ln -s xc XFree40 - mkdir build - cd build - lndir -silent -ignorelinks ../XFree40 - -The build tree will be populated with symbolic links which point back into -the CVS source tree. - -Advanced users may have several build trees for compiling and testing with -different options. - -8.2 Edit the host.def file - -The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the -XFree86 build process. You can change it to customize your build options or -make adjustments for your particular system configuration - -The default host.def file will look something like this: - - #define DefaultCCOptions -Wall - (i386) #define DefaultGcc2i386Opt -O2 - (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) - #define LibraryCDebugFlags -O2 - #define BuildServersOnly YES - #define XF86CardDrivers vga tdfx mga ati i810 - #define LinuxDistribution LinuxRedHat - #define DefaultCCOptions -ansi GccWarningOptions -pipe - #define BuildXF86DRI YES - /* Optionally turn these on for debugging */ - /* #define GlxBuiltInTdfx YES */ - /* #define GlxBuiltInMga YES */ - /* #define GlxBuiltInR128 YES */ - /* #define GlxBuiltInRadeon YES */ - /* #define DoLoadableServer NO */ - #define SharedLibFont NO - -The ProjectRoot variable specifies where the XFree86 files will be installed. -We recommend installing the DRI files over your existing XFree86 installation -- it's generally safe to do and less error-prone. This policy is different -than what we used to recommend. - -If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow- -ing to the host.def file: - - #define ProjectRoot pathToYourXFree86installation - -Note the XF86CardDrivers line to be sure your card's driver is listed. - -If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you -should add the following: - - #define MesaUse3DNow YES - -You don't have to be using an AMD processor in order to enable this option. -The DRI will look for 3DNow! support and runtime and only enable it if appli- -cable. - -If you want to enable SSE optimizations in Mesa and the DRI drivers, you must -upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by -both your processor and your operating system, but to build Mesa inside the -DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If -you enable SSE optimizations with an earlier version of the Linux kernel in -/usr/src/linux, Mesa will not compile. You have been warned. If you do have -a 2.4.x kernel, you should add the following: - - #define MesaUseSSE YES - -If you want to build the DRM kernel modules as part of the full build pro- -cess, add the following: - - #define BuildXF86DRM YES - -Otherwise, you'll need to build them separately as described below. - -8.3 Compilation - -To compile the complete DRI tree: - - cd ~/DRI-CVS/build/xc/ - make World >& world.log - -Or if you want to watch the compilation progress: - - cd ~/DRI-CVS/build/xc/ - make World >& world.log & - tail -f world.log - -With the default compilation flags it's normal to get a lot of warnings dur- -ing compilation. - -Building will take some time so you may want to go check your email or visit -slashdot. - -WARNING: do not use the -j option with make. It's reported that it does not -work with XFree86/DRI. - -8.4 Check for compilation errors - -Using your text editor, examine world.log for errors by searching for the -pattern ***. - -After fixing the errors, run make World again. Later, you might just compile -parts of the source tree but it's important that the whole tree will build -first. - -If you edited your host.def file to enable automatic building of the DRI ker- -nel module(s), verify that they were built: - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - ls - -Otherwise, build them now by running - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make -f Makefile.linux - -For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you -should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI -Radeon, you should see radeon.o. For the Intel i810, you should see i810.o. - -If the DRI kernel module(s) failed to build you should verify that you're -using the right version of the Linux kernel. The most recent kernels are not -always supported. - -If your build machine is running a different version of the kernel than your -target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel -source tree. This can be fixed by explicitly setting the value of LINUXDIR. -If the path to your kernel source is /usr/src/linux-2.4.x, - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x - -or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN- -UXDIR line. - -8.5 DRI kernel module installation - -The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro- -grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/. - -To load the appropriate DRM module in your running kernel you can either use -ismod and restart your X server or copy the kernel module to /lib/mod- -ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X -server. - -Make sure you first unload any older DRI kernel modules that might be already -loaded. - -Note that some DRM modules require that the agpgart module be loaded first. - -9. Normal Installation and Configuration - -Most users will want to install the new X server and use it in place of their -old X server. This section explains how to do that. - -Developers, on the other hand, may just want to test the X server without -actually installing it as their default server. If you want to do that, skip -to the next section. - -9.1 Installation - -Here are the installation commands: - - su - cd ~/DRI-CVS/build/xc - make install - -9.2 Update the XF86Config File - -You may need to edit your XF86Config file to enable the DRI. The config file -is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for -details, but basically, you need to load the "glx" and "dri" modules and add -a "DRI" section. - -On the DRI web site, in the resources section, you'll find example XF86Config -files for a number of graphics cards. These configuration files also setup -DRI options so it's highly recommended that you look at these examples. - -The XFree86 4.x server can generate a basic configuration file itself. Sim- -ply do this: - - cd /usr/X11R6/bin - ./XFree86 -configure - -A file named /root/XF86Config.new will be created. It should allow you to -try your X server but you'll almost certainly have to edit it. For example, -you should add HorizSync and VertRefresh options to the Monitor section and -Modes options to the Screen section. Also, the ModulePath option in the -Files section should be set to /usr/X11R6/lib/modules. - -9.3 Start the New X Server - -The new X server should be ready to use now. Start your X server in your -usual manner. Often times the startx command is used: - - startx - -10. Testing the Server Without Installing It - -As mentioned at the start of section 9, developers may want to simply run the -X server without installing it. This can save some time and allow you to -keep a number of X servers available for testing. - -10.1 Configuration - -As described in the preceding section, you'll need to create a configuration -file for the new server. Put the XF86Config file in your ~/DRI- -CVS/build/xc/programs/Xserver directory. - -Be sure the ModulePath option in your XF86Config file is set correctly. - -10.2 A Startup Script - -A simple shell script can be used to start the X server. Here's an example. - - #!/bin/sh - export DISPLAY=:0 - ./XFree86 -xf86config XF86Config & \ - sleep 2 - fvwm2 & - xset b off - xmodmap -e "clear mod4" - xsetroot -solid "#00306f" - xterm -geometry 80x40+0+0 - -You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro- -grams/Xserver directory. - -To test the server run the script: - - cd ~/DRI-CVS/build/xc/programs/Xserver - ./start-dri - -For debugging, you may also want to capture the log messages printed by the -server in a file. If you're using the C-shell: - - ./start-dri >& log - -11. Where To Go From Here - -At this point your X server should be up and running with hardware-acceler- -ated direct rendering. Please read the DRI User Guide for information about -trouble shooting and how to use the DRI-enabled X server for 3D applications. - - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/dri.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/dri.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/dri.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/dri.c 2017-03-15 18:05:25.000000000 +0000 @@ -158,9 +158,6 @@ Bool drmWasAvailable; DRIEntPrivPtr pDRIEntPriv; DRIEntPrivRec tmp; - drmVersionPtr drmlibv; - int drmlibmajor, drmlibminor; - const char *openBusID; int count; int err; @@ -176,23 +173,6 @@ memset(&tmp, 0, sizeof(tmp)); - /* Check the DRM lib version. - */ - - drmlibmajor = 1; - drmlibminor = 0; - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } - - /* Check if the libdrm can handle falling back to loading based on name - * if a busid string is passed. - */ - openBusID = (drmlibmajor == 1 && drmlibminor >= 2) ? busID : NULL; - tmp.drmFD = -1; sv.drm_di_major = 1; sv.drm_di_minor = 1; @@ -201,7 +181,7 @@ saveSv = sv; count = 10; while (count--) { - tmp.drmFD = drmOpen(drmDriverName, openBusID); + tmp.drmFD = drmOpen(drmDriverName, busID); if (tmp.drmFD < 0) { DRIDrvMsg(-1, X_ERROR, "[drm] drmOpen failed.\n"); @@ -310,6 +290,68 @@ xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); } +static void +drmSIGIOHandler(int interrupt, void *closure) +{ + unsigned long key; + void *value; + ssize_t count; + drm_ctx_t ctx; + typedef void (*_drmCallback) (int, void *, void *); + char buf[256]; + drm_context_t old; + drm_context_t new; + void *oldctx; + void *newctx; + char *pt; + drmHashEntry *entry; + void *hash_table; + + hash_table = drmGetHashTable(); + + if (!hash_table) + return; + if (drmHashFirst(hash_table, &key, &value)) { + entry = value; + do { + if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { + buf[count] = '\0'; + + for (pt = buf; *pt != ' '; ++pt); /* Find first space */ + ++pt; + old = strtol(pt, &pt, 0); + new = strtol(pt, NULL, 0); + oldctx = drmGetContextTag(entry->fd, old); + newctx = drmGetContextTag(entry->fd, new); + ((_drmCallback) entry->f) (entry->fd, oldctx, newctx); + ctx.handle = new; + ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx); + } + } while (drmHashNext(hash_table, &key, &value)); + } +} + +static int +drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)) +{ + drmHashEntry *entry; + + entry = drmGetEntry(fd); + entry->f = f; + + return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0); +} + +static int +drmRemoveSIGIOHandler(int fd) +{ + drmHashEntry *entry = drmGetEntry(fd); + + entry->f = NULL; + + return xf86RemoveSIGIOHandler(fd); +} + Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) { @@ -1605,7 +1647,7 @@ } void -DRIWakeupHandler(void *wakeupData, int result, void *pReadmask) +DRIWakeupHandler(void *wakeupData, int result) { int i; @@ -1614,13 +1656,12 @@ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, - result, pReadmask); + (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result); } } void -DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) +DRIBlockHandler(void *blockData, void *pTimeout) { int i; @@ -1629,14 +1670,12 @@ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, - pTimeout, pReadmask); + (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout); } } void -DRIDoWakeupHandler(ScreenPtr pScreen, - unsigned long result, void *pReadmask) +DRIDoWakeupHandler(ScreenPtr pScreen, int result) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -1653,8 +1692,7 @@ } void -DRIDoBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +DRIDoBlockHandler(ScreenPtr pScreen, void *timeout) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -2378,74 +2416,3 @@ return busID; } - -static void -drmSIGIOHandler(int interrupt, void *closure) -{ - unsigned long key; - void *value; - ssize_t count; - drm_ctx_t ctx; - typedef void (*_drmCallback) (int, void *, void *); - char buf[256]; - drm_context_t old; - drm_context_t new; - void *oldctx; - void *newctx; - char *pt; - drmHashEntry *entry; - void *hash_table; - - hash_table = drmGetHashTable(); - - if (!hash_table) - return; - if (drmHashFirst(hash_table, &key, &value)) { - entry = value; - do { -#if 0 - fprintf(stderr, "Trying %d\n", entry->fd); -#endif - if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { - buf[count] = '\0'; -#if 0 - fprintf(stderr, "Got %s\n", buf); -#endif - - for (pt = buf; *pt != ' '; ++pt); /* Find first space */ - ++pt; - old = strtol(pt, &pt, 0); - new = strtol(pt, NULL, 0); - oldctx = drmGetContextTag(entry->fd, old); - newctx = drmGetContextTag(entry->fd, new); -#if 0 - fprintf(stderr, "%d %d %p %p\n", old, new, oldctx, newctx); -#endif - ((_drmCallback) entry->f) (entry->fd, oldctx, newctx); - ctx.handle = new; - ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx); - } - } while (drmHashNext(hash_table, &key, &value)); - } -} - -int -drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)) -{ - drmHashEntry *entry; - - entry = drmGetEntry(fd); - entry->f = f; - - return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0); -} - -int -drmRemoveSIGIOHandler(int fd) -{ - drmHashEntry *entry = drmGetEntry(fd); - - entry->f = NULL; - - return xf86RemoveSIGIOHandler(fd); -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/dri.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/dri.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/dri.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/dri.h 2017-03-15 18:05:25.000000000 +0000 @@ -263,18 +263,13 @@ extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen); -extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, - int result, void *pReadmask); +extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result); -extern _X_EXPORT void DRIBlockHandler(void *blockData, - OSTimePtr pTimeout, void *pReadmask); +extern _X_EXPORT void DRIBlockHandler(void *blockData, void *timeout); -extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, - unsigned long result, - void *pReadmask); +extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result); -extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask); +extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *timeout); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); @@ -332,9 +327,6 @@ extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); -extern _X_EXPORT int drmInstallSIGIOHandler(int fd, - void (*f) (int, void *, void *)); -extern _X_EXPORT int drmRemoveSIGIOHandler(int fd); extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/dri ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -383,6 +384,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -413,7 +417,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -508,6 +515,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/dri2.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/dri2.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/dri2.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/dri2.c 2017-03-15 18:05:25.000000000 +0000 @@ -186,12 +186,15 @@ GetScreenPrime(ScreenPtr master, int prime_id) { ScreenPtr slave; - if (prime_id == 0 || xorg_list_is_empty(&master->offload_slave_list)) { + if (prime_id == 0) { return master; } - xorg_list_for_each_entry(slave, &master->offload_slave_list, offload_head) { + xorg_list_for_each_entry(slave, &master->slave_list, slave_head) { DRI2ScreenPtr ds; + if (!slave->is_offload_slave) + continue; + ds = DRI2GetScreen(slave); if (ds == NULL) continue; @@ -859,6 +862,7 @@ if (pPriv->prime_slave_pixmap->master_pixmap == mpix) return &pPriv->prime_slave_pixmap->drawable; else { + PixmapUnshareSlavePixmap(pPriv->prime_slave_pixmap); (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap); pPriv->prime_slave_pixmap = NULL; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/dri2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -425,6 +426,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -455,7 +459,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -550,6 +557,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/i965_pci_ids.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/i965_pci_ids.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/i965_pci_ids.h 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/i965_pci_ids.h 2017-03-15 18:05:25.000000000 +0000 @@ -112,6 +112,7 @@ CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1") +CHIPSET(0x190B, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x190E, skl_gt1, "Intel(R) Skylake GT1") CHIPSET(0x1912, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)") CHIPSET(0x1913, skl_gt2, "Intel(R) Skylake GT2f") @@ -122,19 +123,21 @@ CHIPSET(0x191B, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)") CHIPSET(0x191D, skl_gt2, "Intel(R) HD Graphics P530 (Skylake GT2)") CHIPSET(0x191E, skl_gt2, "Intel(R) HD Graphics 515 (Skylake GT2)") -CHIPSET(0x1921, skl_gt2, "Intel(R) Skylake GT2") -CHIPSET(0x1923, skl_gt3, "Intel(R) Iris Graphics 540 (Skylake GT3e)") -CHIPSET(0x1926, skl_gt3, "Intel(R) HD Graphics 535 (Skylake GT3)") +CHIPSET(0x1921, skl_gt2, "Intel(R) HD Graphics 520 (Skylake GT2)") +CHIPSET(0x1923, skl_gt3, "Intel(R) Skylake GT3e") +CHIPSET(0x1926, skl_gt3, "Intel(R) Iris Graphics 540 (Skylake GT3e)") CHIPSET(0x1927, skl_gt3, "Intel(R) Iris Graphics 550 (Skylake GT3e)") CHIPSET(0x192A, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x192B, skl_gt3, "Intel(R) Iris Graphics (Skylake GT3fe)") -CHIPSET(0x1932, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193A, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193B, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193D, skl_gt4, "Intel(R) Skylake GT4") +CHIPSET(0x192B, skl_gt3, "Intel(R) Iris Graphics 555 (Skylake GT3e)") +CHIPSET(0x192D, skl_gt3, "Intel(R) Iris Graphics P555 (Skylake GT3e)") +CHIPSET(0x1932, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)") +CHIPSET(0x193A, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)") +CHIPSET(0x193B, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)") +CHIPSET(0x193D, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)") CHIPSET(0x5902, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x5906, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x590A, kbl_gt1, "Intel(R) Kabylake GT1") +CHIPSET(0x5908, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x590B, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x590E, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x5913, kbl_gt1_5, "Intel(R) Kabylake GT1.5") @@ -147,17 +150,16 @@ CHIPSET(0x591D, kbl_gt2, "Intel(R) Kabylake GT2") CHIPSET(0x591E, kbl_gt2, "Intel(R) Kabylake GT2") CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F") +CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3") CHIPSET(0x5926, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x592A, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x592B, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x5932, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x593A, kbl_gt4, "Intel(R) Kabylake GT4") +CHIPSET(0x5927, kbl_gt3, "Intel(R) Kabylake GT3") CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x593D, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherryview)") -CHIPSET(0x22B1, chv, "Intel(R) HD Graphics (Cherryview)") +CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") +CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)") CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)") +CHIPSET(0x1A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)") CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics (Broxton)") +CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)") diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -90,9 +90,10 @@ subdir = hw/xfree86/dri2/pci_ids ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -304,6 +305,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -334,7 +338,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -429,6 +436,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h 2017-03-15 18:05:25.000000000 +0000 @@ -184,12 +184,24 @@ CHIPSET(0x67E0, POLARIS11_, POLARIS11) CHIPSET(0x67E1, POLARIS11_, POLARIS11) +CHIPSET(0x67E3, POLARIS11_, POLARIS11) +CHIPSET(0x67E7, POLARIS11_, POLARIS11) CHIPSET(0x67E8, POLARIS11_, POLARIS11) CHIPSET(0x67E9, POLARIS11_, POLARIS11) CHIPSET(0x67EB, POLARIS11_, POLARIS11) +CHIPSET(0x67EF, POLARIS11_, POLARIS11) CHIPSET(0x67FF, POLARIS11_, POLARIS11) CHIPSET(0x67C0, POLARIS10_, POLARIS10) +CHIPSET(0x67C1, POLARIS10_, POLARIS10) +CHIPSET(0x67C2, POLARIS10_, POLARIS10) +CHIPSET(0x67C4, POLARIS10_, POLARIS10) +CHIPSET(0x67C7, POLARIS10_, POLARIS10) +CHIPSET(0x67C8, POLARIS10_, POLARIS10) +CHIPSET(0x67C9, POLARIS10_, POLARIS10) +CHIPSET(0x67CA, POLARIS10_, POLARIS10) +CHIPSET(0x67CC, POLARIS10_, POLARIS10) +CHIPSET(0x67CF, POLARIS10_, POLARIS10) CHIPSET(0x67DF, POLARIS10_, POLARIS10) CHIPSET(0x98E4, STONEY_, STONEY) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/drivers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -365,6 +366,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -395,7 +399,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -490,6 +497,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/dri2.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/dri2.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/dri2.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/dri2.c 2017-03-15 18:05:25.000000000 +0000 @@ -46,6 +46,7 @@ enum ms_dri2_frame_event_type { MS_DRI2_QUEUE_SWAP, + MS_DRI2_QUEUE_FLIP, MS_DRI2_WAIT_MSC, }; @@ -117,22 +118,10 @@ return screen->GetWindowPixmap((WindowPtr) drawable); } -static PixmapPtr -get_front_buffer(DrawablePtr drawable) -{ - PixmapPtr pixmap; - - pixmap = get_drawable_pixmap(drawable); - pixmap->refcnt++; - - return pixmap; -} - static DRI2Buffer2Ptr -ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, - unsigned int format) +ms_dri2_create_buffer2(ScreenPtr screen, DrawablePtr drawable, + unsigned int attachment, unsigned int format) { - ScreenPtr screen = drawable->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); DRI2Buffer2Ptr buffer; PixmapPtr pixmap; @@ -151,8 +140,13 @@ } pixmap = NULL; - if (attachment == DRI2BufferFrontLeft) - pixmap = get_front_buffer(drawable); + if (attachment == DRI2BufferFrontLeft) { + pixmap = get_drawable_pixmap(drawable); + if (pixmap && pixmap->drawable.pScreen != screen) + pixmap = NULL; + if (pixmap) + pixmap->refcnt++; + } if (pixmap == NULL) { int pixmap_width = drawable->width; @@ -192,8 +186,6 @@ pixmap_cpp, 0); if (pixmap == NULL) { - if (pixmap) - screen->DestroyPixmap(pixmap); free(private); free(buffer); return NULL; @@ -226,6 +218,14 @@ return buffer; } +static DRI2Buffer2Ptr +ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, + unsigned int format) +{ + return ms_dri2_create_buffer2(drawable->pScreen, drawable, attachment, + format); +} + static void ms_dri2_reference_buffer(DRI2Buffer2Ptr buffer) { @@ -235,7 +235,8 @@ } } -static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) +static void ms_dri2_destroy_buffer2(ScreenPtr unused, DrawablePtr unused2, + DRI2Buffer2Ptr buffer) { if (!buffer) return; @@ -253,28 +254,55 @@ } } +static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) +{ + ms_dri2_destroy_buffer2(NULL, drawable, buffer); +} + static void -ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, - DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) +ms_dri2_copy_region2(ScreenPtr screen, DrawablePtr drawable, RegionPtr pRegion, + DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) { ms_dri2_buffer_private_ptr src_priv = sourceBuffer->driverPrivate; ms_dri2_buffer_private_ptr dst_priv = destBuffer->driverPrivate; PixmapPtr src_pixmap = src_priv->pixmap; PixmapPtr dst_pixmap = dst_priv->pixmap; - ScreenPtr screen = drawable->pScreen; DrawablePtr src = (sourceBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &src_pixmap->drawable; DrawablePtr dst = (destBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &dst_pixmap->drawable; + int off_x = 0, off_y = 0; + Bool translate = FALSE; RegionPtr pCopyClip; GCPtr gc; + if (destBuffer->attachment == DRI2BufferFrontLeft && + drawable->pScreen != screen) { + dst = DRI2UpdatePrime(drawable, destBuffer); + if (!dst) + return; + if (dst != drawable) + translate = TRUE; + } + + if (translate && drawable->type == DRAWABLE_WINDOW) { +#ifdef COMPOSITE + PixmapPtr pixmap = get_drawable_pixmap(drawable); + off_x = -pixmap->screen_x; + off_y = -pixmap->screen_y; +#endif + off_x += drawable->x; + off_y += drawable->y; + } + gc = GetScratchGC(dst->depth, screen); if (!gc) return; pCopyClip = REGION_CREATE(screen, NULL, 0); REGION_COPY(screen, pCopyClip, pRegion); + if (translate) + REGION_TRANSLATE(screen, pCopyClip, off_x, off_y); (*gc->funcs->ChangeClip) (gc, CT_REGION, pCopyClip, 0); ValidateGC(dst, gc); @@ -290,11 +318,19 @@ gc->ops->CopyArea(src, dst, gc, 0, 0, drawable->width, drawable->height, - 0, 0); + off_x, off_y); FreeScratchGC(gc); } +static void +ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, + DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) +{ + ms_dri2_copy_region2(drawable->pScreen, drawable, pRegion, destBuffer, + sourceBuffer); +} + static uint64_t gettime_us(void) { @@ -399,6 +435,197 @@ ms_dri2_copy_region(drawable, ®ion, dst, src); } +struct ms_dri2_vblank_event { + XID drawable_id; + ClientPtr client; + DRI2SwapEventPtr event_complete; + void *event_data; +}; + +static void +ms_dri2_flip_abort(modesettingPtr ms, void *data) +{ + struct ms_present_vblank_event *event = data; + + ms->drmmode.dri2_flipping = FALSE; + free(event); +} + +static void +ms_dri2_flip_handler(modesettingPtr ms, uint64_t msc, + uint64_t ust, void *data) +{ + struct ms_dri2_vblank_event *event = data; + uint32_t frame = msc; + uint32_t tv_sec = ust / 1000000; + uint32_t tv_usec = ust % 1000000; + DrawablePtr drawable; + int status; + + status = dixLookupDrawable(&drawable, event->drawable_id, serverClient, + M_ANY, DixWriteAccess); + if (status == Success) + DRI2SwapComplete(event->client, drawable, frame, tv_sec, tv_usec, + DRI2_FLIP_COMPLETE, event->event_complete, + event->event_data); + + ms->drmmode.dri2_flipping = FALSE; + free(event); +} + +static Bool +ms_dri2_schedule_flip(ms_dri2_frame_event_ptr info) +{ + DrawablePtr draw = info->drawable; + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + ms_dri2_buffer_private_ptr back_priv = info->back->driverPrivate; + struct ms_dri2_vblank_event *event; + drmmode_crtc_private_ptr drmmode_crtc = info->crtc->driver_private; + + event = calloc(1, sizeof(struct ms_dri2_vblank_event)); + if (!event) + return FALSE; + + event->drawable_id = draw->id; + event->client = info->client; + event->event_complete = info->event_complete; + event->event_data = info->event_data; + + if (ms_do_pageflip(screen, back_priv->pixmap, event, + drmmode_crtc->vblank_pipe, FALSE, + ms_dri2_flip_handler, + ms_dri2_flip_abort)) { + ms->drmmode.dri2_flipping = TRUE; + return TRUE; + } + return FALSE; +} + +static Bool +update_front(DrawablePtr draw, DRI2BufferPtr front) +{ + ScreenPtr screen = draw->pScreen; + PixmapPtr pixmap = get_drawable_pixmap(draw); + ms_dri2_buffer_private_ptr priv = front->driverPrivate; + CARD32 size; + CARD16 pitch; + + front->name = glamor_name_from_pixmap(pixmap, &pitch, &size); + if (front->name < 0) + return FALSE; + + (*screen->DestroyPixmap) (priv->pixmap); + front->pitch = pixmap->devKind; + front->cpp = pixmap->drawable.bitsPerPixel / 8; + priv->pixmap = pixmap; + pixmap->refcnt++; + + return TRUE; +} + +static Bool +can_exchange(ScrnInfoPtr scrn, DrawablePtr draw, + DRI2BufferPtr front, DRI2BufferPtr back) +{ + ms_dri2_buffer_private_ptr front_priv = front->driverPrivate; + ms_dri2_buffer_private_ptr back_priv = back->driverPrivate; + PixmapPtr front_pixmap; + PixmapPtr back_pixmap = back_priv->pixmap; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int num_crtcs_on = 0; + int i; + + for (i = 0; i < config->num_crtc; i++) { + 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++; + } + + /* We can't do pageflipping if all the CRTCs are off. */ + if (num_crtcs_on == 0) + return FALSE; + + if (!update_front(draw, front)) + return FALSE; + + front_pixmap = front_priv->pixmap; + + if (front_pixmap->drawable.width != back_pixmap->drawable.width) + return FALSE; + + if (front_pixmap->drawable.height != back_pixmap->drawable.height) + return FALSE; + + if (front_pixmap->drawable.bitsPerPixel != + back_pixmap->drawable.bitsPerPixel) + return FALSE; + + if (front_pixmap->devKind != back_pixmap->devKind) + return FALSE; + + return TRUE; +} + +static Bool +can_flip(ScrnInfoPtr scrn, DrawablePtr draw, + DRI2BufferPtr front, DRI2BufferPtr back) +{ + modesettingPtr ms = modesettingPTR(scrn); + + return draw->type == DRAWABLE_WINDOW && + ms->drmmode.pageflip && + !ms->drmmode.present_flipping && + scrn->vtSema && + DRI2CanFlip(draw) && can_exchange(scrn, draw, front, back); +} + +static void +ms_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front, + DRI2BufferPtr back) +{ + ms_dri2_buffer_private_ptr front_priv = front->driverPrivate; + ms_dri2_buffer_private_ptr back_priv = back->driverPrivate; + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + msPixmapPrivPtr front_pix = msGetPixmapPriv(&ms->drmmode, front_priv->pixmap); + msPixmapPrivPtr back_pix = msGetPixmapPriv(&ms->drmmode, back_priv->pixmap); + msPixmapPrivRec tmp_pix; + RegionRec region; + int tmp; + + /* Swap BO names so DRI works */ + tmp = front->name; + front->name = back->name; + back->name = tmp; + + /* Swap pixmap privates */ + tmp_pix = *front_pix; + *front_pix = *back_pix; + *back_pix = tmp_pix; + + glamor_egl_exchange_buffers(front_priv->pixmap, back_priv->pixmap); + + /* Post damage on the front buffer so that listeners, such + * as DisplayLink know take a copy and shove it over the USB. + */ + region.extents.x1 = region.extents.y1 = 0; + region.extents.x2 = front_priv->pixmap->drawable.width; + region.extents.y2 = front_priv->pixmap->drawable.height; + region.data = NULL; + DamageRegionAppend(&front_priv->pixmap->drawable, ®ion); + DamageRegionProcessPending(&front_priv->pixmap->drawable); +} + static void ms_dri2_frame_event_handler(uint64_t msc, uint64_t usec, @@ -417,6 +644,13 @@ } switch (frame_info->type) { + case MS_DRI2_QUEUE_FLIP: + if (can_flip(scrn, drawable, frame_info->front, frame_info->back) && + ms_dri2_schedule_flip(frame_info)) { + ms_dri2_exchange_buffers(drawable, frame_info->front, frame_info->back); + break; + } + /* else fall through to blit */ case MS_DRI2_QUEUE_SWAP: ms_dri2_blit_swap(drawable, frame_info->front, frame_info->back); DRI2SwapComplete(frame_info->client, drawable, msc, tv_sec, tv_usec, @@ -607,7 +841,7 @@ ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); drmVBlank vbl; - int ret; + 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; @@ -645,20 +879,36 @@ ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); + /* Flips need to be submitted one frame before */ + if (can_flip(scrn, draw, front, back)) { + frame_info->type = MS_DRI2_QUEUE_FLIP; + flip = 1; + } + + /* Correct target_msc by 'flip' if frame_info->type == MS_DRI2_QUEUE_FLIP. + * Do it early, so handling of different timing constraints + * for divisor, remainder and msc vs. target_msc works. + */ + if (*target_msc > 0) + *target_msc -= flip; + /* * 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) { - /* We need to use DRM_VBLANK_NEXTONMISS to avoid unreliable - * timestamping later on. - */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_NEXTONMISS | 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 * to the caller. This makes swap_interval logic more robust. @@ -683,7 +933,8 @@ goto blit_fallback; } - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, + vbl.reply.sequence + flip); frame_info->frame = *target_msc; return TRUE; @@ -695,9 +946,10 @@ * equation. */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_NEXTONMISS | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); + if (flip == 0) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; request_msc = current_msc - (current_msc % divisor) + remainder; @@ -721,7 +973,8 @@ if (!seq) goto blit_fallback; - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); + /* 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); @@ -732,7 +985,8 @@ goto blit_fallback; } - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + /* Adjust returned value for 1 fame pageflip offset of flip > 0 */ + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence + flip); frame_info->frame = *target_msc; return TRUE; @@ -835,13 +1089,16 @@ info.driverName = NULL; /* Compat field, unused. */ info.deviceName = drmGetDeviceNameFromFd(ms->fd); - info.version = 4; + info.version = 9; info.CreateBuffer = ms_dri2_create_buffer; info.DestroyBuffer = ms_dri2_destroy_buffer; info.CopyRegion = ms_dri2_copy_region; info.ScheduleSwap = ms_dri2_schedule_swap; info.GetMSC = ms_dri2_get_msc; info.ScheduleWaitMSC = ms_dri2_schedule_wait_msc; + info.CreateBuffer2 = ms_dri2_create_buffer2; + info.DestroyBuffer2 = ms_dri2_destroy_buffer2; + info.CopyRegion2 = ms_dri2_copy_region2; /* These two will be filled in by dri2.c */ info.numDrivers = 0; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/driver.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/driver.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/driver.c 2016-07-19 17:12:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/driver.c 2017-03-15 18:05:25.000000000 +0000 @@ -130,6 +130,7 @@ {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE}, {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE}, + {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -215,14 +216,26 @@ } static int -check_outputs(int fd) +check_outputs(int fd, int *count) { drmModeResPtr res = drmModeGetResources(fd); int ret; if (!res) return FALSE; + + if (count) + *count = res->count_connectors; + ret = res->count_connectors > 0; +#if defined DRM_CAP_PRIME && GLAMOR_HAS_GBM_LINEAR + if (ret == FALSE) { + uint64_t value = 0; + if (drmGetCap(fd, DRM_CAP_PRIME, &value) == 0 && + (value & DRM_PRIME_CAP_EXPORT)) + ret = TRUE; + } +#endif drmModeFreeResources(res); return ret; } @@ -237,13 +250,13 @@ fd = xf86_platform_device_odev_attributes(platform_dev)->fd; if (fd == -1) return FALSE; - return check_outputs(fd); + return check_outputs(fd, NULL); } #endif fd = open_hw(dev); if (fd != -1) { - int ret = check_outputs(fd); + int ret = check_outputs(fd, NULL); close(fd); return ret; @@ -286,7 +299,7 @@ devid = ms_DRICreatePCIBusID(pdev); if (id && devid && !strcmp(id, devid)) - ret = check_outputs(fd); + ret = check_outputs(fd, NULL); close(fd); free(id); @@ -539,20 +552,14 @@ } static void -dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) +dispatch_dirty_pixmap(ScrnInfoPtr scrn, xf86CrtcPtr crtc, PixmapPtr ppix) { modesettingPtr ms = modesettingPTR(scrn); - PixmapPtr pixmap = crtc->randr_crtc->scanout_pixmap; - msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, pixmap); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - DamagePtr damage = drmmode_crtc->slave_damage; + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + DamagePtr damage = ppriv->slave_damage; int fb_id = ppriv->fb_id; - int ret; - - ret = dispatch_dirty_region(scrn, pixmap, damage, fb_id); - if (ret) { - } + dispatch_dirty_region(scrn, ppix, damage, fb_id); } static void @@ -564,55 +571,105 @@ 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 (!crtc->randr_crtc) - continue; - if (!crtc->randr_crtc->scanout_pixmap) + if (!drmmode_crtc) continue; - dispatch_dirty_crtc(scrn, crtc); + if (drmmode_crtc->prime_pixmap) + dispatch_dirty_pixmap(scrn, crtc, drmmode_crtc->prime_pixmap); + if (drmmode_crtc->prime_pixmap_back) + dispatch_dirty_pixmap(scrn, crtc, drmmode_crtc->prime_pixmap_back); } } static void -redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) +redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout) { + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); + RegionRec pixregion; - RegionRec pixregion; + PixmapRegionInit(&pixregion, dirty->slave_dst); + DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); + PixmapSyncDirtyHelper(dirty); - PixmapRegionInit(&pixregion, dirty->slave_dst); - DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); - PixmapSyncDirtyHelper(dirty); + if (!screen->isGPU) { +#ifdef GLAMOR + /* + * When copying from the master framebuffer to the shared pixmap, + * we must ensure the copy is complete before the slave starts a + * copy to its own framebuffer (some slaves scanout directly from + * the shared pixmap, but not all). + */ + if (ms->drmmode.glamor) + glamor_finish(screen); +#endif + /* Ensure the slave processes the damage immediately */ + if (timeout) + *timeout = 0; + } - DamageRegionProcessPending(&dirty->slave_dst->drawable); - RegionUninit(&pixregion); + DamageRegionProcessPending(&dirty->slave_dst->drawable); + RegionUninit(&pixregion); } static void -ms_dirty_update(ScreenPtr screen) +ms_dirty_update(ScreenPtr screen, int *timeout) { - RegionPtr region; - PixmapDirtyUpdatePtr ent; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); - if (xorg_list_is_empty(&screen->pixmap_dirty_list)) - return; + RegionPtr region; + PixmapDirtyUpdatePtr ent; - xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { - region = DamageRegion(ent->damage); - if (RegionNotEmpty(region)) { - redisplay_dirty(screen, ent); - DamageEmpty(ent->damage); - } + if (xorg_list_is_empty(&screen->pixmap_dirty_list)) + return; + + 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 (ppriv->notify_on_damage) { + ppriv->notify_on_damage = FALSE; + + ent->slave_dst->drawable.pScreen-> + SharedPixmapNotifyDamage(ent->slave_dst); + } + + /* Requested manual updating */ + if (ppriv->defer_dirty_update) + continue; + + redisplay_dirty(screen, ent, timeout); + DamageEmpty(ent->damage); } + } +} + +static PixmapDirtyUpdatePtr +ms_dirty_get_ent(ScreenPtr screen, PixmapPtr slave_dst) +{ + PixmapDirtyUpdatePtr ent; + + if (xorg_list_is_empty(&screen->pixmap_dirty_list)) + return NULL; + + xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { + if (ent->slave_dst == slave_dst) + return ent; + } + + return NULL; } static void -msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +msBlockHandler(ScreenPtr pScreen, void *timeout) { modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); pScreen->BlockHandler = ms->BlockHandler; - pScreen->BlockHandler(pScreen, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, timeout); ms->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = msBlockHandler; if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode) @@ -620,7 +677,18 @@ else if (ms->dirty_enabled) dispatch_dirty(pScreen); - ms_dirty_update(pScreen); + ms_dirty_update(pScreen, timeout); +} + +static void +msBlockHandler_oneshot(ScreenPtr pScreen, void *pTimeout) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + + msBlockHandler(pScreen, pTimeout); + + drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE); } static void @@ -702,6 +770,35 @@ #endif } +static Bool +msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms) +{ + Bool ret = FALSE, asked; + int from; + drmVersionPtr v = drmGetVersion(ms->fd); + + if (!ms->drmmode.shadow_enable) + return FALSE; + + if (!strcmp(v->name, "mgag200") || + !strcmp(v->name, "ast")) /* XXX || rn50 */ + ret = TRUE; + + drmFreeVersion(v); + + asked = xf86GetOptValBool(ms->drmmode.Options, OPTION_DOUBLE_SHADOW, &ret); + + if (asked) + from = X_CONFIG; + else + from = X_INFO; + + xf86DrvMsg(pScrn->scrnIndex, from, + "Double-buffered shadow updates: %s\n", ret ? "on" : "off"); + + return ret; +} + #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 #endif @@ -752,7 +849,7 @@ if (pEnt->location.type == BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); if (ms->PciInfo) { - BusID = malloc(64); + BusID = XNFalloc(64); sprintf(BusID, "PCI:%d:%d:%d", #if XSERVER_LIBPCIACCESS ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), @@ -765,6 +862,7 @@ ); } ms->fd = drmOpen(NULL, BusID); + free(BusID); } else { const char *devicename; @@ -787,7 +885,7 @@ EntityInfoPtr pEnt; uint64_t value = 0; int ret; - int bppflags; + int bppflags, connector_count; int defaultdepth, defaultbpp; if (pScrn->numEntities != 1) @@ -824,6 +922,9 @@ return FALSE; ms->drmmode.fd = ms->fd; + if (!check_outputs(ms->fd, &connector_count)) + return FALSE; + drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); if (defaultdepth == 24 && defaultbpp == 24) { ms->drmmode.force_24_32 = TRUE; @@ -882,10 +983,7 @@ try_enable_glamor(pScrn); - if (ms->drmmode.glamor) { - ms->drmmode.pageflip = - xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE); - } else { + if (!ms->drmmode.glamor) { Bool prefer_shadow = TRUE; if (ms->drmmode.force_24_32) { @@ -908,14 +1006,17 @@ ms->drmmode.force_24_32 ? "FORCE" : ms->drmmode.shadow_enable ? "YES" : "NO"); - ms->drmmode.pageflip = FALSE; + ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); } + ms->drmmode.pageflip = + 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 (value & DRM_PRIME_CAP_IMPORT) { + if (connector_count && (value & DRM_PRIME_CAP_IMPORT)) { pScrn->capabilities |= RR_Capability_SinkOutput; if (ms->drmmode.glamor) pScrn->capabilities |= RR_Capability_SinkOffload; @@ -943,7 +1044,7 @@ } } - if (pScrn->modes == NULL) { + if (!(pScrn->is_gpu && connector_count == 0) && pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); return FALSE; } @@ -983,28 +1084,243 @@ return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); } +/* somewhat arbitrary tile size, in pixels */ +#define TILE 16 + +static int +msUpdateIntersect(modesettingPtr ms, shadowBufPtr pBuf, BoxPtr box, + xRectangle *prect) +{ + int i, dirty = 0, stride = pBuf->pPixmap->devKind, cpp = ms->drmmode.cpp; + int width = (box->x2 - box->x1) * cpp; + unsigned char *old, *new; + + old = ms->drmmode.shadow_fb2; + old += (box->y1 * stride) + (box->x1 * cpp); + new = ms->drmmode.shadow_fb; + new += (box->y1 * stride) + (box->x1 * cpp); + + for (i = box->y2 - box->y1 - 1; i >= 0; i--) { + unsigned char *o = old + i * stride, + *n = new + i * stride; + if (memcmp(o, n, width) != 0) { + dirty = 1; + memcpy(o, n, width); + } + } + + if (dirty) { + prect->x = box->x1; + prect->y = box->y1; + prect->width = box->x2 - box->x1; + prect->height = box->y2 - box->y1; + } + + return dirty; +} + static void msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { - shadowUpdatePacked(pScreen, pBuf); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; + + if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do { + RegionPtr damage = DamageRegion(pBuf->pDamage), tiles; + BoxPtr extents = RegionExtents(damage); + xRectangle *prect; + int nrects; + int i, j, tx1, tx2, ty1, ty2; + + tx1 = extents->x1 / TILE; + tx2 = (extents->x2 + TILE - 1) / TILE; + ty1 = extents->y1 / TILE; + ty2 = (extents->y2 + TILE - 1) / TILE; + + nrects = (tx2 - tx1) * (ty2 - ty1); + if (!(prect = calloc(nrects, sizeof(xRectangle)))) + break; + + nrects = 0; + for (j = ty2 - 1; j >= ty1; j--) { + for (i = tx2 - 1; i >= tx1; i--) { + BoxRec box; + + box.x1 = max(i * TILE, extents->x1); + box.y1 = max(j * TILE, extents->y1); + box.x2 = min((i+1) * TILE, extents->x2); + box.y2 = min((j+1) * TILE, extents->y2); + + if (RegionContainsRect(damage, &box) != rgnOUT) { + if (msUpdateIntersect(ms, pBuf, &box, prect + nrects)) { + nrects++; + } + } + } + } + + tiles = RegionFromRects(nrects, prect, CT_NONE); + RegionIntersect(damage, damage, tiles); + RegionDestroy(tiles); + free(prect); + } while (0); + + if (use_ms_shadow) + ms_shadowUpdate32to24(pScreen, pBuf); + else + shadowUpdatePacked(pScreen, pBuf); +} + +static Bool +msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + EntityInfoPtr pEnt = ms->pEnt; + xf86CrtcPtr xf86Crtc = crtc->devPrivate; + + if (!xf86Crtc) + return FALSE; + + /* Not supported if we can't flip */ + if (!ms->drmmode.pageflip) + return FALSE; + + /* Not currently supported with reverse PRIME */ + if (ms->drmmode.reverse_prime_offload_mode) + return FALSE; + +#if XSERVER_PLATFORM_BUS + if (pEnt->location.type == BUS_PLATFORM) { + char *syspath = + xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> + syspath; + + /* Not supported for devices using USB transport due to misbehaved + * vblank events */ + if (syspath && strstr(syspath, "usb")) + return FALSE; + } +#endif + + return drmmode_EnableSharedPixmapFlipping(xf86Crtc, &ms->drmmode, + front, back); +} + +static void +msDisableSharedPixmapFlipping(RRCrtcPtr crtc) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcPtr xf86Crtc = crtc->devPrivate; + + if (xf86Crtc) + drmmode_DisableSharedPixmapFlipping(xf86Crtc, &ms->drmmode); +} + +static Bool +msStartFlippingPixmapTracking(RRCrtcPtr crtc, PixmapPtr src, + PixmapPtr slave_dst1, PixmapPtr slave_dst2, + int x, int y, int dst_x, int dst_y, + Rotation rotation) +{ + ScreenPtr pScreen = src->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + + if (!PixmapStartDirtyTracking(src, slave_dst1, x, y, + dst_x, dst_y, rotation)) { + return FALSE; + } + + if (!PixmapStartDirtyTracking(src, slave_dst2, x, y, + dst_x, dst_y, rotation)) { + PixmapStopDirtyTracking(src, slave_dst1); + return FALSE; + } + + ppriv1->slave_src = src; + ppriv2->slave_src = src; + + ppriv1->dirty = ms_dirty_get_ent(pScreen, slave_dst1); + ppriv2->dirty = ms_dirty_get_ent(pScreen, slave_dst2); + + ppriv1->defer_dirty_update = TRUE; + ppriv2->defer_dirty_update = TRUE; + + return TRUE; +} + +static Bool +msPresentSharedPixmap(PixmapPtr slave_dst) +{ + ScreenPtr pScreen = slave_dst->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst); + + RegionPtr region = DamageRegion(ppriv->dirty->damage); + + if (RegionNotEmpty(region)) { + redisplay_dirty(ppriv->slave_src->drawable.pScreen, ppriv->dirty, NULL); + DamageEmpty(ppriv->dirty->damage); + + return TRUE; + } + + return FALSE; +} + +static Bool +msStopFlippingPixmapTracking(PixmapPtr src, + PixmapPtr slave_dst1, PixmapPtr slave_dst2) +{ + ScreenPtr pScreen = src->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + + Bool ret = TRUE; + + ret &= PixmapStopDirtyTracking(src, slave_dst1); + ret &= PixmapStopDirtyTracking(src, slave_dst2); + + if (ret) { + ppriv1->slave_src = NULL; + ppriv2->slave_src = NULL; + + ppriv1->dirty = NULL; + ppriv2->dirty = NULL; + + ppriv1->defer_dirty_update = FALSE; + ppriv2->defer_dirty_update = FALSE; + } + + return ret; } static Bool CreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); modesettingPtr ms = modesettingPTR(pScrn); PixmapPtr rootPixmap; Bool ret; void *pixels = NULL; int err; - Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; pScreen->CreateScreenResources = ms->createScreenResources; ret = pScreen->CreateScreenResources(pScreen); pScreen->CreateScreenResources = CreateScreenResources; - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, pScrn->is_gpu)) return FALSE; if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode)) @@ -1026,13 +1342,18 @@ if (ms->drmmode.shadow_enable) pixels = ms->drmmode.shadow_fb; + if (ms->drmmode.shadow_enable2) { + ms->drmmode.shadow_fb2 = calloc(1, pScrn->displayWidth * pScrn->virtualY * ((pScrn->bitsPerPixel + 7) >> 3)); + if (!ms->drmmode.shadow_fb2) + ms->drmmode.shadow_enable2 = FALSE; + } + if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) FatalError("Couldn't adjust screen pixmap\n"); if (ms->drmmode.shadow_enable) { - if (!shadowAdd(pScreen, rootPixmap, - use_ms_shadow ? ms_shadowUpdate32to24 : msUpdatePacked, - msShadowWindow, 0, 0)) + if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow, + 0, 0)) return FALSE; } @@ -1053,6 +1374,12 @@ return FALSE; } } + + pScrPriv->rrEnableSharedPixmapFlipping = msEnableSharedPixmapFlipping; + pScrPriv->rrDisableSharedPixmapFlipping = msDisableSharedPixmapFlipping; + + pScrPriv->rrStartFlippingPixmapTracking = msStartFlippingPixmapTracking; + return ret; } @@ -1072,7 +1399,8 @@ int ret; CARD16 stride; CARD32 size; - ret = glamor_fd_from_pixmap(ppix->drawable.pScreen, ppix, &stride, &size); + ret = glamor_shareable_fd_from_pixmap(ppix->drawable.pScreen, ppix, + &stride, &size); if (ret == -1) return FALSE; @@ -1092,6 +1420,10 @@ Bool ret; int ihandle = (int) (long) fd_handle; + if (ihandle == -1) + if (!ms->drmmode.reverse_prime_offload_mode) + return drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, 0, 0); + if (ms->drmmode.reverse_prime_offload_mode) { ret = glamor_back_pixmap_from_fd(ppix, ihandle, ppix->drawable.width, @@ -1112,6 +1444,53 @@ } static Bool +msRequestSharedPixmapNotifyDamage(PixmapPtr ppix) +{ + ScreenPtr screen = ppix->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + + ppriv->notify_on_damage = TRUE; + + return TRUE; +} + +static Bool +msSharedPixmapNotifyDamage(PixmapPtr ppix) +{ + Bool ret = FALSE; + int c; + + ScreenPtr screen = ppix->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + + if (!ppriv->wait_for_damage) + return ret; + ppriv->wait_for_damage = FALSE; + + 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 (!drmmode_crtc) + continue; + if (!(drmmode_crtc->prime_pixmap && drmmode_crtc->prime_pixmap_back)) + continue; + + // Received damage on master screen pixmap, schedule present on vblank + ret |= drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, &ms->drmmode); + } + + return ret; +} + +static Bool SetMaster(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); @@ -1131,6 +1510,25 @@ return ret == 0; } +/* When the root window is created, initialize the screen contents from + * console if -background none was specified on the command line + */ +static Bool +CreateWindow_oneshot(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + Bool ret; + + pScreen->CreateWindow = ms->CreateWindow; + ret = pScreen->CreateWindow(pWin); + + if (ret) + drmmode_copy_fb(pScrn, &ms->drmmode); + return ret; +} + static Bool ScreenInit(ScreenPtr pScreen, int argc, char **argv) { @@ -1239,18 +1637,30 @@ * later memory should be bound when allocating, e.g rotate_mem */ pScrn->vtSema = TRUE; + if (serverGeneration == 1 && bgNoneRoot && ms->drmmode.glamor) { + ms->CreateWindow = pScreen->CreateWindow; + pScreen->CreateWindow = CreateWindow_oneshot; + } + pScreen->SaveScreen = xf86SaveScreen; ms->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = CloseScreen; ms->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = msBlockHandler; + pScreen->BlockHandler = msBlockHandler_oneshot; pScreen->SharePixmapBacking = msSharePixmapBacking; pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; pScreen->StartPixmapTracking = PixmapStartDirtyTracking; pScreen->StopPixmapTracking = PixmapStopDirtyTracking; + pScreen->SharedPixmapNotifyDamage = msSharedPixmapNotifyDamage; + pScreen->RequestSharedPixmapNotifyDamage = + msRequestSharedPixmapNotifyDamage; + + pScreen->PresentSharedPixmap = msPresentSharedPixmap; + pScreen->StopFlippingPixmapTracking = msStopFlippingPixmapTracking; + if (!xf86CrtcScreenInit(pScreen)) return FALSE; @@ -1292,13 +1702,28 @@ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the Present extension.\n"); } - /* enable reverse prime if we are a GPU screen, and accelerated */ - if (pScreen->isGPU) + /* enable reverse prime if we are a GPU screen, and accelerated, and not + * i915. i915 is happy scanning out from sysmem. */ + if (pScreen->isGPU) { + drmVersionPtr version; + + /* enable if we are an accelerated GPU screen */ ms->drmmode.reverse_prime_offload_mode = TRUE; + + /* disable if we detect i915 */ + if ((version = drmGetVersion(ms->drmmode.fd))) { + if (!strncmp("i915", version->name, version->name_len)) { + ms->drmmode.reverse_prime_offload_mode = FALSE; + } + drmFreeVersion(version); + } + } } #endif - return EnterVT(pScrn); + pScrn->vtSema = TRUE; + + return TRUE; } static void @@ -1345,7 +1770,7 @@ SetMaster(pScrn); - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE)) return FALSE; return TRUE; @@ -1385,6 +1810,8 @@ shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); free(ms->drmmode.shadow_fb); ms->drmmode.shadow_fb = NULL; + free(ms->drmmode.shadow_fb2); + ms->drmmode.shadow_fb2 = NULL; } drmmode_uevent_fini(pScrn, &ms->drmmode); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/driver.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/driver.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/driver.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/driver.h 2017-03-15 18:05:25.000000000 +0000 @@ -52,6 +52,7 @@ OPTION_ACCEL_METHOD, OPTION_PAGEFLIP, OPTION_ZAPHOD_HEADS, + OPTION_DOUBLE_SHADOW, } modesettingOpts; typedef struct @@ -97,7 +98,7 @@ Bool noAccel; CloseScreenProcPtr CloseScreen; - + CreateWindowProcPtr CreateWindow; unsigned int SaveGeneration; CreateScreenResourcesProcPtr createScreenResources; @@ -136,8 +137,6 @@ Bool ms_crtc_on(xf86CrtcPtr crtc); xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); -xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, - xf86CrtcPtr desired, BoxPtr crtc_box_ret); int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); @@ -152,3 +151,24 @@ void ms_vblank_close_screen(ScreenPtr screen); Bool ms_present_screen_init(ScreenPtr screen); + +#ifdef GLAMOR + +typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms, + uint64_t frame, + uint64_t usec, + void *data); + +typedef void (*ms_pageflip_abort_proc)(modesettingPtr ms, void *data); + +Bool ms_do_pageflip(ScreenPtr screen, + PixmapPtr new_front, + void *event, + int ref_crtc_vblank_pipe, + Bool async, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort); + +#endif + +int ms_flush_drm_events(ScreenPtr screen); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/drmmode_display.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/drmmode_display.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/drmmode_display.c 2016-07-19 17:10:57.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/drmmode_display.c 2017-03-15 18:05:25.000000000 +0000 @@ -51,7 +51,9 @@ #include "driver.h" 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 Bool drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name) { @@ -177,50 +179,259 @@ } Bool -drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap) +drmmode_SetSlaveBO(PixmapPtr ppix, + drmmode_ptr drmmode, int fd_handle, int pitch, int size) { -#ifdef GLAMOR - ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn); - CARD16 pitch; - CARD32 size; - int fd; + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); -#ifdef GLAMOR_HAS_GBM - if (drmmode->glamor) { - bo->gbm = glamor_gbm_bo_from_pixmap(screen, pixmap); - bo->dumb = NULL; - return bo->gbm != NULL; + if (fd_handle == -1) { + dumb_bo_destroy(drmmode->fd, ppriv->backing_bo); + ppriv->backing_bo = NULL; + return TRUE; } -#endif - fd = glamor_fd_from_pixmap(screen, pixmap, &pitch, &size); - if (fd < 0) { - xf86DrvMsg(drmmode->scrn->scrnIndex, X_ERROR, - "Failed to get fd for flip to new front.\n"); + ppriv->backing_bo = + dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); + if (!ppriv->backing_bo) return FALSE; + + close(fd_handle); + return TRUE; +} + +static Bool +drmmode_SharedPixmapPresent(PixmapPtr ppix, xf86CrtcPtr crtc, + drmmode_ptr drmmode) +{ + ScreenPtr master = crtc->randr_crtc->pScreen->current_master; + + if (master->PresentSharedPixmap(ppix)) { + /* Success, queue flip to back target */ + if (drmmode_SharedPixmapFlip(ppix, crtc, drmmode)) + return TRUE; + + xf86DrvMsg(drmmode->scrn->scrnIndex, X_WARNING, + "drmmode_SharedPixmapFlip() failed, trying again next vblank\n"); + + return drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, drmmode); } - bo->dumb = dumb_get_bo_from_fd(drmmode->fd, fd, pitch, size); - close(fd); -#endif - return bo->dumb != NULL; + /* Failed to present, try again on next vblank after damage */ + if (master->RequestSharedPixmapNotifyDamage) { + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + + /* Set flag first in case we are immediately notified */ + ppriv->wait_for_damage = TRUE; + + if (master->RequestSharedPixmapNotifyDamage(ppix)) + return TRUE; + else + ppriv->wait_for_damage = FALSE; + } + + /* Damage notification not available, just try again on vblank */ + return drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, drmmode); +} + +struct vblank_event_args { + PixmapPtr frontTarget; + PixmapPtr backTarget; + xf86CrtcPtr crtc; + drmmode_ptr drmmode; + Bool flip; +}; +static void +drmmode_SharedPixmapVBlankEventHandler(uint64_t frame, uint64_t usec, + void *data) +{ + struct vblank_event_args *args = data; + + drmmode_crtc_private_ptr drmmode_crtc = args->crtc->driver_private; + + if (args->flip) { + /* frontTarget is being displayed, update crtc to reflect */ + drmmode_crtc->prime_pixmap = args->frontTarget; + drmmode_crtc->prime_pixmap_back = args->backTarget; + + /* Safe to present on backTarget, no longer displayed */ + drmmode_SharedPixmapPresent(args->backTarget, args->crtc, args->drmmode); + } else { + /* backTarget is still being displayed, present on frontTarget */ + drmmode_SharedPixmapPresent(args->frontTarget, args->crtc, args->drmmode); + } + + free(args); +} + +static void +drmmode_SharedPixmapVBlankEventAbort(void *data) +{ + struct vblank_event_args *args = data; + + msGetPixmapPriv(args->drmmode, args->frontTarget)->flip_seq = 0; + + free(args); } Bool -drmmode_SetSlaveBO(PixmapPtr ppix, - drmmode_ptr drmmode, int fd_handle, int pitch, int size) +drmmode_SharedPixmapPresentOnVBlank(PixmapPtr ppix, xf86CrtcPtr crtc, + drmmode_ptr drmmode) { + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); - ppriv->backing_bo = - dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); - if (!ppriv->backing_bo) + drmVBlank vbl; + struct vblank_event_args *event_args; + + if (ppix == drmmode_crtc->prime_pixmap) + return FALSE; /* Already flipped to this pixmap */ + if (ppix != drmmode_crtc->prime_pixmap_back) + return FALSE; /* Pixmap is not a scanout pixmap for CRTC */ + + event_args = calloc(1, sizeof(*event_args)); + if (!event_args) return FALSE; - close(fd_handle); + event_args->frontTarget = ppix; + event_args->backTarget = drmmode_crtc->prime_pixmap; + event_args->crtc = crtc; + event_args->drmmode = drmmode; + event_args->flip = FALSE; + + ppriv->flip_seq = + ms_drm_queue_alloc(crtc, event_args, + 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; +} + +Bool +drmmode_SharedPixmapFlip(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + msPixmapPrivPtr ppriv_front = msGetPixmapPriv(drmmode, frontTarget); + + struct vblank_event_args *event_args; + + event_args = calloc(1, sizeof(*event_args)); + if (!event_args) + return FALSE; + + event_args->frontTarget = frontTarget; + event_args->backTarget = drmmode_crtc->prime_pixmap; + event_args->crtc = crtc; + event_args->drmmode = drmmode; + event_args->flip = TRUE; + + ppriv_front->flip_seq = + ms_drm_queue_alloc(crtc, event_args, + drmmode_SharedPixmapVBlankEventHandler, + drmmode_SharedPixmapVBlankEventAbort); + + if (drmModePageFlip(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + ppriv_front->fb_id, DRM_MODE_PAGE_FLIP_EVENT, + (void *)(intptr_t) ppriv_front->flip_seq) < 0) { + ms_drm_abort_seq(crtc->scrn, ppriv_front->flip_seq); + return FALSE; + } + + return TRUE; +} + +static Bool +drmmode_InitSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (!drmmode_crtc->enable_flipping) + return FALSE; + + if (drmmode_crtc->flipping_active) + return TRUE; + + drmmode_crtc->flipping_active = + drmmode_SharedPixmapPresent(drmmode_crtc->prime_pixmap_back, + crtc, drmmode); + + return drmmode_crtc->flipping_active; +} + +static void +drmmode_FiniSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + uint32_t seq; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (!drmmode_crtc->flipping_active) + return; + + drmmode_crtc->flipping_active = FALSE; + + /* Abort page flip event handler on prime_pixmap */ + seq = msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap)->flip_seq; + if (seq) + ms_drm_abort_seq(crtc->scrn, seq); + + /* Abort page flip event handler on prime_pixmap_back */ + seq = msGetPixmapPriv(drmmode, + drmmode_crtc->prime_pixmap_back)->flip_seq; + if (seq) + ms_drm_abort_seq(crtc->scrn, seq); +} + +static Bool drmmode_set_target_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target); + +Bool +drmmode_EnableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode, + PixmapPtr front, PixmapPtr back) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->enable_flipping = TRUE; + + /* Set front scanout pixmap */ + drmmode_crtc->enable_flipping &= + drmmode_set_target_scanout_pixmap(crtc, front, + &drmmode_crtc->prime_pixmap); + if (!drmmode_crtc->enable_flipping) + return FALSE; + + /* Set back scanout pixmap */ + drmmode_crtc->enable_flipping &= + drmmode_set_target_scanout_pixmap(crtc, back, + &drmmode_crtc->prime_pixmap_back); + if (!drmmode_crtc->enable_flipping) { + drmmode_set_target_scanout_pixmap(crtc, NULL, + &drmmode_crtc->prime_pixmap); + return FALSE; + } + return TRUE; } +void +drmmode_DisableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->enable_flipping = FALSE; + + drmmode_FiniSharedPixmapFlipping(crtc, drmmode); + + drmmode_set_target_scanout_pixmap(crtc, NULL, &drmmode_crtc->prime_pixmap); + + drmmode_set_target_scanout_pixmap(crtc, NULL, + &drmmode_crtc->prime_pixmap_back); +} + static void drmmode_ConvertFromKMode(ScrnInfoPtr scrn, drmModeModeInfo * kmode, DisplayModePtr mode) @@ -285,49 +496,105 @@ drmmode_crtc->dpms_mode = mode; } -#if 0 +#ifdef GLAMOR static PixmapPtr -create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int crtc_id) +create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - drmmode_crtc_private_ptr drmmode_crtc; - ScreenPtr pScreen = pScrn->pScreen; - PixmapPtr pixmap; - struct radeon_bo *bo; + PixmapPtr pixmap = drmmode->fbcon_pixmap; drmModeFBPtr fbcon; struct drm_gem_flink flink; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + Bool ret; - drmmode_crtc = xf86_config->crtc[crtc_id]->driver_private; + if (pixmap) + return pixmap; - fbcon = drmModeGetFB(drmmode->fd, drmmode_crtc->mode_crtc->buffer_id); + fbcon = drmModeGetFB(drmmode->fd, fbcon_id); if (fbcon == NULL) return NULL; + if (fbcon->depth != pScrn->depth || + fbcon->width != pScrn->virtualX || + 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"); - return NULL; + goto out_free_fb; } - bo = radeon_bo_open(drmmode->bufmgr, flink.name, 0, 0, 0, 0); - if (bo == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Couldn't allocate bo for fbcon handle\n"); - return NULL; - } - - pixmap = drmmode_create_bo_pixmap(pScreen, fbcon->width, fbcon->height, - fbcon->depth, fbcon->bpp, - fbcon->pitch, bo); + pixmap = drmmode_create_pixmap_header(pScreen, fbcon->width, + fbcon->height, fbcon->depth, + fbcon->bpp, fbcon->pitch, NULL); if (!pixmap) - return NULL; + goto out_free_fb; + + ret = glamor_egl_create_textured_pixmap(pixmap, fbcon->handle, fbcon->pitch); + if (!ret) { + FreePixmap(pixmap); + pixmap = NULL; + } - radeon_bo_unref(bo); + drmmode->fbcon_pixmap = pixmap; +out_free_fb: drmModeFreeFB(fbcon); return pixmap; } +#endif + +void +drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ +#ifdef GLAMOR + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + PixmapPtr src, dst; + int fbcon_id = 0; + GCPtr gc; + int i; + + for (i = 0; i < xf86_config->num_crtc; i++) { + drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[i]->driver_private; + if (drmmode_crtc->mode_crtc->buffer_id) + fbcon_id = drmmode_crtc->mode_crtc->buffer_id; + } + + if (!fbcon_id) + return; + if (fbcon_id == drmmode->fb_id) { + /* in some rare case there might be no fbcon and we might already + * be the one with the current fb to avoid a false deadlck in + * kernel ttm code just do nothing as anyway there is nothing + * to do + */ + return; + } + + src = create_pixmap_for_fbcon(drmmode, pScrn, fbcon_id); + if (!src) + return; + + dst = pScreen->GetScreenPixmap(pScreen); + + gc = GetScratchGC(pScrn->depth, pScreen); + ValidateGC(&dst->drawable, gc); + + (*gc->ops->CopyArea)(&src->drawable, &dst->drawable, gc, 0, 0, + pScrn->virtualX, pScrn->virtualY, 0, 0); + + FreeScratchGC(gc); + + glamor_finish(pScreen); + + pScreen->canDoBGNoneRoot = TRUE; + + if (drmmode->fbcon_pixmap) + pScrn->pScreen->DestroyPixmap(drmmode->fbcon_pixmap); + drmmode->fbcon_pixmap = NULL; #endif +} static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, @@ -390,10 +657,10 @@ drmmode_ConvertToKMode(crtc->scrn, &kmode, mode); fb_id = drmmode->fb_id; - if (crtc->randr_crtc->scanout_pixmap) { + if (drmmode_crtc->prime_pixmap) { if (!drmmode->reverse_prime_offload_mode) { msPixmapPrivPtr ppriv = - msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); + msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap); fb_id = ppriv->fb_id; x = 0; } else @@ -435,6 +702,9 @@ drmmode_crtc->need_modeset = FALSE; crtc->funcs->dpms(crtc, DPMSModeOn); + if (drmmode_crtc->prime_pixmap_back) + drmmode_InitSharedPixmapFlipping(crtc, drmmode); + /* go through all the outputs and force DPMS them back on? */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; @@ -450,11 +720,6 @@ } } -#if 0 - if (pScrn->pScreen && - !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) - xf86_reload_cursors(pScrn->pScreen); -#endif done: if (!ret) { crtc->x = saved_x; @@ -491,12 +756,10 @@ drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; modesettingPtr ms = modesettingPTR(crtc->scrn); - static Bool use_set_cursor2 = TRUE; - int ret; + int ret = -EINVAL; - if (use_set_cursor2) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - CursorPtr cursor = xf86_config->cursor; + if (!drmmode_crtc->set_cursor2_failed) { + CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen); ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, @@ -505,11 +768,15 @@ if (!ret) return TRUE; - use_set_cursor2 = FALSE; + /* -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 = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, - ms->cursor_width, ms->cursor_height); + if (ret == -EINVAL) + ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + handle, ms->cursor_width, ms->cursor_height); if (ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); @@ -539,7 +806,6 @@ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; int i; uint32_t *ptr; - static Bool first_time = TRUE; /* cursor should be mapped already */ ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr); @@ -547,11 +813,11 @@ 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 || first_time) { + 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); - first_time = FALSE; + drmmode_crtc->first_cursor_load_done = TRUE; return ret; } return TRUE; @@ -589,7 +855,8 @@ } static Bool -drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) +drmmode_set_target_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) { ScreenPtr screen = xf86ScrnToScreen(crtc->scrn); PixmapPtr screenpix = screen->GetScreenPixmap(screen); @@ -598,17 +865,19 @@ drmmode_ptr drmmode = drmmode_crtc->drmmode; int c, total_width = 0, max_height = 0, this_x = 0; - if (!ppix) { - if (crtc->randr_crtc->scanout_pixmap) { - PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix); - if (drmmode->fb_id) { - drmModeRmFB(drmmode->fd, drmmode->fb_id); - drmmode->fb_id = 0; - } + if (*target) { + PixmapStopDirtyTracking(*target, screenpix); + if (drmmode->fb_id) { + drmModeRmFB(drmmode->fd, drmmode->fb_id); + drmmode->fb_id = 0; } drmmode_crtc->prime_pixmap_x = 0; - return TRUE; + *target = NULL; } + + if (!ppix) + return TRUE; + /* iterate over all the attached crtcs to work out the bounding box */ for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr iter = xf86_config->crtc[c]; @@ -638,40 +907,44 @@ } drmmode_crtc->prime_pixmap_x = this_x; PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0); + *target = ppix; return TRUE; } static Bool -drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix) +drmmode_set_target_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; msPixmapPrivPtr ppriv; void *ptr; - if (!ppix) { - if (crtc->randr_crtc->scanout_pixmap) { - ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); - drmModeRmFB(drmmode->fd, ppriv->fb_id); - } - if (drmmode_crtc->slave_damage) { - DamageUnregister(drmmode_crtc->slave_damage); - drmmode_crtc->slave_damage = NULL; + if (*target) { + ppriv = msGetPixmapPriv(drmmode, *target); + drmModeRmFB(drmmode->fd, ppriv->fb_id); + ppriv->fb_id = 0; + if (ppriv->slave_damage) { + DamageUnregister(ppriv->slave_damage); + ppriv->slave_damage = NULL; } - return TRUE; + *target = NULL; } + if (!ppix) + return TRUE; + ppriv = msGetPixmapPriv(drmmode, ppix); - if (!drmmode_crtc->slave_damage) { - drmmode_crtc->slave_damage = DamageCreate(NULL, NULL, - DamageReportNone, - TRUE, - crtc->randr_crtc->pScreen, - NULL); + if (!ppriv->slave_damage) { + ppriv->slave_damage = DamageCreate(NULL, NULL, + DamageReportNone, + TRUE, + crtc->randr_crtc->pScreen, + NULL); } ptr = drmmode_map_slave_bo(drmmode, ppriv); ppix->devPrivate.ptr = ptr; - DamageRegister(&ppix->drawable, drmmode_crtc->slave_damage); + DamageRegister(&ppix->drawable, ppriv->slave_damage); if (ppriv->fb_id == 0) { drmModeAddFB(drmmode->fd, ppix->drawable.width, @@ -680,19 +953,34 @@ ppix->drawable.bitsPerPixel, ppix->devKind, ppriv->backing_bo->handle, &ppriv->fb_id); } + *target = ppix; return TRUE; } static Bool -drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) +drmmode_set_target_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; if (drmmode->reverse_prime_offload_mode) - return drmmode_set_scanout_pixmap_gpu(crtc, ppix); + return drmmode_set_target_scanout_pixmap_gpu(crtc, ppix, target); else - return drmmode_set_scanout_pixmap_cpu(crtc, ppix); + return drmmode_set_target_scanout_pixmap_cpu(crtc, ppix, target); +} + +static Bool +drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + /* Use DisableSharedPixmapFlipping before switching to single buf */ + if (drmmode_crtc->enable_flipping) + return FALSE; + + return drmmode_set_target_scanout_pixmap(crtc, ppix, + &drmmode_crtc->prime_pixmap); } static void * @@ -803,7 +1091,6 @@ drmmode_ptr drmmode = drmmode_crtc->drmmode; if (rotate_pixmap) { - drmmode_set_pixmap_bo(drmmode, rotate_pixmap, NULL); rotate_pixmap->drawable.pScreen->DestroyPixmap(rotate_pixmap); } @@ -862,6 +1149,9 @@ drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num); crtc->driver_private = drmmode_crtc; + /* Hide any cursors which may be active from previous users */ + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0); + /* Mark num'th crtc as in use on this device. */ ms_ent->assigned_crtcs |= (1 << num); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG, @@ -1109,12 +1399,22 @@ drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); - if (mode == DPMSModeOn && crtc) { + if (crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - if (drmmode_crtc->need_modeset) - drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, - crtc->x, crtc->y); + + if (mode == DPMSModeOn) { + if (drmmode_crtc->need_modeset) + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, + crtc->x, crtc->y); + + if (drmmode_crtc->enable_flipping) + drmmode_InitSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } else { + if (drmmode_crtc->enable_flipping) + drmmode_FiniSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } } + return; } @@ -1401,10 +1701,8 @@ fallback: if (koutput->connector_type >= MS_ARRAY_SIZE(output_names)) snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, koutput->connector_type_id); -#ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT 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); -#endif else snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id); } @@ -1611,11 +1909,6 @@ if (!drmmode->glamor) return TRUE; - if (bo == NULL) { - glamor_egl_destroy_textured_pixmap(pixmap); - return TRUE; - } - #ifdef GLAMOR_HAS_GBM if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); @@ -1657,12 +1950,9 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - - drmmode_crtc_private_ptr - drmmode_crtc = xf86_config->crtc[0]->driver_private; - drmmode_ptr drmmode = drmmode_crtc->drmmode; + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; drmmode_bo old_front; - Bool ret; ScreenPtr screen = xf86ScrnToScreen(scrn); uint32_t old_fb_id; int i, pitch, old_width, old_height, old_pitch; @@ -1677,16 +1967,12 @@ xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocate new frame buffer %dx%d stride\n", width, height); - if (drmmode->triple_buffer_pixmap) { - screen->DestroyPixmap(drmmode->triple_buffer_pixmap); - drmmode->triple_buffer_pixmap = NULL; - } - old_width = scrn->virtualX; old_height = scrn->virtualY; old_pitch = drmmode_bo_get_pitch(&drmmode->front_bo); - old_fb_id = drmmode->fb_id; old_front = drmmode->front_bo; + old_fb_id = drmmode->fb_id; + drmmode->fb_id = 0; if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, drmmode->kbpp)) @@ -1698,13 +1984,6 @@ scrn->virtualY = height; scrn->displayWidth = pitch / kcpp; - ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, - scrn->bitsPerPixel, pitch, - drmmode_bo_get_handle(&drmmode->front_bo), - &drmmode->fb_id); - if (ret) - goto fail; - if (!drmmode->gbm) { new_pixels = drmmode_map_front_bo(drmmode); if (!new_pixels) @@ -1720,6 +1999,13 @@ drmmode->shadow_fb = new_pixels; } + if (drmmode->shadow_enable2) { + uint32_t size = scrn->displayWidth * scrn->virtualY * cpp; + void *fb2 = calloc(1, size); + free(drmmode->shadow_fb2); + drmmode->shadow_fb2 = fb2; + } + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, scrn->displayWidth * cpp, new_pixels); @@ -1830,7 +2116,7 @@ } Bool -drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -1843,8 +2129,10 @@ /* Skip disabled CRTCs */ if (!crtc->enabled) { - drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, - 0, 0, 0, NULL, 0, NULL); + if (set_hw) { + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); + } continue; } @@ -1875,10 +2163,19 @@ crtc->desiredY = 0; } - if (!crtc->funcs-> - set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, - crtc->desiredX, crtc->desiredY)) - return FALSE; + if (set_hw) { + if (!crtc->funcs-> + set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) + return FALSE; + } else { + crtc->mode = crtc->desiredMode; + crtc->rotation = crtc->desiredRotation; + crtc->x = crtc->desiredX; + crtc->y = crtc->desiredY; + if (!xf86CrtcRotate(crtc)) + return FALSE; + } } return TRUE; } @@ -1974,11 +2271,14 @@ drmModeResPtr mode_res; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int i, j; - Bool found; + Bool found = FALSE; Bool changed = FALSE; - dev = udev_monitor_receive_device(drmmode->uevent_monitor); - if (!dev) + while ((dev = udev_monitor_receive_device(drmmode->uevent_monitor))) { + udev_device_unref(dev); + found = TRUE; + } + if (!found) return; mode_res = drmModeGetResources(drmmode->fd); @@ -2044,7 +2344,6 @@ drmModeFreeResources(mode_res); out: RRGetInfo(xf86ScrnToScreen(scrn), TRUE); - udev_device_unref(dev); } #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/drmmode_display.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/drmmode_display.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/drmmode_display.h 2016-07-19 17:10:57.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/drmmode_display.h 2017-03-15 18:05:25.000000000 +0000 @@ -66,29 +66,23 @@ Bool glamor; Bool shadow_enable; + Bool shadow_enable2; /** Is Option "PageFlip" enabled? */ Bool pageflip; Bool force_24_32; void *shadow_fb; - - /** - * A screen-sized pixmap when we're doing triple-buffered DRI2 - * pageflipping. - * - * One is shared between all drawables that flip to the front - * buffer, and it only gets reallocated when root pixmap size - * changes. - */ - PixmapPtr triple_buffer_pixmap; - - /** The GEM name for triple_buffer_pixmap */ - uint32_t triple_buffer_name; + void *shadow_fb2; DevPrivateKeyRec pixmapPrivateKeyRec; Bool reverse_prime_offload_mode; Bool is_secondary; + + PixmapPtr fbcon_pixmap; + + Bool dri2_flipping; + Bool present_flipping; } drmmode_rec, *drmmode_ptr; typedef struct { @@ -98,12 +92,17 @@ 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]; - DamagePtr slave_damage; drmmode_bo rotate_bo; unsigned rotate_fb_id; + + PixmapPtr prime_pixmap; + PixmapPtr prime_pixmap_back; unsigned prime_pixmap_x; + /** * @{ MSC (vblank count) handling for the PRESENT extension. * @@ -117,6 +116,9 @@ /** @} */ Bool need_modeset; + + Bool enable_flipping; + Bool flipping_active; } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; typedef struct { @@ -143,6 +145,18 @@ typedef struct _msPixmapPriv { uint32_t fb_id; struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ + + DamagePtr slave_damage; + + /** Sink fields for flipping shared pixmaps */ + int flip_seq; /* seq of current page flip event handler */ + Bool wait_for_damage; /* if we have requested damage notification from source */ + + /** 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 */ + Bool notify_on_damage; /* if sink has requested damage notification */ } msPixmapPrivRec, *msPixmapPrivPtr; extern DevPrivateKeyRec msPixmapPrivateKeyRec; @@ -151,7 +165,6 @@ #define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) -Bool drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap); 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); @@ -161,9 +174,17 @@ drmmode_ptr drmmode, int fd_handle, int pitch, int size); +Bool drmmode_EnableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode, + PixmapPtr front, PixmapPtr back); +Bool drmmode_SharedPixmapPresentOnVBlank(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode); +Bool drmmode_SharedPixmapFlip(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode); +void drmmode_DisableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode); + extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); -extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw); extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode); @@ -176,7 +197,7 @@ 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 diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/Makefile.am 2016-07-19 17:10:57.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -54,6 +54,7 @@ sh3224.c \ sh3224.h \ vblank.c \ + pageflip.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -118,9 +118,10 @@ subdir = hw/xfree86/drivers/modesetting ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -168,7 +169,7 @@ 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 + dumb_bo.lo present.lo sh3224.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@) @@ -416,6 +417,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -446,7 +450,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -541,6 +548,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -616,6 +624,7 @@ sh3224.c \ sh3224.h \ vblank.c \ + pageflip.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) @@ -708,6 +717,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmmode_display.Plo@am__quote@ @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@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/pageflip.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/pageflip.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/pageflip.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/pageflip.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,344 @@ +/* + * Copyright © 2014 Intel 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 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_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include + +#include "driver.h" + +/* + * Flush the DRM event queue when full; makes space for new events. + * + * Returns a negative value on error, 0 if there was nothing to process, + * or 1 if we handled any events. + */ +int +ms_flush_drm_events(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + struct pollfd p = { .fd = ms->fd, .events = POLLIN }; + int r; + + do { + r = xserver_poll(&p, 1, 0); + } while (r == -1 && (errno == EINTR || errno == EAGAIN)); + + /* If there was an error, r will be < 0. Return that. If there was + * nothing to process, r == 0. Return that. + */ + if (r <= 0) + return r; + + /* Try to handle the event. If there was an error, return it. */ + r = drmHandleEvent(ms->fd, &ms->event_context); + if (r < 0) + return r; + + /* Otherwise return 1 to indicate that we handled an event. */ + return 1; +} + +#ifdef GLAMOR + +/* + * Event data for an in progress flip. + * This contains a pointer to the vblank event, + * and information about the flip in progress. + * a reference to this is stored in the per-crtc + * flips. + */ +struct ms_flipdata { + ScreenPtr screen; + void *event; + ms_pageflip_handler_proc event_handler; + ms_pageflip_abort_proc abort_handler; + /* number of CRTC events referencing this */ + int flip_count; + uint64_t fe_msc; + uint64_t fe_usec; + uint32_t old_fb_id; +}; + +/* + * Per crtc pageflipping infomation, + * These are submitted to the queuing code + * one of them per crtc per flip. + */ +struct ms_crtc_pageflip { + Bool on_reference_crtc; + /* reference to the ms_flipdata */ + struct ms_flipdata *flipdata; +}; + +/** + * Free an ms_crtc_pageflip. + * + * Drops the reference count on the flipdata. + */ +static void +ms_pageflip_free(struct ms_crtc_pageflip *flip) +{ + struct ms_flipdata *flipdata = flip->flipdata; + + free(flip); + if (--flipdata->flip_count > 0) + return; + free(flipdata); +} + +/** + * Callback for the DRM event queue when a single flip has completed + * + * Once the flip has been completed on all pipes, notify the + * extension code telling it when that happened + */ +static void +ms_pageflip_handler(uint64_t msc, uint64_t ust, void *data) +{ + struct ms_crtc_pageflip *flip = data; + struct ms_flipdata *flipdata = flip->flipdata; + ScreenPtr screen = flipdata->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (flip->on_reference_crtc) { + flipdata->fe_msc = msc; + flipdata->fe_usec = ust; + } + + if (flipdata->flip_count == 1) { + flipdata->event_handler(ms, flipdata->fe_msc, + flipdata->fe_usec, + flipdata->event); + + drmModeRmFB(ms->fd, flipdata->old_fb_id); + } + ms_pageflip_free(flip); +} + +/* + * Callback for the DRM queue abort code. A flip has been aborted. + */ +static void +ms_pageflip_abort(void *data) +{ + struct ms_crtc_pageflip *flip = data; + struct ms_flipdata *flipdata = flip->flipdata; + ScreenPtr screen = flipdata->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (flipdata->flip_count == 1) + flipdata->abort_handler(ms, flipdata->event); + + ms_pageflip_free(flip); +} + +static Bool +queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, + struct ms_flipdata *flipdata, + int ref_crtc_vblank_pipe, uint32_t flags) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + struct ms_crtc_pageflip *flip; + uint32_t seq; + int err; + + flip = calloc(1, sizeof(struct ms_crtc_pageflip)); + if (flip == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue: carrier alloc failed.\n"); + return FALSE; + } + + /* Only the reference crtc will finally deliver its page flip + * completion event. All other crtc's events will be discarded. + */ + flip->on_reference_crtc = (drmmode_crtc->vblank_pipe == ref_crtc_vblank_pipe); + flip->flipdata = flipdata; + + seq = ms_drm_queue_alloc(crtc, flip, ms_pageflip_handler, ms_pageflip_abort); + if (!seq) { + free(flip); + return FALSE; + } + + /* 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)) { + 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 + * some other reason and should just return an error. + */ + if (ms_flush_drm_events(screen) <= 0) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue failed: %s\n", strerror(err)); + /* Aborting will also decrement flip_count and free(flip). */ + ms_drm_abort_seq(scrn, seq); + return FALSE; + } + + /* We flushed some events, so try again. */ + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue retry\n"); + } + + /* The page flip succeded. */ + return TRUE; +} + + +Bool +ms_do_pageflip(ScreenPtr screen, + PixmapPtr new_front, + void *event, + int ref_crtc_vblank_pipe, + Bool async, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort) +{ +#ifndef GLAMOR_HAS_GBM + return FALSE; +#else + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + drmmode_bo new_front_bo; + uint32_t flags; + int i; + struct ms_flipdata *flipdata; + glamor_block_handler(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"); + return FALSE; + } + + flipdata = calloc(1, sizeof(struct ms_flipdata)); + if (!flipdata) { + drmmode_bo_destroy(&ms->drmmode, &new_front_bo); + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to allocate flipdata.\n"); + return FALSE; + } + + flipdata->event = event; + flipdata->screen = screen; + flipdata->event_handler = pageflip_handler; + flipdata->abort_handler = pageflip_abort; + + /* + * Take a local reference on flipdata. + * if the first flip fails, the sequence abort + * code will free the crtc flip data, and drop + * it's reference which would cause this to be + * freed when we still required it. + */ + flipdata->flip_count++; + + /* 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); + + flags = DRM_MODE_PAGE_FLIP_EVENT; + if (async) + flags |= DRM_MODE_PAGE_FLIP_ASYNC; + + /* Queue flips on all enabled CRTCs. + * + * Note that if/when we get per-CRTC buffers, we'll have to update this. + * Right now it assumes a single shared fb across all CRTCs, with the + * kernel fixing up the offset of each CRTC as necessary. + * + * Also, flips queued on disabled or incorrectly configured displays + * may never complete; this is a configuration error. + */ + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + + if (!ms_crtc_on(crtc)) + continue; + + if (!queue_flip_on_crtc(screen, crtc, flipdata, + ref_crtc_vblank_pipe, + flags)) { + goto error_undo; + } + } + + /* + * Do we have more than our local reference, + * if so and no errors, then drop our local + * reference and return now. + */ + if (flipdata->flip_count > 1) { + flipdata->flip_count--; + return TRUE; + } + +error_undo: + + /* + * Have we just got the local reference? + * free the framebuffer if so since nobody successfully + * submitted anything + */ + if (flipdata->flip_count == 1) { + drmModeRmFB(ms->fd, ms->drmmode.fb_id); + ms->drmmode.fb_id = flipdata->old_fb_id; + } + +error_out: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", + strerror(errno)); + /* if only the local reference - free the structure, + * else drop the local reference and return */ + if (flipdata->flip_count == 1) + free(flipdata); + else + flipdata->flip_count--; + + return FALSE; +#endif /* GLAMOR_HAS_GBM */ +} + +#endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/present.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/present.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/present.c 2016-07-19 15:12:15.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/present.c 2017-03-15 18:05:25.000000000 +0000 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -54,6 +53,7 @@ struct ms_present_vblank_event { uint64_t event_id; + Bool unflip; }; static RRCrtcPtr @@ -72,40 +72,6 @@ } /* - * Flush the DRM event queue when full; makes space for new events. - * - * Returns a negative value on error, 0 if there was nothing to process, - * or 1 if we handled any events. - */ -static int -ms_flush_drm_events(ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - - struct pollfd p = { .fd = ms->fd, .events = POLLIN }; - int r; - - do { - r = poll(&p, 1, 0); - } while (r == -1 && (errno == EINTR || errno == EAGAIN)); - - /* If there was an error, r will be < 0. Return that. If there was - * nothing to process, r == 0. Return that. - */ - if (r <= 0) - return r; - - /* Try to handle the event. If there was an error, return it. */ - r = drmHandleEvent(ms->fd, &ms->event_context); - if (r < 0) - return r; - - /* Otherwise return 1 to indicate that we handled an event. */ - return 1; -} - -/* * Called when the queued vblank event has occurred */ static void @@ -226,289 +192,38 @@ #ifdef GLAMOR -/* - * Event data for an in progress flip. - * This contains a pointer to the vblank event, - * and information about the flip in progress. - * a reference to this is stored in the per-crtc - * flips. - */ -struct ms_flipdata { - ScreenPtr screen; - struct ms_present_vblank_event *event; - /* number of CRTC events referencing this */ - int flip_count; - uint64_t fe_msc; - uint64_t fe_usec; - uint32_t old_fb_id; -}; - -/* - * Per crtc pageflipping infomation, - * These are submitted to the queuing code - * one of them per crtc per flip. - */ -struct ms_crtc_pageflip { - Bool on_reference_crtc; - /* reference to the ms_flipdata */ - struct ms_flipdata *flipdata; -}; - -/** - * Free an ms_crtc_pageflip. - * - * Drops the reference count on the flipdata. - */ -static void -ms_present_flip_free(struct ms_crtc_pageflip *flip) -{ - struct ms_flipdata *flipdata = flip->flipdata; - - free(flip); - if (--flipdata->flip_count > 0) - return; - free(flipdata); -} - /** - * Callback for the DRM event queue when a single flip has completed + * Callback for the DRM event queue when a flip has completed on all pipes * - * Once the flip has been completed on all pipes, notify the - * extension code telling it when that happened + * Notify the extension code */ static void -ms_flip_handler(uint64_t msc, uint64_t ust, void *data) +ms_present_flip_handler(modesettingPtr ms, uint64_t msc, + uint64_t ust, void *data) { - struct ms_crtc_pageflip *flip = data; - ScreenPtr screen = flip->flipdata->screen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - struct ms_flipdata *flipdata = flip->flipdata; + struct ms_present_vblank_event *event = data; - DebugPresent(("\t\tms:fh %lld c %d msc %llu ust %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, + DebugPresent(("\t\tms:fc %lld msc %llu ust %llu\n", + (long long) event->event_id, (long long) msc, (long long) ust)); - if (flip->on_reference_crtc) { - flipdata->fe_msc = msc; - flipdata->fe_usec = ust; - } + if (event->unflip) + ms->drmmode.present_flipping = FALSE; - if (flipdata->flip_count == 1) { - DebugPresent(("\t\tms:fc %lld c %d msc %llu ust %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, - (long long) flipdata->fe_msc, (long long) flipdata->fe_usec)); - - - ms_present_vblank_handler(flipdata->fe_msc, - flipdata->fe_usec, - flipdata->event); - - drmModeRmFB(ms->fd, flipdata->old_fb_id); - } - ms_present_flip_free(flip); + ms_present_vblank_handler(msc, ust, event); } /* * Callback for the DRM queue abort code. A flip has been aborted. */ static void -ms_present_flip_abort(void *data) +ms_present_flip_abort(modesettingPtr ms, void *data) { - struct ms_crtc_pageflip *flip = data; - struct ms_flipdata *flipdata = flip->flipdata; - - DebugPresent(("\t\tms:fa %lld c %d\n", (long long) flipdata->event->event_id, flipdata->flip_count)); - - if (flipdata->flip_count == 1) - free(flipdata->event); - - ms_present_flip_free(flip); -} - -static Bool -queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, - struct ms_flipdata *flipdata, - int ref_crtc_vblank_pipe, uint32_t flags) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - struct ms_crtc_pageflip *flip; - uint32_t seq; - int err; - - flip = calloc(1, sizeof(struct ms_crtc_pageflip)); - if (flip == NULL) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "flip queue: carrier alloc failed.\n"); - return FALSE; - } - - /* Only the reference crtc will finally deliver its page flip - * completion event. All other crtc's events will be discarded. - */ - flip->on_reference_crtc = (drmmode_crtc->vblank_pipe == ref_crtc_vblank_pipe); - flip->flipdata = flipdata; - - seq = ms_drm_queue_alloc(crtc, flip, ms_flip_handler, ms_present_flip_abort); - if (!seq) { - free(flip); - return FALSE; - } - - DebugPresent(("\t\tms:fq %lld c %d -> %d seq %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, flipdata->flip_count + 1, - (long long) seq)); - - /* 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)) { - 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 - * some other reason and should just return an error. - */ - if (ms_flush_drm_events(screen) <= 0) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "flip queue failed: %s\n", strerror(err)); - /* Aborting will also decrement flip_count and free(flip). */ - ms_drm_abort_seq(scrn, seq); - return FALSE; - } - - /* We flushed some events, so try again. */ - xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue retry\n"); - } - - /* The page flip succeded. */ - return TRUE; -} - - -static Bool -ms_do_pageflip(ScreenPtr screen, - PixmapPtr new_front, - struct ms_present_vblank_event *event, - int ref_crtc_vblank_pipe, - Bool async) -{ -#ifndef GLAMOR_HAS_GBM - return FALSE; -#else - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - drmmode_bo new_front_bo; - uint32_t flags; - int i; - struct ms_flipdata *flipdata; - glamor_block_handler(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"); - return FALSE; - } - - flipdata = calloc(1, sizeof(struct ms_flipdata)); - if (!flipdata) { - drmmode_bo_destroy(&ms->drmmode, &new_front_bo); - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to allocate flipdata.\n"); - return FALSE; - } - - flipdata->event = event; - flipdata->screen = screen; - - /* - * Take a local reference on flipdata. - * if the first flip fails, the sequence abort - * code will free the crtc flip data, and drop - * it's reference which would cause this to be - * freed when we still required it. - */ - flipdata->flip_count++; - - /* 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); - - flags = DRM_MODE_PAGE_FLIP_EVENT; - if (async) - flags |= DRM_MODE_PAGE_FLIP_ASYNC; - - /* Queue flips on all enabled CRTCs. - * - * Note that if/when we get per-CRTC buffers, we'll have to update this. - * Right now it assumes a single shared fb across all CRTCs, with the - * kernel fixing up the offset of each CRTC as necessary. - * - * Also, flips queued on disabled or incorrectly configured displays - * may never complete; this is a configuration error. - */ - for (i = 0; i < config->num_crtc; i++) { - xf86CrtcPtr crtc = config->crtc[i]; - - if (!ms_crtc_on(crtc)) - continue; - - if (!queue_flip_on_crtc(screen, crtc, flipdata, - ref_crtc_vblank_pipe, - flags)) { - goto error_undo; - } - } - - /* - * Do we have more than our local reference, - * if so and no errors, then drop our local - * reference and return now. - */ - if (flipdata->flip_count > 1) { - flipdata->flip_count--; - return TRUE; - } - -error_undo: - - /* - * Have we just got the local reference? - * free the framebuffer if so since nobody successfully - * submitted anything - */ - if (flipdata->flip_count == 1) { - drmModeRmFB(ms->fd, ms->drmmode.fb_id); - ms->drmmode.fb_id = flipdata->old_fb_id; - } + struct ms_present_vblank_event *event = data; -error_out: - xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", - strerror(errno)); - /* if only the local reference - free the structure, - * else drop the local reference and return */ - if (flipdata->flip_count == 1) - free(flipdata); - else - flipdata->flip_count--; + DebugPresent(("\t\tms:fa %lld\n", (long long) event->event_id)); - return FALSE; -#endif /* GLAMOR_HAS_GBM */ + free(event); } /* @@ -530,6 +245,9 @@ if (!ms->drmmode.pageflip) return FALSE; + if (ms->drmmode.dri2_flipping) + return FALSE; + if (!scrn->vtSema) return FALSE; @@ -576,6 +294,7 @@ { ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); xf86CrtcPtr xf86_crtc = crtc->devPrivate; drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; Bool ret; @@ -588,10 +307,18 @@ if (!event) return FALSE; + DebugPresent(("\t\tms:pf %lld msc %llu\n", + (long long) event_id, (long long) target_msc)); + event->event_id = event_id; - ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip); + event->unflip = FALSE; + + ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip, + ms_present_flip_handler, ms_present_flip_abort); if (!ret) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n"); + else + ms->drmmode.present_flipping = TRUE; return ret; } @@ -603,6 +330,7 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); PixmapPtr pixmap = screen->GetScreenPixmap(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int i; @@ -613,9 +341,11 @@ return; event->event_id = event_id; + event->unflip = TRUE; if (ms_present_check_flip(NULL, screen->root, pixmap, TRUE) && - ms_do_pageflip(screen, pixmap, event, -1, FALSE)) { + ms_do_pageflip(screen, pixmap, event, -1, FALSE, + ms_present_flip_handler, ms_present_flip_abort)) { return; } @@ -643,6 +373,7 @@ } present_event_notify(event_id, 0, 0); + ms->drmmode.present_flipping = FALSE; } #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/vblank.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/vblank.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/drivers/modesetting/vblank.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/drivers/modesetting/vblank.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,7 +32,6 @@ #include #include #include -#include #include "driver.h" #include "drmmode_display.h" @@ -93,46 +92,68 @@ /* * Return the crtc covering 'box'. If two crtcs cover a portion of - * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc - * with greater coverage + * 'box', then prefer the crtc with greater coverage. */ -xf86CrtcPtr -ms_covering_crtc(ScrnInfoPtr scrn, - BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) +static xf86CrtcPtr +ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms) { + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; BoxRec crtc_box, cover_box; + Bool crtc_on; best_crtc = NULL; best_coverage = 0; - crtc_box_ret->x1 = 0; - crtc_box_ret->x2 = 0; - crtc_box_ret->y1 = 0; - crtc_box_ret->y2 = 0; for (c = 0; c < xf86_config->num_crtc; c++) { crtc = xf86_config->crtc[c]; + if (screen_is_ms) + crtc_on = ms_crtc_on(crtc); + else + crtc_on = crtc->enabled; + /* If the CRTC is off, treat it as not covering */ - if (!ms_crtc_on(crtc)) + if (!crtc_on) continue; ms_crtc_box(crtc, &crtc_box); ms_box_intersect(&cover_box, &crtc_box, box); coverage = ms_box_area(&cover_box); - if (coverage && crtc == desired) { - *crtc_box_ret = crtc_box; - return crtc; - } if (coverage > best_coverage) { - *crtc_box_ret = crtc_box; best_crtc = crtc; best_coverage = coverage; } } + + /* Fallback to primary crtc for drawable's on slave outputs */ + if (best_crtc == NULL && !pScreen->isGPU) { + RROutputPtr primary_output = NULL; + ScreenPtr slave; + + if (dixPrivateKeyRegistered(rrPrivKey)) + primary_output = RRFirstOutput(scrn->pScreen); + if (!primary_output || !primary_output->crtc) + return NULL; + + crtc = primary_output->crtc->devPrivate; + if (!ms_crtc_on(crtc)) + return NULL; + + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + + if (ms_covering_crtc(slave, box, FALSE)) { + /* The drawable is on a slave output, return primary crtc */ + return crtc; + } + } + } + return best_crtc; } @@ -140,15 +161,14 @@ ms_dri2_crtc_covering_drawable(DrawablePtr pDraw) { ScreenPtr pScreen = pDraw->pScreen; - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - BoxRec box, crtcbox; + BoxRec box; box.x1 = pDraw->x; box.y1 = pDraw->y; box.x2 = box.x1 + pDraw->width; box.y2 = box.y1 + pDraw->height; - return ms_covering_crtc(pScrn, &box, NULL, &crtcbox); + return ms_covering_crtc(pScreen, &box, TRUE); } static Bool @@ -244,18 +264,16 @@ * Check for pending DRM events and process them. */ static void -ms_drm_wakeup_handler(void *data, int err, void *mask) +ms_drm_socket_handler(int fd, int ready, void *data) { ScreenPtr screen = data; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); - fd_set *read_mask = mask; - if (data == NULL || err < 0) + if (data == NULL) return; - if (FD_ISSET(ms->fd, read_mask)) - drmHandleEvent(ms->fd, &ms->event_context); + drmHandleEvent(fd, &ms->event_context); } /* @@ -393,9 +411,7 @@ * registration within ScreenInit and not PreInit. */ if (ms_ent->fd_wakeup_registered != serverGeneration) { - AddGeneralSocket(ms->fd); - RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, - ms_drm_wakeup_handler, screen); + SetNotifyFd(ms->fd, ms_drm_socket_handler, X_NOTIFY_READ, screen); ms_ent->fd_wakeup_registered = serverGeneration; ms_ent->fd_wakeup_ref = 1; } else @@ -415,8 +431,6 @@ if (ms_ent->fd_wakeup_registered == serverGeneration && !--ms_ent->fd_wakeup_ref) { - RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, - ms_drm_wakeup_handler, screen); - RemoveGeneralSocket(ms->fd); + RemoveNotifyFd(ms->fd); } } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/exa/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/exa/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/exa/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/exa/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/exa ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -427,6 +428,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -457,7 +461,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -552,6 +559,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/exa/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/exa/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/exa/man/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/exa/man/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/exa/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/fbdevhw/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/fbdevhw/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/fbdevhw/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/fbdevhw/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/fbdevhw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -430,6 +431,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -460,7 +464,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -555,6 +562,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/fbdevhw/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/fbdevhw/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/fbdevhw/man/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/fbdevhw/man/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/fbdevhw/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/glamor_egl/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/glamor_egl/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/glamor_egl/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/glamor_egl/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -112,9 +112,10 @@ subdir = hw/xfree86/glamor_egl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -407,6 +408,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -437,7 +441,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -532,6 +539,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/i2c/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/i2c/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/i2c/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/i2c/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/i2c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -383,6 +384,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -413,7 +417,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -508,6 +515,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/i2c/xf86i2c.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/i2c/xf86i2c.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/i2c/xf86i2c.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/i2c/xf86i2c.c 2017-03-15 18:05:25.000000000 +0000 @@ -614,7 +614,7 @@ void xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) { - if (d) { + if (d && d->pI2CBus) { I2CDevPtr *p; /* Remove this from the list of active I2C devices. */ @@ -628,10 +628,10 @@ xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO, "I2C device \"%s:%s\" removed.\n", d->pI2CBus->BusName, d->DevName); - - if (unalloc) - free(d); } + + if (unalloc) + free(d); } /* I2C transmissions are related to an I2CDevRec you must link to a diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/int10/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/int10/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/int10/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/int10/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/xfree86/int10 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -402,6 +403,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -432,7 +436,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -527,6 +534,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/loader.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/loader.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/loader.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/loader.c 2017-03-15 18:05:25.000000000 +0000 @@ -180,7 +180,6 @@ {ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, {ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, {ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, - {ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, {NULL, 0} }; int i; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/loadmod.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/loadmod.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/loadmod.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/loadmod.c 2017-03-15 18:05:25.000000000 +0000 @@ -86,7 +86,6 @@ ABI_VIDEODRV_VERSION, ABI_XINPUT_VERSION, ABI_EXTENSION_VERSION, - ABI_FONT_VERSION }; static int ModuleDuplicated[] = { }; @@ -613,8 +612,6 @@ ver = LoaderVersionInfo.xinputVersion; else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION)) ver = LoaderVersionInfo.extensionVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_FONT)) - ver = LoaderVersionInfo.fontVersion; abimaj = GET_ABI_MAJOR(data->abiversion); abimin = GET_ABI_MINOR(data->abiversion); @@ -629,9 +626,9 @@ else errtype = X_ERROR; xf86MsgVerb(errtype, 0, - "module ABI major version (%d) doesn't" + "%s: module ABI major version (%d) doesn't" " match the server's version (%d)\n", - abimaj, vermaj); + module, abimaj, vermaj); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -641,9 +638,9 @@ else errtype = X_ERROR; xf86MsgVerb(errtype, 0, - "module ABI minor version (%d) is " + "%s: module ABI minor version (%d) is " "newer than the server's version " - "(%d)\n", abimin, vermin); + "(%d)\n", module, abimin, vermin); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -654,24 +651,24 @@ if (req) { if (req->majorversion != MAJOR_UNSPEC) { if (data->majorversion != req->majorversion) { - xf86MsgVerb(X_WARNING, 2, "module major version (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module major version (%d) " "doesn't match required major version (%d)\n", - data->majorversion, req->majorversion); + module, data->majorversion, req->majorversion); return FALSE; } else if (req->minorversion != MINOR_UNSPEC) { if (data->minorversion < req->minorversion) { - xf86MsgVerb(X_WARNING, 2, "module minor version (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module minor version (%d) " "is less than the required minor version (%d)\n", - data->minorversion, req->minorversion); + 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, "module patch level (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module patch level (%d) " "is less than the required patch level (%d)\n", - data->patchlevel, req->patchlevel); + module, data->patchlevel, req->patchlevel); return FALSE; } } @@ -680,8 +677,9 @@ if (req->moduleclass) { if (!data->moduleclass || strcmp(req->moduleclass, data->moduleclass)) { - xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match " + xf86MsgVerb(X_WARNING, 2, "%s: Module class (%s) doesn't match " "the required class (%s)\n", + module, data->moduleclass ? data->moduleclass : "", req->moduleclass); return FALSE; @@ -689,8 +687,9 @@ } else if (req->abiclass != ABI_CLASS_NONE) { if (!data->abiclass || strcmp(req->abiclass, data->abiclass)) { - xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the " + xf86MsgVerb(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; @@ -705,15 +704,16 @@ maj = GET_ABI_MAJOR(data->abiversion); min = GET_ABI_MINOR(data->abiversion); if (maj != reqmaj) { - xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't " + xf86MsgVerb(X_WARNING, 2, "%s: ABI major version (%d) doesn't " "match the required ABI major version (%d)\n", - maj, reqmaj); + module, maj, reqmaj); return FALSE; } /* XXX Maybe this should be the other way around? */ if (min > reqmin) { - xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) " - "is newer than that available (%d)\n", min, reqmin); + xf86MsgVerb(X_WARNING, 2, "%s: module ABI minor version (%d) " + "is newer than that available (%d)\n", + module, min, reqmin); return FALSE; } } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/loader ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -354,6 +355,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -384,7 +388,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -479,6 +486,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/os.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/os.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/loader/os.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/loader/os.c 2017-03-15 18:05:25.000000000 +0000 @@ -50,7 +50,7 @@ #define OSNAME "openbsd" #elif defined(__GNU__) #define OSNAME "hurd" -#elif defined(SVR4) && defined(sun) +#elif defined(SVR4) && defined(__sun) #define OSNAME "solaris" #elif defined(SVR5) #define OSNAME "svr5" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/Makefile.in 2016-07-19 17:27:27.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/Makefile.in 2017-03-15 18:05:42.000000000 +0000 @@ -93,9 +93,10 @@ subdir = hw/xfree86 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -414,6 +415,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -444,7 +448,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -539,6 +546,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/man/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/man/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -94,9 +94,10 @@ subdir = hw/xfree86/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/man/xorg.conf.man xorg-server-hwe-16.04-1.19.3/hw/xfree86/man/xorg.conf.man --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/man/xorg.conf.man 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/man/xorg.conf.man 2017-03-15 18:05:25.000000000 +0000 @@ -511,15 +511,6 @@ In general you never want to use this option unless you are debugging an Xorg server problem and know how to deal with the consequences. .TP 7 -.BI "Option \*qUseSIGIO\*q \*q" boolean \*q -This controls whether the Xorg server requests that events from -input devices be reported via a SIGIO signal handler (also known as SIGPOLL -on some platforms), or only reported via the standard select(3) loop. -The default behaviour is platform specific. In general you do not want to -use this option unless you are debugging the Xorg server, or -working around a specific bug until it is fixed, and understand the -consequences. -.TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the .BI Ctrl+Alt+F n @@ -641,9 +632,6 @@ enable or disable XINERAMA extension. Default is disabled. .TP 7 -.BI "Option \*qAIGLX\*q \*q" boolean \*q -enable or disable AIGLX. AIGLX is enabled by default. -.TP 7 .BI "Option \*qIndirectGLX\*q \*q" boolean \*q enable or disable indirect GLX contexts. Indirect GLX contexts are disabled by default. @@ -1096,6 +1084,7 @@ .B " # either gizmo or gadget .B " MatchProduct \*qexample\*q .B " MatchProduct \*qgizmo|gadget\*q +.B " NoMatchDriver \*qdrivername\*q .I " ..." .B "EndSection" .fi @@ -1164,6 +1153,20 @@ .B ServerLayout sections have been found. .PP +The above directives have equivalents for negative matching with the +.B NoMatchProduct, +.B NoMatchVendor, +.B NoMatchDevicePath, +.B NoMatchOS, +.B NoMatchPnPID, +.B NoMatchUSBID, +.B NoMatchDriver, +.B NoMatchTag, +and +.B NoMatchLayout +directives. These NoMatch directives match if the subsequent match is not +met by the device. +.PP The second type of entry is used to match device types. These entries take a boolean argument similar to .B Option @@ -1177,6 +1180,8 @@ .TP 7 .BI "MatchIsTablet \*q" bool \*q .TP 7 +.BI "MatchIsTabletPad \*q" bool \*q +.TP 7 .BI "MatchIsTouchpad \*q" bool \*q .TP 7 .BI "MatchIsTouchscreen \*q" bool \*q @@ -2028,6 +2033,12 @@ not accelerated (whether due to lack of support in the hardware or in the driver). .TP 7 +.BI "Option \*qGlxVendorLibrary\*q \*q" string \*q +This option specifies a space-separated list of OpenGL vendor libraries to +use for the screen. This may be used to select an alternate implementation +for development, debugging, or alternate feature sets. +Default: mesa. +.TP 7 .BI "Option \*qInitPrimary\*q \*q" boolean \*q Use the Int10 module to initialize the primary graphics card. Normally, only secondary cards are soft-booted using the Int10 module, as the diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/modes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -389,6 +390,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -419,7 +423,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -514,6 +521,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Crtc.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Crtc.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Crtc.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Crtc.c 2017-03-15 18:05:25.000000000 +0000 @@ -2451,108 +2451,6 @@ return FALSE; } -static Bool -xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, - float gamma_blue) -{ - int i, size = 256; - CARD16 *red, *green, *blue; - - red = xallocarray(size, 3 * sizeof(CARD16)); - green = red + size; - blue = green + size; - - /* Only cause warning if user wanted gamma to be set. */ - if (!crtc->funcs->gamma_set && - (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { - free(red); - return FALSE; - } - else if (!crtc->funcs->gamma_set) { - free(red); - return TRUE; - } - - /* At this early stage none of the randr-interface stuff is up. - * So take the default gamma size for lack of something better. - */ - for (i = 0; i < size; i++) { - if (gamma_red == 1.0) - red[i] = i << 8; - else - red[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_red) * (double) (size - - 1) * - 256); - - if (gamma_green == 1.0) - green[i] = i << 8; - else - green[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_green) * - (double) (size - 1) * 256); - - if (gamma_blue == 1.0) - blue[i] = i << 8; - else - blue[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_blue) * (double) (size - - 1) * - 256); - } - - /* Default size is 256, so anything else is failure. */ - if (size != crtc->gamma_size) { - free(red); - return FALSE; - } - - crtc->gamma_size = size; - memcpy(crtc->gamma_red, red, crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_green, green, crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_blue, blue, crtc->gamma_size * sizeof(CARD16)); - - /* Do not set gamma now, delay until the crtc is activated. */ - - free(red); - - return TRUE; -} - -static Bool -xf86OutputSetInitialGamma(xf86OutputPtr output) -{ - XF86ConfMonitorPtr mon = output->conf_monitor; - float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; - - if (!mon) - return TRUE; - - if (!output->crtc) - return FALSE; - - /* Get configured values, where they exist. */ - if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX) - gamma_red = mon->mon_gamma_red; - - if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX) - gamma_green = mon->mon_gamma_green; - - if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX) - gamma_blue = mon->mon_gamma_blue; - - /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ - if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { - xf86DrvMsg(output->scrn->scrnIndex, X_INFO, - "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", - output->name, gamma_red, gamma_green, gamma_blue); - return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, - gamma_blue); - } - else - return TRUE; -} - /** * Construct default screen configuration * @@ -2672,15 +2570,8 @@ crtc->enabled = FALSE; memset(&crtc->desiredMode, '\0', sizeof(crtc->desiredMode)); - /* Set default gamma for all crtc's. */ - /* This is done to avoid problems later on with cloned outputs. */ - xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); } - if (xf86_crtc_supports_gamma(scrn)) - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); - /* * Set initial configuration */ @@ -2703,10 +2594,6 @@ memcpy(crtc->panningBorder, output->initialBorder, 4 * sizeof(INT16)); output->crtc = crtc; - if (!xf86OutputSetInitialGamma(output)) - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Initial gamma correction for output %s: failed.\n", - output->name); } else { output->crtc = NULL; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Crtc.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Crtc.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Crtc.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Crtc.h 2017-03-15 18:05:25.000000000 +0000 @@ -70,6 +70,14 @@ XF86OutputStatusUnknown } xf86OutputStatus; +typedef enum _xf86DriverTransforms { + XF86DriverTransformNone = 0, + XF86DriverTransformOutput = 1 << 0, + XF86DriverTransformCursorImage = 1 << 1, + XF86DriverTransformCursorPosition = 1 << 2, +} xf86DriverTransforms; + + struct xf86CrtcTileInfo { uint32_t group_id; uint32_t flags; @@ -237,7 +245,7 @@ } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 6 +#define XF86_CRTC_VERSION 7 struct _xf86Crtc { /** @@ -377,21 +385,30 @@ Bool shadowClear; /** - * Indicates that the driver is handling the transform, so the shadow - * surface should be disabled. The driver writes this field before calling - * xf86CrtcRotate to indicate that it is handling the transform (including - * rotation and reflection). + * Indicates that the driver is handling some or all transforms: + * + * XF86DriverTransformOutput: The driver handles the output transform, so + * the shadow surface should be disabled. The driver writes this field + * before calling xf86CrtcRotate to indicate that it is handling the + * transform (including rotation and reflection). + * + * XF86DriverTransformCursorImage: Setting this flag causes the server to + * pass the untransformed cursor image to the driver hook. * - * Setting this flag also causes the server to stop adjusting the cursor - * image and position. + * XF86DriverTransformCursorPosition: Setting this flag causes the server + * to pass the untransformed cursor position to the driver hook. * - * Added in ABI version 4 + * Added in ABI version 4, changed to xf86DriverTransforms in ABI version 7 */ - Bool driverIsPerformingTransform; + xf86DriverTransforms driverIsPerformingTransform; /* Added in ABI version 5 */ PixmapPtr current_scanout; + + /* Added in ABI version 6 + */ + PixmapPtr current_scanout_back; }; typedef struct _xf86OutputFuncs { @@ -968,14 +985,10 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags); /** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions. - * - * Driver should call this from crtc commit function. + * Superseeded by xf86CursorResetCursor, which is getting called + * automatically when necessary. */ -extern _X_EXPORT void - xf86_reload_cursors(ScreenPtr screen); +static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {} /** * Called from EnterVT to turn the cursors back on @@ -995,14 +1008,6 @@ extern _X_EXPORT void xf86_cursors_fini(ScreenPtr screen); -/** - * Transform the cursor's coordinates based on the crtc transform. Normally - * this is done by the server, but if crtc->driverIsPerformingTransform is TRUE, - * then the server does not transform the cursor position automatically. - */ -extern _X_EXPORT void - xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y); - #ifdef XV /* * For overlay video, compute the relevant CRTC and diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Cursors.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Cursors.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Cursors.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Cursors.c 2017-03-15 18:05:25.000000000 +0000 @@ -54,7 +54,7 @@ static Rotation xf86_crtc_cursor_rotation(xf86CrtcPtr crtc) { - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorImage) return RR_Rotate_0; return crtc->rotation; } @@ -74,7 +74,7 @@ break; case RR_Rotate_90: t = x_dst; - x_dst = height - y_dst - 1; + x_dst = width - y_dst - 1; y_dst = t; break; case RR_Rotate_180: @@ -84,7 +84,7 @@ case RR_Rotate_270: t = x_dst; x_dst = y_dst; - y_dst = width - t - 1; + y_dst = height - t - 1; break; } if (rotation & RR_Reflect_X) @@ -287,7 +287,7 @@ { ScreenPtr screen = scrn->pScreen; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - CursorPtr cursor = xf86_config->cursor; + CursorPtr cursor = xf86CurrentCursor(screen); int c; CARD8 *bits = cursor ? dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen) @@ -357,8 +357,8 @@ } } -void -xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) +static void +xf86_crtc_transform_cursor_position(xf86CrtcPtr crtc, int *x, int *y) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; @@ -367,16 +367,45 @@ xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&screen->devPrivates, xf86CursorScreenKey); - struct pict_f_vector v; - int dx, dy; + int dx, dy, t; + Bool swap_reflection = FALSE; + + *x = *x - crtc->x + ScreenPriv->HotX; + *y = *y - crtc->y + ScreenPriv->HotY; + + switch (crtc->rotation & 0xf) { + case RR_Rotate_0: + break; + case RR_Rotate_90: + t = *x; + *x = *y; + *y = crtc->mode.VDisplay - t - 1; + swap_reflection = TRUE; + break; + case RR_Rotate_180: + *x = crtc->mode.HDisplay - *x - 1; + *y = crtc->mode.VDisplay - *y - 1; + break; + case RR_Rotate_270: + t = *x; + *x = crtc->mode.HDisplay - *y - 1; + *y = t; + swap_reflection = TRUE; + break; + } + + if (swap_reflection) { + if (crtc->rotation & RR_Reflect_Y) + *x = crtc->mode.HDisplay - *x - 1; + if (crtc->rotation & RR_Reflect_X) + *y = crtc->mode.VDisplay - *y - 1; + } else { + if (crtc->rotation & RR_Reflect_X) + *x = crtc->mode.HDisplay - *x - 1; + if (crtc->rotation & RR_Reflect_Y) + *y = crtc->mode.VDisplay - *y - 1; + } - v.v[0] = (*x + ScreenPriv->HotX) + 0.5; - v.v[1] = (*y + ScreenPriv->HotY) + 0.5; - v.v[2] = 1; - pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v); - /* cursor will have 0.5 added to it already so floor is sufficent */ - *x = floor(v.v[0]); - *y = floor(v.v[1]); /* * Transform position of cursor upper left corner */ @@ -394,37 +423,33 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; DisplayModePtr mode = &crtc->mode; - Bool in_range; + int crtc_x = x, crtc_y = y; /* * Transform position of cursor on screen */ - if (crtc->transform_in_use && !crtc->driverIsPerformingTransform) - xf86CrtcTransformCursorPos(crtc, &x, &y); + if (crtc->rotation != RR_Rotate_0) + xf86_crtc_transform_cursor_position(crtc, &crtc_x, &crtc_y); else { - x -= crtc->x; - y -= crtc->y; + crtc_x -= crtc->x; + crtc_y -= crtc->y; } /* * Disable the cursor when it is outside the viewport */ - in_range = TRUE; - if (x >= mode->HDisplay || y >= mode->VDisplay || - x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) { - in_range = FALSE; - x = 0; - y = 0; - } - - crtc->cursor_in_range = in_range; - - if (in_range) { - crtc->funcs->set_cursor_position(crtc, x, y); + if (crtc_x >= mode->HDisplay || crtc_y >= mode->VDisplay || + crtc_x <= -cursor_info->MaxWidth || crtc_y <= -cursor_info->MaxHeight) { + crtc->cursor_in_range = FALSE; + xf86_crtc_hide_cursor(crtc); + } else { + crtc->cursor_in_range = TRUE; + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorPosition) + crtc->funcs->set_cursor_position(crtc, x, y); + else + crtc->funcs->set_cursor_position(crtc, crtc_x, crtc_y); xf86_crtc_show_cursor(crtc); } - else - xf86_crtc_hide_cursor(crtc); } static void @@ -492,6 +517,7 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; + xf86_config->cursor = xf86CurrentCursor(scrn->pScreen); for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; @@ -517,11 +543,6 @@ xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; int c; - cursor = RefCursor(cursor); - if (xf86_config->cursor) - FreeCursor(xf86_config->cursor, None); - xf86_config->cursor = cursor; - if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height > cursor_info->MaxHeight) return FALSE; @@ -593,6 +614,7 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; + xf86_config->cursor = cursor; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; @@ -638,70 +660,12 @@ cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb; } - xf86_config->cursor = NULL; xf86_hide_cursors(scrn); return xf86InitCursor(screen, cursor_info); } /** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions - * @note We assume that all hardware cursors to be loaded have already been - * found to be usable by the hardware. - */ - -void -xf86_reload_cursors(ScreenPtr screen) -{ - ScrnInfoPtr scrn; - xf86CrtcConfigPtr xf86_config; - xf86CursorInfoPtr cursor_info; - CursorPtr cursor; - int x, y; - xf86CursorScreenPtr cursor_screen_priv; - - /* initial mode setting will not have set a screen yet. - May be called before the devices are initialised. - */ - if (!screen || !inputInfo.pointer) - return; - cursor_screen_priv = dixLookupPrivate(&screen->devPrivates, - xf86CursorScreenKey); - /* return if HW cursor is inactive, to avoid displaying two cursors */ - if (!cursor_screen_priv || !cursor_screen_priv->isUp) - return; - - scrn = xf86ScreenToScrn(screen); - xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - - /* make sure the cursor code has been initialized */ - cursor_info = xf86_config->cursor_info; - if (!cursor_info) - return; - - cursor = xf86_config->cursor; - GetSpritePosition(inputInfo.pointer, &x, &y); - if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) - (*cursor_info->HideCursor) (scrn); - - if (cursor) { - void *src = - dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, - screen); - if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info)) - xf86DriverLoadCursorARGB(cursor_info, cursor); - else if (src) - xf86DriverLoadCursorImage(cursor_info, src); - - x += scrn->frameX0 + cursor_screen_priv->HotX; - y += scrn->frameY0 + cursor_screen_priv->HotY; - (*cursor_info->SetCursorPosition) (scrn, x, y); - } -} - -/** * Clean up CRTC-based cursor code */ void @@ -716,8 +680,5 @@ } free(xf86_config->cursor_image); xf86_config->cursor_image = NULL; - if (xf86_config->cursor) { - FreeCursor(xf86_config->cursor, None); - xf86_config->cursor = NULL; - } + xf86_config->cursor = NULL; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86EdidModes.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86EdidModes.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86EdidModes.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86EdidModes.c 2017-03-15 18:05:25.000000000 +0000 @@ -153,6 +153,11 @@ static Bool quirk_detailed_use_maximum_size(int scrnIndex, xf86MonPtr DDC) { + /* ADA 1024x600 7" display */ + if (memcmp(DDC->vendor.name, "ADA", 4) == 0 && + DDC->vendor.prod_id == 4) + return TRUE; + /* Bug #21324: Iiyama Vision Master 450 */ if (memcmp(DDC->vendor.name, "IVM", 4) == 0 && DDC->vendor.prod_id == 6400) return TRUE; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86RandR12.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86RandR12.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86RandR12.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86RandR12.c 2017-03-15 18:05:25.000000000 +0000 @@ -40,6 +40,7 @@ #include #include +#include "xf86cmap.h" #include "xf86Crtc.h" #include "xf86RandR12.h" @@ -55,6 +56,13 @@ Rotation rotation; /* current mode */ Rotation supported_rotations; /* driver supported */ + /* Compatibility with colormaps and XF86VidMode's gamma */ + int palette_red_size; + int palette_green_size; + int palette_blue_size; + int palette_size; + LOCO *palette; + /* Used to wrap EnterVT so we can re-probe the outputs when a laptop unsuspends * (actually, any time that we switch back into our VT). * @@ -882,6 +890,9 @@ randrp->maxX = randrp->maxY = 0; + randrp->palette_size = 0; + randrp->palette = NULL; + dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp); #if RANDR_12_INTERFACE @@ -905,6 +916,7 @@ pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder; #endif + free(randrp->palette); free(randrp); } @@ -1154,7 +1166,8 @@ if (rotation != crtc->rotation) changed = TRUE; - if (crtc->current_scanout != randr_crtc->scanout_pixmap) + if (crtc->current_scanout != randr_crtc->scanout_pixmap || + crtc->current_scanout_back != randr_crtc->scanout_pixmap_back) changed = TRUE; transform = RRCrtcGetTransform(randr_crtc); @@ -1219,6 +1232,7 @@ xf86SaveModeContents(&crtc->desiredMode, &mode); crtc->desiredRotation = rotation; crtc->current_scanout = randr_crtc->scanout_pixmap; + crtc->current_scanout_back = randr_crtc->scanout_pixmap_back; if (transform) { crtc->desiredTransform = *transform; crtc->desiredTransformPresent = TRUE; @@ -1235,37 +1249,47 @@ return xf86RandR12CrtcNotify(randr_crtc); } -static Bool -xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +static void +xf86RandR12CrtcComputeGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) { + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); xf86CrtcPtr crtc = randr_crtc->devPrivate; + int gamma_slots; + CARD16 value; + int i, j; - if (crtc->funcs->gamma_set == NULL) - return FALSE; + gamma_slots = crtc->gamma_size / randrp->palette_red_size; + for (i = 0; i < randrp->palette_red_size; i++) { + value = randr_crtc->gammaRed[randrp->palette[i].red]; - if (!crtc->scrn->vtSema) - return TRUE; + for (j = 0; j < gamma_slots; j++) + crtc->gamma_red[i * gamma_slots + j] = value; + } - /* Realloc local gamma if needed. */ - if (randr_crtc->gammaSize != crtc->gamma_size) { - CARD16 *tmp_ptr; - - tmp_ptr = reallocarray(crtc->gamma_red, - randr_crtc->gammaSize, 3 * sizeof(CARD16)); - if (!tmp_ptr) - return FALSE; - crtc->gamma_red = tmp_ptr; - crtc->gamma_green = crtc->gamma_red + randr_crtc->gammaSize; - crtc->gamma_blue = crtc->gamma_green + randr_crtc->gammaSize; + gamma_slots = crtc->gamma_size / randrp->palette_green_size; + for (i = 0; i < randrp->palette_green_size; i++) { + value = randr_crtc->gammaGreen[randrp->palette[i].green]; + + for (j = 0; j < gamma_slots; j++) + crtc->gamma_green[i * gamma_slots + j] = value; } - crtc->gamma_size = randr_crtc->gammaSize; - memcpy(crtc->gamma_red, randr_crtc->gammaRed, - crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_green, randr_crtc->gammaGreen, - crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, - crtc->gamma_size * sizeof(CARD16)); + gamma_slots = crtc->gamma_size / randrp->palette_blue_size; + for (i = 0; i < randrp->palette_blue_size; i++) { + value = randr_crtc->gammaBlue[randrp->palette[i].blue]; + + for (j = 0; j < gamma_slots; j++) + crtc->gamma_blue[i * gamma_slots + j] = value; + } +} + +static void +xf86RandR12CrtcReloadGamma(RRCrtcPtr randr_crtc) +{ + xf86CrtcPtr crtc = randr_crtc->devPrivate; + + if (!crtc->scrn->vtSema || !crtc->funcs->gamma_set) + return; /* Only set it when the crtc is actually running. * Otherwise it will be set when it's activated. @@ -1273,40 +1297,140 @@ if (crtc->active) crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); +} + +static Bool +xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +{ + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + xf86CrtcPtr crtc = randr_crtc->devPrivate; + + if (crtc->funcs->gamma_set == NULL) + return FALSE; + + if (randrp->palette_size) { + xf86RandR12CrtcComputeGamma(pScreen, randr_crtc); + } else { + memcpy(crtc->gamma_red, randr_crtc->gammaRed, + crtc->gamma_size * sizeof(crtc->gamma_red[0])); + memcpy(crtc->gamma_green, randr_crtc->gammaGreen, + crtc->gamma_size * sizeof(crtc->gamma_green[0])); + memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, + crtc->gamma_size * sizeof(crtc->gamma_blue[0])); + } + + xf86RandR12CrtcReloadGamma(randr_crtc); return TRUE; } +static void +init_one_component(CARD16 *comp, unsigned size, float gamma) +{ + int i; + unsigned shift; + + for (shift = 0; (size << shift) < (1 << 16); shift++); + + if (gamma == 1.0) { + for (i = 0; i < size; i++) + comp[i] = i << shift; + } else { + for (i = 0; i < size; i++) + comp[i] = (CARD16) (pow((double) i / (double) (size - 1), + 1. / (double) gamma) * + (double) (size - 1) * (1 << shift)); + } +} + static Bool -xf86RandR12CrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +xf86RandR12CrtcInitGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, + float gamma_blue) { - xf86CrtcPtr crtc = randr_crtc->devPrivate; + unsigned size = crtc->randr_crtc->gammaSize; + CARD16 *red, *green, *blue; - if (!crtc->gamma_size) + if (!crtc->funcs->gamma_set && + (gamma_red != 1.0f || gamma_green != 1.0f || gamma_blue != 1.0f)) return FALSE; - if (!crtc->gamma_red || !crtc->gamma_green || !crtc->gamma_blue) + red = xallocarray(size, 3 * sizeof(CARD16)); + if (!red) return FALSE; - /* Realloc randr gamma if needed. */ - if (randr_crtc->gammaSize != crtc->gamma_size) { - CARD16 *tmp_ptr; + green = red + size; + blue = green + size; + + init_one_component(red, size, gamma_red); + init_one_component(green, size, gamma_green); + init_one_component(blue, size, gamma_blue); + + RRCrtcGammaSet(crtc->randr_crtc, red, green, blue); + free(red); + + return TRUE; +} + +static Bool +xf86RandR12OutputInitGamma(xf86OutputPtr output) +{ + XF86ConfMonitorPtr mon = output->conf_monitor; + float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; + + if (!mon) + return TRUE; + + /* Get configured values, where they exist. */ + if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX) + gamma_red = mon->mon_gamma_red; + + if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX) + gamma_green = mon->mon_gamma_green; + + if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX) + gamma_blue = mon->mon_gamma_blue; + + /* Don't set gamma 1.0 if another cloned output on this CRTC already set a + * different gamma + */ + if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, + "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", + output->name, gamma_red, gamma_green, gamma_blue); + return xf86RandR12CrtcInitGamma(output->crtc, gamma_red, gamma_green, + gamma_blue); + } + + return TRUE; +} + +Bool +xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int o, c; - tmp_ptr = reallocarray(randr_crtc->gammaRed, - crtc->gamma_size, 3 * sizeof(CARD16)); - if (!tmp_ptr) + /* Set default gamma for all CRTCs + * This is done to avoid problems later on with cloned outputs + */ + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + if (!RRCrtcGammaSetSize(crtc->randr_crtc, gammaSize) || + !xf86RandR12CrtcInitGamma(crtc, 1.0f, 1.0f, 1.0f)) return FALSE; - randr_crtc->gammaRed = tmp_ptr; - randr_crtc->gammaGreen = randr_crtc->gammaRed + crtc->gamma_size; - randr_crtc->gammaBlue = randr_crtc->gammaGreen + crtc->gamma_size; - } - randr_crtc->gammaSize = crtc->gamma_size; - memcpy(randr_crtc->gammaRed, crtc->gamma_red, - crtc->gamma_size * sizeof(CARD16)); - memcpy(randr_crtc->gammaGreen, crtc->gamma_green, - crtc->gamma_size * sizeof(CARD16)); - memcpy(randr_crtc->gammaBlue, crtc->gamma_blue, - crtc->gamma_size * sizeof(CARD16)); + } + + /* Set initial gamma per monitor configuration + */ + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr output = config->output[o]; + + if (output->crtc && + !xf86RandR12OutputInitGamma(output)) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Initial gamma correction for output %s: failed.\n", + output->name); + } return TRUE; } @@ -1531,7 +1655,6 @@ xf86CrtcPtr crtc = config->crtc[c]; crtc->randr_crtc = RRCrtcCreate(pScreen, crtc); - RRCrtcGammaSetSize(crtc->randr_crtc, 256); } /* * Configure outputs @@ -1626,6 +1749,7 @@ { int c; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + rrScrPrivPtr rp = rrGetScrPriv(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); if (xf86RandR12Key == NULL) @@ -1638,6 +1762,13 @@ config->maxWidth, config->maxHeight); xf86RandR12CreateMonitors(pScreen); + + if (!pScreen->isGPU) { + rp->primaryOutput = config->output[0]->randr_output; + RROutputChanged(rp->primaryOutput, FALSE); + rp->layoutChanged = TRUE; + } + return TRUE; } @@ -1738,53 +1869,84 @@ } /* - * Compatibility with XF86VidMode's gamma changer. This necessarily clobbers - * any per-crtc setup. You asked for it... + * Compatibility with colormaps and XF86VidMode's gamma */ - -static void -gamma_to_ramp(float gamma, CARD16 *ramp, int size) +void +xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, + LOCO *colors, VisualPtr pVisual) { - int i; + ScreenPtr pScreen = pScrn->pScreen; + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int reds, greens, blues, index, palette_size; + int c, i; - for (i = 0; i < size; i++) { - if (gamma == 1.0) - ramp[i] = i | i << 8; - else - ramp[i] = - (CARD16) (pow((double) i / (double) (size - 1), 1. / gamma) - * (double) (size - 1) * 257); + if (pVisual->class == TrueColor || pVisual->class == DirectColor) { + reds = (pVisual->redMask >> pVisual->offsetRed) + 1; + greens = (pVisual->greenMask >> pVisual->offsetGreen) + 1; + blues = (pVisual->blueMask >> pVisual->offsetBlue) + 1; + } else { + reds = greens = blues = pVisual->ColormapEntries; + } + + palette_size = max(reds, max(greens, blues)); + + if (randrp->palette_size != palette_size) { + randrp->palette = reallocarray(randrp->palette, palette_size, + sizeof(colors[0])); + if (!randrp->palette) { + randrp->palette_size = 0; + return; + } + + randrp->palette_size = palette_size; + } + randrp->palette_red_size = reds; + randrp->palette_green_size = greens; + randrp->palette_blue_size = blues; + + for (i = 0; i < numColors; i++) { + index = indices[i]; + + if (index < reds) + randrp->palette[index].red = colors[index].red; + if (index < greens) + randrp->palette[index].green = colors[index].green; + if (index < blues) + randrp->palette[index].blue = colors[index].blue; + } + + for (c = 0; c < config->num_crtc; c++) { + RRCrtcPtr randr_crtc = config->crtc[c]->randr_crtc; + + xf86RandR12CrtcComputeGamma(pScreen, randr_crtc); + xf86RandR12CrtcReloadGamma(randr_crtc); } } +/* + * Compatibility pScrn->ChangeGamma provider for ddx drivers which do not call + * xf86HandleColormaps(). Note such drivers really should be fixed to call + * xf86HandleColormaps() as this clobbers the per-CRTC gamma ramp of the CRTC + * assigned to the RandR compatibility output. + */ static int xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { - CARD16 *points, *red, *green, *blue; - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); + RRCrtcPtr randr_crtc = xf86CompatRRCrtc(pScrn); int size; - if (!crtc) + if (!randr_crtc) return Success; - size = max(0, crtc->gammaSize); + size = max(0, randr_crtc->gammaSize); if (!size) return Success; - points = calloc(size, 3 * sizeof(CARD16)); - if (!points) - return BadAlloc; - - red = points; - green = points + size; - blue = points + 2 * size; - - gamma_to_ramp(gamma.red, red, size); - gamma_to_ramp(gamma.green, green, size); - gamma_to_ramp(gamma.blue, blue, size); - RRCrtcGammaSet(crtc, red, green, blue); - - free(points); + init_one_component(randr_crtc->gammaRed, size, gamma.red); + init_one_component(randr_crtc->gammaGreen, size, gamma.green); + init_one_component(randr_crtc->gammaBlue, size, gamma.blue); + xf86RandR12CrtcSetGamma(xf86ScrnToScreen(pScrn), randr_crtc); pScrn->gamma = gamma; @@ -1811,7 +1973,7 @@ /* reload gamma */ for (i = 0; i < rp->numCrtcs; i++) - xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]); + xf86RandR12CrtcReloadGamma(rp->crtcs[i]); return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ } @@ -1836,10 +1998,7 @@ { if (!source_provider) { if (provider->output_source) { - ScreenPtr cmScreen = pScreen->current_master; - xf86DetachOutputGPU(pScreen); - AttachUnboundGPU(cmScreen, pScreen); } provider->output_source = NULL; return TRUE; @@ -1850,7 +2009,6 @@ SetRootClip(source_provider->pScreen, ROOT_CLIP_NONE); - DetachUnboundGPU(pScreen); AttachOutputGPU(source_provider->pScreen, pScreen); provider->output_source = source_provider; @@ -1865,9 +2023,7 @@ { if (!sink_provider) { if (provider->offload_sink) { - ScreenPtr cmScreen = pScreen->current_master; xf86DetachOutputGPU(pScreen); - AttachUnboundGPU(cmScreen, pScreen); } provider->offload_sink = NULL; @@ -1877,7 +2033,6 @@ if (provider->offload_sink == sink_provider) return TRUE; - DetachUnboundGPU(pScreen); AttachOffloadGPU(sink_provider->pScreen, pScreen); provider->offload_sink = sink_provider; @@ -1956,12 +2111,12 @@ config->randr_provider->offload_sink = NULL; RRSetChanged(screen); } - else if (config->randr_provider->output_source) { + if (config->randr_provider->output_source) { xf86DetachOutputGPU(screen); config->randr_provider->output_source = NULL; RRSetChanged(screen); } - else if (screen->current_master) + if (screen->current_master) DetachUnboundGPU(screen); } config->randr_provider = NULL; @@ -1973,13 +2128,11 @@ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - int i; rp->rrGetInfo = xf86RandR12GetInfo12; rp->rrScreenSetSize = xf86RandR12ScreenSetSize; rp->rrCrtcSet = xf86RandR12CrtcSet; rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma; - rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma; rp->rrOutputSetProperty = xf86RandR12OutputSetProperty; rp->rrOutputValidateMode = xf86RandR12OutputValidateMode; #if RANDR_13_INTERFACE @@ -2016,9 +2169,10 @@ */ if (!xf86RandR12SetInfo12(pScreen)) return FALSE; - for (i = 0; i < rp->numCrtcs; i++) { - xf86RandR12CrtcGetGamma(pScreen, rp->crtcs[i]); - } + + if (!xf86RandR12InitGamma(pScrn, 256)) + return FALSE; + return TRUE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86RandR12.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86RandR12.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86RandR12.h 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86RandR12.h 2017-03-15 18:05:25.000000000 +0000 @@ -40,4 +40,9 @@ extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86RandR12TellChanged(ScreenPtr pScreen); +extern void xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors, + int *indices, LOCO *colors, + VisualPtr pVisual); +extern Bool xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize); + #endif /* _XF86_RANDR_H_ */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Rotate.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Rotate.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/modes/xf86Rotate.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/modes/xf86Rotate.c 2017-03-15 18:05:25.000000000 +0000 @@ -57,7 +57,7 @@ BoxPtr b = RegionRects(region); XID include_inferiors = IncludeInferiors; - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) return; src = CreatePicture(None, @@ -221,8 +221,7 @@ } static void -xf86RotateBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -235,7 +234,7 @@ xf86RotateRedisplay(pScreen); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); /* Re-wrap if we still need this hook */ if (xf86_config->rotation_damage != NULL) { @@ -387,7 +386,7 @@ new_height = 0; } else { - if (crtc->driverIsPerformingTransform) { + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) { xf86RotateDestroy(crtc); } else { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bsd/bsd_init.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bsd/bsd_init.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bsd/bsd_init.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bsd/bsd_init.c 2017-03-15 18:05:25.000000000 +0000 @@ -269,7 +269,7 @@ "xf86OpenConsole: VT_WAITACTIVE failed\n"); } - signal(SIGUSR1, xf86VTRequest); + OsSignal(SIGUSR1, xf86VTRequest); vtmode.mode = VT_PROCESS; vtmode.relsig = SIGUSR1; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bsd/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bsd/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bsd/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bsd/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/os-support/bsd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -377,6 +378,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -407,7 +411,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -502,6 +509,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bus/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bus/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bus/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bus/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -95,9 +95,10 @@ subdir = hw/xfree86/os-support/bus ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -393,6 +394,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -423,7 +427,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -518,6 +525,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bus/Sbus.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bus/Sbus.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/bus/Sbus.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/bus/Sbus.c 2017-03-15 18:05:25.000000000 +0000 @@ -31,7 +31,7 @@ #include #include #include -#ifdef sun +#ifdef __sun #include #endif #include "xf86.h" @@ -173,7 +173,7 @@ break; } fclose(f); -#elif defined(sun) +#elif defined(__sun) struct utsname buffer; if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u")) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/hurd/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/hurd/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/hurd/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/hurd/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/os-support/hurd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/linux/lnx_init.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/linux/lnx_init.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/linux/lnx_init.c 2016-07-19 17:13:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/linux/lnx_init.c 2017-03-15 18:05:25.000000000 +0000 @@ -239,7 +239,7 @@ FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", strerror(errno)); - signal(SIGUSR1, xf86VTRequest); + OsSignal(SIGUSR1, xf86VTRequest); VT.mode = VT_PROCESS; VT.relsig = SIGUSR1; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/linux/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/linux/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/linux/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/linux/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -95,9 +95,10 @@ subdir = hw/xfree86/os-support/linux ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -379,6 +380,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -409,7 +413,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -505,6 +512,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/os-support ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -422,6 +423,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -452,7 +456,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -547,6 +554,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/misc/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/misc/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/misc/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/misc/Makefile.in 2017-03-15 18:05:43.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/os-support/misc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -353,6 +354,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -383,7 +387,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -478,6 +485,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/posix_tty.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/posix_tty.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/posix_tty.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/posix_tty.c 2017-03-15 18:05:25.000000000 +0000 @@ -57,6 +57,7 @@ #endif #include +#include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" @@ -387,26 +388,19 @@ int xf86WaitForInput(int fd, int timeout) { - fd_set readfds; - struct timeval to; int r; + struct pollfd poll_fd; - FD_ZERO(&readfds); + poll_fd.fd = fd; + poll_fd.events = POLLIN; if (fd >= 0) { - FD_SET(fd, &readfds); - } - - to.tv_sec = timeout / 1000000; - to.tv_usec = timeout % 1000000; - - if (fd >= 0) { - SYSCALL(r = select(FD_SETSIZE, &readfds, NULL, NULL, &to)); + SYSCALL(r = xserver_poll(&poll_fd, 1, timeout)); } else { - SYSCALL(r = select(FD_SETSIZE, NULL, NULL, NULL, &to)); + SYSCALL(r = xserver_poll(&poll_fd, 0, timeout)); } - xf86ErrorFVerb(9, "select returned %d\n", r); + xf86ErrorFVerb(9, "poll returned %d\n", r); return r; } @@ -423,8 +417,7 @@ int xf86FlushInput(int fd) { - fd_set fds; - struct timeval timeout; + struct pollfd poll_fd; /* this needs to be big enough to flush an evdev event. */ char c[256]; @@ -432,15 +425,11 @@ if (tcflush(fd, TCIFLUSH) == 0) return 0; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) { + poll_fd.fd = fd; + poll_fd.events = POLLIN; + while (xserver_poll(&poll_fd, 1, 0) > 0) { if (read(fd, &c, sizeof(c)) < 1) return 0; - FD_ZERO(&fds); - FD_SET(fd, &fds); } return 0; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/sigio.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/sigio.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/sigio.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/sigio.c 2017-03-15 18:05:25.000000000 +0000 @@ -57,6 +57,7 @@ #endif #include +#include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" @@ -83,8 +84,36 @@ static Xf86SigIOFunc xf86SigIOFuncs[MAX_FUNCS]; static int xf86SigIOMax; -static int xf86SigIOMaxFd; -static fd_set xf86SigIOMask; +static struct pollfd *xf86SigIOFds; +static int xf86SigIONum; + +static Bool +xf86SigIOAdd(int fd) +{ + struct pollfd *n; + + n = realloc(xf86SigIOFds, (xf86SigIONum + 1) * sizeof (struct pollfd)); + if (!n) + return FALSE; + + n[xf86SigIONum].fd = fd; + n[xf86SigIONum].events = POLLIN; + xf86SigIONum++; + xf86SigIOFds = n; + return TRUE; +} + +static void +xf86SigIORemove(int fd) +{ + int i; + for (i = 0; i < xf86SigIONum; i++) + if (xf86SigIOFds[i].fd == fd) { + memmove(&xf86SigIOFds[i], &xf86SigIOFds[i+1], (xf86SigIONum - i - 1) * sizeof (struct pollfd)); + xf86SigIONum--; + break; + } +} /* * SIGIO gives no way of discovering which fd signalled, select @@ -93,24 +122,22 @@ static void xf86SIGIO(int sig) { - int i; - fd_set ready; - struct timeval to; + int i, f; int save_errno = errno; /* do not clobber the global errno */ int r; inSignalContext = TRUE; - ready = xf86SigIOMask; - to.tv_sec = 0; - to.tv_usec = 0; - SYSCALL(r = select(xf86SigIOMaxFd, &ready, 0, 0, &to)); - for (i = 0; r > 0 && i < xf86SigIOMax; i++) - if (xf86SigIOFuncs[i].f && FD_ISSET(xf86SigIOFuncs[i].fd, &ready)) { - (*xf86SigIOFuncs[i].f) (xf86SigIOFuncs[i].fd, - xf86SigIOFuncs[i].closure); + SYSCALL(r = xserver_poll(xf86SigIOFds, xf86SigIONum, 0)); + for (f = 0; r > 0 && f < xf86SigIONum; f++) { + if (xf86SigIOFds[f].revents & POLLIN) { + for (i = 0; i < xf86SigIOMax; i++) + if (xf86SigIOFuncs[i].f && xf86SigIOFuncs[i].fd == xf86SigIOFds[f].fd) + (*xf86SigIOFuncs[i].f) (xf86SigIOFuncs[i].fd, + xf86SigIOFuncs[i].closure); r--; } + } if (r > 0) { xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r); } @@ -130,6 +157,26 @@ return S_ISFIFO(buf.st_mode); } +static void +block_sigio(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGIO); + xthread_sigmask(SIG_BLOCK, &set, NULL); +} + +static void +release_sigio(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGIO); + xthread_sigmask(SIG_UNBLOCK, &set, NULL); +} + int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) { @@ -145,7 +192,7 @@ if (!xf86SigIOFuncs[i].f) { if (xf86IsPipe(fd)) return 0; - OsBlockSIGIO(); + block_sigio(); #ifdef O_ASYNC if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) { xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n", @@ -173,7 +220,7 @@ } #endif if (!installed) { - OsReleaseSIGIO(); + release_sigio(); return 0; } sigemptyset(&sa.sa_mask); @@ -186,10 +233,8 @@ xf86SigIOFuncs[i].f = f; if (i >= xf86SigIOMax) xf86SigIOMax = i + 1; - if (fd >= xf86SigIOMaxFd) - xf86SigIOMaxFd = fd + 1; - FD_SET(fd, &xf86SigIOMask); - OsReleaseSIGIO(); + xf86SigIOAdd(fd); + release_sigio(); return 1; } /* Allow overwriting of the closure and callback */ @@ -209,14 +254,12 @@ struct sigaction osa; int i; int max; - int maxfd; int ret; if (!xf86Info.useSIGIO) return 0; max = 0; - maxfd = -1; ret = 0; for (i = 0; i < MAX_FUNCS; i++) { if (xf86SigIOFuncs[i].f) { @@ -224,13 +267,11 @@ xf86SigIOFuncs[i].f = 0; xf86SigIOFuncs[i].fd = 0; xf86SigIOFuncs[i].closure = 0; - FD_CLR(fd, &xf86SigIOMask); + xf86SigIORemove(fd); ret = 1; } else { max = i + 1; - if (xf86SigIOFuncs[i].fd >= maxfd) - maxfd = xf86SigIOFuncs[i].fd + 1; } } } @@ -247,7 +288,6 @@ } #endif xf86SigIOMax = max; - xf86SigIOMaxFd = maxfd; if (!max) { sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); @@ -258,34 +298,3 @@ } return ret; } - -int -xf86BlockSIGIO(void) -{ - return OsBlockSIGIO(); -} - -void -xf86UnblockSIGIO(int wasset) -{ - OsReleaseSIGIO(); -} - -void -xf86AssertBlockedSIGIO(char *where) -{ - sigset_t set, old; - - sigemptyset(&set); - sigprocmask(SIG_BLOCK, &set, &old); - if (!sigismember(&old, SIGIO)) - xf86Msg(X_ERROR, "SIGIO not blocked at %s\n", where); -} - -/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ - -int -xf86SIGIOSupported(void) -{ - return 1; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/sigiostubs.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/sigiostubs.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/sigiostubs.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/sigiostubs.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,26 +45,3 @@ { return 0; } - -int -xf86BlockSIGIO(void) -{ - return 0; -} - -void -xf86UnblockSIGIO(int wasset) -{ -} - -void -xf86AssertBlockedSIGIO(char *where) -{ -} - -/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ -Bool -xf86SIGIOSupported() -{ - return FALSE; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/VTsw_usl.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/VTsw_usl.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/shared/VTsw_usl.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/shared/VTsw_usl.c 2017-03-15 18:05:25.000000000 +0000 @@ -43,7 +43,7 @@ void xf86VTRequest(int sig) { - signal(sig, (void (*)(int)) xf86VTRequest); + OsSignal(sig, (void (*)(int)) xf86VTRequest); xf86Info.vtRequestsPending = TRUE; return; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/solaris/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/solaris/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/solaris/Makefile.in 2016-07-19 17:27:28.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/solaris/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/os-support/solaris ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -408,6 +409,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -438,7 +442,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -533,6 +540,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/solaris/sun_bell.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/solaris/sun_bell.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/solaris/sun_bell.c 2016-07-19 15:12:15.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/solaris/sun_bell.c 2017-03-15 18:05:25.000000000 +0000 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "xf86.h" #include "xf86Priv.h" @@ -163,7 +163,7 @@ /* sleep a little to allow audio buffer to drain */ naptime = BELL_MS * i; - poll(NULL, 0, naptime); + xserver_poll(NULL, 0, naptime); i = ((sizeof(samples) * iovcnt) - written) % sizeof(samples); iovcnt = 0; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/stub/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/stub/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/stub/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/stub/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/os-support/stub ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/xf86_OSlib.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/xf86_OSlib.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/xf86_OSlib.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/xf86_OSlib.h 2017-03-15 18:05:25.000000000 +0000 @@ -84,7 +84,7 @@ /* SYSV386 (SVR3, SVR4), including Solaris */ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ - (defined(sun) || defined(__i386__)) + (defined(__sun) || defined(__i386__)) #include #include #include @@ -94,21 +94,21 @@ #include #if defined(_NEED_SYSI86) -#if !(defined (sun) && defined (SVR4)) +#if !(defined (__sun) && defined (SVR4)) #include #include #include #endif #include #include -#if defined(SVR4) && !defined(sun) +#if defined(SVR4) && !defined(__sun) #include -#endif /* SVR4 && !sun */ +#endif /* SVR4 && !__sun */ /* V86SC_IOPL was moved to on Solaris 7 and later */ #if !defined(V86SC_IOPL) /* Solaris 7 or later? */ #include /* Nope */ #endif -#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) +#if defined(__sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) #include #endif #endif /* _NEED_SYSI86 */ @@ -122,14 +122,14 @@ #include /* MMAP driver header */ #endif -#if !defined(sun) || defined(HAVE_SYS_VT_H) +#if !defined(__sun) || defined(HAVE_SYS_VT_H) #define HAS_USL_VTS #endif -#if !defined(sun) +#if !defined(__sun) #include #endif #if defined(HAS_USL_VTS) -#if !defined(sun) +#if !defined(__sun) #include #endif #include @@ -139,7 +139,7 @@ extern _X_HIDDEN void xf86VTRelease(int); #endif -#if defined(sun) +#if defined(__sun) #include extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; @@ -156,7 +156,7 @@ #define LED_NUM LED_NUM_LOCK #define LED_SCR LED_SCROLL_LOCK #define LED_COMP LED_COMPOSE -#endif /* sun */ +#endif /* __sun */ #if !defined(VT_ACKACQ) #define VT_ACKACQ 2 @@ -164,7 +164,7 @@ #if defined(SVR4) #include -#if !(defined(sun) && defined (SVR4)) +#if !(defined(__sun) && defined (SVR4)) #define DEV_MEM "/dev/pmem" #endif #define CLEARDTR_SUPPORT diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/xf86_OSproc.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/xf86_OSproc.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/os-support/xf86_OSproc.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/os-support/xf86_OSproc.h 2017-03-15 18:05:25.000000000 +0000 @@ -169,10 +169,6 @@ extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *); extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd); -extern _X_EXPORT int xf86BlockSIGIO(void); -extern _X_EXPORT void xf86UnblockSIGIO(int); -extern _X_EXPORT void xf86AssertBlockedSIGIO(char *); -extern _X_EXPORT Bool xf86SIGIOSupported(void); #ifdef XF86_OS_PRIVS typedef void (*PMClose) (void); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/configProcs.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/configProcs.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/configProcs.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/configProcs.h 2017-03-15 18:05:25.000000000 +0000 @@ -102,9 +102,9 @@ void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr); /* scan.c */ -int xf86getToken(xf86ConfigSymTabRec * tab); +int xf86getToken(const xf86ConfigSymTabRec * tab); int xf86getSubToken(char **comment); -int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab); +int xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab); void xf86unGetToken(int token); char *xf86tokenString(void); void @@ -116,7 +116,7 @@ void xf86setSection(const char *section); int -xf86getStringToken(xf86ConfigSymTabRec * tab); +xf86getStringToken(const xf86ConfigSymTabRec * tab); /* write.c */ /* DRI.c */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Device.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Device.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Device.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Device.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,8 +61,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec DeviceTab[] = { +static const xf86ConfigSymTabRec DeviceTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/DRI.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/DRI.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/DRI.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/DRI.c 2017-03-15 18:05:25.000000000 +0000 @@ -37,7 +37,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec DRITab[] = { +static const xf86ConfigSymTabRec DRITab[] = { {ENDSECTION, "endsection"}, {GROUP, "group"}, {MODE, "mode"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Extensions.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Extensions.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Extensions.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Extensions.c 2017-03-15 18:05:25.000000000 +0000 @@ -41,7 +41,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec ExtensionsTab[] = { +static const xf86ConfigSymTabRec ExtensionsTab[] = { {ENDSECTION, "endsection"}, {OPTION, "option"}, {-1, ""}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Files.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Files.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Files.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Files.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec FilesTab[] = { +static const xf86ConfigSymTabRec FilesTab[] = { {ENDSECTION, "endsection"}, {FONTPATH, "fontpath"}, {MODULEPATH, "modulepath"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Flags.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Flags.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Flags.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Flags.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,7 +63,7 @@ #include "optionstr.h" -static xf86ConfigSymTabRec ServerFlagsTab[] = { +static const xf86ConfigSymTabRec ServerFlagsTab[] = { {ENDSECTION, "endsection"}, {NOTRAPSIGNALS, "notrapsignals"}, {DONTZAP, "dontzap"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Input.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Input.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Input.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Input.c 2017-03-15 18:05:25.000000000 +0000 @@ -62,8 +62,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec InputTab[] = { +static const xf86ConfigSymTabRec InputTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/InputClass.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/InputClass.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/InputClass.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/InputClass.c 2017-03-15 18:05:25.000000000 +0000 @@ -34,8 +34,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec InputClassTab[] = { +static const xf86ConfigSymTabRec InputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -53,8 +52,18 @@ {MATCH_IS_POINTER, "matchispointer"}, {MATCH_IS_JOYSTICK, "matchisjoystick"}, {MATCH_IS_TABLET, "matchistablet"}, + {MATCH_IS_TABLET_PAD, "matchistabletpad"}, {MATCH_IS_TOUCHPAD, "matchistouchpad"}, {MATCH_IS_TOUCHSCREEN, "matchistouchscreen"}, + {NOMATCH_PRODUCT, "nomatchproduct"}, + {NOMATCH_VENDOR, "nomatchvendor"}, + {NOMATCH_DEVICE_PATH, "nomatchdevicepath"}, + {NOMATCH_OS, "nomatchos"}, + {NOMATCH_PNPID, "nomatchpnpid"}, + {NOMATCH_USBID, "nomatchusbid"}, + {NOMATCH_DRIVER, "nomatchdriver"}, + {NOMATCH_TAG, "nomatchtag"}, + {NOMATCH_LAYOUT, "nomatchlayout"}, {-1, ""}, }; @@ -138,13 +147,19 @@ #define TOKEN_SEP "|" +enum MatchType { + MATCH_NORMAL, + MATCH_NEGATED, +}; + static void -add_group_entry(struct xorg_list *head, char **values) +add_group_entry(struct xorg_list *head, char **values, enum MatchType type) { xf86MatchGroup *group; group = malloc(sizeof(*group)); if (group) { + group->is_negated = (type == MATCH_NEGATED); group->values = values; xorg_list_add(&group->entry, head); } @@ -155,11 +170,12 @@ { int has_ident = FALSE; int token; + enum MatchType matchtype; parsePrologue(XF86ConfInputClassPtr, XF86ConfInputClassRec) - /* Initialize MatchGroup lists */ - xorg_list_init(&ptr->match_product); + /* Initialize MatchGroup lists */ + xorg_list_init(&ptr->match_product); xorg_list_init(&ptr->match_vendor); xorg_list_init(&ptr->match_device); xorg_list_init(&ptr->match_os); @@ -170,6 +186,8 @@ xorg_list_init(&ptr->match_layout); while ((token = xf86getToken(InputClassTab)) != ENDSECTION) { + matchtype = MATCH_NORMAL; + switch (token) { case COMMENT: ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str); @@ -195,65 +213,103 @@ case OPTION: ptr->option_lst = xf86parseOption(ptr->option_lst); break; + case NOMATCH_PRODUCT: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_PRODUCT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchProduct"); add_group_entry(&ptr->match_product, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_VENDOR: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_VENDOR: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchVendor"); add_group_entry(&ptr->match_vendor, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_DEVICE_PATH: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_DEVICE_PATH: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDevicePath"); add_group_entry(&ptr->match_device, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_OS: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_OS: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchOS"); - add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str, + TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_PNPID: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_PNPID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchPnPID"); add_group_entry(&ptr->match_pnpid, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_USBID: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_USBID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchUSBID"); add_group_entry(&ptr->match_usbid, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_DRIVER: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDriver"); add_group_entry(&ptr->match_driver, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_TAG: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_TAG: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchTag"); - add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str, + TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_LAYOUT: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_LAYOUT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchLayout"); add_group_entry(&ptr->match_layout, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; case MATCH_IS_KEYBOARD: @@ -291,6 +347,14 @@ if (!ptr->is_tablet.set) Error(BOOL_MSG, "MatchIsTablet"); break; + case MATCH_IS_TABLET_PAD: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "MatchIsTabletPad"); + ptr->is_tablet_pad.set = xf86getBoolValue(&ptr->is_tablet_pad.val, xf86_lex_val.str); + free(xf86_lex_val.str); + if (!ptr->is_tablet_pad.set) + Error(BOOL_MSG, "MatchIsTabletPad"); + break; case MATCH_IS_TOUCHPAD: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsTouchpad"); @@ -419,6 +483,9 @@ if (ptr->is_tablet.set) fprintf(cf, "\tIsTablet \"%s\"\n", ptr->is_tablet.val ? "yes" : "no"); + if (ptr->is_tablet_pad.set) + fprintf(cf, "\tIsTabletPad \"%s\"\n", + ptr->is_tablet_pad.val ? "yes" : "no"); if (ptr->is_touchpad.set) fprintf(cf, "\tIsTouchpad \"%s\"\n", ptr->is_touchpad.val ? "yes" : "no"); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Layout.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Layout.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Layout.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Layout.c 2017-03-15 18:05:25.000000000 +0000 @@ -66,7 +66,7 @@ extern int xf86CheckBoolOption(void *optlist, const char *name, int deflt); -static xf86ConfigSymTabRec LayoutTab[] = { +static const xf86ConfigSymTabRec LayoutTab[] = { {ENDSECTION, "endsection"}, {SCREEN, "screen"}, {IDENTIFIER, "identifier"}, @@ -77,7 +77,7 @@ {-1, ""}, }; -static xf86ConfigSymTabRec AdjTab[] = { +static const xf86ConfigSymTabRec AdjTab[] = { {RIGHTOF, "rightof"}, {LEFTOF, "leftof"}, {ABOVE, "above"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/parser ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -387,6 +388,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Module.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Module.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Module.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Module.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,13 +61,13 @@ #include "Configint.h" -static xf86ConfigSymTabRec SubModuleTab[] = { +static const xf86ConfigSymTabRec SubModuleTab[] = { {ENDSUBSECTION, "endsubsection"}, {OPTION, "option"}, {-1, ""}, }; -static xf86ConfigSymTabRec ModuleTab[] = { +static const xf86ConfigSymTabRec ModuleTab[] = { {ENDSECTION, "endsection"}, {LOAD, "load"}, {DISABLE, "disable"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Monitor.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Monitor.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Monitor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Monitor.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec MonitorTab[] = { +static const xf86ConfigSymTabRec MonitorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, @@ -77,7 +77,7 @@ {-1, ""}, }; -static xf86ConfigSymTabRec ModesTab[] = { +static const xf86ConfigSymTabRec ModesTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MODELINE, "modeline"}, @@ -85,7 +85,7 @@ {-1, ""}, }; -static xf86ConfigSymTabRec TimingTab[] = { +static const xf86ConfigSymTabRec TimingTab[] = { {TT_INTERLACE, "interlace"}, {TT_PHSYNC, "+hsync"}, {TT_NHSYNC, "-hsync"}, @@ -101,7 +101,7 @@ {-1, ""}, }; -static xf86ConfigSymTabRec ModeTab[] = { +static const xf86ConfigSymTabRec ModeTab[] = { {DOTCLOCK, "dotclock"}, {HTIMINGS, "htimings"}, {VTIMINGS, "vtimings"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/OutputClass.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/OutputClass.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/OutputClass.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/OutputClass.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,8 +32,7 @@ #include "xf86tokens.h" #include "Configint.h" -static -xf86ConfigSymTabRec OutputClassTab[] = { +static const xf86ConfigSymTabRec OutputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {DRIVER, "driver"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Pointer.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Pointer.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Pointer.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Pointer.c 2017-03-15 18:05:25.000000000 +0000 @@ -62,7 +62,7 @@ #include "Xprintf.h" -static xf86ConfigSymTabRec PointerTab[] = { +static const xf86ConfigSymTabRec PointerTab[] = { {PROTOCOL, "protocol"}, {EMULATE3, "emulate3buttons"}, {EM3TIMEOUT, "emulate3timeout"}, @@ -83,7 +83,7 @@ {-1, ""}, }; -static xf86ConfigSymTabRec ZMapTab[] = { +static const xf86ConfigSymTabRec ZMapTab[] = { {XAXIS, "x"}, {YAXIS, "y"}, {-1, ""}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/read.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/read.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/read.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/read.c 2017-03-15 18:05:25.000000000 +0000 @@ -56,12 +56,13 @@ #include #endif +#include "xf86Config.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" -static xf86ConfigSymTabRec TopLevelTab[] = { +static const xf86ConfigSymTabRec TopLevelTab[] = { {SECTION, "section"}, {-1, ""}, }; @@ -91,7 +92,7 @@ int token; XF86ConfigPtr ptr = NULL; - if ((ptr = calloc(1, sizeof(XF86ConfigRec))) == NULL) { + if ((ptr = xf86allocateConfig()) == NULL) { return NULL; } @@ -270,6 +271,19 @@ return (!(last_1 == last_2)); } +/* + * Conditionally allocate config struct, but only allocate it + * if it's not already there. In either event, return the pointer + * to the global config struct. + */ +XF86ConfigPtr xf86allocateConfig(void) +{ + if (!xf86configptr) { + xf86configptr = calloc(1, sizeof(XF86ConfigRec)); + } + return xf86configptr; +} + void xf86freeConfig(XF86ConfigPtr p) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/scan.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/scan.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/scan.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/scan.c 2017-03-15 18:05:25.000000000 +0000 @@ -87,8 +87,6 @@ #define CONFIG_BUF_LEN 1024 #define CONFIG_MAX_FILES 64 -static int StringToToken(const char *, xf86ConfigSymTabRec *); - static struct { FILE *file; char *path; @@ -241,13 +239,25 @@ return ret; } +static int +StringToToken(const char *str, const xf86ConfigSymTabRec * tab) +{ + int i; + + for (i = 0; tab[i].token != -1; i++) { + if (!xf86nameCompare(tab[i].name, str)) + return tab[i].token; + } + return ERROR_TOKEN; +} + /* * xf86getToken -- * Read next Token from the config file. Handle the global variable * pushToken. */ int -xf86getToken(xf86ConfigSymTabRec * tab) +xf86getToken(const xf86ConfigSymTabRec * tab) { int c, i; @@ -431,14 +441,8 @@ /* * Joop, at last we have to lookup the token ... */ - if (tab) { - i = 0; - while (tab[i].token != -1) - if (xf86nameCompare(configRBuf, tab[i].name) == 0) - return tab[i].token; - else - i++; - } + if (tab) + return StringToToken(configRBuf, tab); return ERROR_TOKEN; /* Error catcher */ } @@ -460,7 +464,7 @@ /*NOTREACHED*/} int -xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab) +xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab) { int token; @@ -1023,23 +1027,11 @@ * Lookup a string if it is actually a token in disguise. */ int -xf86getStringToken(xf86ConfigSymTabRec * tab) +xf86getStringToken(const xf86ConfigSymTabRec * tab) { return StringToToken(xf86_lex_val.str, tab); } -static int -StringToToken(const char *str, xf86ConfigSymTabRec * tab) -{ - int i; - - for (i = 0; tab[i].token != -1; i++) { - if (!xf86nameCompare(tab[i].name, str)) - return tab[i].token; - } - return ERROR_TOKEN; -} - /* * Compare two names. The characters '_', ' ', and '\t' are ignored * in the comparison. diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Screen.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Screen.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Screen.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Screen.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec DisplayTab[] = { +static const xf86ConfigSymTabRec DisplayTab[] = { {ENDSUBSECTION, "endsubsection"}, {MODES, "modes"}, {VIEWPORT, "viewport"}, @@ -222,7 +222,7 @@ #undef CLEANUP -static xf86ConfigSymTabRec ScreenTab[] = { +static const xf86ConfigSymTabRec ScreenTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MATCHSEAT, "matchseat"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Vendor.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Vendor.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Vendor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Vendor.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec VendorSubTab[] = { +static const xf86ConfigSymTabRec VendorSubTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -129,7 +129,7 @@ #undef CLEANUP -static xf86ConfigSymTabRec VendorTab[] = { +static const xf86ConfigSymTabRec VendorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Video.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Video.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/Video.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/Video.c 2017-03-15 18:05:25.000000000 +0000 @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec VideoPortTab[] = { +static const xf86ConfigSymTabRec VideoPortTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -128,7 +128,7 @@ #undef CLEANUP -static xf86ConfigSymTabRec VideoAdaptorTab[] = { +static const xf86ConfigSymTabRec VideoAdaptorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/write.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/write.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/write.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/write.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,7 +63,6 @@ #include #include #include -#include #include #if defined(HAVE_SETEUID) && defined(_POSIX_SAVED_IDS) && _POSIX_SAVED_IDS > 0 @@ -73,14 +72,7 @@ #define HAS_NO_UIDS #endif -#ifdef HAS_NO_UIDS -#define doWriteConfigFile xf86writeConfigFile -#define Local /**/ -#else -#define Local static -#endif - -Local int +static int doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) { FILE *cf; @@ -134,26 +126,21 @@ return 1; } -#ifndef HAS_NO_UIDS - int xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) { +#ifndef HAS_NO_UIDS int ret; -#if !defined(HAS_SAVED_IDS_AND_SETEUID) - int pid, p; - int status; - void (*csig) (int); -#else - int ruid, euid; -#endif - if (getuid() != geteuid()) { #if !defined(HAS_SAVED_IDS_AND_SETEUID) + int pid, p; + int status; + void (*csig) (int); + /* Need to fork to change ruid without loosing euid */ - csig = signal(SIGCHLD, SIG_DFL); + csig = OsSignal(SIGCHLD, SIG_DFL); switch ((pid = fork())) { case -1: ErrorF("xf86writeConfigFile(): fork failed (%s)\n", @@ -171,13 +158,14 @@ p = waitpid(pid, &status, 0); } while (p == -1 && errno == EINTR); } - signal(SIGCHLD, csig); + OsSignal(SIGCHLD, csig); if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0) return 1; /* success */ else return 0; #else /* HAS_SAVED_IDS_AND_SETEUID */ + int ruid, euid; ruid = getuid(); euid = geteuid(); @@ -198,9 +186,7 @@ #endif /* HAS_SAVED_IDS_AND_SETEUID */ } - else { + else +#endif /* !HAS_NO_UIDS */ return doWriteConfigFile(filename, cptr); - } } - -#endif /* !HAS_NO_UIDS */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/xf86Parser.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/xf86Parser.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/xf86Parser.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/xf86Parser.h 2017-03-15 18:05:25.000000000 +0000 @@ -306,6 +306,7 @@ typedef struct { struct xorg_list entry; char **values; + Bool is_negated; } xf86MatchGroup; typedef struct { @@ -325,6 +326,7 @@ xf86TriState is_pointer; xf86TriState is_joystick; xf86TriState is_tablet; + xf86TriState is_tablet_pad; xf86TriState is_touchpad; xf86TriState is_touchscreen; XF86OptionPtr option_lst; @@ -447,6 +449,7 @@ extern void xf86setBuiltinConfig(const char *config[]); extern XF86ConfigPtr xf86readConfigFile(void); extern void xf86closeConfigFile(void); +extern XF86ConfigPtr xf86allocateConfig(void); extern void xf86freeConfig(XF86ConfigPtr p); extern int xf86writeConfigFile(const char *, XF86ConfigPtr); extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/xf86tokens.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/xf86tokens.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/parser/xf86tokens.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/parser/xf86tokens.h 2017-03-15 18:05:25.000000000 +0000 @@ -285,8 +285,19 @@ MATCH_IS_POINTER, MATCH_IS_JOYSTICK, MATCH_IS_TABLET, + MATCH_IS_TABLET_PAD, MATCH_IS_TOUCHPAD, - MATCH_IS_TOUCHSCREEN + MATCH_IS_TOUCHSCREEN, + + NOMATCH_PRODUCT, + NOMATCH_VENDOR, + NOMATCH_DEVICE_PATH, + NOMATCH_OS, + NOMATCH_PNPID, + NOMATCH_USBID, + NOMATCH_DRIVER, + NOMATCH_TAG, + NOMATCH_LAYOUT, } ParserTokens; #endif /* _xf86_tokens_h */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/ramdac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -384,6 +385,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -414,7 +418,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -509,6 +516,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86Cursor.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86Cursor.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86Cursor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86Cursor.c 2017-03-15 18:05:25.000000000 +0000 @@ -337,16 +337,9 @@ return; } - if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) && + if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || - (( - cursor->bits->argb && - infoPtr->UseHWCursorARGB && - (*infoPtr->UseHWCursorARGB)(pScreen, cursor)) || - (cursor->bits->argb == 0 && - (cursor->bits->height <= infoPtr->MaxHeight) && - (cursor->bits->width <= infoPtr->MaxWidth) && - (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) { + xf86CheckHWCursor(pScreen, cursor, infoPtr))) { if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, @@ -462,6 +455,18 @@ } } +CursorPtr +xf86CurrentCursor(ScreenPtr pScreen) +{ + xf86CursorScreenPtr ScreenPriv; + + if (pScreen->is_output_slave) + pScreen = pScreen->current_master; + + ScreenPriv = dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); + return ScreenPriv->CurrentCursor; +} + xf86CursorInfoPtr xf86CreateCursorInfoRec(void) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86Cursor.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86Cursor.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86Cursor.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86Cursor.h 2017-03-15 18:05:25.000000000 +0000 @@ -61,6 +61,7 @@ extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr); extern _X_EXPORT void xf86CursorResetCursor(ScreenPtr pScreen); extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on); +extern _X_EXPORT CursorPtr xf86CurrentCursor(ScreenPtr pScreen); #define HARDWARE_CURSOR_INVERT_MASK 0x00000001 #define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002 diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86CursorPriv.h xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86CursorPriv.h --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86CursorPriv.h 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86CursorPriv.h 2017-03-15 18:05:25.000000000 +0000 @@ -43,6 +43,7 @@ void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed); Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr); +Bool xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr); extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec; #define xf86CursorScreenKey (&xf86CursorScreenKeyRec) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86HWCurs.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86HWCurs.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/ramdac/xf86HWCurs.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/ramdac/xf86HWCurs.c 2017-03-15 18:05:25.000000000 +0000 @@ -17,10 +17,14 @@ #include "cursorstr.h" #include "mi.h" #include "mipointer.h" +#include "randrstr.h" #include "xf86CursorPriv.h" #include "servermd.h" +static void +xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs); + static CARD32 xf86ReverseBitOrder(CARD32 v) { @@ -119,8 +123,59 @@ return TRUE; } +static Bool +xf86ScreenCheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr) +{ + return + (cursor->bits->argb && infoPtr->UseHWCursorARGB && + infoPtr->UseHWCursorARGB(pScreen, cursor)) || + (cursor->bits->argb == 0 && + cursor->bits->height <= infoPtr->MaxHeight && + cursor->bits->width <= infoPtr->MaxWidth && + (!infoPtr->UseHWCursor || infoPtr->UseHWCursor(pScreen, cursor))); +} + Bool -xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) +xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr) +{ + ScreenPtr pSlave; + Bool use_hw_cursor = TRUE; + + input_lock(); + + if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr)) { + use_hw_cursor = FALSE; + goto unlock; + } + + /* ask each driver consuming a pixmap if it can support HW cursor */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + xf86CursorScreenPtr sPriv; + + if (!RRHasScanoutPixmap(pSlave)) + continue; + + sPriv = dixLookupPrivate(&pSlave->devPrivates, xf86CursorScreenKey); + if (!sPriv) { /* NULL if Option "SWCursor", possibly other conditions */ + use_hw_cursor = FALSE; + break; + } + + /* FALSE if HWCursor not supported by slave */ + if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) { + use_hw_cursor = FALSE; + break; + } + } + +unlock: + input_unlock(); + + return use_hw_cursor; +} + +static Bool +xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, @@ -133,11 +188,19 @@ return TRUE; } + /* + * Hot plugged GPU's do not have a CursorScreenKey, force sw cursor. + * This check can be removed once dix/privates.c gets relocation code for + * PRIVATE_CURSOR. Also see the related comment in AddGPUScreen(). + */ + if (!_dixGetScreenPrivateKey(CursorScreenKey, pScreen)) + return FALSE; + bits = dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen); - x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; - y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; + x -= infoPtr->pScrn->frameX0; + y -= infoPtr->pScrn->frameY0; if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr)) if (!bits) { @@ -157,7 +220,7 @@ if (!xf86DriverLoadCursorImage (infoPtr, bits)) return FALSE; - xf86RecolorCursor(pScreen, pCurs, 1); + xf86RecolorCursor_locked (ScreenPriv, pCurs); (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); @@ -165,6 +228,44 @@ return TRUE; } +Bool +xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) +{ + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, + xf86CursorScreenKey); + ScreenPtr pSlave; + Bool ret = FALSE; + + input_lock(); + + x -= ScreenPriv->HotX; + y -= ScreenPriv->HotY; + + if (!xf86ScreenSetCursor(pScreen, pCurs, x, y)) + goto out; + + /* ask each slave driver to set the cursor. */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + if (!RRHasScanoutPixmap(pSlave)) + continue; + + if (!xf86ScreenSetCursor(pSlave, pCurs, x, y)) { + /* + * hide the master (and successfully set slave) cursors, + * otherwise both the hw and sw cursor will show. + */ + xf86SetCursor(pScreen, NullCursor, x, y); + goto out; + } + } + ret = TRUE; + + out: + input_unlock(); + return ret; +} + void xf86SetTransparentCursor(ScreenPtr pScreen) { @@ -173,6 +274,8 @@ xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + input_lock(); + if (!ScreenPriv->transparentData) ScreenPriv->transparentData = (*infoPtr->RealizeCursor) (infoPtr, NullCursor); @@ -185,28 +288,53 @@ ScreenPriv->transparentData); (*infoPtr->ShowCursor) (infoPtr->pScrn); + + input_unlock(); } -void -xf86MoveCursor(ScreenPtr pScreen, int x, int y) +static void +xf86ScreenMoveCursor(ScreenPtr pScreen, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; - x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; - y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; + x -= infoPtr->pScrn->frameX0; + y -= infoPtr->pScrn->frameY0; (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); } void -xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) +xf86MoveCursor(ScreenPtr pScreen, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); + ScreenPtr pSlave; + + input_lock(); + + x -= ScreenPriv->HotX; + y -= ScreenPriv->HotY; + + xf86ScreenMoveCursor(pScreen, x, y); + + /* ask each slave driver to move the cursor */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + if (!RRHasScanoutPixmap(pSlave)) + continue; + + xf86ScreenMoveCursor(pSlave, x, y); + } + + input_unlock(); +} + +static void +xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs) +{ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; /* recoloring isn't applicable to ARGB cursors and drivers @@ -246,6 +374,18 @@ } } +void +xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) +{ + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, + xf86CursorScreenKey); + + input_lock(); + xf86RecolorCursor_locked (ScreenPriv, pCurs); + input_unlock(); +} + /* These functions assume that MaxWidth is a multiple of 32 */ static unsigned char * RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/sdksyms.sh xorg-server-hwe-16.04-1.19.3/hw/xfree86/sdksyms.sh --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/sdksyms.sh 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/sdksyms.sh 2017-03-15 18:05:25.000000000 +0000 @@ -251,7 +251,6 @@ #define _FONTPROTO_H #include "dixfont.h" #include "dixfontstr.h" -#include "dixfontstubs.h" #include "dixgrabs.h" #include "dixstruct.h" #include "exevents.h" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/shadowfb/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/shadowfb/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/shadowfb/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/shadowfb/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/shadowfb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -388,6 +389,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -418,7 +422,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -513,6 +520,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/cvt/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/cvt/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/cvt/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/cvt/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -114,9 +114,10 @@ subdir = hw/xfree86/utils/cvt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -381,6 +382,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -411,7 +415,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -506,6 +513,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/gtf/gtf.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/gtf/gtf.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/gtf/gtf.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/gtf/gtf.c 2017-03-15 18:05:25.000000000 +0000 @@ -692,6 +692,8 @@ if (o->fbmode) print_fb_mode(m); + free(m); + return 0; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/gtf/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/gtf/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/gtf/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/gtf/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -114,9 +114,10 @@ subdir = hw/xfree86/utils/gtf ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -380,6 +381,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -410,7 +414,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -505,6 +512,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -90,9 +90,10 @@ subdir = hw/xfree86/utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -364,6 +365,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -394,7 +398,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -489,6 +496,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/utils/man/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/utils/man/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/utils/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/vbe/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/vbe/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/vbe/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/vbe/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/vbe ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -386,6 +387,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -416,7 +420,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -511,6 +518,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/vbe/vbe.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/vbe/vbe.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/vbe/vbe.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/vbe/vbe.c 2017-03-15 18:05:25.000000000 +0000 @@ -325,7 +325,7 @@ if (!pVbe) return NULL; - if (pVbe->version < 0x200) + if (pVbe->version < 0x102) return NULL; DDC_data = vbeReadEDID(pVbe); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/vgahw/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/vgahw/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/vgahw/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/vgahw/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xfree86/vgahw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -387,6 +388,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/x86emu/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xfree86/x86emu/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/x86emu/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/x86emu/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xfree86/x86emu ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xfree86/xorg-wrapper.c xorg-server-hwe-16.04-1.19.3/hw/xfree86/xorg-wrapper.c --- xorg-server-hwe-16.04-1.18.4/hw/xfree86/xorg-wrapper.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xfree86/xorg-wrapper.c 2017-03-15 18:05:25.000000000 +0000 @@ -240,7 +240,7 @@ memset(&res, 0, sizeof(struct drm_mode_card_res)); r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res); - if (r == 0 && res.count_connectors > 0) + if (r == 0) kms_cards++; close(fd); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/Font.c xorg-server-hwe-16.04-1.19.3/hw/xnest/Font.c --- xorg-server-hwe-16.04-1.18.4/hw/xnest/Font.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/Font.c 2017-03-15 18:05:25.000000000 +0000 @@ -23,6 +23,7 @@ #include "regionstr.h" #include #include +#include "dixfontstr.h" #include "scrnintstr.h" #include "Xnest.h" @@ -42,7 +43,7 @@ int i; const char *name; - FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); name_atom = MakeAtom("FONT", 4, True); value_atom = 0L; @@ -65,7 +66,7 @@ return False; priv = (void *) malloc(sizeof(xnestPrivFont)); - FontSetPrivate(pFont, xnestFontPrivateIndex, priv); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); @@ -82,7 +83,7 @@ if (xnestFontStruct(pFont)) XFreeFont(xnestDisplay, xnestFontStruct(pFont)); free(xnestFontPriv(pFont)); - FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); } return True; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/Handlers.c xorg-server-hwe-16.04-1.19.3/hw/xnest/Handlers.c --- xorg-server-hwe-16.04-1.18.4/hw/xnest/Handlers.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/Handlers.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,14 +32,14 @@ #include "Handlers.h" void -xnestBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +xnestBlockHandler(void *blockData, void *timout) { xnestCollectExposures(); XFlush(xnestDisplay); } void -xnestWakeupHandler(void *blockData, int result, void *pReadMask) +xnestWakeupHandler(void *blockData, int result) { xnestCollectEvents(); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/Handlers.h xorg-server-hwe-16.04-1.19.3/hw/xnest/Handlers.h --- xorg-server-hwe-16.04-1.18.4/hw/xnest/Handlers.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/Handlers.h 2017-03-15 18:05:25.000000000 +0000 @@ -15,8 +15,7 @@ #ifndef XNESTHANDLERS_H #define XNESTHANDLERS_H -void xnestBlockHandler(void *blockData, OSTimePtr pTimeout, - void *pReadMask); -void xnestWakeupHandler(void *blockData, int result, void *pReadMask); +void xnestBlockHandler(void *blockData, void *timeout); +void xnestWakeupHandler(void *blockData, int result); #endif /* XNESTHANDLERS_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/Init.c xorg-server-hwe-16.04-1.19.3/hw/xnest/Init.c --- xorg-server-hwe-16.04-1.18.4/hw/xnest/Init.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/Init.c 2017-03-15 18:05:25.000000000 +0000 @@ -26,6 +26,7 @@ #include "servermd.h" #include "mi.h" #include +#include "dixfontstr.h" #include "Xnest.h" @@ -34,6 +35,7 @@ #include "Pointer.h" #include "Keyboard.h" #include "Handlers.h" +#include "Events.h" #include "Init.h" #include "Args.h" #include "Drawable.h" @@ -72,7 +74,7 @@ break; } - xnestFontPrivateIndex = AllocateFontPrivateIndex(); + xnestFontPrivateIndex = xfont2_allocate_font_private_index(); if (!xnestNumScreens) xnestNumScreens = 1; @@ -85,6 +87,12 @@ xnestDoFullGeneration = xnestFullGeneration; } +static void +xnestNotifyConnection(int fd, int ready, void *data) +{ + xnestCollectEvents(); +} + void InitInput(int argc, char *argv[]) { @@ -100,7 +108,7 @@ mieqInit(); - AddEnabledDevice(XConnectionNumber(xnestDisplay)); + SetNotifyFd(XConnectionNumber(xnestDisplay), xnestNotifyConnection, X_NOTIFY_READ, NULL); RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xnest/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xnest/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -92,9 +92,10 @@ subdir = hw/xnest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -408,6 +409,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -438,7 +442,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -537,6 +544,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xnest/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xnest/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xnest/man/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xnest/man/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xnest/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/bundle/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/bundle/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/bundle/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/bundle/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -99,9 +99,10 @@ subdir = hw/xquartz/bundle ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -342,6 +343,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -372,7 +376,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -467,6 +474,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwin.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwin.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwin.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwin.c 2017-03-15 18:05:25.000000000 +0000 @@ -303,6 +303,11 @@ ============================================================================= */ +static void +DarwinInputHandlerNotify(int fd __unused, int ready __unused, void *data __unused) +{ +} + /* * DarwinMouseProc: Handle the initialization, etc. of a mouse */ @@ -362,13 +367,13 @@ case DEVICE_ON: pPointer->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); return Success; case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); return Success; } @@ -431,13 +436,13 @@ case DEVICE_ON: pPointer->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); return Success; case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); return Success; } return Success; @@ -459,12 +464,12 @@ case DEVICE_ON: pDev->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); break; case DEVICE_OFF: pDev->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); break; case DEVICE_CLOSE: @@ -675,7 +680,6 @@ void OsVendorFatalError(const char *f, va_list args) { - X11ApplicationFatalError(f, args); } /* diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwinEvents.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwinEvents.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwinEvents.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwinEvents.c 2017-03-15 18:05:25.000000000 +0000 @@ -92,10 +92,32 @@ static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_t fd_add_tid = NULL; -static InternalEvent* darwinEvents = NULL; +static BOOL mieqInitialized; +static pthread_mutex_t mieqInitializedMutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t mieqInitializedCond = PTHREAD_COND_INITIALIZER; -static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER; +_X_NOTSAN +extern inline void +wait_for_mieq_init(void) +{ + if (!mieqInitialized) { + pthread_mutex_lock(&mieqInitializedMutex); + while (!mieqInitialized) { + pthread_cond_wait(&mieqInitializedCond, &mieqInitializedMutex); + } + pthread_mutex_unlock(&mieqInitializedMutex); + } +} + +_X_NOTSAN +static inline void +signal_mieq_init(void) +{ + pthread_mutex_lock(&mieqInitializedMutex); + mieqInitialized = TRUE; + pthread_cond_broadcast(&mieqInitializedCond); + pthread_mutex_unlock(&mieqInitializedMutex); +} /*** Pthread Magics ***/ static pthread_t @@ -113,35 +135,6 @@ return tid; } -void -darwinEvents_lock(void); -void -darwinEvents_lock(void) -{ - int err; - if ((err = pthread_mutex_lock(&mieq_lock))) { - ErrorF("%s:%s:%d: Failed to lock mieq_lock: %d\n", - __FILE__, __FUNCTION__, __LINE__, err); - xorg_backtrace(); - } - if (darwinEvents == NULL) { - pthread_cond_wait(&mieq_ready_cond, &mieq_lock); - } -} - -void -darwinEvents_unlock(void); -void -darwinEvents_unlock(void) -{ - int err; - if ((err = pthread_mutex_unlock(&mieq_lock))) { - ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n", - __FILE__, __FUNCTION__, __LINE__, err); - xorg_backtrace(); - } -} - /* * DarwinPressModifierKey * Press or release the given modifier key (one of NX_MODIFIERKEY_* constants) @@ -379,24 +372,11 @@ mieqInit(); mieqSetHandler(ET_XQuartz, DarwinEventHandler); - /* Note that this *could* cause a potential async issue, since we're checking - * darwinEvents without holding the lock, but darwinEvents is only ever set - * here, so I don't bother. - */ - if (!darwinEvents) { - darwinEvents = InitEventList(GetMaximumEventsNum()); - - if (!darwinEvents) - FatalError("Couldn't allocate event buffer\n"); - - darwinEvents_lock(); - pthread_cond_broadcast(&mieq_ready_cond); - darwinEvents_unlock(); - } - if (!fd_add_tid) fd_add_tid = create_thread(DarwinProcessFDAdditionQueue_thread, NULL); + signal_mieq_init(); + return TRUE; } @@ -437,7 +417,7 @@ void DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev) { - darwinEvents_lock(); + input_lock(); { int i; if (pDev->button) { @@ -458,7 +438,7 @@ } } DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void @@ -470,12 +450,6 @@ ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG("%s called before darwinEvents was initialized\n", - __FUNCTION__); - return; - } - screen = miPointerGetScreen(pDev); if (!screen) { DEBUG_LOG("%s called before screen was initialized\n", @@ -498,7 +472,7 @@ valuator_mask_set_double(&valuators, 3, XQUARTZ_VALUATOR_LIMIT * tilt_x); valuator_mask_set_double(&valuators, 4, XQUARTZ_VALUATOR_LIMIT * tilt_y); - darwinEvents_lock(); + input_lock(); { if (ev_type == ProximityIn || ev_type == ProximityOut) { QueueProximityEvents(pDev, ev_type, &valuators); @@ -507,7 +481,7 @@ &valuators); } DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void @@ -519,12 +493,6 @@ ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG("%s called before darwinEvents was initialized\n", - __FUNCTION__); - return; - } - screen = miPointerGetScreen(pDev); if (!screen) { DEBUG_LOG("%s called before screen was initialized\n", @@ -587,29 +555,22 @@ valuator_mask_set_double(&valuators, 3, pointer_dy); } - darwinEvents_lock(); + input_lock(); { QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void DarwinSendKeyboardEvents(int ev_type, int keycode) { - - if (!darwinEvents) { - DEBUG_LOG( - "DarwinSendKeyboardEvents called before darwinEvents was initialized\n"); - return; - } - - darwinEvents_lock(); + input_lock(); { QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } /* Send the appropriate number of button clicks to emulate scroll wheel */ @@ -618,12 +579,6 @@ ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG( - "DarwinSendScrollEvents called before darwinEvents was initialized\n"); - return; - } - screen = miPointerGetScreen(darwinPointer); if (!screen) { DEBUG_LOG( @@ -635,12 +590,12 @@ valuator_mask_set_double(&valuators, 4, scroll_y); valuator_mask_set_double(&valuators, 5, scroll_x); - darwinEvents_lock(); + input_lock(); { QueuePointerEvents(darwinPointer, MotionNotify, 0, POINTER_RELATIVE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to @@ -682,9 +637,11 @@ va_end(args); } - darwinEvents_lock(); + wait_for_mieq_init(); + + input_lock(); { mieqEnqueue(NULL, (InternalEvent *)&e); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwinXinput.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwinXinput.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/darwinXinput.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/darwinXinput.c 2017-03-15 18:05:25.000000000 +0000 @@ -147,3 +147,18 @@ { DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev); } + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove any traces of the input device specified in config_info. + * This is only necessary if the ddx keeps information around beyond + * the NewInputDeviceRequest/DeleteInputDeviceRequest + * + */ +void +RemoveInputDeviceTraces(const char *config_info) +{ + DEBUG_LOG("RemoveInputDeviceTraces(%s)\n", config_info); +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/glcontextmodes.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/glcontextmodes.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/glcontextmodes.c 2017-07-26 20:48:22.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/glcontextmodes.c 2017-07-26 20:48:23.000000000 +0000 @@ -136,7 +136,6 @@ mode->visualID = config->vid; mode->visualType = _gl_convert_from_x_visual_type(config->class); - mode->xRenderable = GL_TRUE; mode->fbconfigID = config->vid; mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/indirect.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/indirect.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/indirect.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/indirect.c 2017-03-15 18:05:25.000000000 +0000 @@ -112,12 +112,6 @@ */ struct __GLXAquaScreen { __GLXscreen base; - - /* Supported GLX extensions */ - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - - int index; - int num_vis; }; struct __GLXAquaContext { @@ -387,6 +381,9 @@ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext); + if (context->base.drawPriv != context->base.readPriv) + return 0; + if (attach(context, drawPriv)) return /*error*/ 0; @@ -542,38 +539,9 @@ screen->base.fbconfigs = __glXAquaCreateVisualConfigs( &screen->base.numFBConfigs, pScreen->myNum); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); __glXScreenInit(&screen->base, pScreen); - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - - memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); - - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); - - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIS_multisample"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_multisample"); - - //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); - //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); - - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) - { - unsigned int buffer_size = - __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - } - return &screen->base; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xquartz/GL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -354,6 +355,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -384,7 +388,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -479,6 +486,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/visualConfigs.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/visualConfigs.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/GL/visualConfigs.c 2016-07-15 16:17:45.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/GL/visualConfigs.c 2017-03-15 18:05:25.000000000 +0000 @@ -229,7 +229,6 @@ /* SGIX_fbconfig / GLX 1.3 */ c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; c->renderType = GLX_RGBA_BIT; - c->xRenderable = GL_TRUE; c->fbconfigID = -1; /* SGIX_pbuffer / GLX 1.3 */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/mach-startup/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/mach-startup/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/mach-startup/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/mach-startup/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -106,9 +106,10 @@ subdir = hw/xquartz/mach-startup ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -389,6 +390,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -419,7 +423,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -514,6 +521,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xquartz ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -414,6 +415,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -444,7 +448,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -539,6 +546,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/man/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/man/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xquartz/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/app-main.m xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/app-main.m --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/app-main.m 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/app-main.m 2017-03-15 18:05:25.000000000 +0000 @@ -40,9 +40,6 @@ /* Stubs */ char *display = NULL; -BOOL serverRunning = YES; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; static void signal_handler(int sig) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/main.m xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/main.m --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/main.m 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/main.m 2017-03-15 18:05:25.000000000 +0000 @@ -48,22 +48,6 @@ x_selection *_selection_object; -extern BOOL serverRunning; -extern pthread_mutex_t serverRunningMutex; -extern pthread_cond_t serverRunningCond; - -static inline void -wait_for_server_init(void) -{ - /* If the server hasn't finished initializing, wait for it... */ - if (!serverRunning) { - pthread_mutex_lock(&serverRunningMutex); - while (!serverRunning) - pthread_cond_wait(&serverRunningCond, &serverRunningMutex); - pthread_mutex_unlock(&serverRunningMutex); - } -} - static int x_io_error_handler(Display *dpy) { @@ -97,8 +81,6 @@ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; size_t i; - wait_for_server_init(); - for (i = 0, xpbproxy_dpy = NULL; !xpbproxy_dpy && i < 5; i++) { xpbproxy_dpy = XOpenDisplay(NULL); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/Makefile.am 2016-03-03 19:01:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -1,7 +1,6 @@ -AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \ - -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" +AM_CPPFLAGS=-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" -AM_CFLAGS=$(XPBPROXY_CFLAGS) +AM_CFLAGS=$(XPBPROXY_CFLAGS) AM_OBJCFLAGS=$(XPBPROXY_CFLAGS) noinst_LTLIBRARIES = libxpbproxy.la diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/pbproxy/Makefile.in 2016-07-19 17:27:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/pbproxy/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -94,9 +94,10 @@ subdir = hw/xquartz/pbproxy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -384,6 +385,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -414,7 +418,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -509,6 +516,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -556,9 +564,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \ - -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" $(am__append_1) -AM_CFLAGS = $(XPBPROXY_CFLAGS) +AM_CPPFLAGS = -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" \ + $(am__append_1) +AM_CFLAGS = $(XPBPROXY_CFLAGS) AM_OBJCFLAGS = $(XPBPROXY_CFLAGS) noinst_LTLIBRARIES = libxpbproxy.la libxpbproxy_la_SOURCES = \ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzCocoa.m xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzCocoa.m --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzCocoa.m 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzCocoa.m 2017-03-15 18:05:25.000000000 +0000 @@ -48,9 +48,7 @@ * Clean out any autoreleased objects. */ void -QuartzBlockHandler(void *blockData, - OSTimePtr pTimeout, - void *pReadmask) +QuartzBlockHandler(void *blockData, void *pTimeout) { static NSAutoreleasePool *aPool = nil; @@ -62,9 +60,7 @@ * QuartzWakeupHandler */ void -QuartzWakeupHandler(void *blockData, - int result, - void *pReadmask) +QuartzWakeupHandler(void *blockData, int result) { // nothing here } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzCommon.h xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzCommon.h --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzCommon.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzCommon.h 2017-03-15 18:05:25.000000000 +0000 @@ -47,8 +47,9 @@ extern const char *quartzOpenGLBundle; void -QuartzBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask); +QuartzBlockHandler(void *blockData, void *pTimeout); + void -QuartzWakeupHandler(void *blockData, int result, void *pReadmask); +QuartzWakeupHandler(void *blockData, int result); #endif /* _QUARTZCOMMON_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzStartup.c xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzStartup.c --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/quartzStartup.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/quartzStartup.c 2017-03-15 18:05:25.000000000 +0000 @@ -95,6 +95,15 @@ if (!create_thread(server_thread, args)) { FatalError("can't create secondary thread\n"); } + + /* Block signals on the AppKit thread that the X11 expects to handle on its thread */ + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGALRM); +#ifdef BUSFAULT + sigaddset(&set, SIGBUS); +#endif + pthread_sigmask(SIG_BLOCK, &set, NULL); } int diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/X11Application.h xorg-server-hwe-16.04-1.19.3/hw/xquartz/X11Application.h --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/X11Application.h 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/X11Application.h 2017-03-15 18:05:25.000000000 +0000 @@ -87,9 +87,6 @@ X11ApplicationCanEnterRandR(void); void -X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0); - -void X11ApplicationMain(int argc, char **argv, char **envp); #define PREFS_APPSMENU "apps_menu" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/X11Application.m xorg-server-hwe-16.04-1.19.3/hw/xquartz/X11Application.m --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/X11Application.m 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/X11Application.m 2017-03-15 18:05:25.000000000 +0000 @@ -84,7 +84,6 @@ extern Bool noTestExtensions; extern Bool noRenderExtension; -extern BOOL serverRunning; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static TISInputSourceRef last_key_layout; @@ -366,6 +365,15 @@ else { /* No kit window is focused, so send it to X. */ for_appkit = NO; + + /* Reset our swallow state if we're seeing the same keyCode again. + * This can happen if we become !_x_active when the keyCode we + * intended to swallow is delivered. See: + * https://bugs.freedesktop.org/show_bug.cgi?id=92648 + */ + if ([e keyCode] == swallow_keycode) { + do_swallow = NO; + } } } else { /* KeyUp */ @@ -1087,53 +1095,6 @@ } } -void -X11ApplicationFatalError(const char *f, va_list args) -{ -#ifdef HAVE_LIBDISPATCH - NSString *title, *msg; - char *error_msg; - - /* This is called by FatalError() in the server thread just before - * we would abort. If the server never got off the ground, We should - * inform the user of the error rather than letting the ever-so-friendly - * CrashReporter do it for us. - * - * This also has the benefit of forcing user interaction rather than - * allowing an infinite throttled-restart if the crash occurs before - * we can drain the launchd socket. - */ - - if (serverRunning) { - return; - } - - title = NSLocalizedString(@"The application X11 could not be opened.", - @"Dialog title when encountering a fatal error"); - msg = NSLocalizedString( - @"An error occurred while starting the X11 server: \"%s\"\n\nClick Quit to quit X11. Click Report to see more details or send a report to Apple.", - @"Dialog when encountering a fatal error"); - - vasprintf(&error_msg, f, args); - msg = [NSString stringWithFormat:msg, error_msg]; - - /* We want the AppKit thread to actually service the alert or we will race [NSApp run] and create an - * 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count' - */ - dispatch_sync(dispatch_get_main_queue(), ^{ - if (NSAlertDefaultReturn == - NSRunAlertPanel (title, @"%@", - NSLocalizedString (@"Quit", @""), - NSLocalizedString (@"Report...", @""), - nil, msg)) { - exit (EXIT_FAILURE); - } - }); - - /* fall back to caller to do the abort() in the DIX */ -#endif -} - static void check_xinitrc(void) { @@ -1350,9 +1311,7 @@ #endif extern void -darwinEvents_lock(void); -extern void -darwinEvents_unlock(void); +wait_for_mieq_init(void); - (void) sendX11NSEvent:(NSEvent *)e { @@ -1368,8 +1327,7 @@ if (!darwinTabletCurrent) { /* Ensure that the event system is initialized */ - darwinEvents_lock(); - darwinEvents_unlock(); + wait_for_mieq_init(); assert(darwinTabletStylus); tilt = NSZeroPoint; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xquartz/xpr/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xquartz/xpr/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xquartz/xpr/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xquartz/xpr/Makefile.in 2017-03-15 18:05:44.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xquartz/xpr ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xwayland/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/Makefile.am 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -30,6 +30,7 @@ $(XSERVER_SYS_LIBS) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) +Xwayland_built_sources = if GLAMOR_EGL Xwayland_SOURCES += \ @@ -39,26 +40,45 @@ xwayland-glamor-xv.c endif -nodist_Xwayland_SOURCES = \ +glamor_built_sources = \ drm-client-protocol.h \ drm-protocol.c -CLEANFILES = $(nodist_Xwayland_SOURCES) - -xwayland-glamor.c : $(nodist_Xwayland_SOURCES) +Xwayland_built_sources += $(glamor_built_sources) glamor_lib = $(top_builddir)/glamor/libglamor.la Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL -Xwayland_DEPENDENCIES = $(glamor_lib) +Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS) endif +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 + +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 < $< > $@ +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 < $< > $@ +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 $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwayland/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -95,7 +95,8 @@ @GLAMOR_EGL_TRUE@@XV_TRUE@am__append_2 = \ @GLAMOR_EGL_TRUE@@XV_TRUE@ xwayland-glamor-xv.c -@GLAMOR_EGL_TRUE@am__append_3 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL +@GLAMOR_EGL_TRUE@am__append_3 = $(glamor_built_sources) +@GLAMOR_EGL_TRUE@am__append_4 = $(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@ $(top_builddir)/Xext/libXvidmode.la \ @@ -103,9 +104,10 @@ subdir = hw/xwayland ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -139,8 +141,12 @@ Xwayland-xwayland-vidmode.$(OBJEXT) \ Xwayland-dpmsstubs.$(OBJEXT) Xwayland-stubs.$(OBJEXT) \ Xwayland-miinitext.$(OBJEXT) $(am__objects_1) $(am__objects_2) -@GLAMOR_EGL_TRUE@nodist_Xwayland_OBJECTS = \ -@GLAMOR_EGL_TRUE@ Xwayland-drm-protocol.$(OBJEXT) +@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-relative-pointer-unstable-v1-protocol.$(OBJEXT) \ + Xwayland-pointer-constraints-unstable-v1-protocol.$(OBJEXT) +nodist_Xwayland_OBJECTS = $(am__objects_5) Xwayland_OBJECTS = $(am_Xwayland_OBJECTS) $(nodist_Xwayland_OBJECTS) am__DEPENDENCIES_1 = @GLAMOR_EGL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @@ -389,6 +395,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -419,7 +428,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -514,6 +526,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -577,15 +590,21 @@ $(am__append_1) $(am__append_2) Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) $(XWAYLAND_SYS_LIBS) \ $(top_builddir)/Xext/libXvidmode.la $(XSERVER_SYS_LIBS) \ - $(am__append_3) + $(am__append_4) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -@GLAMOR_EGL_TRUE@nodist_Xwayland_SOURCES = \ +Xwayland_built_sources = $(am__append_3) \ + 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 +@GLAMOR_EGL_TRUE@glamor_built_sources = \ @GLAMOR_EGL_TRUE@ drm-client-protocol.h \ @GLAMOR_EGL_TRUE@ drm-protocol.c -@GLAMOR_EGL_TRUE@CLEANFILES = $(nodist_Xwayland_SOURCES) @GLAMOR_EGL_TRUE@glamor_lib = $(top_builddir)/glamor/libglamor.la -@GLAMOR_EGL_TRUE@Xwayland_DEPENDENCIES = $(glamor_lib) +@GLAMOR_EGL_TRUE@Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS) +nodist_Xwayland_SOURCES = $(Xwayland_built_sources) +CLEANFILES = $(Xwayland_built_sources) EXTRA_DIST = drm.xml all: all-am @@ -683,6 +702,8 @@ @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-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-xwayland-cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-cvt.Po@am__quote@ @@ -897,6 +918,34 @@ @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-drm-protocol.obj `if test -f 'drm-protocol.c'; then $(CYGPATH_W) 'drm-protocol.c'; else $(CYGPATH_W) '$(srcdir)/drm-protocol.c'; fi` +Xwayland-relative-pointer-unstable-v1-protocol.o: relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-relative-pointer-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo -c -o Xwayland-relative-pointer-unstable-v1-protocol.o `test -f 'relative-pointer-unstable-v1-protocol.c' || echo '$(srcdir)/'`relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relative-pointer-unstable-v1-protocol.c' object='Xwayland-relative-pointer-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-relative-pointer-unstable-v1-protocol.o `test -f 'relative-pointer-unstable-v1-protocol.c' || echo '$(srcdir)/'`relative-pointer-unstable-v1-protocol.c + +Xwayland-relative-pointer-unstable-v1-protocol.obj: relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-relative-pointer-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo -c -o Xwayland-relative-pointer-unstable-v1-protocol.obj `if test -f 'relative-pointer-unstable-v1-protocol.c'; then $(CYGPATH_W) 'relative-pointer-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/relative-pointer-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relative-pointer-unstable-v1-protocol.c' object='Xwayland-relative-pointer-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-relative-pointer-unstable-v1-protocol.obj `if test -f 'relative-pointer-unstable-v1-protocol.c'; then $(CYGPATH_W) 'relative-pointer-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/relative-pointer-unstable-v1-protocol.c'; fi` + +Xwayland-pointer-constraints-unstable-v1-protocol.o: pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-pointer-constraints-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo -c -o Xwayland-pointer-constraints-unstable-v1-protocol.o `test -f 'pointer-constraints-unstable-v1-protocol.c' || echo '$(srcdir)/'`pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pointer-constraints-unstable-v1-protocol.c' object='Xwayland-pointer-constraints-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-pointer-constraints-unstable-v1-protocol.o `test -f 'pointer-constraints-unstable-v1-protocol.c' || echo '$(srcdir)/'`pointer-constraints-unstable-v1-protocol.c + +Xwayland-pointer-constraints-unstable-v1-protocol.obj: pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-pointer-constraints-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo -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` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pointer-constraints-unstable-v1-protocol.c' object='Xwayland-pointer-constraints-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-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` + mostlyclean-libtool: -rm -f *.lo @@ -1112,11 +1161,21 @@ .PRECIOUS: Makefile -@GLAMOR_EGL_TRUE@xwayland-glamor.c : $(nodist_Xwayland_SOURCES) +$(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 < $< > $@ +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 < $< > $@ +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 $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,6 +32,8 @@ #include #include #include +#include +#include #ifdef XF86VIDMODE #include @@ -52,6 +54,8 @@ void OsVendorInit(void) { + if (serverGeneration == 1) + ForceClockId(CLOCK_MONOTONIC); } void @@ -99,6 +103,12 @@ static DevPrivateKeyRec xwl_screen_private_key; static DevPrivateKeyRec xwl_pixmap_private_key; +static struct xwl_window * +xwl_window_get(WindowPtr window) +{ + return dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); +} + struct xwl_screen * xwl_screen_get(ScreenPtr screen) { @@ -120,6 +130,8 @@ &xwl_screen->seat_list, link) xwl_seat_destroy(xwl_seat); + RemoveNotifyFd(xwl_screen->wayland_fd); + wl_display_disconnect(xwl_screen->display); screen->CloseScreen = xwl_screen->CloseScreen; @@ -128,6 +140,76 @@ return screen->CloseScreen(screen); } +static struct xwl_window * +xwl_window_from_window(WindowPtr window) +{ + struct xwl_window *xwl_window; + + while (window) { + xwl_window = xwl_window_get(window); + if (xwl_window) + return xwl_window; + + window = window->parent; + } + + return NULL; +} + +static struct xwl_seat * +xwl_screen_get_default_seat(struct xwl_screen *xwl_screen) +{ + return container_of(xwl_screen->seat_list.prev, + struct xwl_seat, + link); +} + +static void +xwl_cursor_warped_to(DeviceIntPtr device, + ScreenPtr screen, + ClientPtr client, + WindowPtr window, + SpritePtr sprite, + int x, int y) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_seat *xwl_seat = device->public.devicePrivate; + struct xwl_window *xwl_window; + + if (!xwl_seat) + xwl_seat = xwl_screen_get_default_seat(xwl_screen); + + xwl_window = xwl_window_from_window(window); + if (!xwl_window) + return; + + xwl_seat_emulate_pointer_warp(xwl_seat, xwl_window, sprite, x, y); +} + +static void +xwl_cursor_confined_to(DeviceIntPtr device, + ScreenPtr screen, + WindowPtr window) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_seat *xwl_seat = device->public.devicePrivate; + struct xwl_window *xwl_window; + + if (!xwl_seat) + xwl_seat = xwl_screen_get_default_seat(xwl_screen); + + if (window == screen->root) { + xwl_seat_unconfine_pointer(xwl_seat); + return; + } + + xwl_window = xwl_window_from_window(window); + if (!xwl_window) + return; + + xwl_seat_confine_pointer(xwl_seat, xwl_window); +} + static void damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) { @@ -319,7 +401,15 @@ 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->last_xwindow == window) + xwl_seat->last_xwindow = NullWindow; + if (xwl_seat->cursor_confinement_window && + xwl_seat->cursor_confinement_window->window == window) + xwl_seat_unconfine_pointer(xwl_seat); + if (xwl_seat->pointer_warp_emulator && + xwl_seat->pointer_warp_emulator->locked_window && + xwl_seat->pointer_warp_emulator->locked_window->window == window) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); xwl_seat_clear_touch(xwl_seat, window); } @@ -328,8 +418,7 @@ xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; screen->UnrealizeWindow = xwl_unrealize_window; - xwl_window = - dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); + xwl_window = xwl_window_get(window); if (!xwl_window) return ret; @@ -359,6 +448,8 @@ uint32_t time) { struct xwl_window *xwl_window = data; + + wl_callback_destroy (xwl_window->frame_callback); xwl_window->frame_callback = NULL; } @@ -446,7 +537,7 @@ xorg_list_for_each_entry_safe(xwl_output, tmp_xwl_output, &xwl_screen->output_list, link) { if (xwl_output->server_output_id == name) { - xwl_output_destroy(xwl_output); + xwl_output_remove(xwl_output); break; } } @@ -458,20 +549,16 @@ }; static void -wakeup_handler(void *data, int err, void *read_mask) +xwl_read_events (struct xwl_screen *xwl_screen) { - struct xwl_screen *xwl_screen = data; int ret; - if (err < 0) - return; - - if (!FD_ISSET(xwl_screen->wayland_fd, (fd_set *) read_mask)) + if (xwl_screen->wait_flush) return; ret = wl_display_read_events(xwl_screen->display); if (ret == -1) - FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); + FatalError("failed to read Wayland events: %s\n", strerror(errno)); xwl_screen->prepare_read = 0; @@ -480,13 +567,25 @@ FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); } +static int +xwl_display_pollout (struct xwl_screen *xwl_screen, int timeout) +{ + struct pollfd poll_fd; + + poll_fd.fd = wl_display_get_fd(xwl_screen->display); + poll_fd.events = POLLOUT; + + return xserver_poll(&poll_fd, 1, timeout); +} + static void -block_handler(void *data, struct timeval **tv, void *read_mask) +xwl_dispatch_events (struct xwl_screen *xwl_screen) { - struct xwl_screen *xwl_screen = data; - int ret; + int ret = 0; + int ready; - xwl_screen_post_damage(xwl_screen); + if (xwl_screen->wait_flush) + goto pollout; while (xwl_screen->prepare_read == 0 && wl_display_prepare_read(xwl_screen->display) == -1) { @@ -498,9 +597,47 @@ xwl_screen->prepare_read = 1; - ret = wl_display_flush(xwl_screen->display); - if (ret == -1) +pollout: + ready = xwl_display_pollout(xwl_screen, 5); + if (ready == -1 && errno != EINTR) + FatalError("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_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); +} + +static void +socket_handler(int fd, int ready, void *data) +{ + struct xwl_screen *xwl_screen = data; + + xwl_read_events (xwl_screen); +} + +static void +wakeup_handler(void *data, int err) +{ +} + +static void +block_handler(void *data, void *timeout) +{ + struct xwl_screen *xwl_screen = data; + + xwl_screen_post_damage(xwl_screen); + xwl_dispatch_events (xwl_screen); +} + +void +xwl_sync_events (struct xwl_screen *xwl_screen) +{ + xwl_dispatch_events (xwl_screen); + xwl_read_events (xwl_screen); } static CARD32 @@ -663,7 +800,7 @@ #endif xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display); - AddGeneralSocket(xwl_screen->wayland_fd); + SetNotifyFd(xwl_screen->wayland_fd, socket_handler, X_NOTIFY_READ, xwl_screen); RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, xwl_screen); pScreen->SaveScreen = xwl_save_screen; @@ -699,6 +836,9 @@ xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; + pScreen->CursorWarpedTo = xwl_cursor_warped_to; + pScreen->CursorConfinedTo = xwl_cursor_confined_to; + return ret; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-cursor.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-cursor.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-cursor.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-cursor.c 2017-03-15 18:05:25.000000000 +0000 @@ -76,6 +76,7 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) { PixmapPtr pixmap; + struct xwl_screen *xwl_screen; struct xwl_seat *xwl_seat; pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); @@ -85,9 +86,9 @@ dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, NULL); /* When called from FreeCursor(), device is always NULL */ - if (device) { - xwl_seat = device->public.devicePrivate; - if (xwl_seat && cursor == xwl_seat->x_cursor) + xwl_screen = xwl_screen_get(screen); + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + if (cursor == xwl_seat->x_cursor) xwl_seat->x_cursor = NULL; } @@ -95,12 +96,22 @@ } static void +clear_cursor_frame_callback(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->cursor_frame_cb) { + wl_callback_destroy (xwl_seat->cursor_frame_cb); + xwl_seat->cursor_frame_cb = NULL; + } +} + +static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct xwl_seat *xwl_seat = data; - xwl_seat->cursor_frame_cb = NULL; + + clear_cursor_frame_callback(xwl_seat); if (xwl_seat->cursor_needs_update) { xwl_seat->cursor_needs_update = FALSE; xwl_seat_set_cursor(xwl_seat); @@ -124,6 +135,8 @@ 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; return; } @@ -166,12 +179,19 @@ ScreenPtr screen, CursorPtr cursor, int x, int y) { struct xwl_seat *xwl_seat; + Bool cursor_visibility_changed; xwl_seat = device->public.devicePrivate; if (xwl_seat == NULL) return; + cursor_visibility_changed = !!xwl_seat->x_cursor ^ !!cursor; + xwl_seat->x_cursor = cursor; + + if (cursor_visibility_changed) + xwl_seat_cursor_visibility_changed(xwl_seat); + xwl_seat_set_cursor(xwl_seat); } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-cvt.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-cvt.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-cvt.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-cvt.c 2017-03-15 18:05:25.000000000 +0000 @@ -296,6 +296,13 @@ if (Interlaced) modeinfo.modeFlags |= RR_Interlace; + /* FWXGA hack adapted from hw/xfree86/modes/xf86EdidModes.c, because you can't say 1366 */ + if (HDisplay == 1366 && VDisplay == 768) { + modeinfo.width = 1366; + modeinfo.hSyncStart--; + modeinfo.hSyncEnd--; + } + snprintf(name, sizeof name, "%dx%d", modeinfo.width, modeinfo.height); modeinfo.nameLength = strlen(name); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-glamor.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-glamor.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-glamor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-glamor.c 2017-03-15 18:05:25.000000000 +0000 @@ -31,14 +31,15 @@ #define MESA_EGL_NO_X11_HEADERS #include -#include -#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; @@ -292,9 +293,10 @@ return; } - xwl_screen->egl_display = eglGetDisplay(xwl_screen->gbm); + xwl_screen->egl_display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, + xwl_screen->gbm); if (xwl_screen->egl_display == EGL_NO_DISPLAY) { - ErrorF("eglGetDisplay() failed\n"); + ErrorF("glamor_egl_get_display() failed\n"); return; } @@ -347,7 +349,7 @@ 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)); + xwl_screen->device_name, strerror(errno)); return; } @@ -417,11 +419,6 @@ return TRUE; } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) -{ -} - int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, @@ -434,17 +431,49 @@ 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; - dri3_send_open_reply(state->client, state->fd); - AttendClient(state->client); - free(state); - wl_callback_destroy(callback); + /* 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 = { @@ -459,7 +488,6 @@ { struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_auth_state *state; - struct wl_callback *callback; drm_magic_t magic; int fd; @@ -487,8 +515,9 @@ } wl_drm_authenticate(xwl_screen->drm, magic); - callback = wl_display_sync(xwl_screen->display); - wl_callback_add_listener(callback, &sync_listener, state); + 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); @@ -570,6 +599,16 @@ 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"); + return FALSE; + } + xwl_screen->CreateScreenResources = screen->CreateScreenResources; screen->CreateScreenResources = xwl_glamor_create_screen_resources; screen->CreatePixmap = xwl_glamor_create_pixmap; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland.h xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland.h --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland.h 2016-07-19 17:13:47.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland.h 2017-03-15 18:05:25.000000000 +0000 @@ -42,12 +42,14 @@ #include #include +#include "relative-pointer-unstable-v1-client-protocol.h" +#include "pointer-constraints-unstable-v1-client-protocol.h" + struct xwl_screen { int width; int height; int depth; ScreenPtr screen; - WindowPtr pointer_limbo_window; int expecting_event; enum RootClipMode root_clip_mode; @@ -63,6 +65,7 @@ DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; + XYToWindowProcPtr XYToWindow; struct xorg_list output_list; struct xorg_list seat_list; @@ -75,6 +78,8 @@ struct wl_compositor *compositor; struct wl_shm *shm; struct wl_shell *shell; + struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; + struct zwp_pointer_constraints_v1 *pointer_constraints; uint32_t serial; @@ -83,6 +88,7 @@ #define XWL_FORMAT_RGB565 (1 << 2) int prepare_read; + int wait_flush; char *device_name; int drm_fd; @@ -114,13 +120,21 @@ struct xorg_list link_touch; }; +struct xwl_pointer_warp_emulator { + struct xwl_seat *xwl_seat; + struct xwl_window *locked_window; + struct zwp_locked_pointer_v1 *locked_pointer; +}; + struct xwl_seat { DeviceIntPtr pointer; + DeviceIntPtr relative_pointer; DeviceIntPtr keyboard; DeviceIntPtr touch; 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 wl_array keys; @@ -132,12 +146,32 @@ struct wl_surface *cursor; struct wl_callback *cursor_frame_cb; Bool cursor_needs_update; + WindowPtr last_xwindow; struct xorg_list touches; size_t keymap_size; char *keymap; struct wl_surface *keyboard_focus; + + struct xorg_list sync_pending; + + struct xwl_pointer_warp_emulator *pointer_warp_emulator; + + struct xwl_window *cursor_confinement_window; + struct zwp_confined_pointer_v1 *confined_pointer; + + struct { + Bool has_absolute; + wl_fixed_t x; + wl_fixed_t y; + + Bool has_relative; + double dx; + double dy; + double dx_unaccel; + double dy_unaccel; + } pending_pointer_event; }; struct xwl_output { @@ -153,6 +187,8 @@ 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); @@ -163,6 +199,19 @@ void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window); +void xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y); + +void xwl_seat_destroy_pointer_warp_emulator(struct xwl_seat *xwl_seat); + +void xwl_seat_cursor_visibility_changed(struct xwl_seat *xwl_seat); + +void xwl_seat_confine_pointer(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window); +void xwl_seat_unconfine_pointer(struct xwl_seat *xwl_seat); + Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, @@ -170,6 +219,8 @@ void xwl_output_destroy(struct xwl_output *xwl_output); +void xwl_output_remove(struct xwl_output *xwl_output); + RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-input.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-input.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-input.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-input.c 2017-03-15 18:05:25.000000000 +0000 @@ -41,44 +41,77 @@ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) +struct sync_pending { + struct xorg_list l; + DeviceIntPtr pending_dev; +}; + +static void +xwl_pointer_warp_emulator_handle_motion(struct xwl_pointer_warp_emulator *warp_emulator, + double dx, + double dy, + double dx_unaccel, + double dy_unaccel); +static void +xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y); + +static void +xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); + static void xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl) { /* Nothing to do, dix handles all settings */ } -static int -xwl_pointer_proc(DeviceIntPtr device, int what) +static Bool +init_pointer_buttons(DeviceIntPtr device) { #define NBUTTONS 10 -#define NAXES 4 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; + + for (i = 1; i <= NBUTTONS; i++) + map[i] = i; + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); + btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + /* don't know about the rest */ + + if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) + return FALSE; + + return TRUE; +} + +static int +xwl_pointer_proc(DeviceIntPtr device, int what) +{ +#define NAXES 4 Atom axes_labels[NAXES] = { 0 }; switch (what) { case DEVICE_INIT: device->public.on = FALSE; - for (i = 1; i <= NBUTTONS; i++) - map[i] = i; - - btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); - btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); - btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); - btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); - btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); - btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); - /* don't know about the rest */ + if (!init_pointer_buttons(device)) + return BadValue; 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_REL_HWHEEL); axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); - if (!InitValuatorClassDeviceStruct(device, NAXES, btn_labels, + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, GetMotionHistorySize(), Absolute)) return BadValue; @@ -98,7 +131,55 @@ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; - if (!InitButtonClassDeviceStruct(device, 3, btn_labels, map)) + 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 NBUTTONS +#undef NAXES +} + +static int +xwl_pointer_proc_relative(DeviceIntPtr device, int what) +{ +#define NAXES 2 + Atom axes_labels[NAXES] = { 0 }; + + switch (what) { + case DEVICE_INIT: + device->public.on = FALSE; + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + /* + * We'll never send buttons, but XGetPointerMapping might in certain + * situations make the client think we have no buttons. + */ + if (!init_pointer_buttons(device)) + return BadValue; + + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, + GetMotionHistorySize(), Relative)) + return BadValue; + + /* Valuators */ + InitValuatorAxisStruct(device, 0, axes_labels[0], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); + InitValuatorAxisStruct(device, 1, axes_labels[1], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); + + if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; return Success; @@ -115,7 +196,6 @@ return BadMatch; -#undef NBUTTONS #undef NAXES } @@ -162,7 +242,6 @@ #define NTOUCHPOINTS 20 #define NBUTTONS 1 #define NAXES 2 - struct xwl_seat *xwl_seat = device->public.devicePrivate; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; BYTE map[NBUTTONS + 1] = { 0 }; @@ -186,13 +265,10 @@ return BadValue; /* Valuators */ - /* FIXME: devices might be mapped to a single wl_output */ InitValuatorAxisStruct(device, 0, axes_labels[0], - 0, xwl_seat->xwl_screen->width, - 10000, 0, 10000, Absolute); + 0, 0xFFFF, 10000, 0, 10000, Absolute); InitValuatorAxisStruct(device, 1, axes_labels[1], - 0, xwl_seat->xwl_screen->height, - 10000, 0, 10000, Absolute); + 0, 0xFFFF, 10000, 0, 10000, Absolute); return Success; case DEVICE_ON: @@ -219,10 +295,10 @@ struct xwl_seat *xwl_seat = data; DeviceIntPtr dev = xwl_seat->pointer; DeviceIntPtr master; - miPointerPtr mipointer; int i; int sx = wl_fixed_to_int(sx_w); int sy = wl_fixed_to_int(sy_w); + int dx, dy; ScreenPtr pScreen = xwl_seat->xwl_screen->screen; ValuatorMask mask; @@ -239,17 +315,16 @@ xwl_seat->pointer_enter_serial = serial; xwl_seat->focus_window = wl_surface_get_user_data(surface); + dx = xwl_seat->focus_window->window->drawable.x; + dy = xwl_seat->focus_window->window->drawable.y; + + /* We just entered a new xwindow, forget about the old last xwindow */ + xwl_seat->last_xwindow = NullWindow; master = GetMaster(dev, POINTER_OR_FLOAT); - (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE); + (*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE); - /* X is very likely to have the wrong idea of what the actual cursor - * sprite is, so in order to force updating the cursor lets set the - * current sprite to some invalid cursor behind its back so that it - * always will think it changed to the not invalid cursor. - */ - mipointer = MIPOINTER(master); - mipointer->pSpriteCursor = (CursorPtr) 1; + miPointerInvalidateSprite(master); CheckMotion(NULL, master); @@ -277,6 +352,12 @@ xwl_seat->cursor_frame_cb = NULL; xwl_seat_set_cursor(xwl_seat); } + + if (xwl_seat->pointer_warp_emulator) { + xwl_pointer_warp_emulator_maybe_lock(xwl_seat->pointer_warp_emulator, + xwl_seat->focus_window, + NULL, 0, 0); + } } static void @@ -288,8 +369,72 @@ xwl_seat->xwl_screen->serial = serial; - xwl_seat->focus_window = NULL; - CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT)); + /* The pointer has left a known xwindow, save it for a possible match + * in sprite_check_lost_focus() + */ + if (xwl_seat->focus_window) { + xwl_seat->last_xwindow = xwl_seat->focus_window->window; + xwl_seat->focus_window = NULL; + CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT)); + } +} + +static void +dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) +{ + ValuatorMask mask; + + if (xwl_seat->pointer_warp_emulator && + xwl_seat->pending_pointer_event.has_relative) { + double dx; + double dy; + double dx_unaccel; + double dy_unaccel; + + dx = xwl_seat->pending_pointer_event.dx; + dy = xwl_seat->pending_pointer_event.dy; + dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; + dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; + xwl_pointer_warp_emulator_handle_motion(xwl_seat->pointer_warp_emulator, + dx, dy, + dx_unaccel, dy_unaccel); + } else if (xwl_seat->pending_pointer_event.has_absolute || + xwl_seat->pending_pointer_event.has_relative) { + int x; + int y; + + if (xwl_seat->pending_pointer_event.has_absolute) { + int sx = wl_fixed_to_int(xwl_seat->pending_pointer_event.x); + int sy = wl_fixed_to_int(xwl_seat->pending_pointer_event.y); + int dx = xwl_seat->focus_window->window->drawable.x; + int dy = xwl_seat->focus_window->window->drawable.y; + + x = dx + sx; + y = dy + sy; + } else { + miPointerGetPosition(xwl_seat->pointer, &x, &y); + } + + valuator_mask_zero(&mask); + if (xwl_seat->pending_pointer_event.has_relative) { + double dx_unaccel; + double dy_unaccel; + + dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; + dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; + valuator_mask_set_absolute_unaccelerated(&mask, 0, x, dx_unaccel); + valuator_mask_set_absolute_unaccelerated(&mask, 1, y, dy_unaccel); + } else { + valuator_mask_set(&mask, 0, x); + valuator_mask_set(&mask, 1, y); + } + + QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); + } + + xwl_seat->pending_pointer_event.has_absolute = FALSE; + xwl_seat->pending_pointer_event.has_relative = FALSE; } static void @@ -297,23 +442,16 @@ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct xwl_seat *xwl_seat = data; - int32_t dx, dy; - int sx = wl_fixed_to_int(sx_w); - int sy = wl_fixed_to_int(sy_w); - ValuatorMask mask; if (!xwl_seat->focus_window) return; - dx = xwl_seat->focus_window->window->drawable.x; - dy = xwl_seat->focus_window->window->drawable.y; - - valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, dx + sx); - valuator_mask_set(&mask, 1, dy + sy); + xwl_seat->pending_pointer_event.has_absolute = TRUE; + xwl_seat->pending_pointer_event.x = sx_w; + xwl_seat->pending_pointer_event.y = sy_w; - QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); + if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) + dispatch_pointer_motion_event(xwl_seat); } static void @@ -373,12 +511,73 @@ QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); } +static void +pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) +{ + struct xwl_seat *xwl_seat = data; + + if (!xwl_seat->focus_window) + return; + + dispatch_pointer_motion_event(xwl_seat); +} + +static void +pointer_handle_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source) +{ +} + +static void +pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer, + uint32_t time, uint32_t axis) +{ +} + +static void +pointer_handle_axis_discrete(void *data, struct wl_pointer *wl_pointer, + uint32_t axis, int32_t discrete) +{ +} + static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, + pointer_handle_frame, + pointer_handle_axis_source, + pointer_handle_axis_stop, + pointer_handle_axis_discrete, +}; + +static void +relative_pointer_handle_relative_motion(void *data, + struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, + uint32_t utime_hi, + uint32_t utime_lo, + wl_fixed_t dxf, + wl_fixed_t dyf, + wl_fixed_t dx_unaccelf, + wl_fixed_t dy_unaccelf) +{ + struct xwl_seat *xwl_seat = data; + + xwl_seat->pending_pointer_event.has_relative = TRUE; + xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf); + xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf); + xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf); + xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf); + + if (!xwl_seat->focus_window) + return; + + if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) + dispatch_pointer_motion_event(xwl_seat); +} + +static const struct zwp_relative_pointer_v1_listener relative_pointer_listener = { + relative_pointer_handle_relative_motion, }; static void @@ -462,7 +661,7 @@ wl_array_copy(&xwl_seat->keys, keys); wl_array_for_each(k, &xwl_seat->keys) - QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, EnterNotify, *k + 8); } static void @@ -475,7 +674,7 @@ xwl_seat->xwl_screen->serial = serial; wl_array_for_each(k, &xwl_seat->keys) - QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); xwl_seat->keyboard_focus = NULL; } @@ -492,6 +691,8 @@ xkbStateNotify sn; CARD16 changed; + mieqProcessInputEvents(); + for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev != xwl_seat->keyboard && dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) @@ -500,12 +701,11 @@ old_state = dev->key->xkbInfo->state; new_state = &dev->key->xkbInfo->state; - if (!xwl_seat->keyboard_focus) { - new_state->locked_mods = mods_locked & XkbAllModifiersMask; - XkbLatchModifiers(dev, XkbAllModifiersMask, - mods_latched & XkbAllModifiersMask); - } new_state->locked_group = group & XkbAllGroupsMask; + new_state->base_mods = mods_depressed & XkbAllModifiersMask; + new_state->locked_mods = mods_locked & XkbAllModifiersMask; + XkbLatchModifiers(dev, XkbAllModifiersMask, + mods_latched & XkbAllModifiersMask); XkbComputeDerivedState(dev->key->xkbInfo); @@ -523,6 +723,64 @@ } static void +remove_sync_pending(DeviceIntPtr dev) +{ + struct xwl_seat *xwl_seat = dev->public.devicePrivate; + struct sync_pending *p, *npd; + + xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { + if (p->pending_dev == dev) { + xorg_list_del(&xwl_seat->sync_pending); + free (p); + return; + } + } +} + +static void +sync_callback(void *data, struct wl_callback *callback, uint32_t serial) +{ + DeviceIntPtr dev = (DeviceIntPtr) data; + + remove_sync_pending(dev); + wl_callback_destroy(callback); +} + +static const struct wl_callback_listener sync_listener = { + sync_callback +}; + +static Bool +keyboard_check_repeat (DeviceIntPtr dev, XkbSrvInfoPtr xkbi, unsigned key) +{ + struct xwl_seat *xwl_seat = dev->public.devicePrivate; + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + struct wl_callback *callback; + struct sync_pending *p; + + /* Make sure we didn't miss a possible reply from the compositor */ + xwl_sync_events (xwl_screen); + + xorg_list_for_each_entry(p, &xwl_seat->sync_pending, l) { + if (p->pending_dev == dev) { + ErrorF("Key repeat discarded, Wayland compositor doesn't " + "seem to be processing events fast enough!\n"); + + return FALSE; + } + } + + p = xnfalloc(sizeof(struct sync_pending)); + p->pending_dev = dev; + callback = wl_display_sync (xwl_screen->display); + xorg_list_add(&p->l, &xwl_seat->sync_pending); + + wl_callback_add_listener(callback, &sync_listener, dev); + + return TRUE; +} + +static void keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) { @@ -531,8 +789,8 @@ XkbControlsPtr ctrl; if (rate < 0 || delay < 0) { - ErrorF("Wrong rate/delay: %d, %d\n", rate, delay); - return; + ErrorF("Wrong rate/delay: %d, %d\n", rate, delay); + return; } for (dev = inputInfo.devices; dev; dev = dev->next) { @@ -540,15 +798,15 @@ dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) continue; - if (rate != 0) { + if (rate != 0) { ctrl = dev->key->xkbInfo->desc->ctrls; ctrl->repeat_delay = delay; /* rate is number of keys per second */ ctrl->repeat_interval = 1000 / rate; - XkbSetRepeatKeys(dev, -1, AutoRepeatModeOn); - } else - XkbSetRepeatKeys(dev, -1, AutoRepeatModeOff); + XkbSetRepeatKeys(dev, -1, AutoRepeatModeOn); + } else + XkbSetRepeatKeys(dev, -1, AutoRepeatModeOff); } } @@ -579,15 +837,18 @@ xwl_touch_send_event(struct xwl_touch *xwl_touch, struct xwl_seat *xwl_seat, int type) { - int32_t dx, dy; + double dx, dy, x, y; ValuatorMask mask; dx = xwl_touch->window->window->drawable.x; dy = xwl_touch->window->window->drawable.y; + x = (dx + xwl_touch->x) * 0xFFFF / xwl_seat->xwl_screen->width; + y = (dy + xwl_touch->y) * 0xFFFF / xwl_seat->xwl_screen->height; + valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, dx + xwl_touch->x); - valuator_mask_set(&mask, 1, dy + xwl_touch->y); + valuator_mask_set_double(&mask, 0, x); + valuator_mask_set_double(&mask, 1, y); QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask); } @@ -708,67 +969,145 @@ } static void +init_pointer(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_pointer = wl_seat_get_pointer(xwl_seat->seat); + wl_pointer_add_listener(xwl_seat->wl_pointer, + &pointer_listener, xwl_seat); + + if (xwl_seat->pointer == NULL) { + xwl_seat_set_cursor(xwl_seat); + xwl_seat->pointer = + add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); + ActivateDevice(xwl_seat->pointer, TRUE); + } + EnableDevice(xwl_seat->pointer, TRUE); +} + +static void +release_pointer(struct xwl_seat *xwl_seat) +{ + wl_pointer_release(xwl_seat->wl_pointer); + xwl_seat->wl_pointer = NULL; + + if (xwl_seat->pointer) + DisableDevice(xwl_seat->pointer, TRUE); +} + +static void +init_relative_pointer(struct xwl_seat *xwl_seat) +{ + struct zwp_relative_pointer_manager_v1 *relative_pointer_manager = + xwl_seat->xwl_screen->relative_pointer_manager; + + if (relative_pointer_manager) { + xwl_seat->wp_relative_pointer = + zwp_relative_pointer_manager_v1_get_relative_pointer( + relative_pointer_manager, xwl_seat->wl_pointer); + zwp_relative_pointer_v1_add_listener(xwl_seat->wp_relative_pointer, + &relative_pointer_listener, + xwl_seat); + } + + if (xwl_seat->relative_pointer == NULL) { + xwl_seat->relative_pointer = + add_device(xwl_seat, "xwayland-relative-pointer", + xwl_pointer_proc_relative); + ActivateDevice(xwl_seat->relative_pointer, TRUE); + } + EnableDevice(xwl_seat->relative_pointer, TRUE); +} + +static void +release_relative_pointer(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->wp_relative_pointer) { + zwp_relative_pointer_v1_destroy(xwl_seat->wp_relative_pointer); + xwl_seat->wp_relative_pointer = NULL; + } + + if (xwl_seat->relative_pointer) + DisableDevice(xwl_seat->relative_pointer, TRUE); +} + +static void +init_keyboard(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_keyboard = wl_seat_get_keyboard(xwl_seat->seat); + wl_keyboard_add_listener(xwl_seat->wl_keyboard, + &keyboard_listener, xwl_seat); + + if (xwl_seat->keyboard == NULL) { + xwl_seat->keyboard = + add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); + ActivateDevice(xwl_seat->keyboard, TRUE); + } + EnableDevice(xwl_seat->keyboard, TRUE); + xwl_seat->keyboard->key->xkbInfo->checkRepeat = keyboard_check_repeat; +} + +static void +release_keyboard(struct xwl_seat *xwl_seat) +{ + wl_keyboard_release(xwl_seat->wl_keyboard); + xwl_seat->wl_keyboard = NULL; + + if (xwl_seat->keyboard) { + remove_sync_pending(xwl_seat->keyboard); + DisableDevice(xwl_seat->keyboard, TRUE); + } +} + +static void +init_touch(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_touch = wl_seat_get_touch(xwl_seat->seat); + wl_touch_add_listener(xwl_seat->wl_touch, + &touch_listener, xwl_seat); + + if (xwl_seat->touch == NULL) { + xwl_seat->touch = + add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); + ActivateDevice(xwl_seat->touch, TRUE); + } + EnableDevice(xwl_seat->touch, TRUE); + +} + +static void +release_touch(struct xwl_seat *xwl_seat) +{ + wl_touch_release(xwl_seat->wl_touch); + xwl_seat->wl_touch = NULL; + + if (xwl_seat->touch) + DisableDevice(xwl_seat->touch, TRUE); +} + +static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct xwl_seat *xwl_seat = data; if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->wl_pointer == NULL) { - xwl_seat->wl_pointer = wl_seat_get_pointer(seat); - wl_pointer_add_listener(xwl_seat->wl_pointer, - &pointer_listener, xwl_seat); - - if (xwl_seat->pointer == NULL) { - xwl_seat_set_cursor(xwl_seat); - xwl_seat->pointer = - add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); - ActivateDevice(xwl_seat->pointer, TRUE); - } - EnableDevice(xwl_seat->pointer, TRUE); + init_pointer(xwl_seat); + init_relative_pointer(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { - wl_pointer_release(xwl_seat->wl_pointer); - xwl_seat->wl_pointer = NULL; - - if (xwl_seat->pointer) - DisableDevice(xwl_seat->pointer, TRUE); + release_pointer(xwl_seat); + release_relative_pointer(xwl_seat); } if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->wl_keyboard == NULL) { - xwl_seat->wl_keyboard = wl_seat_get_keyboard(seat); - wl_keyboard_add_listener(xwl_seat->wl_keyboard, - &keyboard_listener, xwl_seat); - - if (xwl_seat->keyboard == NULL) { - xwl_seat->keyboard = - add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); - ActivateDevice(xwl_seat->keyboard, TRUE); - } - EnableDevice(xwl_seat->keyboard, TRUE); + init_keyboard(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { - wl_keyboard_release(xwl_seat->wl_keyboard); - xwl_seat->wl_keyboard = NULL; - - if (xwl_seat->keyboard) - DisableDevice(xwl_seat->keyboard, TRUE); + release_keyboard(xwl_seat); } if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) { - xwl_seat->wl_touch = wl_seat_get_touch(seat); - wl_touch_add_listener(xwl_seat->wl_touch, - &touch_listener, xwl_seat); - - if (xwl_seat->touch) - EnableDevice(xwl_seat->touch, TRUE); - else { - xwl_seat->touch = - add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); - } + init_touch(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) { - wl_touch_release(xwl_seat->wl_touch); - xwl_seat->wl_touch = NULL; - - if (xwl_seat->touch) - DisableDevice(xwl_seat->touch, TRUE); + release_touch(xwl_seat); } xwl_seat->xwl_screen->expecting_event--; @@ -776,7 +1115,7 @@ static void seat_handle_name(void *data, struct wl_seat *seat, - const char *name) + const char *name) { } @@ -802,7 +1141,7 @@ xwl_seat->seat = wl_registry_bind(xwl_screen->registry, id, - &wl_seat_interface, min(version, 4)); + &wl_seat_interface, min(version, 5)); xwl_seat->id = id; xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); @@ -810,12 +1149,14 @@ wl_array_init(&xwl_seat->keys); xorg_list_init(&xwl_seat->touches); + xorg_list_init(&xwl_seat->sync_pending); } void xwl_seat_destroy(struct xwl_seat *xwl_seat) { struct xwl_touch *xwl_touch, *next_xwl_touch; + struct sync_pending *p, *npd; xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, &xwl_seat->touches, link_touch) { @@ -823,6 +1164,11 @@ free(xwl_touch); } + xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { + xorg_list_del(&xwl_seat->sync_pending); + free (p); + } + wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); if (xwl_seat->cursor_frame_cb) @@ -832,6 +1178,26 @@ } static void +init_relative_pointer_manager(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + xwl_screen->relative_pointer_manager = + wl_registry_bind(xwl_screen->registry, id, + &zwp_relative_pointer_manager_v1_interface, + 1); +} + +static void +init_pointer_constraints(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + xwl_screen->pointer_constraints = + wl_registry_bind(xwl_screen->registry, id, + &zwp_pointer_constraints_v1_interface, + 1); +} + +static void input_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { @@ -840,6 +1206,10 @@ if (strcmp(interface, "wl_seat") == 0 && version >= 3) { create_input_device(xwl_screen, id, version); xwl_screen->expecting_event++; + } else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) { + init_relative_pointer_manager(xwl_screen, id, version); + } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { + init_pointer_constraints(xwl_screen, id, version); } } @@ -870,6 +1240,68 @@ { } +static Bool +sprite_check_lost_focus(SpritePtr sprite, WindowPtr window) +{ + DeviceIntPtr device, master; + struct xwl_seat *xwl_seat; + + for (device = inputInfo.devices; device; device = device->next) { + /* Ignore non-wayland devices */ + if (device->deviceProc == xwl_pointer_proc && + device->spriteInfo->sprite == sprite) + break; + } + + if (!device) + return FALSE; + + xwl_seat = device->public.devicePrivate; + + master = GetMaster(device, POINTER_OR_FLOAT); + if (!master || !master->lastSlave) + return FALSE; + + /* We do want the last active slave, we only check on slave xwayland + * devices so we can find out the xwl_seat, but those don't actually own + * their sprite, so the match doesn't mean a lot. + */ + if (master->lastSlave == xwl_seat->pointer && + xwl_seat->focus_window == NULL && + xwl_seat->last_xwindow != NullWindow && + IsParent(xwl_seat->last_xwindow, window)) + return TRUE; + + return FALSE; +} + +static WindowPtr +xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y) +{ + struct xwl_screen *xwl_screen; + WindowPtr ret; + + xwl_screen = xwl_screen_get(screen); + + screen->XYToWindow = xwl_screen->XYToWindow; + ret = screen->XYToWindow(screen, sprite, x, y); + xwl_screen->XYToWindow = screen->XYToWindow; + screen->XYToWindow = xwl_xy_to_window; + + /* If the device controlling the sprite has left the Wayland surface but + * the DIX still finds the pointer within the X11 window, it means that + * the pointer has crossed to another native Wayland window, in this + * case, pretend we entered the root window so that a LeaveNotify + * event is emitted. + */ + if (sprite_check_lost_focus(sprite, ret)) { + sprite->spriteTraceGood = 1; + return sprite->spriteTrace[0]; + } + + return ret; +} + void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) { @@ -884,6 +1316,281 @@ } } +static void +xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_emulator, + int x, + int y) +{ + struct zwp_locked_pointer_v1 *locked_pointer = + warp_emulator->locked_pointer; + WindowPtr window; + int sx, sy; + + if (!warp_emulator->locked_pointer) + return; + + if (!warp_emulator->xwl_seat->focus_window) + return; + + window = warp_emulator->xwl_seat->focus_window->window; + if (x >= window->drawable.x || + y >= window->drawable.y || + x < (window->drawable.x + window->drawable.width) || + y < (window->drawable.y + window->drawable.height)) { + sx = x - window->drawable.x; + sy = y - window->drawable.y; + zwp_locked_pointer_v1_set_cursor_position_hint(locked_pointer, + wl_fixed_from_int(sx), + wl_fixed_from_int(sy)); + wl_surface_commit(warp_emulator->xwl_seat->focus_window->surface); + } +} + +static Bool +xwl_pointer_warp_emulator_is_locked(struct xwl_pointer_warp_emulator *warp_emulator) +{ + if (warp_emulator->locked_pointer) + return TRUE; + else + return FALSE; +} + +static void +xwl_pointer_warp_emulator_lock(struct xwl_pointer_warp_emulator *warp_emulator) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + struct zwp_pointer_constraints_v1 *pointer_constraints = + xwl_screen->pointer_constraints; + struct xwl_window *lock_window = xwl_seat->focus_window; + + warp_emulator->locked_window = lock_window; + + warp_emulator->locked_pointer = + zwp_pointer_constraints_v1_lock_pointer(pointer_constraints, + lock_window->surface, + xwl_seat->wl_pointer, + NULL, + ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT); +} + +static void +xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + GrabPtr pointer_grab = xwl_seat->pointer->deviceGrab.grab; + + if (warp_emulator->locked_pointer) + return; + + /* + * If there is no grab, and the window doesn't have pointer focus, ignore + * the warp, as under Wayland it won't receive input anyway. + */ + if (!pointer_grab && xwl_seat->focus_window != xwl_window) + return; + + /* + * If there is a grab, but it's not an ownerEvents grab and the destination + * is not the pointer focus, ignore it, as events wouldn't be delivered + * there anyway. + */ + if (pointer_grab && + !pointer_grab->ownerEvents && + XYToWindow(sprite, x, y) != xwl_seat->focus_window->window) + return; + + xwl_pointer_warp_emulator_lock(warp_emulator); +} + +static void +xwl_pointer_warp_emulator_warp(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + xwl_pointer_warp_emulator_maybe_lock(warp_emulator, + xwl_window, + sprite, + x, y); + xwl_pointer_warp_emulator_set_fake_pos(warp_emulator, x, y); +} + +static void +xwl_pointer_warp_emulator_handle_motion(struct xwl_pointer_warp_emulator *warp_emulator, + double dx, + double dy, + double dx_unaccel, + double dy_unaccel) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + ValuatorMask mask; + WindowPtr window; + int x, y; + + valuator_mask_zero(&mask); + valuator_mask_set_unaccelerated(&mask, 0, dx, dx_unaccel); + valuator_mask_set_unaccelerated(&mask, 1, dy, dy_unaccel); + + QueuePointerEvents(xwl_seat->relative_pointer, MotionNotify, 0, + POINTER_RELATIVE, &mask); + + window = xwl_seat->focus_window->window; + miPointerGetPosition(xwl_seat->pointer, &x, &y); + + if (xwl_pointer_warp_emulator_is_locked(warp_emulator) && + xwl_seat->cursor_confinement_window != warp_emulator->locked_window && + (x < window->drawable.x || + y < window->drawable.y || + x >= (window->drawable.x + window->drawable.width) || + y >= (window->drawable.y + window->drawable.height))) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); + else + xwl_pointer_warp_emulator_set_fake_pos(warp_emulator, x, y); +} + +static struct xwl_pointer_warp_emulator * +xwl_pointer_warp_emulator_create(struct xwl_seat *xwl_seat) +{ + struct xwl_pointer_warp_emulator *warp_emulator; + + warp_emulator = calloc(sizeof *warp_emulator, 1); + if (!warp_emulator) { + ErrorF("%s: ENOMEM", __func__); + return NULL; + } + + warp_emulator->xwl_seat = xwl_seat; + + return warp_emulator; +} + +static void +xwl_pointer_warp_emulator_destroy(struct xwl_pointer_warp_emulator *warp_emulator) +{ + if (warp_emulator->locked_pointer) + zwp_locked_pointer_v1_destroy(warp_emulator->locked_pointer); + free(warp_emulator); +} + +static void +xwl_seat_create_pointer_warp_emulator(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->confined_pointer) + xwl_seat_destroy_confined_pointer(xwl_seat); + + xwl_seat->pointer_warp_emulator = + xwl_pointer_warp_emulator_create(xwl_seat); +} + +static Bool +xwl_seat_can_emulate_pointer_warp(struct xwl_seat *xwl_seat) +{ + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + + if (!xwl_screen->relative_pointer_manager) + return FALSE; + + if (!xwl_screen->pointer_constraints) + return FALSE; + + return TRUE; +} + +void +xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + if (!xwl_seat_can_emulate_pointer_warp(xwl_seat)) + return; + + if (xwl_seat->x_cursor != NULL) + return; + + if (!xwl_seat->pointer_warp_emulator) + xwl_seat_create_pointer_warp_emulator(xwl_seat); + + if (!xwl_seat->pointer_warp_emulator) + return; + + xwl_pointer_warp_emulator_warp(xwl_seat->pointer_warp_emulator, + xwl_window, + sprite, + x, y); +} + +void +xwl_seat_cursor_visibility_changed(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->pointer_warp_emulator && xwl_seat->x_cursor != NULL) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); +} + +void +xwl_seat_destroy_pointer_warp_emulator(struct xwl_seat *xwl_seat) +{ + if (!xwl_seat->pointer_warp_emulator) + return; + + xwl_pointer_warp_emulator_destroy(xwl_seat->pointer_warp_emulator); + xwl_seat->pointer_warp_emulator = NULL; + + if (xwl_seat->cursor_confinement_window) { + xwl_seat_confine_pointer(xwl_seat, + xwl_seat->cursor_confinement_window); + } +} + +void +xwl_seat_confine_pointer(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window) +{ + struct zwp_pointer_constraints_v1 *pointer_constraints = + xwl_seat->xwl_screen->pointer_constraints; + + if (!pointer_constraints) + return; + + if (xwl_seat->cursor_confinement_window == xwl_window && + xwl_seat->confined_pointer) + return; + + xwl_seat_unconfine_pointer(xwl_seat); + + xwl_seat->cursor_confinement_window = xwl_window; + + if (xwl_seat->pointer_warp_emulator) + return; + + xwl_seat->confined_pointer = + zwp_pointer_constraints_v1_confine_pointer(pointer_constraints, + xwl_window->surface, + xwl_seat->wl_pointer, + NULL, + ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT); +} + +static void +xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat) +{ + zwp_confined_pointer_v1_destroy(xwl_seat->confined_pointer); + xwl_seat->confined_pointer = NULL; +} + +void +xwl_seat_unconfine_pointer(struct xwl_seat *xwl_seat) +{ + xwl_seat->cursor_confinement_window = NULL; + + if (xwl_seat->confined_pointer) + xwl_seat_destroy_confined_pointer(xwl_seat); +} + void InitInput(int argc, char *argv[]) { @@ -896,7 +1603,9 @@ wl_registry_add_listener(xwl_screen->input_registry, &input_listener, xwl_screen); - xwl_screen->expecting_event = 0; + xwl_screen->XYToWindow = pScreen->XYToWindow; + pScreen->XYToWindow = xwl_xy_to_window; + wl_display_roundtrip(xwl_screen->display); while (xwl_screen->expecting_event) wl_display_roundtrip(xwl_screen->display); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-output.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-output.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-output.c 2016-07-19 17:13:47.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-output.c 2017-03-15 18:05:25.000000000 +0000 @@ -31,6 +31,12 @@ #include #define DEFAULT_DPI 96 +#define ALL_ROTATIONS (RR_Rotate_0 | \ + RR_Rotate_90 | \ + RR_Rotate_180 | \ + RR_Rotate_270 | \ + RR_Reflect_X | \ + RR_Reflect_Y) static Rotation wl_transform_to_xrandr(enum wl_output_transform transform) @@ -102,26 +108,30 @@ if (!(flags & WL_OUTPUT_MODE_CURRENT)) return; - if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { - xwl_output->width = width; - xwl_output->height = height; - } else { - xwl_output->width = height; - xwl_output->height = width; - } - + xwl_output->width = width; + xwl_output->height = height; xwl_output->refresh = refresh; } static inline void output_get_new_size(struct xwl_output *xwl_output, - int *height, int *width) + int *height, int *width) { - if (*width < xwl_output->x + xwl_output->width) - *width = xwl_output->x + xwl_output->width; + int output_width, output_height; + + if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { + output_width = xwl_output->width; + output_height = xwl_output->height; + } else { + output_width = xwl_output->height; + output_height = xwl_output->width; + } - if (*height < xwl_output->y + xwl_output->height) - *height = xwl_output->y + xwl_output->height; + if (*width < xwl_output->x + output_width) + *width = xwl_output->x + output_width; + + if (*height < xwl_output->y + output_height) + *height = xwl_output->y + output_height; } /* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs @@ -266,6 +276,7 @@ ErrorF("Failed creating RandR CRTC\n"); goto err; } + RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS); xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name, strlen(name), xwl_output); @@ -292,26 +303,32 @@ void xwl_output_destroy(struct xwl_output *xwl_output) { + wl_output_destroy(xwl_output->output); + free(xwl_output); +} + +void +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; - wl_output_destroy(xwl_output->output); - xorg_list_del(&xwl_output->link); 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); update_screen_size(xwl_output, width, height); - free(xwl_output); + xwl_output_destroy(xwl_output); } static Bool xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) { - *rotations = 0; + *rotations = ALL_ROTATIONS; return TRUE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-shm.c xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-shm.c --- xorg-server-hwe-16.04-1.18.4/hw/xwayland/xwayland-shm.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwayland/xwayland-shm.c 2017-03-15 18:05:25.000000000 +0000 @@ -28,6 +28,8 @@ #include #endif +#include "os.h" + #include "xwayland.h" #include @@ -40,7 +42,6 @@ struct xwl_pixmap { struct wl_buffer *buffer; - int fd; void *data; size_t size; }; @@ -140,9 +141,17 @@ return -1; #ifdef HAVE_POSIX_FALLOCATE + /* + * posix_fallocate does an explicit rollback if it gets EINTR. + * Temporarily block signals to allow the call to succeed on + * slow systems where the smart scheduler's SIGALRM prevents + * large allocation attempts from ever succeeding. + */ + OsBlockSignals(); do { ret = posix_fallocate(fd, 0, size); } while (ret == EINTR); + OsReleaseSignals(); if (ret != 0) { close(fd); @@ -184,9 +193,13 @@ xwl_shm_create_pixmap(ScreenPtr screen, int width, int height, int depth, unsigned int hint) { - PixmapPtr pixmap; + struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_pixmap *xwl_pixmap; + struct wl_shm_pool *pool; + PixmapPtr pixmap; size_t size, stride; + uint32_t format; + int fd; if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE || (width == 0 && height == 0) || depth < 15) @@ -204,12 +217,12 @@ size = stride * height; xwl_pixmap->buffer = NULL; xwl_pixmap->size = size; - xwl_pixmap->fd = os_create_anonymous_file(size); - if (xwl_pixmap->fd < 0) + fd = os_create_anonymous_file(size); + if (fd < 0) goto err_free_xwl_pixmap; xwl_pixmap->data = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_SHARED, xwl_pixmap->fd, 0); + MAP_SHARED, fd, 0); if (xwl_pixmap->data == MAP_FAILED) goto err_close_fd; @@ -218,6 +231,15 @@ stride, xwl_pixmap->data)) goto err_munmap; + format = shm_format_for_depth(pixmap->drawable.depth); + pool = wl_shm_create_pool(xwl_screen->shm, fd, xwl_pixmap->size); + xwl_pixmap->buffer = wl_shm_pool_create_buffer(pool, 0, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->devKind, format); + wl_shm_pool_destroy(pool); + close(fd); + xwl_pixmap_set_private(pixmap, xwl_pixmap); return pixmap; @@ -225,7 +247,7 @@ err_munmap: munmap(xwl_pixmap->data, size); err_close_fd: - close(xwl_pixmap->fd); + close(fd); err_free_xwl_pixmap: free(xwl_pixmap); err_destroy_pixmap: @@ -243,7 +265,6 @@ if (xwl_pixmap->buffer) wl_buffer_destroy(xwl_pixmap->buffer); munmap(xwl_pixmap->data, xwl_pixmap->size); - close(xwl_pixmap->fd); free(xwl_pixmap); } @@ -253,26 +274,7 @@ struct wl_buffer * xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap) { - struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); - struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); - struct wl_shm_pool *pool; - uint32_t format; - - if (xwl_pixmap->buffer) - return xwl_pixmap->buffer; - - pool = wl_shm_create_pool(xwl_screen->shm, - xwl_pixmap->fd, xwl_pixmap->size); - - format = shm_format_for_depth(pixmap->drawable.depth); - xwl_pixmap->buffer = wl_shm_pool_create_buffer(pool, 0, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->devKind, format); - - wl_shm_pool_destroy(pool); - - return xwl_pixmap->buffer; + return xwl_pixmap_get(pixmap)->buffer; } Bool diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,9 @@ +noinst_LTLIBRARIES = libWindowsDRI.la + +libWindowsDRI_la_SOURCES = \ + windowsdri.c \ + windowsdri.h + +AM_CFLAGS = $(DIX_CFLAGS) \ + @WINDOWSDRI_CFLAGS@ \ + -I$(top_srcdir)/hw/xwin/ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -0,0 +1,836 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = hw/xwin/dri +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 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-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/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libWindowsDRI_la_LIBADD = +am_libWindowsDRI_la_OBJECTS = windowsdri.lo +libWindowsDRI_la_OBJECTS = $(am_libWindowsDRI_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 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +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 = $(libWindowsDRI_la_SOURCES) +DIST_SOURCES = $(libWindowsDRI_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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +BUNDLE_VERSION = @BUNDLE_VERSION@ +BUNDLE_VERSION_STRING = @BUNDLE_VERSION_STRING@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +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@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +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_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XQUARTZ_SPARKLE_FEED_URL = @XQUARTZ_SPARKLE_FEED_URL@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +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@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libWindowsDRI.la +libWindowsDRI_la_SOURCES = \ + windowsdri.c \ + windowsdri.h + +AM_CFLAGS = $(DIX_CFLAGS) \ + @WINDOWSDRI_CFLAGS@ \ + -I$(top_srcdir)/hw/xwin/ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xwin/dri/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xwin/dri/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_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}; \ + } + +libWindowsDRI.la: $(libWindowsDRI_la_OBJECTS) $(libWindowsDRI_la_DEPENDENCIES) $(EXTRA_libWindowsDRI_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libWindowsDRI_la_OBJECTS) $(libWindowsDRI_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowsdri.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am 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 maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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 -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/windowsdri.c xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/windowsdri.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/windowsdri.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/windowsdri.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,274 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "dixstruct.h" +#include "extnsionst.h" +#include "scrnintstr.h" +#include "swaprep.h" +#include "protocol-versions.h" +#include "windowsdri.h" +#include "glx/dri_helpers.h" + +static int WindowsDRIErrorBase = 0; +static unsigned char WindowsDRIReqCode = 0; +static int WindowsDRIEventBase = 0; + +static void +WindowsDRIResetProc(ExtensionEntry* extEntry) +{ +} + +static int +ProcWindowsDRIQueryVersion(ClientPtr client) +{ + xWindowsDRIQueryVersionReply rep; + + REQUEST_SIZE_MATCH(xWindowsDRIQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = SERVER_WINDOWSDRI_MAJOR_VERSION; + rep.minorVersion = SERVER_WINDOWSDRI_MINOR_VERSION; + rep.patchVersion = SERVER_WINDOWSDRI_PATCH_VERSION; + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); + swapl(&rep.patchVersion); + } + WriteToClient(client, sizeof(xWindowsDRIQueryVersionReply), &rep); + return Success; +} + +static int +ProcWindowsDRIQueryDirectRenderingCapable(ClientPtr client) +{ + xWindowsDRIQueryDirectRenderingCapableReply rep; + + REQUEST(xWindowsDRIQueryDirectRenderingCapableReq); + REQUEST_SIZE_MATCH(xWindowsDRIQueryDirectRenderingCapableReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!client->local) + rep.isCapable = 0; + else + rep.isCapable = glxWinGetScreenAiglxIsActive(screenInfo.screens[stuff->screen]); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + } + + WriteToClient(client, + sizeof(xWindowsDRIQueryDirectRenderingCapableReply), + &rep); + return Success; +} + +static int +ProcWindowsDRIQueryDrawable(ClientPtr client) +{ + xWindowsDRIQueryDrawableReply rep; + int rc; + + REQUEST(xWindowsDRIQueryDrawableReq); + REQUEST_SIZE_MATCH(xWindowsDRIQueryDrawableReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rc = glxWinQueryDrawable(client, stuff->drawable, &(rep.drawable_type), &(rep.handle)); + + if (rc) + return rc; + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.handle); + swapl(&rep.drawable_type); + } + + WriteToClient(client, sizeof(xWindowsDRIQueryDrawableReply), &rep); + return Success; +} + +static int +ProcWindowsDRIFBConfigToPixelFormat(ClientPtr client) +{ + xWindowsDRIFBConfigToPixelFormatReply rep; + + REQUEST(xWindowsDRIFBConfigToPixelFormatReq); + REQUEST_SIZE_MATCH(xWindowsDRIFBConfigToPixelFormatReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.pixelFormatIndex = glxWinFBConfigIDToPixelFormatIndex(stuff->screen, stuff->fbConfigID); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.pixelFormatIndex); + } + + WriteToClient(client, sizeof(xWindowsDRIFBConfigToPixelFormatReply), &rep); + return Success; +} + +/* dispatch */ + +static int +ProcWindowsDRIDispatch(ClientPtr client) +{ + REQUEST(xReq); + + switch (stuff->data) { + case X_WindowsDRIQueryVersion: + return ProcWindowsDRIQueryVersion(client); + + case X_WindowsDRIQueryDirectRenderingCapable: + return ProcWindowsDRIQueryDirectRenderingCapable(client); + } + + if (!client->local) + return WindowsDRIErrorBase + WindowsDRIClientNotLocal; + + switch (stuff->data) { + case X_WindowsDRIQueryDrawable: + return ProcWindowsDRIQueryDrawable(client); + + case X_WindowsDRIFBConfigToPixelFormat: + return ProcWindowsDRIFBConfigToPixelFormat(client); + + default: + return BadRequest; + } +} + +static void +SNotifyEvent(xWindowsDRINotifyEvent *from, + xWindowsDRINotifyEvent *to) +{ + to->type = from->type; + to->kind = from->kind; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->time, to->time); +} + +static int +SProcWindowsDRIQueryVersion(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryVersionReq); + swaps(&stuff->length); + return ProcWindowsDRIQueryVersion(client); +} + +static int +SProcWindowsDRIQueryDirectRenderingCapable(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryDirectRenderingCapableReq); + swaps(&stuff->length); + swapl(&stuff->screen); + return ProcWindowsDRIQueryDirectRenderingCapable(client); +} + +static int +SProcWindowsDRIQueryDrawable(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryDrawableReq); + swaps(&stuff->length); + swapl(&stuff->screen); + swapl(&stuff->drawable); + return ProcWindowsDRIQueryDrawable(client); +} + +static int +SProcWindowsDRIFBConfigToPixelFormat(ClientPtr client) +{ + REQUEST(xWindowsDRIFBConfigToPixelFormatReq); + swaps(&stuff->length); + swapl(&stuff->screen); + swapl(&stuff->fbConfigID); + return ProcWindowsDRIFBConfigToPixelFormat(client); +} + +static int +SProcWindowsDRIDispatch(ClientPtr client) +{ + REQUEST(xReq); + + switch (stuff->data) { + case X_WindowsDRIQueryVersion: + return SProcWindowsDRIQueryVersion(client); + + case X_WindowsDRIQueryDirectRenderingCapable: + return SProcWindowsDRIQueryDirectRenderingCapable(client); + } + + if (!client->local) + return WindowsDRIErrorBase + WindowsDRIClientNotLocal; + + switch (stuff->data) { + case X_WindowsDRIQueryDrawable: + return SProcWindowsDRIQueryDrawable(client); + + case X_WindowsDRIFBConfigToPixelFormat: + return SProcWindowsDRIFBConfigToPixelFormat(client); + + default: + return BadRequest; + } +} + +void +WindowsDRIExtensionInit(void) +{ + ExtensionEntry* extEntry; + + if ((extEntry = AddExtension(WINDOWSDRINAME, + WindowsDRINumberEvents, + WindowsDRINumberErrors, + ProcWindowsDRIDispatch, + SProcWindowsDRIDispatch, + WindowsDRIResetProc, + StandardMinorOpcode))) { + size_t i; + WindowsDRIReqCode = (unsigned char)extEntry->base; + WindowsDRIErrorBase = extEntry->errorBase; + WindowsDRIEventBase = extEntry->eventBase; + for (i = 0; i < WindowsDRINumberEvents; i++) + EventSwapVector[WindowsDRIEventBase + i] = (EventSwapPtr)SNotifyEvent; + } +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/windowsdri.h xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/windowsdri.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/dri/windowsdri.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/dri/windowsdri.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 windowsdri_h +#define windowsdri_h + +void WindowsDRIExtensionInit(void); +Bool noDriExtension; + +#endif /* windowsdri_h */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/dri_helpers.c xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/dri_helpers.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/dri_helpers.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/dri_helpers.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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. + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "indirect.h" +#include "winpriv.h" +#include "dri_helpers.h" +#include "win.h" + +int +glxWinQueryDrawable(ClientPtr client, XID drawId, unsigned int *type, unsigned int *handle) +{ + __GLXWinDrawable *pDrawable; + int err; + + if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, + DixReadAccess, (__GLXdrawable **)&pDrawable, &err)) { + + switch (pDrawable->base.type) + { + case GLX_DRAWABLE_WINDOW: + { + HWND h = winGetWindowInfo((WindowPtr)(pDrawable->base.pDraw)); + *handle = (uintptr_t)h; + *type = WindowsDRIDrawableWindow; + } + break; + + case GLX_DRAWABLE_PIXMAP: + glxWinDeferredCreateDrawable(pDrawable, pDrawable->base.config); + *handle = pDrawable->base.pDraw->id; + // The XID is used to create a unique name for a file mapping + // shared with the requesting process + // + // XXX: Alternatively, we could use an anonymous file mapping + // and use DuplicateHandle to make pDrawable->hSection available + // to the requesting process... ? + *type = WindowsDRIDrawablePixmap; + break; + + case GLX_DRAWABLE_PBUFFER: + glxWinDeferredCreateDrawable(pDrawable, pDrawable->base.config); + *handle = (uintptr_t)(pDrawable->hPbuffer); + *type = WindowsDRIDrawablePbuffer; + break; + + default: + assert(FALSE); + *handle = 0; + } + } + else { + HWND h; + /* The drawId XID doesn't identify a GLX drawable. The only other valid + alternative is that it is the XID of a window drawable that is being + used by the pre-GLX 1.3 interface */ + DrawablePtr pDraw; + int rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); + if (rc != Success || pDraw->type != DRAWABLE_WINDOW) { + return err; + } + + h = winGetWindowInfo((WindowPtr)(pDraw)); + *handle = (uintptr_t)h; + *type = WindowsDRIDrawableWindow; + } + + winDebug("glxWinQueryDrawable: type %d, handle %p\n", *type, (void *)(uintptr_t)*handle); + return Success; +} + +int +glxWinFBConfigIDToPixelFormatIndex(int scr, int fbConfigID) +{ + __GLXscreen *screen = glxGetScreen(screenInfo.screens[scr]); + __GLXconfig *c; + + for (c = screen->fbconfigs; + c != NULL; + c = c->next) { + if (c->fbconfigID == fbConfigID) + return ((GLXWinConfig *)c)->pixelFormatIndex; + } + + return 0; +} + +Bool +glxWinGetScreenAiglxIsActive(ScreenPtr pScreen) +{ + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + return pWinScreen->fNativeGlActive; +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/dri_helpers.h xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/dri_helpers.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/dri_helpers.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/dri_helpers.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 dri_helpers_h +#define dri_helpers_h + +#include "dixstruct.h" + +int +glxWinQueryDrawable(ClientPtr client, XID drawId, unsigned int *type, unsigned int *handle); + +int +glxWinFBConfigIDToPixelFormatIndex(int scr, int fbConfigID); + +Bool +glxWinGetScreenAiglxIsActive(ScreenPtr pScreen); + +#endif /* dri_helpers_h */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/indirect.c xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/indirect.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/indirect.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/indirect.c 2017-03-15 18:05:25.000000000 +0000 @@ -81,12 +81,12 @@ #include "glwindows.h" #include #include -#include #include #include #include #include +#include #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) @@ -101,59 +101,6 @@ #define PFD_SUPPORT_COMPOSITION 0x00008000 #endif -/* ---------------------------------------------------------------------- */ -/* - * structure definitions - */ - -typedef struct __GLXWinContext __GLXWinContext; -typedef struct __GLXWinDrawable __GLXWinDrawable; -typedef struct __GLXWinScreen glxWinScreen; -typedef struct __GLXWinConfig GLXWinConfig; - -struct __GLXWinContext { - __GLXcontext base; - HGLRC ctx; /* Windows GL Context */ - __GLXWinContext *shareContext; /* Context with which we will share display lists and textures */ - HWND hwnd; /* For detecting when HWND has changed */ -}; - -struct __GLXWinDrawable { - __GLXdrawable base; - __GLXWinContext *drawContext; - __GLXWinContext *readContext; - - /* If this drawable is GLX_DRAWABLE_PBUFFER */ - HPBUFFERARB hPbuffer; - - /* If this drawable is GLX_DRAWABLE_PIXMAP */ - HDC dibDC; - HBITMAP hDIB; - HBITMAP hOldDIB; /* original DIB for DC */ - void *pOldBits; /* original pBits for this drawable's pixmap */ -}; - -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; - Bool has_WGL_ARB_render_texture; - - /* wrapped screen functions */ - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - CopyWindowProcPtr CopyWindow; -}; - -struct __GLXWinConfig { - __GLXconfig base; - int pixelFormatIndex; -}; /* ---------------------------------------------------------------------- */ /* @@ -419,7 +366,8 @@ static Bool glxWinUnrealizeWindow(WindowPtr pWin); static void glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - +static Bool glxWinSetPixelFormat(HDC hdc, int bppOverride, int drawableTypeOverride, + __GLXscreen *screen, __GLXconfig *config); static HDC glxWinMakeDC(__GLXWinContext * gc, __GLXWinDrawable * draw, HDC * hdc, HWND * hwnd); static void glxWinReleaseDC(HWND hwnd, HDC hdc, __GLXWinDrawable * draw); @@ -627,75 +575,46 @@ // those screens to be accelerated in XP and earlier... { - // testing facility to not use any WGL extensions - char *envptr = getenv("GLWIN_NO_WGL_EXTENSIONS"); - - if ((envptr != NULL) && (atoi(envptr) != 0)) { - ErrorF("GLWIN_NO_WGL_EXTENSIONS is set, ignoring WGL_EXTENSIONS\n"); - wgl_extensions = ""; - } - } - - { - Bool glx_sgi_make_current_read = FALSE; - // // Based on the WGL extensions available, enable various GLX extensions // XXX: make this table-driven ? // - memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); - - if (strstr(wgl_extensions, "WGL_ARB_make_current_read")) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_make_current_read"); - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); - glx_sgi_make_current_read = TRUE; - } + if (strstr(wgl_extensions, "WGL_ARB_make_current_read")) + screen->has_WGL_ARB_make_current_read = TRUE; + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_make_current_read\n"); if (strstr(gl_extensions, "GL_WIN_swap_hint")) { - __glXEnableExtension(screen->glx_enable_bits, + __glXEnableExtension(screen->base.glx_enable_bits, "GLX_MESA_copy_sub_buffer"); LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); } if (strstr(wgl_extensions, "WGL_EXT_swap_control")) { - __glXEnableExtension(screen->glx_enable_bits, + __glXEnableExtension(screen->base.glx_enable_bits, "GLX_SGI_swap_control"); - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_swap_control"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); + LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control\n"); } /* // Hmm? screen->texOffset */ /* if (strstr(wgl_extensions, "WGL_ARB_render_texture")) */ /* { */ -/* __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_texture_from_pixmap"); */ +/* __glXEnableExtension(screen->base.glx_enable_bits, "GLX_EXT_texture_from_pixmap"); */ /* LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); */ /* screen->has_WGL_ARB_render_texture = TRUE; */ /* } */ - if (strstr(wgl_extensions, "WGL_ARB_pbuffer")) { - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_pbuffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_SGIX_pbuffer\n"); + if (strstr(wgl_extensions, "WGL_ARB_pbuffer")) screen->has_WGL_ARB_pbuffer = TRUE; - } + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_pbuffer\n"); - if (strstr(wgl_extensions, "WGL_ARB_multisample")) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_ARB_multisample"); - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGIS_multisample"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_ARB_multisample and GLX_SGIS_multisample\n"); + if (strstr(wgl_extensions, "WGL_ARB_multisample")) screen->has_WGL_ARB_multisample = TRUE; - } + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_multisample\n"); screen->base.destroy = glxWinScreenDestroy; screen->base.createContext = glxWinCreateContext; @@ -737,40 +656,7 @@ screen->base.numVisuals = 0; __glXScreenInit(&screen->base, pScreen); - - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) - { - unsigned int buffer_size = - __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - } - - // - // Override the GLX version (__glXScreenInit() sets it to "1.2") - // if we have all the needed extensions to operate as a higher version - // - // SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3 - // ARB_multisample -> 1.4 - // - if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read) { - if (screen->has_WGL_ARB_multisample) { - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - } - else { - screen->base.GLXmajor = 1; - screen->base.GLXminor = 3; - } - } } - LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n", - screen->base.GLXmajor, screen->base.GLXminor); wglMakeCurrent(NULL, NULL); wglDeleteContext(hglrc); @@ -788,6 +674,9 @@ screen->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = glxWinCopyWindow; + // Note that WGL is active on this screen + winSetScreenAiglxIsActive(pScreen); + return &screen->base; error: @@ -934,6 +823,10 @@ } if (glxPriv->hDIB) { + if (!CloseHandle(glxPriv->hSection)) { + ErrorF("CloseHandle failed: %s\n", glxWinErrorMessage()); + } + if (!DeleteObject(glxPriv->hDIB)) { ErrorF("DeleteObject failed: %s\n", glxWinErrorMessage()); } @@ -977,6 +870,179 @@ return &glxPriv->base; } +void +glxWinDeferredCreateDrawable(__GLXWinDrawable *draw, __GLXconfig *config) +{ + switch (draw->base.type) { + case GLX_DRAWABLE_WINDOW: + { + WindowPtr pWin = (WindowPtr) draw->base.pDraw; + + if (!(config->drawableType & GLX_WINDOW_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_WINDOW drawable with a fbConfig which doesn't have drawableType GLX_WINDOW_BIT\n"); + } + + if (pWin == NULL) { + GLWIN_DEBUG_MSG("Deferring until X window is created"); + return; + } + + GLWIN_DEBUG_MSG("glxWinDeferredCreateDrawable: pWin %p", pWin); + + if (winGetWindowInfo(pWin) == NULL) { + GLWIN_DEBUG_MSG("Deferring until native window is created"); + return; + } + } + break; + + case GLX_DRAWABLE_PBUFFER: + { + if (draw->hPbuffer == NULL) { + __GLXscreen *screen; + glxWinScreen *winScreen; + int pixelFormat; + + // XXX: which DC are we supposed to use??? + HDC screenDC = GetDC(NULL); + + if (!(config->drawableType & GLX_PBUFFER_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_PBUFFER drawable with a fbConfig which doesn't have drawableType GLX_PBUFFER_BIT\n"); + } + + screen = glxGetScreen(screenInfo.screens[draw->base.pDraw->pScreen->myNum]); + winScreen = (glxWinScreen *) screen; + + pixelFormat = + fbConfigToPixelFormatIndex(screenDC, config, + GLX_PBUFFER_BIT, winScreen); + if (pixelFormat == 0) { + return; + } + + draw->hPbuffer = + wglCreatePbufferARBWrapper(screenDC, pixelFormat, + draw->base.pDraw->width, + draw->base.pDraw->height, NULL); + ReleaseDC(NULL, screenDC); + + if (draw->hPbuffer == NULL) { + ErrorF("wglCreatePbufferARBWrapper error: %s\n", + glxWinErrorMessage()); + return; + } + + GLWIN_DEBUG_MSG + ("glxWinDeferredCreateDrawable: pBuffer %p created for drawable %p", + draw->hPbuffer, draw); + } + } + break; + + case GLX_DRAWABLE_PIXMAP: + { + if (draw->dibDC == NULL) { + BITMAPINFOHEADER bmpHeader; + void *pBits; + __GLXscreen *screen; + DWORD size; + char name[MAX_PATH]; + + memset(&bmpHeader, 0, sizeof(BITMAPINFOHEADER)); + bmpHeader.biSize = sizeof(BITMAPINFOHEADER); + bmpHeader.biWidth = draw->base.pDraw->width; + bmpHeader.biHeight = draw->base.pDraw->height; + bmpHeader.biPlanes = 1; + bmpHeader.biBitCount = draw->base.pDraw->bitsPerPixel; + bmpHeader.biCompression = BI_RGB; + + if (!(config->drawableType & GLX_PIXMAP_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_PIXMAP drawable with a fbConfig which doesn't have drawableType GLX_PIXMAP_BIT\n"); + } + + draw->dibDC = CreateCompatibleDC(NULL); + if (draw->dibDC == NULL) { + ErrorF("CreateCompatibleDC error: %s\n", glxWinErrorMessage()); + return; + } + +#define RASTERWIDTHBYTES(bmi) (((((bmi)->biWidth*(bmi)->biBitCount)+31)&~31)>>3) + size = bmpHeader.biHeight * RASTERWIDTHBYTES(&bmpHeader); + GLWIN_DEBUG_MSG("shared memory region size %zu + %u\n", sizeof(BITMAPINFOHEADER), (unsigned int)size); + + // Create unique name for mapping based on XID + // + // XXX: not quite unique as potentially this name could be used in + // another server instance. Not sure how to deal with that. + snprintf(name, sizeof(name), "Local\\CYGWINX_WINDOWSDRI_%08x", (unsigned int)draw->base.pDraw->id); + GLWIN_DEBUG_MSG("shared memory region name %s\n", name); + + // Create a file mapping backed by the pagefile + draw->hSection = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, + PAGE_READWRITE, 0, sizeof(BITMAPINFOHEADER) + size, name); + if (draw->hSection == NULL) { + ErrorF("CreateFileMapping error: %s\n", glxWinErrorMessage()); + return; + } + + draw->hDIB = + CreateDIBSection(draw->dibDC, (BITMAPINFO *) &bmpHeader, + DIB_RGB_COLORS, &pBits, draw->hSection, sizeof(BITMAPINFOHEADER)); + if (draw->dibDC == NULL) { + ErrorF("CreateDIBSection error: %s\n", glxWinErrorMessage()); + return; + } + + // Store a copy of the BITMAPINFOHEADER at the start of the shared + // memory for the information of the receiving process + { + LPVOID pData = MapViewOfFile(draw->hSection, FILE_MAP_WRITE, 0, 0, 0); + memcpy(pData, (void *)&bmpHeader, sizeof(BITMAPINFOHEADER)); + UnmapViewOfFile(pData); + } + + // XXX: CreateDIBSection insists on allocating the bitmap memory for us, so we're going to + // need some jiggery pokery to point the underlying X Drawable's bitmap at the same set of bits + // so that they can be read with XGetImage as well as glReadPixels, assuming the formats are + // even compatible ... + draw->pOldBits = ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr; + ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr = pBits; + + // Select the DIB into the DC + draw->hOldDIB = SelectObject(draw->dibDC, draw->hDIB); + if (!draw->hOldDIB) { + ErrorF("SelectObject error: %s\n", glxWinErrorMessage()); + } + + screen = glxGetScreen(screenInfo.screens[draw->base.pDraw->pScreen->myNum]); + + // Set the pixel format of the bitmap + glxWinSetPixelFormat(draw->dibDC, + draw->base.pDraw->bitsPerPixel, + GLX_PIXMAP_BIT, + screen, + config); + + GLWIN_DEBUG_MSG + ("glxWinDeferredCreateDrawable: DIB bitmap %p created for drawable %p", + draw->hDIB, draw); + } + } + break; + + default: + { + ErrorF + ("glxWinDeferredCreateDrawable: tried to attach unhandled drawable type %d\n", + draw->base.type); + return; + } + } +} + /* ---------------------------------------------------------------------- */ /* * Texture functions @@ -1020,13 +1086,10 @@ */ static Bool -glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, - int drawableTypeOverride) +glxWinSetPixelFormat(HDC hdc, int bppOverride, int drawableTypeOverride, + __GLXscreen *screen, __GLXconfig *config) { - __GLXscreen *screen = gc->base.pGlxScreen; glxWinScreen *winScreen = (glxWinScreen *) screen; - - __GLXconfig *config = gc->base.config; GLXWinConfig *winConfig = (GLXWinConfig *) config; GLWIN_DEBUG_MSG("glxWinSetPixelFormat: pixelFormatIndex %d", @@ -1077,7 +1140,7 @@ int pixelFormat; /* convert fbConfig to PFD */ - if (fbConfigToPixelFormat(gc->base.config, &pfd, drawableTypeOverride)) { + if (fbConfigToPixelFormat(config, &pfd, drawableTypeOverride)) { ErrorF("glxWinSetPixelFormat: fbConfigToPixelFormat failed\n"); return FALSE; } @@ -1109,9 +1172,9 @@ } } else { - int pixelFormat = - fbConfigToPixelFormatIndex(hdc, gc->base.config, - drawableTypeOverride, winScreen); + int pixelFormat = fbConfigToPixelFormatIndex(hdc, config, + drawableTypeOverride, + winScreen); if (pixelFormat == 0) { return FALSE; } @@ -1178,7 +1241,7 @@ gc->hwnd = *hwnd; /* We must select a pixelformat, but SetPixelFormat can only be called once for a window... */ - if (!glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT)) { + if (!glxWinSetPixelFormat(*hdc, 0, GLX_WINDOW_BIT, gc->base.pGlxScreen, gc->base.config)) { ErrorF("glxWinSetPixelFormat error: %s\n", glxWinErrorMessage()); ReleaseDC(*hwnd, *hdc); @@ -1264,140 +1327,7 @@ ("glxWinDeferredCreateContext: attach context %p to drawable %p", gc, draw); - switch (draw->base.type) { - case GLX_DRAWABLE_WINDOW: - { - WindowPtr pWin = (WindowPtr) draw->base.pDraw; - - if (!(gc->base.config->drawableType & GLX_WINDOW_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_WINDOW_BIT to a GLX_DRAWABLE_WINDOW drawable\n"); - } - - if (pWin == NULL) { - GLWIN_DEBUG_MSG("Deferring until X window is created"); - return; - } - - GLWIN_DEBUG_MSG("glxWinDeferredCreateContext: pWin %p", pWin); - - if (winGetWindowInfo(pWin) == NULL) { - GLWIN_DEBUG_MSG("Deferring until native window is created"); - return; - } - } - break; - - case GLX_DRAWABLE_PBUFFER: - { - if (draw->hPbuffer == NULL) { - __GLXscreen *screen; - glxWinScreen *winScreen; - int pixelFormat; - - // XXX: which DC are we supposed to use??? - HDC screenDC = GetDC(NULL); - - if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_PBUFFER_BIT to a GLX_DRAWABLE_PBUFFER drawable\n"); - } - - screen = gc->base.pGlxScreen; - winScreen = (glxWinScreen *) screen; - - pixelFormat = - fbConfigToPixelFormatIndex(screenDC, gc->base.config, - GLX_PBUFFER_BIT, winScreen); - if (pixelFormat == 0) { - return; - } - - draw->hPbuffer = - wglCreatePbufferARBWrapper(screenDC, pixelFormat, - draw->base.pDraw->width, - draw->base.pDraw->height, NULL); - ReleaseDC(NULL, screenDC); - - if (draw->hPbuffer == NULL) { - ErrorF("wglCreatePbufferARBWrapper error: %s\n", - glxWinErrorMessage()); - return; - } - - GLWIN_DEBUG_MSG - ("glxWinDeferredCreateContext: pBuffer %p created for drawable %p", - draw->hPbuffer, draw); - } - } - break; - - case GLX_DRAWABLE_PIXMAP: - { - if (draw->dibDC == NULL) { - BITMAPINFOHEADER bmpHeader; - void *pBits; - - memset(&bmpHeader, 0, sizeof(BITMAPINFOHEADER)); - bmpHeader.biSize = sizeof(BITMAPINFOHEADER); - bmpHeader.biWidth = draw->base.pDraw->width; - bmpHeader.biHeight = draw->base.pDraw->height; - bmpHeader.biPlanes = 1; - bmpHeader.biBitCount = draw->base.pDraw->bitsPerPixel; - bmpHeader.biCompression = BI_RGB; - - if (!(gc->base.config->drawableType & GLX_PIXMAP_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_PIXMAP_BIT to a GLX_DRAWABLE_PIXMAP drawable\n"); - } - - draw->dibDC = CreateCompatibleDC(NULL); - if (draw->dibDC == NULL) { - ErrorF("CreateCompatibleDC error: %s\n", glxWinErrorMessage()); - return; - } - - draw->hDIB = - CreateDIBSection(draw->dibDC, (BITMAPINFO *) &bmpHeader, - DIB_RGB_COLORS, &pBits, 0, 0); - if (draw->dibDC == NULL) { - ErrorF("CreateDIBSection error: %s\n", glxWinErrorMessage()); - return; - } - - // XXX: CreateDIBSection insists on allocating the bitmap memory for us, so we're going to - // need some jiggery pokery to point the underlying X Drawable's bitmap at the same set of bits - // so that they can be read with XGetImage as well as glReadPixels, assuming the formats are - // even compatible ... - draw->pOldBits = ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr; - ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr = pBits; - - // Select the DIB into the DC - draw->hOldDIB = SelectObject(draw->dibDC, draw->hDIB); - if (!draw->hOldDIB) { - ErrorF("SelectObject error: %s\n", glxWinErrorMessage()); - } - - // Set the pixel format of the bitmap - glxWinSetPixelFormat(gc, draw->dibDC, - draw->base.pDraw->bitsPerPixel, - GLX_PIXMAP_BIT); - - GLWIN_DEBUG_MSG - ("glxWinDeferredCreateContext: DIB bitmap %p created for drawable %p", - draw->hDIB, draw); - } - } - break; - - default: - { - ErrorF - ("glxWinDeferredCreateContext: tried to attach unhandled drawable type %d\n", - draw->base.type); - return; - } - } + glxWinDeferredCreateDrawable(draw, gc->base.config); dc = glxWinMakeDC(gc, draw, &dc, &hwnd); gc->ctx = wglCreateContext(dc); @@ -1434,6 +1364,7 @@ glxWinContextMakeCurrent(__GLXcontext * base) { __GLXWinContext *gc = (__GLXWinContext *) base; + glxWinScreen *scr = (glxWinScreen *)base->pGlxScreen; BOOL ret; HDC drawDC; HDC readDC = NULL; @@ -1466,7 +1397,14 @@ } if ((gc->base.readPriv != NULL) && (gc->base.readPriv != gc->base.drawPriv)) { - // XXX: should only occur with WGL_ARB_make_current_read + /* + * We enable GLX_SGI_make_current_read unconditionally, but the + * renderer might not support it. It's fairly rare to use this + * feature so just error out if it can't work. + */ + if (!scr->has_WGL_ARB_make_current_read) + return False; + /* If there is a separate read drawable, create a separate read DC, and use the wglMakeContextCurrent extension to make the context current drawing @@ -1959,7 +1897,6 @@ c->base.renderType = GLX_RGBA_BIT; } - c->base.xRenderable = GL_TRUE; c->base.fbconfigID = -1; // will be set by __glXScreenInit() /* SGIX_pbuffer / GLX 1.3 */ @@ -2319,7 +2256,6 @@ c->base.renderType = GLX_RGBA_BIT; } - c->base.xRenderable = GL_TRUE; c->base.fbconfigID = -1; // will be set by __glXScreenInit() /* SGIX_pbuffer / GLX 1.3 */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/indirect.h xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/indirect.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/indirect.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/indirect.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * Copyright © 2014 Jon TURNEY + * + * 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 indirect_h +#define indirect_h + +#include +#include +#include + +/* ---------------------------------------------------------------------- */ +/* + * structure definitions + */ + +typedef struct __GLXWinContext __GLXWinContext; +typedef struct __GLXWinDrawable __GLXWinDrawable; +typedef struct __GLXWinScreen glxWinScreen; +typedef struct __GLXWinConfig GLXWinConfig; + +struct __GLXWinContext { + __GLXcontext base; + HGLRC ctx; /* Windows GL Context */ + __GLXWinContext *shareContext; /* Context with which we will share display lists and textures */ + HWND hwnd; /* For detecting when HWND has changed */ +}; + +struct __GLXWinDrawable { + __GLXdrawable base; + __GLXWinContext *drawContext; + __GLXWinContext *readContext; + + /* If this drawable is GLX_DRAWABLE_PBUFFER */ + HPBUFFERARB hPbuffer; + + /* If this drawable is GLX_DRAWABLE_PIXMAP */ + HDC dibDC; + HANDLE hSection; /* file mapping handle */ + HBITMAP hDIB; + HBITMAP hOldDIB; /* original DIB for DC */ + void *pOldBits; /* original pBits for this drawable's pixmap */ +}; + +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; + Bool has_WGL_ARB_render_texture; + Bool has_WGL_ARB_make_current_read; + + /* wrapped screen functions */ + RealizeWindowProcPtr RealizeWindow; + UnrealizeWindowProcPtr UnrealizeWindow; + CopyWindowProcPtr CopyWindow; +}; + +struct __GLXWinConfig { + __GLXconfig base; + int pixelFormatIndex; +}; + +/* ---------------------------------------------------------------------- */ +/* + * function prototypes + */ + +void +glxWinDeferredCreateDrawable(__GLXWinDrawable *draw, __GLXconfig *config); + +#endif /* indirect_h */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/Makefile.am 2016-07-15 16:17:45.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -7,9 +7,16 @@ glwindows.h \ glshim.c \ indirect.c \ + indirect.h \ wgl_ext_api.c \ wgl_ext_api.h +if XWIN_WINDOWS_DRI +libXwinGLX_la_SOURCES += \ + dri_helpers.c \ + dri_helpers.h +endif + libnativeGLthunk_la_SOURCES = \ glthunk.c diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -88,12 +88,17 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@XWIN_WINDOWS_DRI_TRUE@am__append_1 = \ +@XWIN_WINDOWS_DRI_TRUE@ dri_helpers.c \ +@XWIN_WINDOWS_DRI_TRUE@ dri_helpers.h + subdir = hw/xwin/glx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -138,8 +143,12 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libXwinGLX_la_LIBADD = +am__libXwinGLX_la_SOURCES_DIST = winpriv.c winpriv.h glwindows.h \ + glshim.c indirect.c indirect.h wgl_ext_api.c wgl_ext_api.h \ + dri_helpers.c dri_helpers.h +@XWIN_WINDOWS_DRI_TRUE@am__objects_1 = dri_helpers.lo am_libXwinGLX_la_OBJECTS = winpriv.lo glshim.lo indirect.lo \ - wgl_ext_api.lo + wgl_ext_api.lo $(am__objects_1) libXwinGLX_la_OBJECTS = $(am_libXwinGLX_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -187,7 +196,8 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libXwinGLX_la_SOURCES) $(libnativeGLthunk_la_SOURCES) -DIST_SOURCES = $(libXwinGLX_la_SOURCES) $(libnativeGLthunk_la_SOURCES) +DIST_SOURCES = $(am__libXwinGLX_la_SOURCES_DIST) \ + $(libnativeGLthunk_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -389,6 +399,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -419,7 +432,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -514,6 +530,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -563,15 +580,9 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libXwinGLX.la lib_LTLIBRARIES = libnativeGLthunk.la -libXwinGLX_la_SOURCES = \ - winpriv.c \ - winpriv.h \ - glwindows.h \ - glshim.c \ - indirect.c \ - wgl_ext_api.c \ - wgl_ext_api.h - +libXwinGLX_la_SOURCES = winpriv.c winpriv.h glwindows.h glshim.c \ + indirect.c indirect.h wgl_ext_api.c wgl_ext_api.h \ + $(am__append_1) libnativeGLthunk_la_SOURCES = \ glthunk.c @@ -685,6 +696,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri_helpers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glshim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnativeGLthunk_la-glthunk.Plo@am__quote@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/winpriv.c xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/winpriv.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/winpriv.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/winpriv.c 2017-03-15 18:05:25.000000000 +0000 @@ -119,3 +119,10 @@ return FALSE; } + +void +winSetScreenAiglxIsActive(ScreenPtr pScreen) +{ + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + pWinScreen->fNativeGlActive = TRUE; +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/winpriv.h xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/winpriv.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/glx/winpriv.h 2016-03-03 19:01:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/glx/winpriv.h 2017-03-15 18:05:25.000000000 +0000 @@ -9,3 +9,4 @@ HWND winGetWindowInfo(WindowPtr pWin); Bool winCheckScreenAiglxIsSupported(ScreenPtr pScreen); +void winSetScreenAiglxIsActive(ScreenPtr pScreen); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/InitInput.c xorg-server-hwe-16.04-1.19.3/hw/xwin/InitInput.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/InitInput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/InitInput.c 2017-03-15 18:05:25.000000000 +0000 @@ -89,6 +89,18 @@ return; } + +#ifdef HAS_DEVWINDOWS +static void +xwinDevWindowsHandlerNotify(int fd, int ready, void *data) +{ + /* This should process Windows messages, but instead all of that is delayed + * until the wakeup handler is called. + */ + ; +} +#endif + /* See Porting Layer Definition - p. 17 */ void InitInput(int argc, char *argv[]) @@ -129,7 +141,7 @@ } /* Add the message queue as a device to wait for in WaitForSomething */ - AddEnabledDevice(g_fdMessageQueue); + SetNotifyFd(g_fdMessageQueue, xwinDevWindowsHandlerNotify, X_NOTIFY_READ, NULL); } #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/InitOutput.c xorg-server-hwe-16.04-1.19.3/hw/xwin/InitOutput.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/InitOutput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/InitOutput.c 2017-03-15 18:05:25.000000000 +0000 @@ -66,6 +66,7 @@ #include "glx_extinit.h" #ifdef XWIN_GLX_WINDOWS #include "glx/glwindows.h" +#include "dri/windowsdri.h" #endif /* @@ -76,9 +77,6 @@ * Function prototypes */ -static Bool - winCheckDisplayNumber(void); - void winLogCommandLine(int argc, char *argv[]); @@ -120,6 +118,9 @@ static const ExtensionModule xwinExtensions[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, +#ifdef XWIN_WINDOWS_DRI + { WindowsDRIExtensionInit, "Windows-DRI", &noDriExtension }, +#endif #endif }; @@ -213,7 +214,7 @@ #endif if (!g_fLogInited) { - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); g_fLogInited = TRUE; } LogClose(error); @@ -638,7 +639,8 @@ * avoid the second call */ g_fLogInited = TRUE; - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); + } LogSetParameter(XLOG_FLUSH, 1); LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose); @@ -692,6 +694,20 @@ } } } + + /* Work out what the default resize setting should be, and apply it if it + was not explicitly specified */ + { + int j; + for (j = 0; j < g_iNumScreens; j++) { + if (g_ScreenInfo[j].iResizeMode == resizeDefault) { + if (g_ScreenInfo[j].fFullScreen) + g_ScreenInfo[j].iResizeMode = resizeNotAllowed; + else + g_ScreenInfo[j].iResizeMode = resizeWithRandr; + } + } + } } static void @@ -748,10 +764,6 @@ ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n"); -#ifdef XWIN_MULTIWINDOWEXTWM - ErrorF("-internalwm\n" "\tRun the internal window manager.\n"); -#endif - #ifdef XWIN_XF86CONFIG ErrorF("-keyboard\n" "\tSpecify a keyboard device from the configuration file.\n"); @@ -824,11 +836,6 @@ "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n" "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n"); - ErrorF("-silent-dup-error\n" - "\tIf another instance of " EXECUTABLE_NAME - " with the same display number is running\n" - "\texit silently and don't display any error message.\n"); - ErrorF("-swcursor\n" "\tDisable the usage of the Windows cursor and use the X11 software\n" "\tcursor instead.\n"); @@ -877,7 +884,7 @@ /* Log file will not be opened for UseMsg unless we open it now */ if (!g_fLogInited) { - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); g_fLogInited = TRUE; } LogClose(EXIT_NO_ERROR); @@ -918,14 +925,6 @@ "Exiting.\n"); } - /* Check for duplicate invocation on same display number. */ - if (serverGeneration == 1 && !winCheckDisplayNumber()) { - if (g_fSilentDupError) - g_fSilentFatalError = TRUE; - FatalError("InitOutput - Duplicate invocation on display " - "number: %s. Exiting.\n", display); - } - #ifdef XWIN_XF86CONFIG /* Try to read the xorg.conf-style configuration file */ if (!winReadConfigfile()) @@ -1050,70 +1049,3 @@ winDebug("InitOutput - Returning.\n"); #endif } - -/* - * winCheckDisplayNumber - Check if another instance of Cygwin/X is - * already running on the same display number. If no one exists, - * make a mutex to prevent new instances from running on the same display. - * - * return FALSE if the display number is already used. - */ - -static Bool -winCheckDisplayNumber(void) -{ - int nDisp; - HANDLE mutex; - char name[MAX_PATH]; - const char *pszPrefix = '\0'; - OSVERSIONINFO osvi = { 0 }; - - /* Check display range */ - nDisp = atoi(display); - if (nDisp < 0 || nDisp > 65535) { - ErrorF("winCheckDisplayNumber - Bad display number: %d\n", nDisp); - return FALSE; - } - - /* Set first character of mutex name to null */ - name[0] = '\0'; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Want a mutex shared among all terminals on NT > 4.0 */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) { - pszPrefix = "Global\\"; - } - - /* Setup Cygwin/X specific part of name */ - snprintf(name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp); - - /* Windows automatically releases the mutex when this process exits */ - mutex = CreateMutex(NULL, FALSE, name); - if (!mutex) { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL); - ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n", - (LPSTR) lpMsgBuf); - LocalFree(lpMsgBuf); - - return FALSE; - } - if (GetLastError() == ERROR_ALREADY_EXISTS) { - ErrorF("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", nDisp); - return FALSE; - } - - return TRUE; -} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/Makefile.am xorg-server-hwe-16.04-1.19.3/hw/xwin/Makefile.am --- xorg-server-hwe-16.04-1.18.4/hw/xwin/Makefile.am 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -9,9 +9,17 @@ endif if XWIN_GLX_WINDOWS -GLX_DIR = glx -DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS -XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la +GLX_DIR = +DEFS_GLX_WINDOWS = +XWIN_GLX_LIBS = +if XWIN_WINDOWS_DRI +GLX_DIR += dri +DEFS_GLX_WINDOWS += -DXWIN_WINDOWS_DRI +XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/dri/libWindowsDRI.la +endif +GLX_DIR += glx +DEFS_GLX_WINDOWS += -DXWIN_GLX_WINDOWS +XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/glx/libXwinGLX.la XWIN_GLX_SYS_LIBS = -lopengl32 endif @@ -189,4 +197,4 @@ $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) SUBDIRS = man $(GLX_DIR) winclipboard . -DIST_SUBDIRS = man glx winclipboard . +DIST_SUBDIRS = man dri glx winclipboard . diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwin/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwin/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -90,12 +90,16 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = XWin$(EXEEXT) +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_1 = dri +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_2 = -DXWIN_WINDOWS_DRI +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_3 = $(top_builddir)/hw/xwin/dri/libWindowsDRI.la subdir = hw/xwin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -508,6 +512,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -538,7 +545,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -635,6 +645,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -688,9 +699,11 @@ @XWIN_CLIPBOARD_TRUE@DEFS_CLIPBOARD = -DXWIN_CLIPBOARD @XWIN_CLIPBOARD_TRUE@CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la -@XWIN_GLX_WINDOWS_TRUE@GLX_DIR = glx -@XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS -@XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.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 \ @@ -821,7 +834,7 @@ XWin.exe.manifest SUBDIRS = man $(GLX_DIR) winclipboard . -DIST_SUBDIRS = man glx winclipboard . +DIST_SUBDIRS = man dri glx winclipboard . all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/man/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwin/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwin/man/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/man/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -91,9 +91,10 @@ subdir = hw/xwin/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -352,6 +353,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/man/XWin.man xorg-server-hwe-16.04-1.19.3/hw/xwin/man/XWin.man --- xorg-server-hwe-16.04-1.18.4/hw/xwin/man/XWin.man 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/man/XWin.man 2017-03-15 18:05:25.000000000 +0000 @@ -124,7 +124,8 @@ .SH OPTIONS CONTROLLING RESIZE BEHAVIOUR .TP 8 .B \-resize[=none|scrollbars|randr] -Select the resize mode of an X screen. The default is randr. +Select the resize mode of an X screen. +The default is \fBnone\fP if \fB\-fullscreen\fP is used, \fBrandr\fP otherwise. .RS .IP \fB\-resize=none\fP 8 @@ -305,10 +306,6 @@ information (including trace and debug output) is produced. Bigger values will yield a still more detailed debug output. .TP 8 -.B \-silent-dup-error -If another instance of \fIXWin\fP with the same display number is found running, -exit silently and don't display any error message. -.TP 8 .B "\-xkblayout \fIlayout\fP" .TP 8 .B "\-xkbmodel \fImodel\fP" @@ -350,9 +347,6 @@ not have the correct colors. This option is intended to allow applications which only work with a depth 8 visual to operate in TrueColor modes. -.TP 8 -.B \-internalwm -Run the internal window manager. .SH LOG FILE As it runs \fIXWin\fP writes messages indicating the most relevant events diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winallpriv.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winallpriv.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winallpriv.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winallpriv.c 2017-03-15 18:05:25.000000000 +0000 @@ -79,13 +79,6 @@ /* Save the screen private pointer */ winSetScreenPriv(pScreen, pScreenPriv); - /* Reserve GC memory for our privates */ - if (!dixRegisterPrivateKey - (g_iGCPrivateKey, PRIVATE_GC, sizeof(winPrivGCRec))) { - ErrorF("winAllocatePrivates - AllocateGCPrivate () failed\n"); - return FALSE; - } - /* Reserve Pixmap memory for our privates */ if (!dixRegisterPrivateKey (g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof(winPrivPixmapRec))) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winauth.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winauth.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winauth.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winauth.c 2017-03-15 18:05:25.000000000 +0000 @@ -38,6 +38,16 @@ #include "securitysrv.h" #include "os/osdep.h" +#include + +/* Need to get this from Xlib.h */ +extern void XSetAuthorization( + const char * /* name */, + int /* namelen */, + const char * /* data */, + int /* datalen */ +); + /* * Constants */ @@ -51,6 +61,7 @@ static XID g_authId = 0; static unsigned int g_uiAuthDataLen = 0; static char *g_pAuthData = NULL; +static xcb_auth_info_t auth_info; /* * Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY @@ -131,6 +142,11 @@ g_uiAuthDataLen, g_pAuthData); } + auth_info.name = AUTH_NAME; + auth_info.namelen = strlen(AUTH_NAME); + auth_info.data = g_pAuthData; + auth_info.datalen = g_uiAuthDataLen; + #ifdef XCSECURITY /* Allocate structure for additional auth information */ pAuth = (SecurityAuthorizationPtr) @@ -168,3 +184,12 @@ XSetAuthorization(AUTH_NAME, strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen); } + +xcb_auth_info_t * +winGetXcbAuthInfo(void) +{ + if (g_pAuthData) + return &auth_info; + + return NULL; +} diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winblock.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winblock.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winblock.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winblock.c 2017-03-15 18:05:25.000000000 +0000 @@ -36,8 +36,7 @@ /* See Porting Layer Definition - p. 6 */ void -winBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask) +winBlockHandler(ScreenPtr pScreen, void *pTimeout) { #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) winScreenPriv(pScreen); @@ -70,7 +69,7 @@ if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) { int iReturn; - ErrorF("winBlockHandler - pthread_mutex_unlock()\n"); + winDebug("winBlockHandler - pthread_mutex_unlock()\n"); /* Flag that modules are to be started */ pScreenPriv->fServerStarted = TRUE; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winclipboard/Makefile.in xorg-server-hwe-16.04-1.19.3/hw/xwin/winclipboard/Makefile.in --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winclipboard/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winclipboard/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -94,9 +94,10 @@ subdir = hw/xwin/winclipboard ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -419,6 +420,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -449,7 +453,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -544,6 +551,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winconfig.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winconfig.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winconfig.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winconfig.c 2017-03-15 18:05:25.000000000 +0000 @@ -264,8 +264,9 @@ break; } g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1; - winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n", - g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); + winMsg(X_PROBED, "Setting autorepeat to delay=%ld, rate=%ld\n", + g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); + } } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/wincreatewnd.c xorg-server-hwe-16.04-1.19.3/hw/xwin/wincreatewnd.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/wincreatewnd.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/wincreatewnd.c 2017-03-15 18:05:25.000000000 +0000 @@ -171,7 +171,7 @@ fForceShowWindow = TRUE; } dwWindowStyle |= WS_CAPTION; - if (pScreenInfo->iResizeMode != notAllowed) + if (pScreenInfo->iResizeMode != resizeNotAllowed) dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX; } else @@ -226,7 +226,7 @@ ) && (pScreenInfo->iResizeMode == resizeWithScrollbars)) { /* We cannot have scrollbars if we do not have a window border */ - pScreenInfo->iResizeMode = notAllowed; + pScreenInfo->iResizeMode = resizeNotAllowed; } /* Did the user specify a height and width? */ @@ -253,7 +253,7 @@ #endif /* Are we resizable */ - if (pScreenInfo->iResizeMode != notAllowed) { + if (pScreenInfo->iResizeMode != resizeNotAllowed) { #if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window is resizable\n"); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winengine.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winengine.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winengine.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winengine.c 2017-03-15 18:05:25.000000000 +0000 @@ -203,7 +203,7 @@ return TRUE; } - return TRUE; + return FALSE; } /* diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winerror.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winerror.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winerror.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winerror.c 2017-03-15 18:05:25.000000000 +0000 @@ -75,7 +75,7 @@ if (!g_fLogInited) { g_fLogInited = TRUE; - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); } LogClose(EXIT_ERR_ABORT); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winglobals.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winglobals.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winglobals.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winglobals.c 2017-03-15 18:05:25.000000000 +0000 @@ -76,7 +76,6 @@ Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; -Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = TRUE; Bool g_fHostInTitle = TRUE; pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winglobals.h xorg-server-hwe-16.04-1.19.3/hw/xwin/winglobals.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winglobals.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winglobals.h 2017-03-15 18:05:25.000000000 +0000 @@ -52,7 +52,6 @@ extern Bool g_fXdmcpEnabled; extern Bool g_fNoHelpMessageBox; -extern Bool g_fSilentDupError; extern Bool g_fNativeGl; extern Bool g_fHostInTitle; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/win.h xorg-server-hwe-16.04-1.19.3/hw/xwin/win.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/win.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/win.h 2017-03-15 18:05:25.000000000 +0000 @@ -162,7 +162,6 @@ #include "mipointer.h" #include "X11/keysym.h" #include "micoord.h" -#include "dix.h" #include "miline.h" #include "shadow.h" #include "fb.h" @@ -287,26 +286,13 @@ typedef Bool (*winDestroyColormapProcPtr) (ColormapPtr pColormap); -typedef Bool (*winHotKeyAltTabProcPtr) (ScreenPtr); - typedef Bool (*winCreatePrimarySurfaceProcPtr) (ScreenPtr); typedef Bool (*winReleasePrimarySurfaceProcPtr) (ScreenPtr); -typedef Bool (*winFinishCreateWindowsWindowProcPtr) (WindowPtr pWin); - typedef Bool (*winCreateScreenResourcesProc) (ScreenPtr); /* - * GC (graphics context) privates - */ - -typedef struct { - HDC hdc; - HDC hdcMem; -} winPrivGCRec, *winPrivGCPtr; - -/* * Pixmap privates */ @@ -329,6 +315,7 @@ PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES]; } winPrivCmapRec, *winPrivCmapPtr; + /* * Windows Cursor handling. */ @@ -348,7 +335,8 @@ * Resize modes */ typedef enum { - notAllowed, + resizeDefault = -1, + resizeNotAllowed, resizeWithScrollbars, resizeWithRandr } winResizeMode; @@ -404,8 +392,6 @@ Bool fDecoration; #ifdef XWIN_MULTIWINDOWEXTWM Bool fMWExtWM; - Bool fInternalWM; - Bool fAnotherWMRunning; #endif Bool fRootless; #ifdef XWIN_MULTIWINDOW @@ -524,17 +510,10 @@ winStoreColorsProcPtr pwinStoreColors; winCreateColormapProcPtr pwinCreateColormap; winDestroyColormapProcPtr pwinDestroyColormap; - winHotKeyAltTabProcPtr pwinHotKeyAltTab; winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface; winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface; - winCreateScreenResourcesProc pwinCreateScreenResources; -#ifdef XWIN_MULTIWINDOW - /* Window Procedures for MultiWindow mode */ - winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow; -#endif - /* Window Procedures for Rootless mode */ CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; @@ -554,6 +533,8 @@ SetShapeProcPtr SetShape; winCursorRec cursor; + + Bool fNativeGlActive; } winPrivScreenRec; #ifdef XWIN_MULTIWINDOWEXTWM @@ -738,8 +719,7 @@ void -winBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask); +winBlockHandler(ScreenPtr pScreen, void *pTimeout); #ifdef XWIN_CLIPBOARD /* @@ -923,9 +903,7 @@ */ void - -winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, void *pReadmask); +winWakeupHandler(ScreenPtr pScreen, int iResult); /* * winwindow.c @@ -1137,9 +1115,6 @@ wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam); -Bool - winIsInternalWMRunning(winScreenInfoPtr pScreenInfo); - void winMWExtWMRestackWindows(ScreenPtr pScreen); #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winkeybd.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winkeybd.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winkeybd.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winkeybd.c 2017-03-15 18:05:25.000000000 +0000 @@ -246,7 +246,7 @@ unsigned short internalKeyStates; /* X server is being initialized */ - if (!inputInfo.keyboard) + if (!inputInfo.keyboard || !inputInfo.keyboard->key) return; /* Only process events if the rootwindow is mapped. The keyboard events diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmsg.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winmsg.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmsg.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmsg.c 2017-03-15 18:05:25.000000000 +0000 @@ -38,17 +38,7 @@ #endif #include -void -winVMsg(int, MessageType, int verb, const char *, va_list) -_X_ATTRIBUTE_PRINTF(4, 0); - -void -winVMsg(int scrnIndex, MessageType type, int verb, const char *format, - va_list ap) -{ - LogVMessageVerb(type, verb, format, ap); -} - +#ifdef XWIN_XF86CONFIG void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) { @@ -60,16 +50,6 @@ } void -winMsg(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - -void winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) { @@ -79,16 +59,7 @@ LogVMessageVerb(type, verb, format, ap); va_end(ap); } - -void -winMsgVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} +#endif void winErrorFVerb(int verb, const char *format, ...) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmsg.h xorg-server-hwe-16.04-1.19.3/hw/xwin/winmsg.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmsg.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmsg.h 2017-03-15 18:05:25.000000000 +0000 @@ -1,5 +1,3 @@ -#ifndef __WIN_MSG_H__ -#define __WIN_MSG_H__ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. * @@ -30,12 +28,17 @@ * Authors: Alexander Gottwald */ +#ifndef __WIN_MSG_H__ +#define __WIN_MSG_H__ + #include +#include /* * Function prototypes */ +#ifdef XWIN_XF86CONFIG void winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) @@ -43,12 +46,10 @@ void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(3, 4); -void -winMsgVerb(MessageType type, int verb, const char *format, ...) -_X_ATTRIBUTE_PRINTF(3, 4); -void -winMsg(MessageType type, const char *format, ...) -_X_ATTRIBUTE_PRINTF(2, 3); +#endif + +#define winMsg LogMessage + void winDebug(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowicons.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowicons.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowicons.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowicons.c 2017-03-15 18:05:25.000000000 +0000 @@ -36,15 +36,21 @@ #define WINVER 0x0500 #endif +#include +#include + #include #include -#include +#include +#include +#include #include "winresource.h" #include "winprefs.h" #include "winmsg.h" #include "winmultiwindowicons.h" #include "winglobals.h" + /* * global variables */ @@ -57,7 +63,7 @@ static void winScaleXImageToWindowsIcon(int iconSize, int effBPP, - int stride, XImage * pixmap, unsigned char *image) + int stride, xcb_image_t* pixmap, unsigned char *image) { int row, column, effXBPP, effXDepth; unsigned char *outPtr; @@ -69,15 +75,15 @@ unsigned int zero; unsigned int color; - effXBPP = pixmap->bits_per_pixel; - if (pixmap->bits_per_pixel == 15) + effXBPP = pixmap->bpp; + if (pixmap->bpp == 15) effXBPP = 16; effXDepth = pixmap->depth; if (pixmap->depth == 15) effXDepth = 16; - xStride = pixmap->bytes_per_line; + xStride = pixmap->stride; if (stride == 0 || xStride == 0) { ErrorF("winScaleXBitmapToWindows - stride or xStride is zero. " "Bailing.\n"); @@ -330,8 +336,8 @@ static HICON NetWMToWinIcon(int bpp, uint32_t * icon) { - static Bool hasIconAlphaChannel = FALSE; - static BOOL versionChecked = FALSE; + static bool hasIconAlphaChannel = FALSE; + static bool versionChecked = FALSE; if (!versionChecked) { OSVERSIONINFOEX osvi = { 0 }; @@ -366,8 +372,8 @@ */ static - HICON -winXIconToHICON(Display * pDisplay, Window id, int iconSize) +HICON +winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize) { unsigned char *mask, *image = NULL, *imageMask; unsigned char *dst, *src; @@ -375,16 +381,13 @@ unsigned int biggest_size = 0; HDC hDC; ICONINFO ii; - XWMHints *hints; + xcb_icccm_wm_hints_t hints; HICON hIcon = NULL; uint32_t *biggest_icon = NULL; - static Atom _XA_NET_WM_ICON; + static xcb_atom_t _XA_NET_WM_ICON; static int generation; uint32_t *icon, *icon_data = NULL; unsigned long int size; - Atom type; - int format; - unsigned long int left; hDC = GetDC(GetDesktopWindow()); planes = GetDeviceCaps(hDC, PLANES); @@ -393,17 +396,31 @@ /* Always prefer _NET_WM_ICON icons */ if (generation != serverGeneration) { + xcb_intern_atom_reply_t *atom_reply; + xcb_intern_atom_cookie_t atom_cookie; + const char *atomName = "_NET_WM_ICON"; + generation = serverGeneration; - _XA_NET_WM_ICON = XInternAtom(pDisplay, "_NET_WM_ICON", FALSE); + + _XA_NET_WM_ICON = XCB_NONE; + + atom_cookie = xcb_intern_atom(conn, 0, strlen(atomName), atomName); + atom_reply = xcb_intern_atom_reply(conn, atom_cookie, NULL); + if (atom_reply) { + _XA_NET_WM_ICON = atom_reply->atom; + free(atom_reply); + } } - if ((XGetWindowProperty(pDisplay, id, _XA_NET_WM_ICON, - 0, MAXINT, FALSE, - AnyPropertyType, &type, &format, &size, &left, - (unsigned char **) &icon_data) == Success) && - (icon_data != NULL)) { - for (icon = icon_data; icon < &icon_data[size] && *icon; - icon = &icon[icon[0] * icon[1] + 2]) { + { + xcb_get_property_cookie_t cookie = xcb_get_property(conn, FALSE, id, _XA_NET_WM_ICON, XCB_ATOM_CARDINAL, 0L, INT_MAX); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie, NULL); + + if (reply && + ((icon_data = xcb_get_property_value(reply)) != NULL)) { + size = xcb_get_property_value_length(reply)/sizeof(uint32_t); + for (icon = icon_data; icon < &icon_data[size] && *icon; + icon = &icon[icon[0] * icon[1] + 2]) { winDebug("winXIconToHICON: %u x %u NetIcon\n", icon[0], icon[1]); /* Icon data size will overflow an int and thus is bigger than the @@ -441,40 +458,46 @@ hIcon = NetWMToWinIcon(bpp, biggest_icon); } - XFree(icon_data); + free(reply); + } } if (!hIcon) { + xcb_get_property_cookie_t wm_hints_cookie; + winDebug("winXIconToHICON: no suitable NetIcon\n"); - hints = XGetWMHints(pDisplay, id); - if (hints) { + wm_hints_cookie = xcb_icccm_get_wm_hints(conn, id); + if (xcb_icccm_get_wm_hints_reply(conn, wm_hints_cookie, &hints, NULL)) { winDebug("winXIconToHICON: id 0x%x icon_pixmap hint 0x%x\n", (unsigned int)id, - (unsigned int)hints->icon_pixmap); + (unsigned int)hints.icon_pixmap); - if (hints->icon_pixmap) { - Window root; - int x, y; - unsigned int width, height, border_width, depth; - XImage *xImageIcon; - XImage *xImageMask = NULL; - - XGetGeometry(pDisplay, hints->icon_pixmap, &root, &x, &y, - &width, &height, &border_width, &depth); - - xImageIcon = - XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height, - 0xFFFFFFFF, ZPixmap); - winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", - (unsigned int)id, xImageIcon); - - if (hints->icon_mask) - xImageMask = - XGetImage(pDisplay, hints->icon_mask, 0, 0, width, - height, 0xFFFFFFFF, ZPixmap); + if (hints.icon_pixmap) { + unsigned int width, height; + xcb_image_t *xImageIcon; + xcb_image_t *xImageMask = NULL; - if (xImageIcon) { + xcb_get_geometry_cookie_t geom_cookie = xcb_get_geometry(conn, hints.icon_pixmap); + xcb_get_geometry_reply_t *geom_reply = xcb_get_geometry_reply(conn, geom_cookie, NULL); + + if (geom_reply) { + width = geom_reply->width; + height = geom_reply->height; + + xImageIcon = xcb_image_get(conn, hints.icon_pixmap, + 0, 0, width, height, + 0xFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + + winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", + (unsigned int)id, xImageIcon); + + if (hints.icon_mask) + xImageMask = xcb_image_get(conn, hints.icon_mask, + 0, 0, width, height, + 0xFFFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + + if (xImageIcon) { int effBPP, stride, maskStride; /* 15 BPP is really 16BPP as far as we care */ @@ -543,12 +566,12 @@ free(imageMask); if (xImageMask) - XDestroyImage(xImageMask); + xcb_image_destroy(xImageMask); - XDestroyImage(xImageIcon); + xcb_image_destroy(xImageIcon); + } } } - XFree(hints); } } return hIcon; @@ -560,20 +583,22 @@ #ifdef XWIN_MULTIWINDOW void -winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) +winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew) { HICON hIcon, hIconSmall = NULL, hIconOld; - /* Start with the icon from preferences, if any */ - hIcon = hIconNew; - hIconSmall = hIconNew; - - /* If we still need an icon, try and get the icon from WM_HINTS */ - if (!hIcon) - hIcon = winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXICON)); - if (!hIconSmall) - hIconSmall = - winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXSMICON)); + if (hIconNew) + { + /* Start with the icon from preferences, if any */ + hIcon = hIconNew; + hIconSmall = hIconNew; + } + else + { + /* If we still need an icon, try and get the icon from WM_HINTS */ + hIcon = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXICON)); + hIconSmall = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXSMICON)); + } /* If we got the small, but not the large one swap them */ if (!hIcon && hIconSmall) { diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowicons.h xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowicons.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowicons.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowicons.h 2017-03-15 18:05:25.000000000 +0000 @@ -27,8 +27,10 @@ #ifndef WINMULTIWINDOWICONS_H #define WINMULTIWINDOWICONS_H +#include + void - winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew); + winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew); void winInitGlobalIcons(void); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwindow.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwindow.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwindow.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwindow.c 2017-03-15 18:05:25.000000000 +0000 @@ -35,9 +35,11 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + #include "win.h" #include "dixevents.h" #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" /* * Prototypes for local functions @@ -485,7 +487,6 @@ HWND hFore = NULL; winWindowPriv(pWin); - winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; WinXSizeHints hints; Window daddyId; DWORD dwStyle, dwExStyle; @@ -606,9 +607,6 @@ /* Flag that this Windows window handles its own activation */ SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); - - /* Call engine-specific create window procedure */ - (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin); } Bool winInDestroyWindowsWindow = FALSE; @@ -802,56 +800,6 @@ } /* - * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE - */ - -void -winMinimizeWindow(Window id) -{ - WindowPtr pWin; - winPrivWinPtr pWinPriv; - -#ifdef XWIN_MULTIWINDOWEXTWM - win32RootlessWindowPtr pRLWinPriv; -#endif - HWND hWnd; - ScreenPtr pScreen = NULL; - winPrivScreenPtr pScreenPriv = NULL; - -#if CYGWINDOWING_DEBUG - ErrorF("winMinimizeWindow\n"); -#endif - - dixLookupResourceByType((void *) &pWin, id, RT_WINDOW, NullClient, - DixUnknownAccess); - if (!pWin) { - ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); - return; - } - - pScreen = pWin->drawable.pScreen; - if (pScreen) - pScreenPriv = winGetScreenPriv(pScreen); - -#ifdef XWIN_MULTIWINDOWEXTWM - if (pScreenPriv && pScreenPriv->pScreenInfo->fInternalWM) { - pRLWinPriv = - (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE); - hWnd = pRLWinPriv->hWnd; - } - else -#else - if (pScreenPriv) -#endif - { - pWinPriv = winGetWindowPriv(pWin); - hWnd = pWinPriv->hWnd; - } - - ShowWindow(hWnd, SW_MINIMIZE); -} - -/* * CopyWindow - See Porting Layer Definition - p. 39 */ void diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwm.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwm.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwm.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwm.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,16 +45,15 @@ #define HANDLE void * #include #undef HANDLE -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include + #include /* Local headers */ +#include "X11/Xdefs.h" // for Bool type #include "winwindow.h" #include "winprefs.h" #include "window.h" @@ -62,14 +61,11 @@ #include "windowstr.h" #include "winglobals.h" #include "windisplay.h" +#include "winmultiwindowicons.h" -#ifdef XWIN_MULTIWINDOWEXTWM -#include -#else /* We need the native HWND atom for intWM, so for consistency use the - same name as extWM would if we were building with enabled... */ + same name as extWM does */ #define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND" -#endif #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 @@ -78,6 +74,7 @@ extern void winDebug(const char *format, ...); extern void winReshapeMultiWindow(WindowPtr pWin); extern void winUpdateRgnMultiWindow(WindowPtr pWin); +extern xcb_auth_info_t *winGetXcbAuthInfo(void); #ifndef CYGDEBUG #define CYGDEBUG NO @@ -92,8 +89,6 @@ #ifdef HAS_DEVWINDOWS #define WIN_MSG_QUEUE_FNAME "/dev/windows" #endif -#define WIN_JMP_OKAY 0 -#define WIN_JMP_ERROR_IO 2 /* * Local structures @@ -109,17 +104,18 @@ struct _WMMsgNodeRec *pTail; pthread_mutex_t pmMutex; pthread_cond_t pcNotEmpty; - int nQueueSize; } WMMsgQueueRec, *WMMsgQueuePtr; typedef struct _WMInfo { - Display *pDisplay; + xcb_connection_t *conn; WMMsgQueueRec wmMsgQueue; - Atom atmWmProtos; - Atom atmWmDelete; - Atom atmWmTakeFocus; - Atom atmPrivMap; - Bool fAllowOtherWM; + xcb_atom_t atmWmProtos; + xcb_atom_t atmWmDelete; + xcb_atom_t atmWmTakeFocus; + xcb_atom_t atmPrivMap; + xcb_atom_t atmUtf8String; + xcb_atom_t atmNetWmName; + xcb_ewmh_connection_t ewmh; } WMInfoRec, *WMInfoPtr; typedef struct _WMProcArgRec { @@ -129,7 +125,7 @@ } WMProcArgRec, *WMProcArgPtr; typedef struct _XMsgProcArgRec { - Display *pDisplay; + xcb_connection_t *conn; DWORD dwScreen; WMInfoPtr pWMInfo; pthread_mutex_t *ppmServerStarted; @@ -149,48 +145,31 @@ InitQueue(WMMsgQueuePtr pQueue); static void - GetWindowName(Display * pDpy, Window iWin, char **ppWindowName); + GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName); -static int - SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData); +static void + SendXMessage(xcb_connection_t *conn, xcb_window_t iWin, xcb_atom_t atmType, long nData); static void - UpdateName(WMInfoPtr pWMInfo, Window iWindow); + UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow); static void *winMultiWindowWMProc(void *pArg); -static int - winMultiWindowWMErrorHandler(Display * pDisplay, XErrorEvent * pErr); - -static int - winMultiWindowWMIOErrorHandler(Display * pDisplay); - static void *winMultiWindowXMsgProc(void *pArg); -static int - winMultiWindowXMsgProcErrorHandler(Display * pDisplay, XErrorEvent * pErr); - -static int - winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay); - -static int - winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr); - static void winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg); #if 0 static void - PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction); + PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction); #endif static Bool - -CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen, - Bool fAllowOtherWM); +CheckAnotherWindowManager(xcb_connection_t *conn, DWORD dwScreen); static void - winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle); + winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle); void winUpdateWindowPosition(HWND hWnd, HWND * zstyle); @@ -199,15 +178,62 @@ * Local globals */ -static jmp_buf g_jmpWMEntry; -static XIOErrorHandler g_winMultiWindowWMOldIOErrorHandler; -static pthread_t g_winMultiWindowWMThread; -static jmp_buf g_jmpXMsgProcEntry; -static XIOErrorHandler g_winMultiWindowXMsgProcOldIOErrorHandler; -static pthread_t g_winMultiWindowXMsgProcThread; static Bool g_shutdown = FALSE; -static Bool redirectError = FALSE; -static Bool g_fAnotherWMRunning = FALSE; + +/* + * Translate msg id to text, for debug purposes + */ + +static const char * +MessageName(winWMMessagePtr msg) +{ + switch (msg->msg) + { + case WM_WM_MOVE: + return "WM_WM_MOVE"; + break; + case WM_WM_SIZE: + return "WM_WM_SIZE"; + break; + case WM_WM_RAISE: + return "WM_WM_RAISE"; + break; + case WM_WM_LOWER: + return "WM_WM_LOWER"; + break; + case WM_WM_UNMAP: + return "WM_WM_UNMAP"; + break; + case WM_WM_KILL: + return "WM_WM_KILL"; + break; + case WM_WM_ACTIVATE: + return "WM_WM_ACTIVATE"; + break; + case WM_WM_NAME_EVENT: + return "WM_WM_NAME_EVENT"; + break; + case WM_WM_ICON_EVENT: + return "WM_WM_ICON_EVENT"; + break; + case WM_WM_CHANGE_STATE: + return "WM_WM_CHANGE_STATE"; + break; + case WM_WM_MAP2: + return "WM_WM_MAP2"; + break; + case WM_WM_MAP3: + return "WM_WM_MAP3"; + break; + case WM_WM_HINTS_EVENT: + return "WM_WM_HINTS_EVENT"; + break; + default: + return "Unknown Message"; + break; + } +} + /* * PushMessage - Push a message onto the queue @@ -231,47 +257,6 @@ pQueue->pHead = pNode; } -#if 0 - switch (pNode->msg.msg) { - case WM_WM_MOVE: - ErrorF("\tWM_WM_MOVE\n"); - break; - case WM_WM_SIZE: - ErrorF("\tWM_WM_SIZE\n"); - break; - case WM_WM_RAISE: - ErrorF("\tWM_WM_RAISE\n"); - break; - case WM_WM_LOWER: - ErrorF("\tWM_WM_LOWER\n"); - break; - case WM_WM_MAP: - ErrorF("\tWM_WM_MAP\n"); - break; - case WM_WM_MAP2: - ErrorF("\tWM_WM_MAP2\n"); - break; - case WM_WM_MAP3: - ErrorF("\tWM_WM_MAP3\n"); - break; - case WM_WM_UNMAP: - ErrorF("\tWM_WM_UNMAP\n"); - break; - case WM_WM_KILL: - ErrorF("\tWM_WM_KILL\n"); - break; - case WM_WM_ACTIVATE: - ErrorF("\tWM_WM_ACTIVATE\n"); - break; - default: - ErrorF("\tUnknown Message.\n"); - break; - } -#endif - - /* Increase the count of elements in the queue by one */ - ++(pQueue->nQueueSize); - /* Release the queue mutex */ pthread_mutex_unlock(&pQueue->pmMutex); @@ -279,25 +264,6 @@ pthread_cond_signal(&pQueue->pcNotEmpty); } -#if CYGMULTIWINDOW_DEBUG -/* - * QueueSize - Return the size of the queue - */ - -static int -QueueSize(WMMsgQueuePtr pQueue) -{ - WMMsgNodePtr pNode; - int nSize = 0; - - /* Loop through all elements in the queue */ - for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext) - ++nSize; - - return nSize; -} -#endif - /* * PopMessage - Pop a message from the queue */ @@ -324,13 +290,6 @@ pQueue->pTail = NULL; } - /* Drop the number of elements in the queue by one */ - --(pQueue->nQueueSize); - -#if CYGMULTIWINDOW_DEBUG - ErrorF("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue)); -#endif - /* Release the queue mutex */ pthread_mutex_unlock(&pQueue->pmMutex); @@ -343,7 +302,7 @@ */ static Bool -HaveMessage(WMMsgQueuePtr pQueue, UINT msg, Window iWindow) +HaveMessage(WMMsgQueuePtr pQueue, UINT msg, xcb_window_t iWindow) { WMMsgNodePtr pNode; @@ -374,14 +333,6 @@ pQueue->pHead = NULL; pQueue->pTail = NULL; - /* There are no elements initially */ - pQueue->nQueueSize = 0; - -#if CYGMULTIWINDOW_DEBUG - winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize, - QueueSize(pQueue)); -#endif - winDebug("InitQueue - Calling pthread_mutex_init\n"); /* Create synchronization objects */ @@ -399,29 +350,20 @@ static char * -Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp) +Xutf8TextPropertyToString(WMInfoPtr pWMInfo, xcb_icccm_get_text_property_reply_t *xtp) { - int nNum; - char **ppList; char *pszReturnData; - if (Xutf8TextPropertyToTextList(pDisplay, xtp, &ppList, &nNum) >= Success && - nNum > 0 && *ppList) { - int i; - int iLen = 0; - - for (i = 0; i < nNum; i++) - iLen += strlen(ppList[i]); - pszReturnData = malloc(iLen + 1); - pszReturnData[0] = '\0'; - for (i = 0; i < nNum; i++) - strcat(pszReturnData, ppList[i]); - if (ppList) - XFreeStringList(ppList); + if ((xtp->encoding == XCB_ATOM_STRING) || // Latin1 ISO 8859-1 + (xtp->encoding == pWMInfo->atmUtf8String)) { // UTF-8 ISO 10646 + pszReturnData = strndup(xtp->name, xtp->name_len); } else { - pszReturnData = malloc(1); - pszReturnData[0] = '\0'; + // Converting from COMPOUND_TEXT to UTF-8 properly is complex to + // implement, and not very much use unless you have an old + // application which isn't UTF-8 aware. + ErrorF("Xutf8TextPropertyToString: text encoding %d is not implemented\n", xtp->encoding); + pszReturnData = strdup(""); } return pszReturnData; @@ -432,51 +374,81 @@ */ static void -GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) +GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName) { - int nResult; - XTextProperty xtpWindowName; - XTextProperty xtpClientMachine; - char *pszWindowName; - char *pszClientMachine; - char hostname[HOST_NAME_MAX + 1]; + xcb_connection_t *conn = pWMInfo->conn; + char *pszWindowName = NULL; #if CYGMULTIWINDOW_DEBUG ErrorF("GetWindowName\n"); #endif - /* Intialize ppWindowName to NULL */ - *ppWindowName = NULL; + /* Try to get window name from _NET_WM_NAME */ + { + xcb_get_property_cookie_t cookie; + xcb_get_property_reply_t *reply; - /* Try to get window name */ - nResult = XGetWMName(pDisplay, iWin, &xtpWindowName); - if (!nResult || !xtpWindowName.value || !xtpWindowName.nitems) { -#if CYGMULTIWINDOW_DEBUG - ErrorF("GetWindowName - XGetWMName failed. No name.\n"); -#endif - return; + cookie = xcb_get_property(pWMInfo->conn, FALSE, iWin, + pWMInfo->atmNetWmName, + XCB_GET_PROPERTY_TYPE_ANY, 0, INT_MAX); + reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL); + if (reply && (reply->type != XCB_NONE)) { + pszWindowName = strndup(xcb_get_property_value(reply), + xcb_get_property_value_length(reply)); + free(reply); + } } - pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName); - XFree(xtpWindowName.value); + /* Otherwise, try to get window name from WM_NAME */ + if (!pszWindowName) + { + xcb_get_property_cookie_t cookie; + xcb_icccm_get_text_property_reply_t reply; + + cookie = xcb_icccm_get_wm_name(conn, iWin); + if (!xcb_icccm_get_wm_name_reply(conn, cookie, &reply, NULL)) { + ErrorF("GetWindowName - xcb_icccm_get_wm_name_reply failed. No name.\n"); + *ppWindowName = NULL; + return; + } + + pszWindowName = Xutf8TextPropertyToString(pWMInfo, &reply); + xcb_icccm_get_text_property_reply_wipe(&reply); + } + + /* return the window name, unless... */ + *ppWindowName = pszWindowName; if (g_fHostInTitle) { + xcb_get_property_cookie_t cookie; + xcb_icccm_get_text_property_reply_t reply; + /* Try to get client machine name */ - nResult = XGetWMClientMachine(pDisplay, iWin, &xtpClientMachine); - if (nResult && xtpClientMachine.value && xtpClientMachine.nitems) { - pszClientMachine = - Xutf8TextPropertyToString(pDisplay, &xtpClientMachine); - XFree(xtpClientMachine.value); + cookie = xcb_icccm_get_wm_client_machine(conn, iWin); + if (xcb_icccm_get_wm_client_machine_reply(conn, cookie, &reply, NULL)) { + char *pszClientMachine; + char *pszClientHostname; + char *dot; + char hostname[HOST_NAME_MAX + 1]; + + pszClientMachine = Xutf8TextPropertyToString(pWMInfo, &reply); + xcb_icccm_get_text_property_reply_wipe(&reply); + + /* If client machine name looks like a FQDN, find the hostname */ + pszClientHostname = strdup(pszClientMachine); + dot = strchr(pszClientHostname, '.'); + if (dot) + *dot = '\0'; /* - If we have a client machine name - and it's not the local host name + If we have a client machine hostname + and it's not the local hostname and it's not already in the window title... */ - if (strlen(pszClientMachine) && + if (strlen(pszClientHostname) && !gethostname(hostname, HOST_NAME_MAX + 1) && - strcmp(hostname, pszClientMachine) && - (strstr(pszWindowName, pszClientMachine) == 0)) { + strcmp(hostname, pszClientHostname) && + (strstr(pszWindowName, pszClientHostname) == 0)) { /* ... add '@' to end of window name */ *ppWindowName = malloc(strlen(pszWindowName) + @@ -486,15 +458,12 @@ strcat(*ppWindowName, pszClientMachine); free(pszWindowName); - free(pszClientMachine); - - return; } + + free(pszClientMachine); + free(pszClientHostname); } } - - /* otherwise just return the window name */ - *ppWindowName = pszWindowName; } /* @@ -502,17 +471,21 @@ */ static Bool -IsWmProtocolAvailable(Display * pDisplay, Window iWindow, Atom atmProtocol) +IsWmProtocolAvailable(WMInfoPtr pWMInfo, xcb_window_t iWindow, xcb_atom_t atmProtocol) { - int i, n, found = 0; - Atom *protocols; - - if (XGetWMProtocols(pDisplay, iWindow, &protocols, &n)) { - for (i = 0; i < n; ++i) - if (protocols[i] == atmProtocol) - ++found; - - XFree(protocols); + int i, found = 0; + xcb_get_property_cookie_t cookie; + xcb_icccm_get_wm_protocols_reply_t reply; + xcb_connection_t *conn = pWMInfo->conn; + + cookie = xcb_icccm_get_wm_protocols(conn, iWindow, pWMInfo->ewmh.WM_PROTOCOLS); + if (xcb_icccm_get_wm_protocols_reply(conn, cookie, &reply, NULL)) { + for (i = 0; i < reply.atoms_len; ++i) + if (reply.atoms[i] == atmProtocol) { + ++found; + break; + } + xcb_icccm_get_wm_protocols_reply_wipe(&reply); } return found > 0; @@ -522,49 +495,46 @@ * Send a message to the X server from the WM thread */ -static int -SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData) +static void +SendXMessage(xcb_connection_t *conn, xcb_window_t iWin, xcb_atom_t atmType, long nData) { - XEvent e; + xcb_client_message_event_t e; /* Prepare the X event structure */ - e.type = ClientMessage; - e.xclient.window = iWin; - e.xclient.message_type = atmType; - e.xclient.format = 32; - e.xclient.data.l[0] = nData; - e.xclient.data.l[1] = CurrentTime; + memset(&e, 0, sizeof(e)); + e.response_type = XCB_CLIENT_MESSAGE; + e.window = iWin; + e.type = atmType; + e.format = 32; + e.data.data32[0] = nData; + e.data.data32[1] = XCB_CURRENT_TIME; /* Send the event to X */ - return XSendEvent(pDisplay, iWin, False, NoEventMask, &e); + xcb_send_event(conn, FALSE, iWin, XCB_EVENT_MASK_NO_EVENT, (const char *)&e); } /* * See if we can get the stored HWND for this window... */ static HWND -getHwnd(WMInfoPtr pWMInfo, Window iWindow) +getHwnd(WMInfoPtr pWMInfo, xcb_window_t iWindow) { - Atom atmType; - int fmtRet; - unsigned long items, remain; - HWND *retHwnd, hWnd = NULL; - - if (XGetWindowProperty(pWMInfo->pDisplay, - iWindow, - pWMInfo->atmPrivMap, - 0, - sizeof(HWND)/4, - False, - XA_INTEGER, - &atmType, - &fmtRet, - &items, - &remain, (unsigned char **) &retHwnd) == Success) { - if (retHwnd) { - hWnd = *retHwnd; - XFree(retHwnd); + HWND hWnd = NULL; + xcb_get_property_cookie_t cookie; + xcb_get_property_reply_t *reply; + + cookie = xcb_get_property(pWMInfo->conn, FALSE, iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 0L, sizeof(HWND)/4L); + reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL); + + if (reply) { + int length = xcb_get_property_value_length(reply); + HWND *value = xcb_get_property_value(reply); + + if (value && (length == sizeof(HWND))) { + hWnd = *value; } + free(reply); } /* Some sanity checks */ @@ -577,26 +547,81 @@ } /* + * Helper function to check for override-redirect + */ +static Bool +IsOverrideRedirect(xcb_connection_t *conn, xcb_window_t iWin) +{ + Bool result = FALSE; + xcb_get_window_attributes_reply_t *reply; + xcb_get_window_attributes_cookie_t cookie; + + cookie = xcb_get_window_attributes(conn, iWin); + reply = xcb_get_window_attributes_reply(conn, cookie, NULL); + if (reply) { + result = (reply->override_redirect != 0); + free(reply); + } + else { + ErrorF("IsOverrideRedirect: Failed to get window attributes\n"); + } + + return result; +} + +/* + * Helper function to get class and window names +*/ +static void +GetClassNames(WMInfoPtr pWMInfo, xcb_window_t iWindow, char **res_name, + char **res_class, char **window_name) +{ + xcb_get_property_cookie_t cookie1; + xcb_icccm_get_wm_class_reply_t reply1; + xcb_get_property_cookie_t cookie2; + xcb_icccm_get_text_property_reply_t reply2; + + cookie1 = xcb_icccm_get_wm_class(pWMInfo->conn, iWindow); + if (xcb_icccm_get_wm_class_reply(pWMInfo->conn, cookie1, &reply1, + NULL)) { + *res_name = strdup(reply1.instance_name); + *res_class = strdup(reply1.class_name); + xcb_icccm_get_wm_class_reply_wipe(&reply1); + } + else { + *res_name = strdup(""); + *res_class = strdup(""); + } + + cookie2 = xcb_icccm_get_wm_name(pWMInfo->conn, iWindow); + if (xcb_icccm_get_wm_name_reply(pWMInfo->conn, cookie2, &reply2, NULL)) { + *window_name = strndup(reply2.name, reply2.name_len); + xcb_icccm_get_text_property_reply_wipe(&reply2); + } + else { + *window_name = strdup(""); + } +} + +/* * Updates the name of a HWND according to its X WM_NAME property */ static void -UpdateName(WMInfoPtr pWMInfo, Window iWindow) +UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; - XWindowAttributes attr; hWnd = getHwnd(pWMInfo, iWindow); if (!hWnd) return; /* If window isn't override-redirect */ - XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); - if (!attr.override_redirect) { + if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) { char *pszWindowName; /* Get the X windows window name */ - GetWindowName(pWMInfo->pDisplay, iWindow, &pszWindowName); + GetWindowName(pWMInfo, iWindow, &pszWindowName); if (pszWindowName) { /* Convert from UTF-8 to wide char */ @@ -621,39 +646,30 @@ */ static void -UpdateIcon(WMInfoPtr pWMInfo, Window iWindow) +UpdateIcon(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; HICON hIconNew = NULL; - XWindowAttributes attr; hWnd = getHwnd(pWMInfo, iWindow); if (!hWnd) return; /* If window isn't override-redirect */ - XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); - if (!attr.override_redirect) { - XClassHint class_hint = { 0, 0 }; + if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) { char *window_name = 0; + char *res_name = 0; + char *res_class = 0; - if (XGetClassHint(pWMInfo->pDisplay, iWindow, &class_hint)) { - XFetchName(pWMInfo->pDisplay, iWindow, &window_name); + GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name); - hIconNew = - (HICON) winOverrideIcon(class_hint.res_name, - class_hint.res_class, window_name); + hIconNew = winOverrideIcon(res_name, res_class, window_name); - if (class_hint.res_name) - XFree(class_hint.res_name); - if (class_hint.res_class) - XFree(class_hint.res_class); - if (window_name) - XFree(window_name); - } + free(res_name); + free(res_class); + free(window_name); + winUpdateIcon(hWnd, pWMInfo->conn, iWindow, hIconNew); } - - winUpdateIcon(hWnd, pWMInfo->pDisplay, iWindow, hIconNew); } /* @@ -661,7 +677,7 @@ */ static void -UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) +UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; HWND zstyle = HWND_NOTOPMOST; @@ -672,7 +688,7 @@ return; /* Determine the Window style, which determines borders and clipping region... */ - winApplyHints(pWMInfo->pDisplay, iWindow, hWnd, &zstyle); + winApplyHints(pWMInfo, iWindow, hWnd, &zstyle); winUpdateWindowPosition(hWnd, &zstyle); /* Apply the updated window style, without changing it's show or activation state */ @@ -695,17 +711,36 @@ WS_EX_APPWINDOW) ? TRUE : FALSE); } +/* + * Updates the state of a HWND + * (only minimization supported at the moment) + */ + +static void +UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow) +{ + HWND hWnd; + + winDebug("UpdateState: iWindow 0x%08x\n", (int)iWindow); + + hWnd = getHwnd(pWMInfo, iWindow); + if (!hWnd) + return; + + ShowWindow(hWnd, SW_MINIMIZE); +} + #if 0 /* * Fix up any differences between the X11 and Win32 window stacks * starting at the window passed in */ static void -PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction) +PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction) { HWND hWnd; DWORD myWinProcID, winProcID; - Window xWindow; + xcb_window_t xWindow; WINDOWPLACEMENT wndPlace; hWnd = getHwnd(pWMInfo, iWindow); @@ -757,11 +792,6 @@ for (;;) { WMMsgNodePtr pNode; - if (g_fAnotherWMRunning) { /* Another Window manager exists. */ - Sleep(1000); - continue; - } - /* Pop a message off of our queue */ pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo); if (pNode == NULL) { @@ -772,74 +802,58 @@ } #if CYGMULTIWINDOW_DEBUG - ErrorF("winMultiWindowWMProc - MSG: %d ID: %d\n", - (int) pNode->msg.msg, (int) pNode->msg.dwID); + ErrorF("winMultiWindowWMProc - MSG: %s (%d) ID: %d\n", + MessageName(&(pNode->msg)), (int)pNode->msg.msg, (int)pNode->msg.dwID); #endif /* Branch on the message type */ switch (pNode->msg.msg) { #if 0 case WM_WM_MOVE: - ErrorF("\tWM_WM_MOVE\n"); break; case WM_WM_SIZE: - ErrorF("\tWM_WM_SIZE\n"); break; #endif case WM_WM_RAISE: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_RAISE\n"); -#endif /* Raise the window */ - XRaiseWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + { + const static uint32_t values[] = { XCB_STACK_MODE_ABOVE }; + xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow, + XCB_CONFIG_WINDOW_STACK_MODE, values); + } + #if 0 PreserveWin32Stack(pWMInfo, pNode->msg.iWindow, GW_HWNDPREV); #endif break; case WM_WM_LOWER: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_LOWER\n"); -#endif - /* Lower the window */ - XLowerWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + { + const static uint32_t values[] = { XCB_STACK_MODE_BELOW }; + xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow, + XCB_CONFIG_WINDOW_STACK_MODE, values); + } break; - case WM_WM_MAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP\n"); -#endif + case WM_WM_MAP2: /* Put a note as to the HWND associated with this Window */ - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); - UpdateName(pWMInfo, pNode->msg.iWindow); - UpdateIcon(pWMInfo, pNode->msg.iWindow); - break; + xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, + pNode->msg.iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 32, + sizeof(HWND)/4, &(pNode->msg.hwndWindow)); - case WM_WM_MAP2: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP2\n"); -#endif - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); break; case WM_WM_MAP3: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP3\n"); -#endif /* Put a note as to the HWND associated with this Window */ - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); + xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, + pNode->msg.iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 32, + sizeof(HWND)/4, &(pNode->msg.hwndWindow)); + UpdateName(pWMInfo, pNode->msg.iWindow); UpdateIcon(pWMInfo, pNode->msg.iWindow); UpdateStyle(pWMInfo, pNode->msg.iWindow); @@ -858,35 +872,26 @@ break; case WM_WM_UNMAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_UNMAP\n"); -#endif /* Unmap the window */ - XUnmapWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_unmap_window(pWMInfo->conn, pNode->msg.iWindow); break; case WM_WM_KILL: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_KILL\n"); -#endif { /* --- */ - if (IsWmProtocolAvailable(pWMInfo->pDisplay, + if (IsWmProtocolAvailable(pWMInfo, pNode->msg.iWindow, pWMInfo->atmWmDelete)) - SendXMessage(pWMInfo->pDisplay, + SendXMessage(pWMInfo->conn, pNode->msg.iWindow, pWMInfo->atmWmProtos, pWMInfo->atmWmDelete); else - XKillClient(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_kill_client(pWMInfo->conn, pNode->msg.iWindow); } break; case WM_WM_ACTIVATE: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_ACTIVATE\n"); -#endif /* Set the input focus */ /* @@ -899,23 +904,24 @@ */ { Bool neverFocus = FALSE; - XWMHints *hints = XGetWMHints(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_get_property_cookie_t cookie; + xcb_icccm_wm_hints_t hints; - if (hints) { - if (hints->flags & InputHint) - neverFocus = !hints->input; - XFree(hints); + cookie = xcb_icccm_get_wm_hints(pWMInfo->conn, pNode->msg.iWindow); + if (xcb_icccm_get_wm_hints_reply(pWMInfo->conn, cookie, &hints, + NULL)) { + if (hints.flags & XCB_ICCCM_WM_HINT_INPUT) + neverFocus = !hints.input; } if (!neverFocus) - XSetInputFocus(pWMInfo->pDisplay, - pNode->msg.iWindow, - RevertToPointerRoot, CurrentTime); + xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_POINTER_ROOT, + pNode->msg.iWindow, XCB_CURRENT_TIME); - if (IsWmProtocolAvailable(pWMInfo->pDisplay, + if (IsWmProtocolAvailable(pWMInfo, pNode->msg.iWindow, pWMInfo->atmWmTakeFocus)) - SendXMessage(pWMInfo->pDisplay, + SendXMessage(pWMInfo->conn, pNode->msg.iWindow, pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus); @@ -932,11 +938,8 @@ case WM_WM_HINTS_EVENT: { - XWindowAttributes attr; - /* Don't do anything if this is an override-redirect window */ - XGetWindowAttributes (pWMInfo->pDisplay, pNode->msg.iWindow, &attr); - if (attr.override_redirect) + if (IsOverrideRedirect(pWMInfo->conn, pNode->msg.iWindow)) break; UpdateStyle(pWMInfo, pNode->msg.iWindow); @@ -944,8 +947,7 @@ break; case WM_WM_CHANGE_STATE: - /* Minimize the window in Windows */ - winMinimizeWindow(pNode->msg.iWindow); + UpdateState(pWMInfo, pNode->msg.iWindow); break; default: @@ -958,7 +960,30 @@ free(pNode); /* Flush any pending events on our display */ - XFlush(pWMInfo->pDisplay); + xcb_flush(pWMInfo->conn); + + /* This is just laziness rather than making sure we used _checked everywhere */ + { + xcb_generic_event_t *event = xcb_poll_for_event(pWMInfo->conn); + if (event) { + if ((event->response_type & ~0x80) == 0) { + xcb_generic_error_t *err = (xcb_generic_error_t *)event; + ErrorF("winMultiWindowWMProc - Error code: %i, ID: 0x%08x, " + "Major opcode: %i, Minor opcode: %i\n", + err->error_code, err->resource_id, + err->major_code, err->minor_code); + } + } + } + + /* I/O errors etc. */ + { + int e = xcb_connection_has_error(pWMInfo->conn); + if (e) { + ErrorF("winMultiWindowWMProc - Fatal error %d on xcb connection\n", e); + break; + } + } } /* Free the condition variable */ @@ -976,6 +1001,22 @@ return NULL; } +static xcb_atom_t +intern_atom(xcb_connection_t *conn, const char *atomName) +{ + xcb_intern_atom_reply_t *atom_reply; + xcb_intern_atom_cookie_t atom_cookie; + xcb_atom_t atom = XCB_ATOM_NONE; + + atom_cookie = xcb_intern_atom(conn, 0, strlen(atomName), atomName); + atom_reply = xcb_intern_atom_reply(conn, atom_cookie, NULL); + if (atom_reply) { + atom = atom_reply->atom; + free(atom_reply); + } + return atom; +} + /* * X message procedure */ @@ -987,14 +1028,14 @@ XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg; char pszDisplay[512]; int iRetries; - XEvent event; - Atom atmWmName; - Atom atmWmHints; - Atom atmWmChange; - Atom atmNetWmIcon; - Atom atmWindowState, atmMotifWmHints, atmWindowType, atmNormalHints; + xcb_atom_t atmWmName; + xcb_atom_t atmNetWmName; + xcb_atom_t atmWmHints; + xcb_atom_t atmWmChange; + xcb_atom_t atmNetWmIcon; + xcb_atom_t atmWindowState, atmMotifWmHints, atmWindowType, atmNormalHints; int iReturn; - XIconSize *xis; + xcb_auth_info_t *auth_info; winDebug("winMultiWindowXMsgProc - Hello\n"); @@ -1004,7 +1045,7 @@ pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n"); + winDebug("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n"); /* Grab the server started mutex - pause until we get it */ iReturn = pthread_mutex_lock(pProcArg->ppmServerStarted); @@ -1014,44 +1055,12 @@ pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winMultiWindowXMsgProc - Warning: locale not supported by X\n"); - } + winDebug("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); - ErrorF("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n"); - - /* Install our error handler */ - XSetErrorHandler(winMultiWindowXMsgProcErrorHandler); - g_winMultiWindowXMsgProcThread = pthread_self(); - g_winMultiWindowXMsgProcOldIOErrorHandler = - XSetIOErrorHandler(winMultiWindowXMsgProcIOErrorHandler); - - /* Set jump point for IO Error exits */ - iReturn = setjmp(g_jmpXMsgProcEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO && iReturn != WIN_JMP_OKAY) { - /* setjmp returned an unknown value, exit */ - ErrorF("winInitMultiWindowXMsgProc - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit(NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) { - ErrorF("winInitMultiWindowXMsgProc - Caught IO Error. Exiting.\n"); - pthread_exit(NULL); - } + winDebug("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n"); /* Setup the display connection string x */ winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); @@ -1060,7 +1069,7 @@ ErrorF("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); /* Use our generated cookie for authentication */ - winSetAuthorization(); + auth_info = winGetXcbAuthInfo(); /* Initialize retry count */ iRetries = 0; @@ -1068,8 +1077,9 @@ /* Open the X display */ do { /* Try to open the display */ - pProcArg->pDisplay = XOpenDisplay(pszDisplay); - if (pProcArg->pDisplay == NULL) { + pProcArg->conn = xcb_connect_to_display_with_auth_info(pszDisplay, + auth_info, NULL); + if (xcb_connection_has_error(pProcArg->conn)) { ErrorF("winMultiWindowXMsgProc - Could not open display, try: %d, " "sleeping: %d\n", iRetries + 1, WIN_CONNECT_DELAY); ++iRetries; @@ -1079,49 +1089,56 @@ else break; } - while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); + while (xcb_connection_has_error(pProcArg->conn) && iRetries < WIN_CONNECT_RETRIES); /* Make sure that the display opened */ - if (pProcArg->pDisplay == NULL) { + if (xcb_connection_has_error(pProcArg->conn)) { ErrorF("winMultiWindowXMsgProc - Failed opening the display. " "Exiting.\n"); pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - XOpenDisplay () returned and " + ErrorF("winMultiWindowXMsgProc - xcb_connect() returned and " "successfully opened the display.\n"); /* Check if another window manager is already running */ - g_fAnotherWMRunning = - CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen, - pProcArg->pWMInfo->fAllowOtherWM); - - if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM) { + if (CheckAnotherWindowManager(pProcArg->conn, pProcArg->dwScreen)) { ErrorF("winMultiWindowXMsgProc - " "another window manager is running. Exiting.\n"); pthread_exit(NULL); } - /* Set up the supported icon sizes */ - xis = XAllocIconSize(); - if (xis) { - xis->min_width = xis->min_height = 16; - xis->max_width = xis->max_height = 48; - xis->width_inc = xis->height_inc = 16; - XSetIconSizes(pProcArg->pDisplay, - RootWindow(pProcArg->pDisplay, pProcArg->dwScreen), - xis, 1); - XFree(xis); - } - - atmWmName = XInternAtom(pProcArg->pDisplay, "WM_NAME", False); - atmWmHints = XInternAtom(pProcArg->pDisplay, "WM_HINTS", False); - atmWmChange = XInternAtom(pProcArg->pDisplay, "WM_CHANGE_STATE", False); - atmNetWmIcon = XInternAtom(pProcArg->pDisplay, "_NET_WM_ICON", False); - atmWindowState = XInternAtom(pProcArg->pDisplay, "_NET_WM_STATE", False); - atmMotifWmHints = XInternAtom(pProcArg->pDisplay, "_MOTIF_WM_HINTS", False); - atmWindowType = XInternAtom(pProcArg->pDisplay, "_NET_WM_WINDOW_TYPE", False); - atmNormalHints = XInternAtom(pProcArg->pDisplay, "WM_NORMAL_HINTS", False); + { + /* Get root window id */ + xcb_screen_t *root_screen = xcb_aux_get_screen(pProcArg->conn, pProcArg->dwScreen); + xcb_window_t root_window_id = root_screen->root; + + /* Set WM_ICON_SIZE property indicating desired icon sizes */ + typedef struct { + uint32_t min_width, min_height; + uint32_t max_width, max_height; + int32_t width_inc, height_inc; + } xcb_wm_icon_size_hints_hints_t; + + xcb_wm_icon_size_hints_hints_t xis; + xis.min_width = xis.min_height = 16; + xis.max_width = xis.max_height = 48; + xis.width_inc = xis.height_inc = 16; + + xcb_change_property(pProcArg->conn, XCB_PROP_MODE_REPLACE, root_window_id, + XCB_ATOM_WM_ICON_SIZE, XCB_ATOM_WM_ICON_SIZE, 32, + sizeof(xis)/4, &xis); + } + + atmWmName = intern_atom(pProcArg->conn, "WM_NAME"); + atmNetWmName = intern_atom(pProcArg->conn, "_NET_WM_NAME"); + atmWmHints = intern_atom(pProcArg->conn, "WM_HINTS"); + atmWmChange = intern_atom(pProcArg->conn, "WM_CHANGE_STATE"); + atmNetWmIcon = intern_atom(pProcArg->conn, "_NET_WM_ICON"); + atmWindowState = intern_atom(pProcArg->conn, "_NET_WM_STATE"); + atmMotifWmHints = intern_atom(pProcArg->conn, "_MOTIF_WM_HINTS"); + atmWindowType = intern_atom(pProcArg->conn, "_NET_WM_WINDOW_TYPE"); + atmNormalHints = intern_atom(pProcArg->conn, "WM_NORMAL_HINTS"); /* iiimxcf had a bug until 2009-04-27, assuming that the @@ -1131,50 +1148,54 @@ Since this is on in the default Solaris 10 install, workaround this by making sure it does exist... */ - XInternAtom(pProcArg->pDisplay, "WM_STATE", 0); + intern_atom(pProcArg->conn, "WM_STATE"); /* Loop until we explicitly break out */ while (1) { + xcb_generic_event_t *event; + uint8_t type; + Bool send_event; + if (g_shutdown) break; - if (pProcArg->pWMInfo->fAllowOtherWM && !XPending(pProcArg->pDisplay)) { - if (CheckAnotherWindowManager - (pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) { - if (!g_fAnotherWMRunning) { - g_fAnotherWMRunning = TRUE; - SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0, 0); - } - } - else { - if (g_fAnotherWMRunning) { - g_fAnotherWMRunning = FALSE; - SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0, 0); - } - } - Sleep(500); - continue; - } - /* Fetch next event */ - XNextEvent(pProcArg->pDisplay, &event); + event = xcb_wait_for_event(pProcArg->conn); + if (!event) { // returns NULL on I/O error + int e = xcb_connection_has_error(pProcArg->conn); + ErrorF("winMultiWindowXMsgProc - Fatal error %d on xcb connection\n", e); + break; + } - /* Branch on event type */ - if (event.type == CreateNotify) { - XWindowAttributes attr; + type = event->response_type & ~0x80; + send_event = event->response_type & 0x80; - XSelectInput(pProcArg->pDisplay, - event.xcreatewindow.window, PropertyChangeMask); + winDebug("winMultiWindowXMsgProc - event %d\n", type); - /* Get the window attributes */ - XGetWindowAttributes(pProcArg->pDisplay, - event.xcreatewindow.window, &attr); + /* Branch on event type */ + if (type == 0) { + xcb_generic_error_t *err = (xcb_generic_error_t *)event; + ErrorF("winMultiWindowXMsgProc - Error code: %i, ID: 0x%08x, " + "Major opcode: %i, Minor opcode: %i\n", + err->error_code, err->resource_id, + err->major_code, err->minor_code); + } + else if (type == XCB_CREATE_NOTIFY) { + xcb_create_notify_event_t *notify = (xcb_create_notify_event_t *)event; - if (!attr.override_redirect) - XSetWindowBorderWidth(pProcArg->pDisplay, - event.xcreatewindow.window, 0); + /* Request property change events */ + const static uint32_t mask_value[] = { XCB_EVENT_MASK_PROPERTY_CHANGE }; + xcb_change_window_attributes (pProcArg->conn, notify->window, + XCB_CW_EVENT_MASK, mask_value); + + /* If it's not override-redirect, set the border-width to 0 */ + if (!IsOverrideRedirect(pProcArg->conn, notify->window)) { + const static uint32_t width_value[] = { 0 }; + xcb_configure_window(pProcArg->conn, notify->window, + XCB_CONFIG_WINDOW_BORDER_WIDTH, width_value); + } } - else if (event.type == MapNotify) { + else if (type == XCB_MAP_NOTIFY) { /* Fake a reparentNotify event as SWT/Motif expects a Window Manager to reparent a top-level window when it is mapped and waits until they do. @@ -1190,43 +1211,44 @@ See sourceware bugzilla #9848 */ - XWindowAttributes attr; - Window root; - Window parent; - Window *children; - unsigned int nchildren; - - if (XGetWindowAttributes(event.xmap.display, - event.xmap.window, - &attr) && - XQueryTree(event.xmap.display, - event.xmap.window, - &root, &parent, &children, &nchildren)) { - if (children) - XFree(children); + xcb_map_notify_event_t *notify = (xcb_map_notify_event_t *)event; + + xcb_get_geometry_cookie_t cookie; + xcb_get_geometry_reply_t *reply; + xcb_query_tree_cookie_t cookie_qt; + xcb_query_tree_reply_t *reply_qt; + + cookie = xcb_get_geometry(pProcArg->conn, notify->window); + cookie_qt = xcb_query_tree(pProcArg->conn, notify->window); + reply = xcb_get_geometry_reply(pProcArg->conn, cookie, NULL); + reply_qt = xcb_query_tree_reply(pProcArg->conn, cookie_qt, NULL); + if (reply && reply_qt) { /* It's a top-level window if the parent window is a root window Only non-override_redirect windows can get reparented */ - if ((attr.root == parent) && !event.xmap.override_redirect) { - XEvent event_send; + if ((reply->root == reply_qt->parent) && !notify->override_redirect) { + xcb_reparent_notify_event_t event_send; - event_send.type = ReparentNotify; - event_send.xreparent.event = event.xmap.window; - event_send.xreparent.window = event.xmap.window; - event_send.xreparent.parent = parent; - event_send.xreparent.x = attr.x; - event_send.xreparent.y = attr.y; - - XSendEvent(event.xmap.display, - event.xmap.window, - True, StructureNotifyMask, &event_send); + event_send.response_type = ReparentNotify; + event_send.event = notify->window; + event_send.window = notify->window; + event_send.parent = reply_qt->parent; + event_send.x = reply->x; + event_send.y = reply->y; + + xcb_send_event (pProcArg->conn, TRUE, notify->window, + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + (const char *)&event_send); + + free(reply_qt); + free(reply); } } } - else if (event.type == ConfigureNotify) { - if (!event.xconfigure.send_event) { + else if (type == XCB_CONFIGURE_NOTIFY) { + if (!send_event) { /* Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT doesn't explicitly know about (See sun bug #6434227) @@ -1238,21 +1260,25 @@ Rather than tell all sorts of lies to get XWM to recognize us as one of those, simply send a synthetic ConfigureNotify for every non-synthetic one */ - XEvent event_send = event; + xcb_configure_notify_event_t *notify = (xcb_configure_notify_event_t *)event; + xcb_configure_notify_event_t event_send = *notify; + + event_send.event = notify->window; - event_send.xconfigure.send_event = TRUE; - event_send.xconfigure.event = event.xconfigure.window; - XSendEvent(event.xconfigure.display, - event.xconfigure.window, - True, StructureNotifyMask, &event_send); + xcb_send_event(pProcArg->conn, TRUE, notify->window, + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + (const char *)&event_send); } } - else if (event.type == PropertyNotify) { - if (event.xproperty.atom == atmWmName) { + else if (type == XCB_PROPERTY_NOTIFY) { + xcb_property_notify_event_t *notify = (xcb_property_notify_event_t *)event; + + if ((notify->atom == atmWmName) || + (notify->atom == atmNetWmName)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_NAME_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); @@ -1262,46 +1288,52 @@ Several properties are considered for WM hints, check if this property change affects any of them... (this list needs to be kept in sync with winApplyHints()) */ - if ((event.xproperty.atom == atmWmHints) || - (event.xproperty.atom == atmWindowState) || - (event.xproperty.atom == atmMotifWmHints) || - (event.xproperty.atom == atmWindowType) || - (event.xproperty.atom == atmNormalHints)) { + if ((notify->atom == atmWmHints) || + (notify->atom == atmWindowState) || + (notify->atom == atmMotifWmHints) || + (notify->atom == atmWindowType) || + (notify->atom == atmNormalHints)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_HINTS_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); } /* Not an else as WM_HINTS affects both style and icon */ - if ((event.xproperty.atom == atmWmHints) || - (event.xproperty.atom == atmNetWmIcon)) { + if ((notify->atom == atmWmHints) || + (notify->atom == atmNetWmIcon)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_ICON_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); } } } - else if (event.type == ClientMessage - && event.xclient.message_type == atmWmChange - && event.xclient.data.l[0] == IconicState) { - ErrorF("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n"); + else if (type == XCB_CLIENT_MESSAGE) { + xcb_client_message_event_t *client_msg = (xcb_client_message_event_t *)event; + + if (client_msg->type == atmWmChange + && client_msg->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) { + ErrorF("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n"); - memset(&msg, 0, sizeof(msg)); + memset(&msg, 0, sizeof(msg)); - msg.msg = WM_WM_CHANGE_STATE; - msg.iWindow = event.xclient.window; + msg.msg = WM_WM_CHANGE_STATE; + msg.iWindow = client_msg->window; - winSendMessageToWM(pProcArg->pWMInfo, &msg); + winSendMessageToWM(pProcArg->pWMInfo, &msg); + } } + + /* Free the event */ + free(event); } - XCloseDisplay(pProcArg->pDisplay); + xcb_disconnect(pProcArg->conn); pthread_exit(NULL); return NULL; } @@ -1317,7 +1349,7 @@ pthread_t * ptWMProc, pthread_t * ptXMsgProc, pthread_mutex_t * ppmServerStarted, - int dwScreen, HWND hwndScreen, BOOL allowOtherWM) + int dwScreen, HWND hwndScreen) { WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec)); WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec)); @@ -1339,7 +1371,6 @@ /* Set a return pointer to the Window Manager info structure */ *ppWMInfo = pWMInfo; - pWMInfo->fAllowOtherWM = allowOtherWM; /* Setup the argument structure for the thread function */ pArg->dwScreen = dwScreen; @@ -1387,6 +1418,7 @@ int iRetries = 0; char pszDisplay[512]; int iReturn; + xcb_auth_info_t *auth_info; winDebug("winInitMultiWindowWM - Hello\n"); @@ -1396,7 +1428,7 @@ pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n"); + winDebug("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n"); /* Grab our garbage mutex to satisfy pthread_cond_wait */ iReturn = pthread_mutex_lock(pProcArg->ppmServerStarted); @@ -1406,44 +1438,12 @@ pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winInitMultiWindowWM - Warning: Locale not supported by X.\n"); - } + winDebug("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); - ErrorF("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n"); - - /* Install our error handler */ - XSetErrorHandler(winMultiWindowWMErrorHandler); - g_winMultiWindowWMThread = pthread_self(); - g_winMultiWindowWMOldIOErrorHandler = - XSetIOErrorHandler(winMultiWindowWMIOErrorHandler); - - /* Set jump point for IO Error exits */ - iReturn = setjmp(g_jmpWMEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO && iReturn != WIN_JMP_OKAY) { - /* setjmp returned an unknown value, exit */ - ErrorF("winInitMultiWindowWM - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit(NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) { - ErrorF("winInitMultiWindowWM - Caught IO Error. Exiting.\n"); - pthread_exit(NULL); - } + winDebug("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n"); /* Setup the display connection string x */ winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); @@ -1452,13 +1452,14 @@ ErrorF("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); /* Use our generated cookie for authentication */ - winSetAuthorization(); + auth_info = winGetXcbAuthInfo(); /* Open the X display */ do { /* Try to open the display */ - pWMInfo->pDisplay = XOpenDisplay(pszDisplay); - if (pWMInfo->pDisplay == NULL) { + pWMInfo->conn = xcb_connect_to_display_with_auth_info(pszDisplay, + auth_info, NULL); + if (xcb_connection_has_error(pWMInfo->conn)) { ErrorF("winInitMultiWindowWM - Could not open display, try: %d, " "sleeping: %d\n", iRetries + 1, WIN_CONNECT_DELAY); ++iRetries; @@ -1468,38 +1469,89 @@ else break; } - while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); + while (xcb_connection_has_error(pWMInfo->conn) && iRetries < WIN_CONNECT_RETRIES); /* Make sure that the display opened */ - if (pWMInfo->pDisplay == NULL) { + if (xcb_connection_has_error(pWMInfo->conn)) { ErrorF("winInitMultiWindowWM - Failed opening the display. " "Exiting.\n"); pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - XOpenDisplay () returned and " + ErrorF("winInitMultiWindowWM - xcb_connect () returned and " "successfully opened the display.\n"); /* Create some atoms */ - pWMInfo->atmWmProtos = XInternAtom(pWMInfo->pDisplay, - "WM_PROTOCOLS", False); - pWMInfo->atmWmDelete = XInternAtom(pWMInfo->pDisplay, - "WM_DELETE_WINDOW", False); - pWMInfo->atmWmTakeFocus = XInternAtom(pWMInfo->pDisplay, - "WM_TAKE_FOCUS", False); - - pWMInfo->atmPrivMap = XInternAtom(pWMInfo->pDisplay, - WINDOWSWM_NATIVE_HWND, False); - - if (1) { - Cursor cursor = XCreateFontCursor(pWMInfo->pDisplay, XC_left_ptr); - - if (cursor) { - XDefineCursor(pWMInfo->pDisplay, - DefaultRootWindow(pWMInfo->pDisplay), cursor); - XFreeCursor(pWMInfo->pDisplay, cursor); + pWMInfo->atmWmProtos = intern_atom(pWMInfo->conn, "WM_PROTOCOLS"); + pWMInfo->atmWmDelete = intern_atom(pWMInfo->conn, "WM_DELETE_WINDOW"); + pWMInfo->atmWmTakeFocus = intern_atom(pWMInfo->conn, "WM_TAKE_FOCUS"); + pWMInfo->atmPrivMap = intern_atom(pWMInfo->conn, WINDOWSWM_NATIVE_HWND); + pWMInfo->atmUtf8String = intern_atom(pWMInfo->conn, "UTF8_STRING"); + pWMInfo->atmNetWmName = intern_atom(pWMInfo->conn, "_NET_WM_NAME"); + + /* Initialization for the xcb_ewmh and EWMH atoms */ + { + xcb_intern_atom_cookie_t *atoms_cookie; + atoms_cookie = xcb_ewmh_init_atoms(pWMInfo->conn, &pWMInfo->ewmh); + if (xcb_ewmh_init_atoms_replies(&pWMInfo->ewmh, atoms_cookie, NULL)) { + /* Set the _NET_SUPPORTED atom for this context. + + TODO: Audit to ensure we implement everything defined as MUSTs + for window managers in the EWMH standard.*/ + xcb_atom_t supported[] = + { + pWMInfo->ewmh.WM_PROTOCOLS, + pWMInfo->ewmh._NET_SUPPORTED, + pWMInfo->ewmh._NET_SUPPORTING_WM_CHECK, + pWMInfo->ewmh._NET_CLOSE_WINDOW, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH, + pWMInfo->ewmh._NET_WM_STATE, + pWMInfo->ewmh._NET_WM_STATE_HIDDEN, + pWMInfo->ewmh._NET_WM_STATE_ABOVE, + pWMInfo->ewmh._NET_WM_STATE_BELOW, + pWMInfo->ewmh._NET_WM_STATE_SKIP_TASKBAR, + }; + + xcb_ewmh_set_supported(&pWMInfo->ewmh, pProcArg->dwScreen, + sizeof(supported)/sizeof(xcb_atom_t), supported); + } + else { + ErrorF("winInitMultiWindowWM - xcb_ewmh_init_atoms() failed\n"); } } + + /* + Set the root window cursor to left_ptr (this controls the cursor an + application gets over it's windows when it doesn't set one) + */ + { +#define XC_left_ptr 68 + xcb_cursor_t cursor = xcb_generate_id(pWMInfo->conn); + xcb_font_t font = xcb_generate_id(pWMInfo->conn); + xcb_font_t *mask_font = &font; /* An alias to clarify */ + int shape = XC_left_ptr; + uint32_t mask = XCB_CW_CURSOR; + uint32_t value_list = cursor; + + xcb_screen_t *root_screen = xcb_aux_get_screen(pWMInfo->conn, pProcArg->dwScreen); + xcb_window_t window = root_screen->root; + + static const uint16_t fgred = 0, fggreen = 0, fgblue = 0; + static const uint16_t bgred = 0xFFFF, bggreen = 0xFFFF, bgblue = 0xFFFF; + + xcb_open_font(pWMInfo->conn, font, sizeof("cursor"), "cursor"); + + xcb_create_glyph_cursor(pWMInfo->conn, cursor, font, *mask_font, + shape, shape + 1, + fgred, fggreen, fgblue, bgred, bggreen, bgblue); + + xcb_change_window_attributes(pWMInfo->conn, window, mask, &value_list); + + xcb_free_cursor(pWMInfo->conn, cursor); + xcb_close_font(pWMInfo->conn, font); + } } /* @@ -1512,7 +1564,7 @@ WMMsgNodePtr pNode; #if CYGMULTIWINDOW_DEBUG - ErrorF("winSendMessageToWM ()\n"); + ErrorF("winSendMessageToWM %s\n", MessageName(pMsg)); #endif pNode = malloc(sizeof(WMMsgNodeRec)); @@ -1523,128 +1575,50 @@ } /* - * Window manager error handler - */ - -static int -winMultiWindowWMErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - char pszErrorMsg[100]; - - if (pErr->request_code == X_ChangeWindowAttributes - && pErr->error_code == BadAccess) { - ErrorF("winMultiWindowWMErrorHandler - ChangeWindowAttributes " - "BadAccess.\n"); - return 0; - } - - XGetErrorText(pDisplay, pErr->error_code, pszErrorMsg, sizeof(pszErrorMsg)); - ErrorF("winMultiWindowWMErrorHandler - ERROR: %s\n", pszErrorMsg); - - return 0; -} - -/* - * Window manager IO error handler - */ - -static int -winMultiWindowWMIOErrorHandler(Display * pDisplay) -{ - ErrorF("winMultiWindowWMIOErrorHandler!\n"); - - if (pthread_equal(pthread_self(), g_winMultiWindowWMThread)) { - if (g_shutdown) - pthread_exit(NULL); - - /* Restart at the main entry point */ - longjmp(g_jmpWMEntry, WIN_JMP_ERROR_IO); - } - - if (g_winMultiWindowWMOldIOErrorHandler) - g_winMultiWindowWMOldIOErrorHandler(pDisplay); - - return 0; -} - -/* - * X message procedure error handler - */ - -static int -winMultiWindowXMsgProcErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - char pszErrorMsg[100]; - - XGetErrorText(pDisplay, pErr->error_code, pszErrorMsg, sizeof(pszErrorMsg)); -#if CYGMULTIWINDOW_DEBUG - ErrorF("winMultiWindowXMsgProcErrorHandler - ERROR: %s\n", pszErrorMsg); -#endif - - return 0; -} - -/* - * X message procedure IO error handler - */ - -static int -winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay) -{ - ErrorF("winMultiWindowXMsgProcIOErrorHandler!\n"); - - if (pthread_equal(pthread_self(), g_winMultiWindowXMsgProcThread)) { - /* Restart at the main entry point */ - longjmp(g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO); - } - - if (g_winMultiWindowXMsgProcOldIOErrorHandler) - g_winMultiWindowXMsgProcOldIOErrorHandler(pDisplay); - - return 0; -} - -/* - * Catch RedirectError to detect other window manager running - */ - -static int -winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - redirectError = TRUE; - return 0; -} - -/* * Check if another window manager is running */ static Bool -CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen, - Bool fAllowOtherWM) +CheckAnotherWindowManager(xcb_connection_t *conn, DWORD dwScreen) { + Bool redirectError = FALSE; + + /* Get root window id */ + xcb_screen_t *root_screen = xcb_aux_get_screen(conn, dwScreen); + xcb_window_t root_window_id = root_screen->root; + /* Try to select the events which only one client at a time is allowed to select. If this causes an error, another window manager is already running... */ - redirectError = FALSE; - XSetErrorHandler(winRedirectErrorHandler); - XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen), - ResizeRedirectMask | SubstructureRedirectMask | - ButtonPressMask); - XSync(pDisplay, 0); - XSetErrorHandler(winMultiWindowXMsgProcErrorHandler); + const static uint32_t test_mask[] = { XCB_EVENT_MASK_RESIZE_REDIRECT | + XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | + XCB_EVENT_MASK_BUTTON_PRESS }; + + xcb_void_cookie_t cookie = xcb_change_window_attributes_checked(conn, + root_window_id, + XCB_CW_EVENT_MASK, + test_mask); + xcb_generic_error_t *error; + if ((error = xcb_request_check(conn, cookie))) + { + redirectError = TRUE; + free(error); + } /* Side effect: select the events we are actually interested in... - If other WMs are not allowed, also select one of the events which only one client + Other WMs are not allowed, also select one of the events which only one client at a time is allowed to select, so other window managers won't start... */ - XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen), - SubstructureNotifyMask | (!fAllowOtherWM ? ButtonPressMask : - 0)); - XSync(pDisplay, 0); + { + const uint32_t mask[] = { XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | + XCB_EVENT_MASK_BUTTON_PRESS }; + + xcb_change_window_attributes(conn, root_window_id, XCB_CW_EVENT_MASK, mask); + } + return redirectError; } @@ -1673,18 +1647,18 @@ #define HINT_MIN (1L<<1) static void -winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) +winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle) { - static Atom windowState, motif_wm_hints, windowType; - static Atom hiddenState, fullscreenState, belowState, aboveState, + + xcb_connection_t *conn = pWMInfo->conn; + static xcb_atom_t windowState, motif_wm_hints; + static xcb_atom_t hiddenState, fullscreenState, belowState, aboveState, skiptaskbarState; - static Atom dockWindow; + static xcb_atom_t splashType; static int generation; - Atom type, *pAtom = NULL; - int format; - unsigned long hint = 0, maxmin = 0, nitems = 0, left = 0; + + unsigned long hint = 0, maxmin = 0; unsigned long style, exStyle; - MwmHints *mwm_hint = NULL; if (!hWnd) return; @@ -1693,25 +1667,23 @@ if (generation != serverGeneration) { generation = serverGeneration; - windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False); - motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False); - windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False); - hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False); - fullscreenState = - XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False); - belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); - aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); - dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); - skiptaskbarState = - XInternAtom(pDisplay, "_NET_WM_STATE_SKIP_TASKBAR", False); - } - - if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, - MAXINT, False, XA_ATOM, &type, &format, - &nitems, &left, - (unsigned char **) &pAtom) == Success) { - if (pAtom ) { - unsigned long i; + windowState = intern_atom(conn, "_NET_WM_STATE"); + motif_wm_hints = intern_atom(conn, "_MOTIF_WM_HINTS"); + hiddenState = intern_atom(conn, "_NET_WM_STATE_HIDDEN"); + fullscreenState = intern_atom(conn, "_NET_WM_STATE_FULLSCREEN"); + belowState = intern_atom(conn, "_NET_WM_STATE_BELOW"); + aboveState = intern_atom(conn, "_NET_WM_STATE_ABOVE"); + skiptaskbarState = intern_atom(conn, "_NET_WM_STATE_SKIP_TASKBAR"); + splashType = intern_atom(conn, "_NET_WM_WINDOW_TYPE_SPLASHSCREEN"); + } + + { + xcb_get_property_cookie_t cookie_wm_state = xcb_get_property(conn, FALSE, iWindow, windowState, XCB_ATOM_ATOM, 0L, INT_MAX); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie_wm_state, NULL); + if (reply) { + int i; + int nitems = xcb_get_property_value_length(reply)/sizeof(xcb_atom_t); + xcb_atom_t *pAtom = xcb_get_property_value(reply); for (i = 0; i < nitems; i++) { if (pAtom[i] == skiptaskbarState) @@ -1726,16 +1698,17 @@ *zstyle = HWND_TOPMOST; } - XFree(pAtom); - } + free(reply); + } } - nitems = left = 0; - if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L, - PropMwmHintsElements, False, motif_wm_hints, &type, - &format, &nitems, &left, - (unsigned char **) &mwm_hint) == Success) { - if (mwm_hint && nitems == PropMwmHintsElements && + { + xcb_get_property_cookie_t cookie_mwm_hint = xcb_get_property(conn, FALSE, iWindow, motif_wm_hints, motif_wm_hints, 0L, sizeof(MwmHints)); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie_mwm_hint, NULL); + if (reply) { + int nitems = xcb_get_property_value_length(reply)/4; + MwmHints *mwm_hint = xcb_get_property_value(reply); + if (mwm_hint && (nitems >= PropMwmHintsElements) && (mwm_hint->flags & MwmHintsDecorations)) { if (!mwm_hint->decorations) hint |= (HINT_NOFRAME | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE); @@ -1760,48 +1733,54 @@ */ } } - if (mwm_hint) - XFree(mwm_hint); + free(reply); + } } - nitems = left = 0; - pAtom = NULL; - if (XGetWindowProperty(pDisplay, iWindow, windowType, 0L, - 1L, False, XA_ATOM, &type, &format, - &nitems, &left, - (unsigned char **) &pAtom) == Success) { - if (pAtom && nitems == 1) { - if (*pAtom == dockWindow) { + { + int i; + xcb_ewmh_get_atoms_reply_t type; + xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type(&pWMInfo->ewmh, iWindow); + if (xcb_ewmh_get_wm_window_type_reply(&pWMInfo->ewmh, cookie, &type, NULL)) { + for (i = 0; i < type.atoms_len; i++) { + if (type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK) { hint = (hint & ~HINT_NOFRAME) | HINT_SKIPTASKBAR | HINT_SIZEBOX; *zstyle = HWND_TOPMOST; } + else if ((type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH) + || (type.atoms[i] == splashType)) { + hint |= (HINT_SKIPTASKBAR | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE); + *zstyle = HWND_TOPMOST; + } } - if (pAtom) - XFree(pAtom); + } } { - XSizeHints *normal_hint = XAllocSizeHints(); - long supplied; + xcb_size_hints_t size_hints; + xcb_get_property_cookie_t cookie; - if (normal_hint && - XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) { - if (normal_hint->flags & PMaxSize) { - /* Not maximizable if a maximum size is specified */ - hint |= HINT_NOMAXIMIZE; + cookie = xcb_icccm_get_wm_normal_hints(conn, iWindow); + if (xcb_icccm_get_wm_normal_hints_reply(conn, cookie, &size_hints, NULL)) { + if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) { + + /* Not maximizable if a maximum size is specified, and that size + is smaller (in either dimension) than the screen size */ + if ((size_hints.max_width < GetSystemMetrics(SM_CXVIRTUALSCREEN)) + || (size_hints.max_height < GetSystemMetrics(SM_CYVIRTUALSCREEN))) + hint |= HINT_NOMAXIMIZE; - if (normal_hint->flags & PMinSize) { + if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { /* If both minimum size and maximum size are specified and are the same, don't bother with a resizing frame */ - if ((normal_hint->min_width == normal_hint->max_width) - && (normal_hint->min_height == normal_hint->max_height)) + if ((size_hints.min_width == size_hints.max_width) + && (size_hints.min_height == size_hints.max_height)) hint = (hint & ~HINT_SIZEBOX); } } } - XFree(normal_hint); } /* @@ -1809,41 +1788,32 @@ application id for grouping. */ { - XClassHint class_hint = { 0, 0 }; - char *window_name = 0; char *application_id = 0; + char *window_name = 0; + char *res_name = 0; + char *res_class = 0; - if (XGetClassHint(pDisplay, iWindow, &class_hint)) { - XFetchName(pDisplay, iWindow, &window_name); + GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name); - style = - winOverrideStyle(class_hint.res_name, class_hint.res_class, - window_name); + style = STYLE_NONE; + style = winOverrideStyle(res_name, res_class, window_name); #define APPLICATION_ID_FORMAT "%s.xwin.%s" #define APPLICATION_ID_UNKNOWN "unknown" - if (class_hint.res_class) { - asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, - class_hint.res_class); - } - else { - asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, - APPLICATION_ID_UNKNOWN); - } - winSetAppUserModelID(hWnd, application_id); - - if (class_hint.res_name) - XFree(class_hint.res_name); - if (class_hint.res_class) - XFree(class_hint.res_class); - if (application_id) - free(application_id); - if (window_name) - XFree(window_name); + if (res_class) { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + res_class); } else { - style = STYLE_NONE; + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + APPLICATION_ID_UNKNOWN); } + winSetAppUserModelID(hWnd, application_id); + + free(application_id); + free(res_name); + free(res_class); + free(window_name); } if (style & STYLE_TOPMOST) diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwndproc.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwndproc.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winmultiwindowwndproc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winmultiwindowwndproc.c 2017-03-15 18:05:25.000000000 +0000 @@ -428,7 +428,7 @@ /* * Any window menu items go through here */ - if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam))) { + if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam), s_pScreenPriv)) { /* Don't pass customized menus to DefWindowProc */ return 0; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefs.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefs.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefs.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefs.c 2017-03-15 18:05:25.000000000 +0000 @@ -46,6 +46,7 @@ #include "winprefs.h" #include "windisplay.h" #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" /* Where will the custom menu commands start counting from? */ #define STARTMENUID WM_USER @@ -205,18 +206,21 @@ * Set custom icons and menus again. */ static void -ReloadPrefs(void) +ReloadPrefs(winPrivScreenPtr pScreenPriv) { int i; #ifdef XWIN_MULTIWINDOW + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + /* First, iterate over all windows, deleting their icons and custom menus. * This is really only needed because winDestroyIcon() will try to * destroy the old global icons, which will have changed. * It is probably better to set a windows USER_DATA to flag locally defined * icons, and use that to accurately know when to destroy old icons. */ - EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); + if (pScreenInfo->fMultiWindow) + EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); #endif /* Now, free/clear all info from our prefs structure */ @@ -261,12 +265,12 @@ g_hSmallIconX = NULL; #ifdef XWIN_MULTIWINDOW - winInitGlobalIcons(); -#endif + if (pScreenInfo->fMultiWindow) { + winInitGlobalIcons(); -#ifdef XWIN_MULTIWINDOW - /* Rebuild the icons and menus */ - EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); + /* Rebuild the icons and menus */ + EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); + } #endif /* Whew, done */ @@ -302,7 +306,7 @@ * Return TRUE if command is proccessed, FALSE otherwise. */ Bool -HandleCustomWM_COMMAND(HWND hwnd, int command) +HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv) { int i, j; MENUPARSED *m; @@ -382,13 +386,17 @@ HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); #if XWIN_MULTIWINDOW - /* Reflect the changed Z order */ - winReorderWindowsMultiWindow(); + { + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + if (pScreenInfo->fMultiWindow) + /* Reflect the changed Z order */ + winReorderWindowsMultiWindow(); + } #endif return TRUE; case CMD_RELOAD: - ReloadPrefs(); + ReloadPrefs(pScreenPriv); return TRUE; default: diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefs.h xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefs.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefs.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefs.h 2017-03-15 18:05:25.000000000 +0000 @@ -1,5 +1,3 @@ -#if !defined(WINPREFS_H) -#define WINPREFS_H /* * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. * Copyright (C) Colin Harrison 2005-2008 @@ -32,6 +30,9 @@ * Colin Harrison */ +#if !defined(WINPREFS_H) +#define WINPREFS_H + /* Need Bool */ #include /* Need TRUE */ @@ -42,6 +43,8 @@ /* Xwindows redefines PATH_MAX to at least 1024 */ #include +#include "winwindow.h" + #ifndef NAME_MAX #define NAME_MAX PATH_MAX #endif @@ -159,7 +162,7 @@ HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu); Bool - HandleCustomWM_COMMAND(HWND hwnd, int command); + HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv); int winIconIsOverride(HICON hicon); diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefslex.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefslex.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winprefslex.c 2016-07-19 17:27:44.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winprefslex.c 2017-03-15 18:06:13.000000000 +0000 @@ -7,8 +7,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -141,7 +141,15 @@ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -175,7 +183,7 @@ */ #define YY_LESS_LINENO(n) \ do { \ - int yyl;\ + yy_size_t yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ @@ -193,7 +201,7 @@ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ @@ -363,11 +371,17 @@ int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -415,7 +429,7 @@ } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -447,7 +461,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[52] = +static yyconst YY_CHAR yy_meta[52] = { 0, 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -457,7 +471,7 @@ 1 } ; -static yyconst flex_int16_t yy_base[202] = +static yyconst flex_uint16_t yy_base[202] = { 0, 0, 0, 384, 0, 381, 415, 50, 54, 375, 37, 35, 47, 35, 43, 53, 56, 46, 42, 57, 86, @@ -511,7 +525,7 @@ 194 } ; -static yyconst flex_int16_t yy_nxt[467] = +static yyconst flex_uint16_t yy_nxt[467] = { 0, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 12, 13, 14, 4, 15, 4, 16, 17, 18, 4, @@ -698,7 +712,7 @@ } #define YY_NO_INPUT 1 -#line 702 "winprefslex.c" +#line 716 "winprefslex.c" #define INITIAL 0 @@ -731,11 +745,11 @@ FILE *yyget_in (void ); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * _in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * _out_str ); yy_size_t yyget_leng (void ); @@ -743,7 +757,7 @@ int yyget_lineno (void ); -void yyset_lineno (int line_number ); +void yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -757,6 +771,10 @@ #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -777,7 +795,12 @@ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -864,7 +887,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -874,9 +897,9 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -907,9 +930,9 @@ { #line 63 "winprefslex.l" -#line 911 "winprefslex.c" +#line 934 "winprefslex.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -925,7 +948,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1146,7 +1169,7 @@ #line 100 "winprefslex.l" ECHO; YY_BREAK -#line 1150 "winprefslex.c" +#line 1173 "winprefslex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1290,9 +1313,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1321,7 +1344,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1334,7 +1357,7 @@ else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1424,14 +1447,14 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1456,10 +1479,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1477,6 +1500,10 @@ return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1631,7 +1658,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1786,7 +1813,7 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -1803,7 +1830,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -1911,7 +1938,7 @@ static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1922,7 +1949,7 @@ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ @@ -1977,29 +2004,29 @@ } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -2007,9 +2034,9 @@ return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -2072,7 +2099,8 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2081,7 +2109,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2091,11 +2119,12 @@ void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2108,7 +2137,7 @@ void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winprocarg.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winprocarg.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winprocarg.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winprocarg.c 2017-03-15 18:05:25.000000000 +0000 @@ -130,7 +130,6 @@ defaultScreenInfo.fDecoration = TRUE; #ifdef XWIN_MULTIWINDOWEXTWM defaultScreenInfo.fMWExtWM = FALSE; - defaultScreenInfo.fInternalWM = FALSE; #endif defaultScreenInfo.fRootless = FALSE; #ifdef XWIN_MULTIWINDOW @@ -141,7 +140,7 @@ #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = resizeWithRandr; + defaultScreenInfo.iResizeMode = resizeDefault; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -247,7 +246,7 @@ * OsVendorInit () gets called, otherwise we will overwrite * settings changed by parameters such as -fullscreen, etc. */ - winErrorFVerb(2, "ddxProcessArgument - Initializing default " + winErrorFVerb(3, "ddxProcessArgument - Initializing default " "screens\n"); winInitializeScreenDefaults(); } @@ -577,11 +576,8 @@ * Look for the '-internalwm' argument */ if (IS_OPTION("-internalwm")) { - if (!screenInfoPtr->fMultiMonitorOverride) - screenInfoPtr->fMultipleMonitors = TRUE; - screenInfoPtr->fMWExtWM = TRUE; - screenInfoPtr->fInternalWM = TRUE; - + ErrorF("Ignoring obsolete -internalwm option\n"); + /* Ignored, but we still accept the arg for backwards compatibility */ /* Indicate that we have processed this argument */ return 1; } @@ -666,7 +662,7 @@ if (IS_OPTION("-resize")) mode = resizeWithRandr; else if (IS_OPTION("-noresize")) - mode = notAllowed; + mode = resizeNotAllowed; else if (strncmp(argv[i], "-resize=", strlen("-resize=")) == 0) { char *option = argv[i] + strlen("-resize="); @@ -675,7 +671,7 @@ else if (strcmp(option, "scrollbars") == 0) mode = resizeWithScrollbars; else if (strcmp(option, "none") == 0) - mode = notAllowed; + mode = resizeNotAllowed; else { ErrorF("ddxProcessArgument - resize - Invalid resize mode %s\n", option); @@ -1078,11 +1074,6 @@ return 1; } - if (IS_OPTION("-silent-dup-error")) { - g_fSilentDupError = TRUE; - return 1; - } - if (IS_OPTION("-wgl")) { g_fNativeGl = TRUE; return 1; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winscrinit.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winscrinit.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winscrinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winscrinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -534,9 +534,6 @@ #ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow #endif -#ifdef XWIN_MULTIWINDOWEXTWM - || pScreenInfo->fInternalWM -#endif ) { #if CYGDEBUG || YES winDebug("winFinishScreenInitFB - Calling winInitWM.\n"); @@ -547,11 +544,8 @@ &pScreenPriv->ptWMProc, &pScreenPriv->ptXMsgProc, &pScreenPriv->pmServerStarted, - pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen, -#ifdef XWIN_MULTIWINDOWEXTWM - pScreenInfo->fInternalWM || -#endif - FALSE)) { + pScreenInfo->dwScreen, + (HWND) &pScreenPriv->hwndScreen)) { ErrorF("winFinishScreenInitFB - winInitWM () failed.\n"); return FALSE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winshadddnl.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winshadddnl.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winshadddnl.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winshadddnl.c 2017-03-15 18:05:25.000000000 +0000 @@ -1211,14 +1211,8 @@ pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL; pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL; pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL; - pScreenPriv->pwinHotKeyAltTab = - (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA; pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL; pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow - = (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; -#endif return TRUE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winshadgdi.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winshadgdi.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winshadgdi.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winshadgdi.c 2017-03-15 18:05:25.000000000 +0000 @@ -1143,16 +1143,8 @@ pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI; pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI; pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI; - pScreenPriv->pwinHotKeyAltTab = - (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinCreatePrimarySurface = - (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinReleasePrimarySurface = - (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; -#endif + pScreenPriv->pwinCreatePrimarySurface = NULL; + pScreenPriv->pwinReleasePrimarySurface = NULL; return TRUE; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/wintaskbar.c xorg-server-hwe-16.04-1.19.3/hw/xwin/wintaskbar.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/wintaskbar.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/wintaskbar.c 2017-03-15 18:05:25.000000000 +0000 @@ -66,7 +66,7 @@ seem to be the case */ -void winShowWindowOnTaskbar(HWND hWnd, BOOL show) +void winShowWindowOnTaskbar(HWND hWnd, Bool show) { ITaskbarList* pTaskbarList = NULL; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winvalargs.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winvalargs.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winvalargs.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winvalargs.c 2017-03-15 18:05:25.000000000 +0000 @@ -127,7 +127,7 @@ return FALSE; } - /* Check for -multiwindow, -mwextwm, or -rootless and fullscreen */ + /* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */ if (g_ScreenInfo[i].fFullScreen && (FALSE #ifdef XWIN_MULTIWINDOW || g_ScreenInfo[i].fMultiWindow @@ -142,6 +142,21 @@ return FALSE; } + /* 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 + || g_ScreenInfo[i].fRootless) + ) { + ErrorF("winValidateArgs - -nodecoration is invalid with " + "-multiwindow, -mwextwm, or -rootless.\n"); + return FALSE; + } + /* Check for !fullscreen and any fullscreen-only parameters */ if (!g_ScreenInfo[i].fFullScreen && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_REFRESH @@ -153,7 +168,7 @@ /* Check for fullscreen and any non-fullscreen parameters */ if (g_ScreenInfo[i].fFullScreen - && ((g_ScreenInfo[i].iResizeMode != notAllowed) + && ((g_ScreenInfo[i].iResizeMode != resizeNotAllowed) || !g_ScreenInfo[i].fDecoration || g_ScreenInfo[i].fLessPointer)) { ErrorF("winValidateArgs - -fullscreen is invalid with " diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwakeup.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwakeup.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwakeup.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwakeup.c 2017-03-15 18:05:25.000000000 +0000 @@ -38,8 +38,7 @@ /* See Porting Layer Definition - p. 7 */ void -winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, void *pReadmask) +winWakeupHandler(ScreenPtr pScreen, int iResult) { MSG msg; diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootless.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootless.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootless.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootless.c 2017-03-15 18:05:25.000000000 +0000 @@ -40,6 +40,7 @@ #define _WINDOWSWM_SERVER_ #include #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" #include /* @@ -516,12 +517,6 @@ win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid; winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen); - winScreenInfo *pScreenInfo = NULL; - DWORD dwCurrentProcessID = GetCurrentProcessId(); - DWORD dwWindowProcessID = 0; - HWND hWnd; - Bool fFirst = TRUE; - Bool fNeedRestack = TRUE; #if CYGMULTIWINDOW_DEBUG winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv); @@ -530,9 +525,6 @@ if (pScreenPriv && pScreenPriv->fRestacking) return; - if (pScreenPriv) - pScreenInfo = pScreenPriv->pScreenInfo; - pRLWinPriv->fRestackingNow = TRUE; /* Show window */ @@ -541,68 +533,12 @@ if (pRLNextWinPriv == NULL) { #if CYGMULTIWINDOW_DEBUG - winDebug("Win %08x is top\n", pRLWinPriv); + winDebug("Win %p is top\n", pRLWinPriv); #endif pScreenPriv->widTop = wid; SetWindowPos(pRLWinPriv->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } - else if (winIsInternalWMRunning(pScreenInfo)) { - /* using mulwinidow wm */ -#if CYGMULTIWINDOW_DEBUG - winDebug("Win %08x is not top\n", pRLWinPriv); -#endif - for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDPREV); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow(hWnd, GW_HWNDPREV)) { - GetWindowThreadProcessId(hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWnd, WIN_WINDOW_PROP)) { - if (hWnd == pRLNextWinPriv->hWnd) { - /* Enable interleave X window and Windows window */ - if (!fFirst) { -#if CYGMULTIWINDOW_DEBUG - winDebug("raise: Insert after Win %08x\n", - pRLNextWinPriv); -#endif - SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - } - else { -#if CYGMULTIWINDOW_DEBUG - winDebug("No change\n"); -#endif - } - fNeedRestack = FALSE; - break; - } - if (fFirst) - fFirst = FALSE; - } - } - - for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDNEXT); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) { - GetWindowThreadProcessId(hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWnd, WIN_WINDOW_PROP)) { - if (hWnd == pRLNextWinPriv->hWnd) { -#if CYGMULTIWINDOW_DEBUG - winDebug("lower: Insert after Win %08x\n", pRLNextWinPriv); -#endif - SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - fNeedRestack = FALSE; - break; - } - } - } - } else { /* using general wm like twm, wmaker etc. Interleave X window and Windows window will cause problem. */ diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootlesswindow.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootlesswindow.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootlesswindow.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootlesswindow.c 2017-03-15 18:05:25.000000000 +0000 @@ -194,10 +194,6 @@ /* Get current window placement */ GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace); - if (winIsInternalWMRunning(pScreenInfo)) { - if (!pRLWinPriv->pFrame->win->overrideRedirect) - fDecorate = TRUE; - } #if 0 if (wndPlace.showCmd == SW_HIDE) return; //showCmd = SWP_HIDEWINDOW; @@ -345,15 +341,6 @@ } /* - * winIsInternalWMRunning (winScreenInfoPtr pScreenInfo) - */ -Bool -winIsInternalWMRunning(winScreenInfoPtr pScreenInfo) -{ - return pScreenInfo->fInternalWM && !pScreenInfo->fAnotherWMRunning; -} - -/* * winMWExtWMRestackWindows */ @@ -402,7 +389,7 @@ #if CYGMULTIWINDOW_DEBUG winDebug - ("winMWExtWMRestackWindows - DeferWindowPos (%08x, %08x)\n", + ("winMWExtWMRestackWindows - DeferWindowPos (%p, %p)\n", pRLWin->hWnd, pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP); #endif hWinPosInfo = DeferWindowPos(hWinPosInfo, pRLWin->hWnd, diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootlesswndproc.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootlesswndproc.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwin32rootlesswndproc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwin32rootlesswndproc.c 2017-03-15 18:05:25.000000000 +0000 @@ -60,9 +60,9 @@ * Local function */ -DEFINE_ATOM_HELPER(AtmWindowsWmRaiseOnClick, WINDOWSWM_RAISE_ON_CLICK) - DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE) +DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE) /* DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW) */ + /* * ConstrainSize - Taken from TWM sources - Respects hints for sizing */ @@ -272,55 +272,6 @@ } /* - * IsRaiseOnClick - */ - -static Bool -IsRaiseOnClick(WindowPtr pWin) -{ - - struct _Window *pwin; - struct _Property *prop; - - /* XXX We're getting inputInfo.poniter here, but this might be really wrong. - * Which pointer's current window do we want? */ - WindowPtr pRoot = GetCurrentRootWindow(inputInfo.pointer); - - if (!pWin) { - ErrorF("IsRaiseOnClick - no prop use default value:%d\n", - RAISE_ON_CLICK_DEFAULT); - return RAISE_ON_CLICK_DEFAULT; - } - - pwin = (struct _Window *) pWin; - - if (pwin->optional) - prop = (struct _Property *) pwin->optional->userProps; - else - prop = NULL; - - while (prop) { - if (prop->propertyName == AtmWindowsWmRaiseOnClick() - && prop->type == XA_INTEGER && prop->format == 32) { - return *(int *) prop->data; - } - else - prop = prop->next; - } - - if (pWin != pRoot) { - return IsRaiseOnClick(pRoot); - } - else { -#if CYGMULTIWINDOW_DEBUG - winDebug("IsRaiseOnClick - no prop use default value:%d\n", - RAISE_ON_CLICK_DEFAULT); -#endif - return RAISE_ON_CLICK_DEFAULT; - } -} - -/* * IsMouseActive */ @@ -388,8 +339,6 @@ PAINTSTRUCT ps; LPWINDOWPOS pWinPos = NULL; RECT rcClient; - winWMMessageRec wmMsg; - Bool fWMMsgInitialized = FALSE; /* Check if the Windows window property for our X window pointer is valid */ if ((pRLWinPriv = @@ -403,26 +352,16 @@ if (pScreenPriv) hwndScreen = pScreenPriv->hwndScreen; - wmMsg.msg = 0; - wmMsg.hwndWindow = hwnd; - wmMsg.iWindow = (Window) pWin->drawable.id; - - wmMsg.iX = pRLWinPriv->pFrame->x; - wmMsg.iY = pRLWinPriv->pFrame->y; - wmMsg.iWidth = pRLWinPriv->pFrame->width; - wmMsg.iHeight = pRLWinPriv->pFrame->height; - - fWMMsgInitialized = TRUE; #if CYGDEBUG winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam, lParam); - winDebug("\thWnd %08X\n", hwnd); - winDebug("\tpScreenPriv %08X\n", pScreenPriv); - winDebug("\tpScreenInfo %08X\n", pScreenInfo); - winDebug("\thwndScreen %08X\n", hwndScreen); - winDebug("winMWExtWMWindowProc (%08x) %08x %08x %08x\n", - pRLWinPriv, message, wParam, lParam); + winDebug("\thWnd %p\n", hwnd); + winDebug("\tpScreenPriv %p\n", pScreenPriv); + winDebug("\tpScreenInfo %p\n", pScreenInfo); + winDebug("\thwndScreen %p\n", hwndScreen); + winDebug("winMWExtWMWindowProc (%p) %08x %08x %08x\n", + pRLWinPriv, message, (int)wParam, (int)lParam); #endif } /* Branch on message type */ @@ -446,12 +385,6 @@ DestroyWindow(hwnd); } else { - if (winIsInternalWMRunning(pScreenInfo)) { - /* Tell our Window Manager thread to kill the window */ - wmMsg.msg = WM_WM_KILL; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -680,19 +613,7 @@ #if CYGMULTIWINDOW_DEBUG winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n"); #endif -#if 1 - /* Check if this window needs to be made active when clicked */ - if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect) { -#if CYGMULTIWINDOW_DEBUG - winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE - " - "MA_NOACTIVATE\n"); -#endif - - /* */ - return MA_NOACTIVATE; - } -#endif - if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive(pWin)) + if (!IsMouseActive(pWin)) return MA_NOACTIVATE; break; @@ -805,19 +726,6 @@ winDebug("winMWExtWMWindowProc - WM_ACTIVATE\n"); #endif if (LOWORD(wParam) != WA_INACTIVE) { - if (winIsInternalWMRunning(pScreenInfo)) { -#if 0 - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); -#endif - /* Tell our Window Manager thread to activate the window */ - wmMsg.msg = WM_WM_ACTIVATE; - if (fWMMsgInitialized) - if (!pWin || !pWin->overrideRedirect) /* for OOo menus */ - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -838,14 +746,6 @@ break; } - if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick(pWin)) { -#if CYGMULTIWINDOW_DEBUG - winDebug("Win %p has WINDOWSWM_RAISE_ON_CLICK.\n", - pRLWinPriv); -#endif - break; - } - #if CYGMULTIWINDOW_DEBUG winDebug("Win %p forbid to change z order (%p).\n", pRLWinPriv, @@ -889,9 +789,6 @@ (short) HIWORD(lParam)); #endif if (!pRLWinPriv->fMovingOrSizing) { - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMMoveXWindow(pWin, (LOWORD(lParam) - wBorderWidth(pWin) - GetSystemMetrics(SM_XVIRTUALSCREEN)), (HIWORD(lParam) - wBorderWidth(pWin) @@ -907,31 +804,8 @@ if (!wParam) return 0; - if (!pScreenInfo->fInternalWM) //XXXX - return 0; - winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo); - if (winIsInternalWMRunning(pScreenInfo)) { -#if CYGMULTIWINDOW_DEBUG || TRUE - winDebug("\tMapWindow\n"); -#endif - /* Tell X to map the window */ - MapWindow(pWin, wClient(pWin)); - - if (!pRLWinPriv->pFrame->win->overrideRedirect) - /* Bring the Windows window to the foreground */ - SetForegroundWindow(hwnd); - - /* Setup the Window Manager message */ - wmMsg.msg = WM_WM_MAP; - wmMsg.iWidth = pRLWinPriv->pFrame->width; - wmMsg.iHeight = pRLWinPriv->pFrame->height; - - /* Tell our Window Manager thread to map the window */ - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } break; case WM_SIZING: @@ -967,72 +841,12 @@ if (pWinPos->flags & SWP_HIDEWINDOW) break; - /* Reorder if window z order was changed */ - if ((pScreenPriv != NULL) - && !(pWinPos->flags & SWP_NOZORDER) - && !(pWinPos->flags & SWP_SHOWWINDOW) - && winIsInternalWMRunning(pScreenInfo)) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\twindow z order was changed\n"); -#endif - if (pWinPos->hwndInsertAfter == HWND_TOP - || pWinPos->hwndInsertAfter == HWND_TOPMOST - || pWinPos->hwndInsertAfter == HWND_NOTOPMOST) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\traise to top\n"); -#endif - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } -#if 1 - else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) { - } - else { - /* Check if this window is top of X windows. */ - HWND hWndAbove = NULL; - DWORD dwCurrentProcessID = GetCurrentProcessId(); - DWORD dwWindowProcessID = 0; - - for (hWndAbove = pWinPos->hwndInsertAfter; - hWndAbove != NULL; - hWndAbove = GetNextWindow(hWndAbove, GW_HWNDPREV)) { - /* Ignore other XWin process's window */ - GetWindowThreadProcessId(hWndAbove, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWndAbove, WIN_WINDOW_PROP) - && !IsWindowVisible(hWndAbove) - && !IsIconic(hWndAbove)) /* ignore minimized windows */ - break; - } - /* If this is top of X windows in Windows stack, - raise it in X stack. */ - if (hWndAbove == NULL) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\traise to top\n"); -#endif - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } - } -#endif - } - if (!(pWinPos->flags & SWP_NOSIZE)) { if (IsIconic(hwnd)) { #if CYGMULTIWINDOW_DEBUG winDebug("\tIconic -> MINIMIZED\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) { - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_LOWER; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } + winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -1072,8 +886,6 @@ #if CYGMULTIWINDOW_DEBUG winDebug("\tmove & resize\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveResizeXWindow(pWin, rcClient.left - @@ -1095,8 +907,6 @@ #if CYGMULTIWINDOW_DEBUG winDebug("\tmove\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveResizeXWindow(pWin, rcClient.left - @@ -1118,8 +928,6 @@ #if CYGMULTIWINDOW_DEBUG winDebug("\tmove\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveXWindow(pWin, rcClient.left - wBorderWidth(pWin) @@ -1132,8 +940,6 @@ #if CYGMULTIWINDOW_DEBUG winDebug("\tresize\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMResizeXWindow(pWin, rcClient.right - rcClient.left @@ -1168,12 +974,7 @@ #if CYGMULTIWINDOW_DEBUG winDebug("\tSIZE_MINIMIZED\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) { - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_LOWER; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } + winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -1209,9 +1010,6 @@ /* Perform the resize and notify the X client */ if (!pRLWinPriv->fMovingOrSizing) { - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMResizeXWindow(pWin, (short) LOWORD(lParam) - wBorderWidth(pWin) * 2, (short) HIWORD(lParam) @@ -1224,10 +1022,6 @@ winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n"); #endif if (wParam) { - if (winIsInternalWMRunning(pScreenInfo)) { - } - else { - } winWindowsWMSendEvent(WindowsWMActivationNotify, WindowsWMActivationNotifyMask, 1, @@ -1268,9 +1062,6 @@ MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2); - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMMoveResizeXWindow(pWin, rcClient.left - wBorderWidth(pWin) - GetSystemMetrics(SM_XVIRTUALSCREEN), rcClient.top - wBorderWidth(pWin) @@ -1281,14 +1072,6 @@ - wBorderWidth(pWin) * 2); break; - case WM_MANAGE: - ErrorF("winMWExtWMWindowProc - WM_MANAGE\n"); - break; - - case WM_UNMANAGE: - ErrorF("winMWExtWMWindowProc - WM_UNMANAGE\n"); - break; - default: break; } diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwindow.h xorg-server-hwe-16.04-1.19.3/hw/xwin/winwindow.h --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwindow.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwindow.h 2017-03-15 18:05:25.000000000 +0000 @@ -1,5 +1,3 @@ -#if !defined(_WINWINDOW_H_) -#define _WINWINDOW_H_ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. *Copyright (C) Colin Harrison 2005-2009 @@ -31,6 +29,8 @@ * Authors: Kensuke Matsuzaki * Colin Harrison */ +#if !defined(_WINWINDOW_H_) +#define _WINWINDOW_H_ #ifndef NO #define NO 0 @@ -102,7 +102,6 @@ #define WM_WM_SIZE (WM_USER + 2) #define WM_WM_RAISE (WM_USER + 3) #define WM_WM_LOWER (WM_USER + 4) -#define WM_WM_MAP (WM_USER + 5) #define WM_WM_UNMAP (WM_USER + 6) #define WM_WM_KILL (WM_USER + 7) #define WM_WM_ACTIVATE (WM_USER + 8) @@ -112,8 +111,6 @@ #define WM_WM_MAP2 (WM_USER + 12) #define WM_WM_MAP3 (WM_USER + 13) #define WM_WM_HINTS_EVENT (WM_USER + 14) -#define WM_MANAGE (WM_USER + 100) -#define WM_UNMANAGE (WM_USER + 102) #define MwmHintsDecorations (1L << 1) @@ -125,10 +122,16 @@ #define MwmDecorMinimize (1L << 5) #define MwmDecorMaximize (1L << 6) -/* This structure only contains 3 elements... the Motif 2.0 structure -contains 5... we only need the first 3... so that is all we will define */ +/* + This structure only contains 3 elements. The Motif 2.0 structure contains 5, + but we only need the first 3, so that is all we will define + + This structure represents xcb_get_property()'s view of the property as a + sequence of ints, rather than XGetWindowProperty()'s view of the property as a + sequence of arch-dependent longs. +*/ typedef struct MwmHints { - unsigned long flags, functions, decorations; + unsigned int flags, functions, decorations; } MwmHints; #define PropMwmHintsElements 3 @@ -142,15 +145,12 @@ pthread_t * ptWMProc, pthread_t * ptXMsgProc, pthread_mutex_t * ppmServerStarted, - int dwScreen, HWND hwndScreen, BOOL allowOtherWM); + int dwScreen, HWND hwndScreen); void winDeinitMultiWindowWM(void); void - winMinimizeWindow(Window id); - -void winPropertyStoreInit(void); void @@ -160,7 +160,7 @@ winSetAppUserModelID(HWND hWnd, const char *AppID); void - winShowWindowOnTaskbar(HWND hWnd, BOOL show); + winShowWindowOnTaskbar(HWND hWnd, Bool show); #endif /* XWIN_MULTIWINDOW */ #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwindowswm.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwindowswm.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwindowswm.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwindowswm.c 2017-03-15 18:05:25.000000000 +0000 @@ -312,7 +312,7 @@ REQUEST(xWindowsWMFrameGetRectReq); #if CYGMULTIWINDOW_DEBUG - ErrorF("ProcWindowsWMFrameGetRect %d %d\n", + ErrorF("ProcWindowsWMFrameGetRect %zu %d\n", (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len); #endif diff -Nru xorg-server-hwe-16.04-1.18.4/hw/xwin/winwndproc.c xorg-server-hwe-16.04-1.19.3/hw/xwin/winwndproc.c --- xorg-server-hwe-16.04-1.18.4/hw/xwin/winwndproc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/hw/xwin/winwndproc.c 2017-03-15 18:05:25.000000000 +0000 @@ -162,7 +162,7 @@ * their own mode when they become active. */ if (s_pScreenInfo->fFullScreen - || (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { + && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { break; } @@ -290,22 +290,16 @@ * the display dimensions change. */ - /* - * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface - * and CreatePrimarySurface function pointers to point - * to the no operation function, NoopDDA. This allows us - * to blindly call these functions, even if they are not - * relevant to the current engine (e.g., Shadow GDI). - */ - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Releasing and recreating primary surface\n"); /* Release the old primary surface */ - (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); + if (*s_pScreenPriv->pwinReleasePrimarySurface) + (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); /* Create the new primary surface */ - (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); + if (*s_pScreenPriv->pwinCreatePrimarySurface) + (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); } } @@ -322,7 +316,7 @@ #endif /* Break if we do not allow resizing */ - if ((s_pScreenInfo->iResizeMode == notAllowed) + if ((s_pScreenInfo->iResizeMode == resizeNotAllowed) || !s_pScreenInfo->fDecoration #ifdef XWIN_MULTIWINDOWEXTWM || s_pScreenInfo->fMWExtWM @@ -1107,14 +1101,6 @@ winFixShiftKeys(iScanCode); return 0; - case WM_HOTKEY: - if (s_pScreenPriv == NULL) - break; - - /* Call the engine-specific hot key handler */ - (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen); - return 0; - case WM_ACTIVATE: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; @@ -1192,7 +1178,7 @@ #ifdef XWIN_MULTIWINDOWEXTWM if (s_pScreenPriv->fActive) { /* Restack all window unless using built-in wm. */ - if (s_pScreenInfo->fInternalWM && s_pScreenInfo->fAnotherWMRunning) + if (s_pScreenInfo->fMWExtWM) winMWExtWMRestackWindows(s_pScreen); } #endif @@ -1229,7 +1215,7 @@ default: /* It's probably one of the custom menus... */ - if (HandleCustomWM_COMMAND(0, LOWORD(wParam))) + if (HandleCustomWM_COMMAND(0, LOWORD(wParam), s_pScreenPriv)) return 0; } break; @@ -1256,28 +1242,6 @@ } break; -#ifdef XWIN_MULTIWINDOWEXTWM - case WM_MANAGE: - ErrorF("winWindowProc - WM_MANAGE\n"); - s_pScreenInfo->fAnotherWMRunning = FALSE; - - if (s_pScreenInfo->fInternalWM) { - EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); - //RootlessRepositionWindows (s_pScreen); - } - break; - - case WM_UNMANAGE: - ErrorF("winWindowProc - WM_UNMANAGE\n"); - s_pScreenInfo->fAnotherWMRunning = TRUE; - - if (s_pScreenInfo->fInternalWM) { - EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); - winMWExtWMRestackWindows(s_pScreen); - } - break; -#endif - default: if (message == s_uTaskbarRestart) { winInitNotifyIcon(s_pScreenPriv); diff -Nru xorg-server-hwe-16.04-1.18.4/include/dix-config.h.in xorg-server-hwe-16.04-1.19.3/include/dix-config.h.in --- xorg-server-hwe-16.04-1.18.4/include/dix-config.h.in 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dix-config.h.in 2017-03-15 18:05:25.000000000 +0000 @@ -125,6 +125,9 @@ /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY +/* Define to 1 if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM @@ -143,6 +146,12 @@ /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP +/* Define to 1 if you have the function pthread_setname_np(const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID + +/* 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 @@ -155,6 +164,9 @@ /* 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 + /* Define to use libc SHA1 functions */ #undef HAVE_SHA1_IN_LIBC @@ -232,6 +244,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H +/* 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 @@ -518,7 +533,19 @@ /* Define if no local socket credentials interface exists */ #undef NO_LOCAL_CLIENT_CRED +/* Have setitimer support */ +#undef HAVE_SETITIMER + /* Have posix_fallocate() */ #undef HAVE_POSIX_FALLOCATE +/* Use input thread */ +#undef INPUTTHREAD + +/* Have poll() */ +#undef HAVE_POLL + +/* Have epoll_create1() */ +#undef HAVE_EPOLL_CREATE1 + #endif /* _DIX_CONFIG_H_ */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/dixfont.h xorg-server-hwe-16.04-1.19.3/include/dixfont.h --- xorg-server-hwe-16.04-1.18.4/include/dixfont.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dixfont.h 2017-03-15 18:05:25.000000000 +0000 @@ -29,7 +29,6 @@ #include "closure.h" #include #include -#include #define NullDIXFontProp ((DIXFontPropPtr)0) @@ -98,16 +97,11 @@ extern _X_EXPORT void FreeFonts(void); -extern _X_EXPORT FontPtr find_old_font(XID /*id */ ); - -#define GetGlyphs dixGetGlyphs -extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ , - unsigned long /*count */ , - unsigned char * /*chars */ , - FontEncoding /*fontEncoding */ , - unsigned long * /*glyphcount */ , - CharInfoPtr * /*glyphs */ ); - -extern _X_EXPORT void register_fpe_functions(void); +extern _X_EXPORT void GetGlyphs(FontPtr /*font */ , + unsigned long /*count */ , + unsigned char * /*chars */ , + FontEncoding /*fontEncoding */ , + unsigned long * /*glyphcount */ , + CharInfoPtr * /*glyphs */ ); #endif /* DIXFONT_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/dixfontstr.h xorg-server-hwe-16.04-1.19.3/include/dixfontstr.h --- xorg-server-hwe-16.04-1.18.4/include/dixfontstr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dixfontstr.h 2017-03-15 18:05:25.000000000 +0000 @@ -27,6 +27,7 @@ #include "servermd.h" #include "dixfont.h" #include +#include #include "closure.h" #include /* for xQueryFontReply */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/dixfontstubs.h xorg-server-hwe-16.04-1.19.3/include/dixfontstubs.h --- xorg-server-hwe-16.04-1.18.4/include/dixfontstubs.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dixfontstubs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -#ifndef DIXFONTSTUBS_H -#define DIXFONTSTUBS_H 1 - -/* - * libXfont stubs replacements - * This header exists solely for the purpose of sdksyms generation; - * source code should #include "dixfonts.h" instead, which pulls in these - * declarations from - */ -extern _X_EXPORT int client_auth_generation(ClientPtr client); - -extern _X_EXPORT void DeleteFontClientID(Font id); - -extern _X_EXPORT int GetDefaultPointSize(void); - -extern _X_EXPORT Font GetNewFontClientID(void); - -extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler); - -extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func); - -extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr blockHandler, - Bool all); - -extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id); - -#endif diff -Nru xorg-server-hwe-16.04-1.18.4/include/dix.h xorg-server-hwe-16.04-1.19.3/include/dix.h --- xorg-server-hwe-16.04-1.18.4/include/dix.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dix.h 2017-03-15 18:05:25.000000000 +0000 @@ -136,6 +136,12 @@ extern _X_EXPORT HWEventQueuePtr checkForInput[2]; +static inline _X_NOTSAN Bool +InputCheckPending(void) +{ + return (*checkForInput[0] != *checkForInput[1]); +} + typedef struct _TimeStamp { CARD32 months; /* really ~49.7 days */ CARD32 milliseconds; @@ -208,28 +214,28 @@ extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ ); -extern _X_EXPORT void BlockHandler(void *pTimeout, - void *pReadmask); +extern _X_EXPORT void BlockHandler(void *timeout); -extern _X_EXPORT void WakeupHandler(int result, - void *pReadmask); +extern _X_EXPORT void WakeupHandler(int result); void - EnableLimitedSchedulingLatency(void); +EnableLimitedSchedulingLatency(void); void - DisableLimitedSchedulingLatency(void); +DisableLimitedSchedulingLatency(void); + +typedef void (*ServerBlockHandlerProcPtr) (void *blockData, + void *timeout); -typedef void (*WakeupHandlerProcPtr) (void *blockData, - int result, - void *pReadmask); +typedef void (*ServerWakeupHandlerProcPtr) (void *blockData, + int result); -extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData); -extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData); extern _X_EXPORT void InitBlockAndWakeupHandlers(void); @@ -594,6 +600,8 @@ DeviceIntPtr device; } DeviceEventInfoRec; +extern _X_EXPORT CallbackListPtr RootWindowFinalizeCallback; + extern int XItoCoreType(int xi_type); extern Bool diff -Nru xorg-server-hwe-16.04-1.18.4/include/dixstruct.h xorg-server-hwe-16.04-1.19.3/include/dixstruct.h --- xorg-server-hwe-16.04-1.18.4/include/dixstruct.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/dixstruct.h 2017-03-15 18:05:25.000000000 +0000 @@ -76,6 +76,8 @@ typedef struct _Client { void *requestBuffer; void *osPrivate; /* for OS layer, including scheduler */ + struct xorg_list ready; /* List of clients ready to run */ + struct xorg_list output_pending; /* List of clients with output queued */ Mask clientAsMask; short index; unsigned char majorOp, minorOp; @@ -130,10 +132,53 @@ extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -extern Bool SmartScheduleDisable; +#if HAVE_SETITIMER +extern Bool SmartScheduleSignalEnable; +#else +#define SmartScheduleSignalEnable FALSE +#endif extern void SmartScheduleStartTimer(void); extern void SmartScheduleStopTimer(void); +/* Client has requests queued or data on the network */ +void mark_client_ready(ClientPtr client); + +/* + * Client has requests queued or data on the network, but awaits a + * server grab release + */ +void mark_client_saved_ready(ClientPtr client); + +/* Client has no requests queued and no data on network */ +void mark_client_not_ready(ClientPtr client); + +static inline Bool client_is_ready(ClientPtr client) +{ + return !xorg_list_is_empty(&client->ready); +} + +Bool +clients_are_ready(void); + +extern struct xorg_list output_pending_clients; + +static inline void +output_pending_mark(ClientPtr client) +{ + if (!client->clientGone && xorg_list_is_empty(&client->output_pending)) + xorg_list_append(&client->output_pending, &output_pending_clients); +} + +static inline void +output_pending_clear(ClientPtr client) +{ + xorg_list_del(&client->output_pending); +} + +static inline Bool any_output_pending(void) { + return !xorg_list_is_empty(&output_pending_clients); +} + #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) diff -Nru xorg-server-hwe-16.04-1.18.4/include/do-not-use-config.h.in xorg-server-hwe-16.04-1.19.3/include/do-not-use-config.h.in --- xorg-server-hwe-16.04-1.18.4/include/do-not-use-config.h.in 2016-07-19 17:27:41.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/do-not-use-config.h.in 2017-03-15 18:05:40.000000000 +0000 @@ -3,9 +3,6 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD -/* Build AIGLX loader */ -#undef AIGLX - /* Default base font path */ #undef BASE_FONT_PATH @@ -102,15 +99,15 @@ /* Build DRI2 extension */ #undef DRI2 -/* Build DRI2 AIGLX loader */ -#undef DRI2_AIGLX - /* Build DRI3 extension */ #undef DRI3 /* Default DRI driver path */ #undef DRI_DRIVER_PATH +/* Fallback input driver */ +#undef FALLBACK_INPUT_DRIVER + /* Build glamor */ #undef GLAMOR @@ -138,6 +135,9 @@ /* Use Windows sockets */ #undef HAS_WINSOCK +/* Define to 1 if you have the `arc4random_buf' function. */ +#undef HAVE_ARC4RANDOM_BUF + /* Define to 1 if you have the `authdes_create' function. */ #undef HAVE_AUTHDES_CREATE @@ -173,6 +173,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `epoll_create1' function. */ +#undef HAVE_EPOLL_CREATE1 + /* Have execinfo.h */ #undef HAVE_EXECINFO_H @@ -224,6 +227,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBAUDIT_H +/* Define to 1 if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD + /* Define to 1 if you have the libdispatch (GCD) available */ #undef HAVE_LIBDISPATCH @@ -260,9 +266,24 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `poll' function. */ +#undef HAVE_POLL + /* Define to 1 if you have the `posix_fallocate' function. */ #undef HAVE_POSIX_FALLOCATE +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Have function pthread_setname_np(const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID + +/* Have function pthread_setname_np(pthread_t, const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITH_TID + /* Define to 1 if you have the `reallocarray' function. */ #undef HAVE_REALLOCARRAY @@ -272,6 +293,9 @@ /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID +/* Define to 1 if you have the `setitimer' function. */ +#undef HAVE_SETITIMER + /* Use CommonCrypto SHA1 functions */ #undef HAVE_SHA1_IN_COMMONCRYPTO @@ -376,6 +400,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VT_H +/* Define to 1 if you have the `timingsafe_memcmp' function. */ +#undef HAVE_TIMINGSAFE_MEMCMP + /* Define to 1 if typeof works with your compiler. */ #undef HAVE_TYPEOF @@ -401,6 +428,9 @@ /* Have xshmfence support */ #undef HAVE_XSHMFENCE +/* Use a separate input thread */ +#undef INPUTTHREAD + /* Support IPv6 for TCP connections */ #undef IPv6 @@ -509,6 +539,10 @@ /* Overall prefix */ #undef PROJECTROOT +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + /* Support RANDR extension */ #undef RANDR @@ -584,9 +618,6 @@ /* BSD i386 iopl */ #undef USE_I386_IOPL -/* Use SIGIO handlers for input device events by default */ -#undef USE_SIGIO_BY_DEFAULT - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE diff -Nru xorg-server-hwe-16.04-1.18.4/include/eventstr.h xorg-server-hwe-16.04-1.19.3/include/eventstr.h --- xorg-server-hwe-16.04-1.18.4/include/eventstr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/eventstr.h 2017-03-15 18:05:25.000000000 +0000 @@ -25,6 +25,7 @@ #ifndef EVENTSTR_H #define EVENTSTR_H +#include "inputstr.h" #include /** * @file events.h @@ -78,6 +79,14 @@ }; /** + * How a DeviceEvent was provoked + */ +enum DeviceEventSource { + EVENT_SOURCE_NORMAL = 0, /**< Default: from a user action (e.g. key press) */ + EVENT_SOURCE_FOCUS, /**< Keys or buttons previously down on focus-in */ +}; + +/** * Used for ALL input device events internal in the server until * copied into the matching protocol event. * @@ -124,6 +133,7 @@ int key_repeat; /**< Internally-generated key repeat event */ uint32_t flags; /**< Flags to be copied into the generated event */ uint32_t resource; /**< Touch event resource, only for TOUCH_REPLAYING */ + enum DeviceEventSource source_type; /**< How this event was provoked */ }; /** diff -Nru xorg-server-hwe-16.04-1.18.4/include/globals.h xorg-server-hwe-16.04-1.19.3/include/globals.h --- xorg-server-hwe-16.04-1.18.4/include/globals.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/globals.h 2017-03-15 18:05:25.000000000 +0000 @@ -2,8 +2,6 @@ #ifndef _XSERV_GLOBAL_H_ #define _XSERV_GLOBAL_H_ -#include - #include "window.h" /* for WindowPtr */ #include "extinit.h" diff -Nru xorg-server-hwe-16.04-1.18.4/include/input.h xorg-server-hwe-16.04-1.19.3/include/input.h --- xorg-server-hwe-16.04-1.18.4/include/input.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/input.h 2017-03-15 18:05:25.000000000 +0000 @@ -56,6 +56,7 @@ #include "xkbrules.h" #include "events.h" #include "list.h" +#include "os.h" #include #define DEVICE_INIT 0 @@ -236,6 +237,8 @@ #define ATTR_TABLET (1<<3) #define ATTR_TOUCHPAD (1<<4) #define ATTR_TOUCHSCREEN (1<<5) +#define ATTR_KEY (1<<6) +#define ATTR_TABLET_PAD (1<<7) /* Key/Button has been run through all input processing and events sent to clients. */ #define KEY_PROCESSED 1 @@ -632,6 +635,7 @@ InputAttributes * attrs, DeviceIntPtr *dev); extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev); +extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info); extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration); @@ -672,12 +676,15 @@ int valnum, int *val); extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask, int valnum, double *val); - extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask); extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask, int valuator, double accel, double unaccel); +extern _X_EXPORT void valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask, + int valuator, + int absolute, + double unaccel); extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask, int valuator); extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask, @@ -712,4 +719,21 @@ int *out_x, int *out_y, int *nevents, InternalEvent* events); +extern _X_EXPORT void input_lock(void); +extern _X_EXPORT void input_unlock(void); +extern _X_EXPORT void input_force_unlock(void); +extern _X_EXPORT int in_input_thread(void); + +extern void InputThreadPreInit(void); +extern void InputThreadInit(void); +extern void InputThreadFini(void); + +extern int InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs); + +extern int InputThreadUnregisterDev(int fd); + +extern _X_EXPORT Bool InputThreadEnable; + #endif /* INPUT_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/inpututils.h xorg-server-hwe-16.04-1.19.3/include/inpututils.h --- xorg-server-hwe-16.04-1.18.4/include/inpututils.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/inpututils.h 2017-03-15 18:05:25.000000000 +0000 @@ -30,6 +30,7 @@ #define INPUTUTILS_H #include "input.h" +#include "eventstr.h" #include extern Mask event_filters[MAXDEVICES][MAXEVENTS]; @@ -43,7 +44,8 @@ }; extern void verify_internal_event(const InternalEvent *ev); -extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); +extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms, + enum DeviceEventSource event_source); extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); diff -Nru xorg-server-hwe-16.04-1.18.4/include/Makefile.am xorg-server-hwe-16.04-1.19.3/include/Makefile.am --- xorg-server-hwe-16.04-1.18.4/include/Makefile.am 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -60,6 +60,7 @@ xkbsrv.h \ xkbstr.h \ xkbrules.h \ + xserver_poll.h \ xserver-properties.h nodist_sdk_HEADERS = xorg-server.h @@ -70,7 +71,7 @@ EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ - dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + eventconvert.h eventstr.h inpututils.h \ probes.h \ protocol-versions.h \ swaprep.h \ diff -Nru xorg-server-hwe-16.04-1.18.4/include/Makefile.in xorg-server-hwe-16.04-1.19.3/include/Makefile.in --- xorg-server-hwe-16.04-1.18.4/include/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -91,9 +91,10 @@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -162,7 +163,7 @@ 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-properties.h + xkbrules.h xserver_poll.h xserver-properties.h HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)do-not-use-config.h.in xorg-server.h.in dix-config.h.in \ @@ -367,6 +368,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -397,7 +401,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -492,6 +499,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -600,6 +608,7 @@ @XORG_TRUE@ xkbsrv.h \ @XORG_TRUE@ xkbstr.h \ @XORG_TRUE@ xkbrules.h \ +@XORG_TRUE@ xserver_poll.h \ @XORG_TRUE@ xserver-properties.h @XORG_TRUE@nodist_sdk_HEADERS = xorg-server.h @@ -607,7 +616,7 @@ EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ - dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + eventconvert.h eventstr.h inpututils.h \ probes.h \ protocol-versions.h \ swaprep.h \ diff -Nru xorg-server-hwe-16.04-1.18.4/include/misc.h xorg-server-hwe-16.04-1.19.3/include/misc.h --- xorg-server-hwe-16.04-1.18.4/include/misc.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/misc.h 2017-03-15 18:05:25.000000000 +0000 @@ -79,6 +79,7 @@ #include #include +#include #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -86,7 +87,7 @@ #ifndef MAXGPUSCREENS #define MAXGPUSCREENS 16 #endif -#define MAXCLIENTS 512 +#define MAXCLIENTS 2048 #define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */ #define MAXEXTENSIONS 128 #define MAXFORMATS 8 diff -Nru xorg-server-hwe-16.04-1.18.4/include/os.h xorg-server-hwe-16.04-1.19.3/include/os.h --- xorg-server-hwe-16.04-1.18.4/include/os.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/os.h 2017-03-15 18:05:25.000000000 +0000 @@ -51,6 +51,9 @@ #include #include #include +#ifdef MONOTONIC_CLOCK +#include +#endif #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -93,8 +96,7 @@ _X_ATTRIBUTE_PRINTF(1, 0); #endif -extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */ - ); +extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready); extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ ); @@ -139,20 +141,21 @@ unsigned int /*string_n */ , char * /*auth_string */ ); -extern _X_EXPORT Bool EstablishNewConnections(ClientPtr clientUnused, - void *closure); - -extern _X_EXPORT void CheckConnections(void); - extern _X_EXPORT void CloseDownConnection(ClientPtr /*client */ ); -extern _X_EXPORT void AddGeneralSocket(int /*fd */ ); - -extern _X_EXPORT void RemoveGeneralSocket(int /*fd */ ); +typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); -extern _X_EXPORT void AddEnabledDevice(int /*fd */ ); - -extern _X_EXPORT void RemoveEnabledDevice(int /*fd */ ); +#define X_NOTIFY_NONE 0x0 +#define X_NOTIFY_READ 0x1 +#define X_NOTIFY_WRITE 0x2 +#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */ + +extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); + +static inline void RemoveNotifyFd(int fd) +{ + (void) SetNotifyFd(fd, NULL, X_NOTIFY_NONE, NULL); +} extern _X_EXPORT int OnlyListenToOneClient(ClientPtr /*client */ ); @@ -170,11 +173,14 @@ extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); +#ifdef MONOTONIC_CLOCK +extern void ForceClockId(clockid_t /* forced_clockid */); +#endif + extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); -extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, - unsigned long newdelay); +extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, int newdelay); typedef struct _OsTimerRec *OsTimerPtr; @@ -326,12 +332,6 @@ extern _X_EXPORT void OsReleaseSignals(void); -extern _X_EXPORT int -OsBlockSIGIO(void); - -extern _X_EXPORT void -OsReleaseSIGIO(void); - extern void OsResetSignals(void); @@ -590,6 +590,11 @@ strndup(const char *str, size_t n); #endif +#ifndef HAVE_TIMINGSAFE_MEMCMP +extern _X_EXPORT int +timingsafe_memcmp(const void *b1, const void *b2, size_t len); +#endif + /* Logging. */ typedef enum _LogParameter { XLOG_FLUSH, @@ -702,4 +707,9 @@ extern _X_EXPORT int os_move_fd(int fd); +#include + +extern _X_EXPORT int +xthread_sigmask(int how, const sigset_t *set, sigset_t *oldest); + #endif /* OS_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/pixmap.h xorg-server-hwe-16.04-1.19.3/include/pixmap.h --- xorg-server-hwe-16.04-1.18.4/include/pixmap.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/pixmap.h 2017-03-15 18:05:25.000000000 +0000 @@ -115,6 +115,9 @@ extern _X_EXPORT PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave); +extern _X_EXPORT void +PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap); + #define HAS_DIRTYTRACKING_ROTATION 1 extern _X_EXPORT Bool PixmapStartDirtyTracking(PixmapPtr src, diff -Nru xorg-server-hwe-16.04-1.18.4/include/privates.h xorg-server-hwe-16.04-1.19.3/include/privates.h --- xorg-server-hwe-16.04-1.18.4/include/privates.h 2016-07-15 16:18:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/privates.h 2017-03-15 18:05:25.000000000 +0000 @@ -252,6 +252,9 @@ extern void dixInitScreenSpecificPrivates(ScreenPtr pScreen); +/* is this private created - so hotplug can avoid crashing */ +Bool dixPrivatesCreated(DevPrivateType type); + extern _X_EXPORT void * _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, unsigned size, diff -Nru xorg-server-hwe-16.04-1.18.4/include/property.h xorg-server-hwe-16.04-1.19.3/include/property.h --- xorg-server-hwe-16.04-1.18.4/include/property.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/property.h 2017-03-15 18:05:25.000000000 +0000 @@ -67,15 +67,6 @@ void *value, Bool sendevent); -extern _X_EXPORT int ChangeWindowProperty(WindowPtr pWin, - Atom property, - Atom type, - int format, - int mode, - unsigned long len, - void *value, - Bool sendevent); - extern _X_EXPORT int DeleteProperty(ClientPtr /*client */ , WindowPtr /*pWin */ , Atom /*propName */ ); diff -Nru xorg-server-hwe-16.04-1.18.4/include/protocol-versions.h xorg-server-hwe-16.04-1.19.3/include/protocol-versions.h --- xorg-server-hwe-16.04-1.18.4/include/protocol-versions.h 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/protocol-versions.h 2017-03-15 18:05:25.000000000 +0000 @@ -111,6 +111,11 @@ #define SERVER_SYNC_MAJOR_VERSION 3 #define SERVER_SYNC_MINOR_VERSION 1 +/* Windows DRI */ +#define SERVER_WINDOWSDRI_MAJOR_VERSION 1 +#define SERVER_WINDOWSDRI_MINOR_VERSION 0 +#define SERVER_WINDOWSDRI_PATCH_VERSION 0 + /* Windows WM */ #define SERVER_WINDOWSWM_MAJOR_VERSION 1 #define SERVER_WINDOWSWM_MINOR_VERSION 0 diff -Nru xorg-server-hwe-16.04-1.18.4/include/scrnintstr.h xorg-server-hwe-16.04-1.19.3/include/scrnintstr.h --- xorg-server-hwe-16.04-1.18.4/include/scrnintstr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/scrnintstr.h 2017-03-15 18:05:25.000000000 +0000 @@ -233,6 +233,18 @@ int /*y */ , Bool /*generateEvent */ ); +typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ , + ScreenPtr /*pScreen */ , + ClientPtr /*pClient */ , + WindowPtr /*pWindow */ , + SpritePtr /*pSprite */ , + int /*x */ , + int /*y */ ); + +typedef void (*CurserConfinedToProcPtr) (DeviceIntPtr /* pDev */ , + ScreenPtr /*pScreen */ , + WindowPtr /*pWindow */ ); + typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ ); typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ ); @@ -258,12 +270,15 @@ typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ ); typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen, - void *pTimeout, - void *pReadmask); + void *timeout); +/* result has three possible values: + * < 0 - error + * = 0 - timeout + * > 0 - activity + */ typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen, - unsigned long result, - void *pReadMask); + int result); typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ ); @@ -344,13 +359,40 @@ typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *); +#define HAS_SYNC_SHARED_PIXMAP 1 +/* The SyncSharedPixmap hook has two purposes: + * + * 1. If the master driver has it, the slave driver can use it to + * synchronize the shared pixmap contents with the screen pixmap. + * 2. If the slave driver has it, the master driver can expect the slave + * driver to call the master screen's SyncSharedPixmap hook, so the master + * driver doesn't have to synchronize the shared pixmap contents itself, + * e.g. from the BlockHandler. + * + * A driver must only set the hook if it handles both cases correctly. + * + * The argument is the slave screen's pixmap_dirty_list entry, the hook is + * responsible for finding the corresponding entry in the master screen's + * pixmap_dirty_list. + */ +typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr); + typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr, int x, int y, int dst_x, int dst_y, Rotation rotation); +typedef Bool (*PresentSharedPixmapProcPtr)(PixmapPtr); + +typedef Bool (*RequestSharedPixmapNotifyDamageProcPtr)(PixmapPtr); + typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr); +typedef Bool (*StopFlippingPixmapTrackingProcPtr)(PixmapPtr, + PixmapPtr, PixmapPtr); + +typedef Bool (*SharedPixmapNotifyDamageProcPtr)(PixmapPtr); + typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool); typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen, @@ -524,6 +566,8 @@ UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; + CursorWarpedToProcPtr CursorWarpedTo; + CurserConfinedToProcPtr CursorConfinedTo; /* GC procedures */ @@ -590,23 +634,28 @@ Bool isGPU; - struct xorg_list unattached_list; - struct xorg_list unattached_head; - + /* Info on this screen's slaves (if any) */ + struct xorg_list slave_list; + struct xorg_list slave_head; + int output_slaves; + /* Info for when this screen is a slave */ ScreenPtr current_master; - - struct xorg_list output_slave_list; - struct xorg_list output_head; + Bool is_output_slave; + Bool is_offload_slave; SharePixmapBackingProcPtr SharePixmapBacking; SetSharedPixmapBackingProcPtr SetSharedPixmapBacking; StartPixmapTrackingProcPtr StartPixmapTracking; StopPixmapTrackingProcPtr StopPixmapTracking; + SyncSharedPixmapProcPtr SyncSharedPixmap; + + SharedPixmapNotifyDamageProcPtr SharedPixmapNotifyDamage; + RequestSharedPixmapNotifyDamageProcPtr RequestSharedPixmapNotifyDamage; + PresentSharedPixmapProcPtr PresentSharedPixmap; + StopFlippingPixmapTrackingProcPtr StopFlippingPixmapTracking; struct xorg_list pixmap_dirty_list; - struct xorg_list offload_slave_list; - struct xorg_list offload_head; ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; XYToWindowProcPtr XYToWindow; diff -Nru xorg-server-hwe-16.04-1.18.4/include/xkbsrv.h xorg-server-hwe-16.04-1.19.3/include/xkbsrv.h --- xorg-server-hwe-16.04-1.18.4/include/xkbsrv.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/xkbsrv.h 2017-03-15 18:05:25.000000000 +0000 @@ -142,6 +142,10 @@ struct _XkbFilter *next; } XkbFilterRec, *XkbFilterPtr; +typedef Bool (*XkbSrvCheckRepeatPtr) (DeviceIntPtr dev, + struct _XkbSrvInfo * /* xkbi */ , + unsigned /* keycode */); + typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; @@ -189,6 +193,8 @@ int szFilters; XkbFilterPtr filters; + + XkbSrvCheckRepeatPtr checkRepeat; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) diff -Nru xorg-server-hwe-16.04-1.18.4/include/xorg-config.h.in xorg-server-hwe-16.04-1.19.3/include/xorg-config.h.in --- xorg-server-hwe-16.04-1.18.4/include/xorg-config.h.in 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/xorg-config.h.in 2017-03-15 18:05:25.000000000 +0000 @@ -127,9 +127,6 @@ /* Path to text files containing PCI IDs */ #undef PCI_TXT_IDS_PATH -/* Use SIGIO handlers for input device events by default */ -#undef USE_SIGIO_BY_DEFAULT - /* Build with libdrm support */ #undef WITH_LIBDRM @@ -151,4 +148,7 @@ /* Support APM/ACPI power management in the server */ #undef XF86PM +/* Fallback input driver if the assigned driver fails */ +#undef FALLBACK_INPUT_DRIVER + #endif /* _XORG_CONFIG_H_ */ diff -Nru xorg-server-hwe-16.04-1.18.4/include/xserver_poll.h xorg-server-hwe-16.04-1.19.3/include/xserver_poll.h --- xorg-server-hwe-16.04-1.18.4/include/xserver_poll.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/include/xserver_poll.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright © 2016 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. + */ + +#ifndef _XSERVER_POLL_H_ +#define _XSERVER_POLL_H_ + +#ifndef _DIX_CONFIG_H_ +#error must inclue dix-config.h to use xserver_poll.h +#endif + +#if HAVE_POLL +#include +#define xserver_poll(fds, nfds, timeout) poll(fds, nfds, timeout) +#else + +#define POLLIN 0x01 +#define POLLPRI 0x02 +#define POLLOUT 0x04 +#define POLLERR 0x08 +#define POLLHUP 0x10 +#define POLLNVAL 0x20 + +struct pollfd +{ + int fd; + short events; + short revents; +}; + +typedef unsigned long nfds_t; + +int xserver_poll (struct pollfd *pArray, nfds_t n_fds, int timeout); + +#endif + +#endif /* _XSERVER_POLL_H_ */ diff -Nru xorg-server-hwe-16.04-1.18.4/m4/ax_pthread.m4 xorg-server-hwe-16.04-1.19.3/m4/ax_pthread.m4 --- xorg-server-hwe-16.04-1.18.4/m4/ax_pthread.m4 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/m4/ax_pthread.m4 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,337 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 21 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; + netbsd*) + # use libc stubs, don't link against libpthread, to allow + # dynamic loading + ax_pthread_flags="" + ;; +esac + +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], + [AC_MSG_RESULT([yes])], + [ax_pthread_extra_flags= + AC_MSG_RESULT([no])]) +CFLAGS="$save_CFLAGS" + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT([$attr_name]) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT([$flag]) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff -Nru xorg-server-hwe-16.04-1.18.4/Makefile.in xorg-server-hwe-16.04-1.19.3/Makefile.in --- xorg-server-hwe-16.04-1.18.4/Makefile.in 2016-07-19 17:27:25.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -91,9 +91,10 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -197,9 +198,8 @@ CTAGS = ctags CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xorg-server.pc.in \ - $(srcdir)/xserver.ent.in COPYING ChangeLog INSTALL README TODO \ - compile config.guess config.sub depcomp install-sh ltmain.sh \ - missing ylwrap + $(srcdir)/xserver.ent.in COPYING ChangeLog INSTALL README \ + compile config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -417,6 +417,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -447,7 +450,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -542,6 +548,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -935,7 +942,7 @@ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 @@ -960,7 +967,7 @@ @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -978,7 +985,7 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -988,7 +995,7 @@ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff -Nru xorg-server-hwe-16.04-1.18.4/man/Makefile.in xorg-server-hwe-16.04-1.19.3/man/Makefile.in --- xorg-server-hwe-16.04-1.18.4/man/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/man/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -95,9 +95,10 @@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -356,6 +357,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -386,7 +390,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -481,6 +488,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/mi/Makefile.in xorg-server-hwe-16.04-1.19.3/mi/Makefile.in --- xorg-server-hwe-16.04-1.18.4/mi/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -92,9 +92,10 @@ subdir = mi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -392,6 +393,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -422,7 +426,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -517,6 +524,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/mi/mieq.c xorg-server-hwe-16.04-1.19.3/mi/mieq.c --- xorg-server-hwe-16.04-1.18.4/mi/mieq.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/mieq.c 2017-03-15 18:05:25.000000000 +0000 @@ -87,27 +87,6 @@ static EventQueueRec miEventQueue; -#ifdef XQUARTZ -#include -static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER; - -extern BOOL serverRunning; -extern pthread_mutex_t serverRunningMutex; -extern pthread_cond_t serverRunningCond; - -static inline void -wait_for_server_init(void) -{ - /* If the server hasn't finished initializing, wait for it... */ - if (!serverRunning) { - pthread_mutex_lock(&serverRunningMutex); - while (!serverRunning) - pthread_cond_wait(&serverRunningCond, &serverRunningMutex); - pthread_mutex_unlock(&serverRunningMutex); - } -} -#endif - static size_t mieqNumEnqueued(EventQueuePtr eventQueue) { @@ -122,7 +101,7 @@ return n_enqueued; } -/* Pre-condition: Called with miEventQueueMutex held */ +/* Pre-condition: Called with input_lock held */ static Bool mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) { @@ -145,11 +124,6 @@ n_enqueued = mieqNumEnqueued(eventQueue); - /* We block signals, so an mieqEnqueue triggered by SIGIO does not - * write to our queue as we are modifying it. - */ - OsBlockSignals(); - /* First copy the existing events */ first_hunk = eventQueue->nevents - eventQueue->head; memcpy(new_events, @@ -168,7 +142,6 @@ for (j = 0; j < i; j++) FreeEventList(new_events[j].events, 1); free(new_events); - OsReleaseSignals(); return FALSE; } new_events[i].events = evlist; @@ -181,7 +154,6 @@ free(eventQueue->events); eventQueue->events = new_events; - OsReleaseSignals(); return TRUE; } @@ -191,8 +163,10 @@ memset(&miEventQueue, 0, sizeof(miEventQueue)); miEventQueue.lastEventTime = GetTimeInMillis(); + input_lock(); if (!mieqGrowQueue(&miEventQueue, QUEUE_INITIAL_SIZE)) FatalError("Could not allocate event queue.\n"); + input_unlock(); SetInputCheck(&miEventQueue.head, &miEventQueue.tail); return TRUE; @@ -212,32 +186,9 @@ free(miEventQueue.events); } -/* This function will determine if the given event is allowed to used the reserved - * queue space. - */ -static Bool -mieqReservedCandidate(InternalEvent *e) -{ - switch (e->any.type) { - case ET_KeyRelease: - case ET_ButtonRelease: -#if XFreeXDGA - case ET_DGAEvent: -#endif - case ET_RawKeyRelease: - case ET_RawButtonRelease: - case ET_XQuartz: - return TRUE; - default: - return FALSE; - } -} - /* * Must be reentrant with ProcessInputEvents. Assumption: mieqEnqueue - * will never be interrupted. If this is called from both signal - * handlers and regular code, make sure the signal is suspended when - * called from regular code. + * will never be interrupted. Must be called with input_lock held */ void @@ -250,11 +201,6 @@ Time time; size_t n_enqueued; -#ifdef XQUARTZ - wait_for_server_init(); - pthread_mutex_lock(&miEventQueueMutex); -#endif - verify_internal_event(e); n_enqueued = mieqNumEnqueued(&miEventQueue); @@ -267,39 +213,35 @@ oldtail != miEventQueue.head) { oldtail = (oldtail - 1) % miEventQueue.nevents; } - else if ((n_enqueued + 1 == miEventQueue.nevents) || - ((n_enqueued + 1 >= miEventQueue.nevents - QUEUE_RESERVED_SIZE) && - !mieqReservedCandidate(e))) { - /* Toss events which come in late. Usually this means your server's - * stuck in an infinite loop somewhere, but SIGIO is still getting - * handled. - */ - miEventQueue.dropped++; - if (miEventQueue.dropped == 1) { - ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " - "discarded until existing events are processed.\n"); - xorg_backtrace(); - ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to " - "a culprit higher up the stack.\n"); - ErrorFSigSafe("[mi] mieq is *NOT* the cause. It is a victim.\n"); - } - else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 && - miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <= - QUEUE_DROP_BACKTRACE_MAX) { - ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been " - "dropped.\n", miEventQueue.dropped); - if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == - QUEUE_DROP_BACKTRACE_MAX) { - ErrorFSigSafe("[mi] No further overflow reports will be " - "reported until the clog is cleared.\n"); + else if (n_enqueued + 1 == miEventQueue.nevents) { + if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { + /* Toss events which come in late. Usually this means your server's + * stuck in an infinite loop in the main thread. + */ + miEventQueue.dropped++; + if (miEventQueue.dropped == 1) { + ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " + "discarded until existing events are processed.\n"); + xorg_backtrace(); + ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to " + "a culprit higher up the stack.\n"); + ErrorFSigSafe("[mi] mieq is *NOT* the cause. It is a victim.\n"); } - xorg_backtrace(); + else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 && + miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <= + QUEUE_DROP_BACKTRACE_MAX) { + ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been " + "dropped.\n", miEventQueue.dropped); + if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == + QUEUE_DROP_BACKTRACE_MAX) { + ErrorFSigSafe("[mi] No further overflow reports will be " + "reported until the clog is cleared.\n"); + } + xorg_backtrace(); + } + return; } - -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - return; + oldtail = miEventQueue.tail; } evlen = e->any.length; @@ -319,9 +261,6 @@ miEventQueue.lastMotion = isMotion; miEventQueue.tail = (oldtail + 1) % miEventQueue.nevents; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } /** @@ -342,31 +281,19 @@ void mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool set_dequeue_screen) { -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif EnqueueScreen(pDev) = pScreen; if (set_dequeue_screen) DequeueScreen(pDev) = pScreen; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } void mieqSetHandler(int event, mieqHandler handler) { -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif if (handler && miEventQueue.handlers[event]) ErrorF("[mi] mieq: warning: overriding existing handler %p with %p for " "event %d\n", miEventQueue.handlers[event], handler, event); miEventQueue.handlers[event] = handler; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } /** @@ -578,12 +505,9 @@ ScreenPtr screen; InternalEvent event; DeviceIntPtr dev = NULL, master = NULL; - size_t n_enqueued; static Bool inProcessInputEvents = FALSE; -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif + input_lock(); /* * report an error if mieqProcessInputEvents() is called recursively; @@ -593,17 +517,6 @@ BUG_WARN_MSG(inProcessInputEvents, "[mi] mieqProcessInputEvents() called recursively.\n"); inProcessInputEvents = TRUE; - /* Grow our queue if we are reaching capacity: < 2 * QUEUE_RESERVED_SIZE remaining */ - n_enqueued = mieqNumEnqueued(&miEventQueue); - if (n_enqueued >= (miEventQueue.nevents - (2 * QUEUE_RESERVED_SIZE)) && - miEventQueue.nevents < QUEUE_MAXIMUM_SIZE) { - ErrorF("[mi] Increasing EQ size to %lu to prevent dropped events.\n", - (unsigned long) (miEventQueue.nevents << 1)); - if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { - ErrorF("[mi] Increasing the size of EQ failed.\n"); - } - } - if (miEventQueue.dropped) { ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", (unsigned long) miEventQueue.dropped); @@ -621,9 +534,7 @@ miEventQueue.head = (miEventQueue.head + 1) % miEventQueue.nevents; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif + input_unlock(); master = (dev) ? GetMaster(dev, MASTER_ATTACHED) : NULL; @@ -647,14 +558,10 @@ event.device_event.flags & TOUCH_POINTER_EMULATED))) miPointerUpdateSprite(dev); -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif + input_lock(); } inProcessInputEvents = FALSE; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif + input_unlock(); } diff -Nru xorg-server-hwe-16.04-1.18.4/mi/miglblt.c xorg-server-hwe-16.04-1.19.3/mi/miglblt.c --- xorg-server-hwe-16.04-1.18.4/mi/miglblt.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/miglblt.c 2017-03-15 18:05:25.000000000 +0000 @@ -53,7 +53,7 @@ #include #include "misc.h" #include -#include +#include #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -186,13 +186,13 @@ void *pglyphBase /* start of array of glyphs */ ) { - ExtentInfoRec info; /* used by QueryGlyphExtents() */ + ExtentInfoRec info; /* used by xfont2_query_glyph_extents() */ ChangeGCVal gcvals[3]; int oldAlu, oldFS; unsigned long oldFG; xRectangle backrect; - QueryGlyphExtents(pGC->font, ppci, (unsigned long) nglyph, &info); + xfont2_query_glyph_extents(pGC->font, ppci, (unsigned long) nglyph, &info); if (info.overallWidth >= 0) { backrect.x = x; diff -Nru xorg-server-hwe-16.04-1.18.4/mi/mipointer.c xorg-server-hwe-16.04-1.19.3/mi/mipointer.c --- xorg-server-hwe-16.04-1.18.4/mi/mipointer.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/mipointer.c 2017-03-15 18:05:25.000000000 +0000 @@ -65,6 +65,18 @@ #include "inpututils.h" #include "eventstr.h" +typedef struct { + ScreenPtr pScreen; /* current screen */ + ScreenPtr pSpriteScreen; /* screen containing current sprite */ + CursorPtr pCursor; /* current cursor */ + CursorPtr pSpriteCursor; /* cursor on screen */ + BoxRec limits; /* current constraints */ + Bool confined; /* pointer can't change screens */ + int x, y; /* hot spot location */ + int devx, devy; /* sprite position */ + Bool generateEvent; /* generate an event during warping? */ +} miPointerRec, *miPointerPtr; + DevPrivateKeyRec miPointerScreenKeyRec; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ @@ -468,6 +480,21 @@ } /** + * Invalidate the current sprite and force it to be reloaded on next cursor setting + * operation + * + * @param pDev The device to invalidate the sprite fore + */ +void +miPointerInvalidateSprite(DeviceIntPtr pDev) +{ + miPointerPtr pPointer; + + pPointer = MIPOINTER(pDev); + pPointer->pSpriteCursor = (CursorPtr) 1; +} + +/** * Set the device to the coordinates on the given screen. * * @param pDev The device to move @@ -528,8 +555,9 @@ pPointer = MIPOINTER(pDev); /* Hack: We mustn't call into ->MoveCursor for anything but the - * VCP, as this may cause a non-HW rendered cursor to be rendered during - * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. + * VCP, as this may cause a non-HW rendered cursor to be rendered while + * not holding the input lock. This would race with building the command + * buffer for other rendering. */ if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer &&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { @@ -681,12 +709,6 @@ *y = MIPOINTER(pDev)->y; } -#ifdef XQUARTZ -#include -void darwinEvents_lock(void); -void darwinEvents_unlock(void); -#endif - /** * Move the device's pointer to the x/y coordinates on the given screen. * This function generates and enqueues pointer events. @@ -723,14 +745,8 @@ POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); - OsBlockSignals(); -#ifdef XQUARTZ - darwinEvents_lock(); -#endif + input_lock(); for (i = 0; i < nevents; i++) mieqEnqueue(pDev, &mipointermove_events[i]); -#ifdef XQUARTZ - darwinEvents_unlock(); -#endif - OsReleaseSignals(); + input_unlock(); } diff -Nru xorg-server-hwe-16.04-1.18.4/mi/mipointer.h xorg-server-hwe-16.04-1.19.3/mi/mipointer.h --- xorg-server-hwe-16.04-1.18.4/mi/mipointer.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/mipointer.h 2017-03-15 18:05:25.000000000 +0000 @@ -109,6 +109,12 @@ extern _X_EXPORT void miPointerUpdateSprite(DeviceIntPtr pDev); +/* Invalidate current sprite, forcing reload on next + * sprite setting (window crossing, grab action, etc) + */ +extern _X_EXPORT void +miPointerInvalidateSprite(DeviceIntPtr pDev); + /* Sets whether the sprite should be updated immediately on pointer moves */ extern _X_EXPORT Bool miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait); diff -Nru xorg-server-hwe-16.04-1.18.4/mi/mipointrst.h xorg-server-hwe-16.04-1.19.3/mi/mipointrst.h --- xorg-server-hwe-16.04-1.18.4/mi/mipointrst.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/mipointrst.h 2017-03-15 18:05:25.000000000 +0000 @@ -35,22 +35,10 @@ #include "scrnintstr.h" typedef struct { - ScreenPtr pScreen; /* current screen */ - ScreenPtr pSpriteScreen; /* screen containing current sprite */ - CursorPtr pCursor; /* current cursor */ - CursorPtr pSpriteCursor; /* cursor on screen */ - BoxRec limits; /* current constraints */ - Bool confined; /* pointer can't change screens */ - int x, y; /* hot spot location */ - int devx, devy; /* sprite position */ - Bool generateEvent; /* generate an event during warping? */ -} miPointerRec, *miPointerPtr; - -typedef struct { miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */ CloseScreenProcPtr CloseScreen; - Bool waitForUpdate; /* don't move cursor in SIGIO */ + Bool waitForUpdate; /* don't move cursor from input thread */ Bool showTransparent; /* show empty cursors */ } miPointerScreenRec, *miPointerScreenPtr; #endif /* MIPOINTRST_H */ diff -Nru xorg-server-hwe-16.04-1.18.4/mi/misprite.c xorg-server-hwe-16.04-1.19.3/mi/misprite.c --- xorg-server-hwe-16.04-1.18.4/mi/misprite.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/mi/misprite.c 2017-03-15 18:05:25.000000000 +0000 @@ -198,8 +198,7 @@ unsigned int subWindowMode); static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -static void miSpriteBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask); +static void miSpriteBlockHandler(ScreenPtr pScreen, void *timeout); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); @@ -512,8 +511,7 @@ } static void -miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask) +miSpriteBlockHandler(ScreenPtr pScreen, void *timeout) { miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; @@ -545,7 +543,7 @@ } } - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, timeout); if (WorkToDo) SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); diff -Nru xorg-server-hwe-16.04-1.18.4/miext/damage/damage.c xorg-server-hwe-16.04-1.19.3/miext/damage/damage.c --- xorg-server-hwe-16.04-1.18.4/miext/damage/damage.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/damage/damage.c 2017-03-15 18:05:25.000000000 +0000 @@ -32,8 +32,9 @@ #include #include "dixfontstr.h" #include -#include +#include #include "mi.h" +#include "mipict.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" @@ -499,6 +500,15 @@ if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); } + /* + * Validating a source picture bound to a window may trigger other + * composite operations. Do it before unwrapping to make sure damage + * is reported correctly. + */ + if (pSrc->pDrawable && WindowDrawable(pSrc->pDrawable->type)) + miCompositeSourceValidate(pSrc); + if (pMask && pMask->pDrawable && WindowDrawable(pMask->pDrawable->type)) + miCompositeSourceValidate(pMask); unwrap(pScrPriv, ps, Composite); (*ps->Composite) (op, pSrc, @@ -1248,7 +1258,7 @@ ExtentInfoRec extents; BoxRec box; - QueryGlyphExtents(font, charinfo, n, &extents); + xfont2_query_glyph_extents(font, charinfo, n, &extents); if (imageblt) { if (extents.overallWidth > extents.overallRight) extents.overallRight = extents.overallWidth; diff -Nru xorg-server-hwe-16.04-1.18.4/miext/damage/Makefile.in xorg-server-hwe-16.04-1.19.3/miext/damage/Makefile.in --- xorg-server-hwe-16.04-1.18.4/miext/damage/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/damage/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -92,9 +92,10 @@ subdir = miext/damage ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -385,6 +386,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -415,7 +419,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -510,6 +517,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/miext/Makefile.in xorg-server-hwe-16.04-1.19.3/miext/Makefile.in --- xorg-server-hwe-16.04-1.18.4/miext/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -90,9 +90,10 @@ subdir = miext ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -364,6 +365,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -394,7 +398,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -489,6 +496,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/miext/rootless/Makefile.in xorg-server-hwe-16.04-1.19.3/miext/rootless/Makefile.in --- xorg-server-hwe-16.04-1.18.4/miext/rootless/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/rootless/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -91,9 +91,10 @@ subdir = miext/rootless ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -354,6 +355,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -384,7 +388,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -479,6 +486,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/miext/rootless/rootlessScreen.c xorg-server-hwe-16.04-1.19.3/miext/rootless/rootlessScreen.c --- xorg-server-hwe-16.04-1.18.4/miext/rootless/rootlessScreen.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/rootless/rootlessScreen.c 2017-03-15 18:05:25.000000000 +0000 @@ -603,7 +603,7 @@ * on select(). */ static void -RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask) +RootlessBlockHandler(void *pbdata, void *ptimeout) { ScreenPtr pScreen = pbdata; RootlessScreenRec *screenRec = SCREENREC(pScreen); @@ -616,7 +616,7 @@ } static void -RootlessWakeupHandler(void *data, int i, void *LastSelectMask) +RootlessWakeupHandler(void *data, int result) { // nothing here } diff -Nru xorg-server-hwe-16.04-1.18.4/miext/shadow/Makefile.in xorg-server-hwe-16.04-1.19.3/miext/shadow/Makefile.in --- xorg-server-hwe-16.04-1.18.4/miext/shadow/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/shadow/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -92,9 +92,10 @@ subdir = miext/shadow ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -391,6 +392,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -421,7 +425,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -516,6 +523,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/miext/shadow/shadow.c xorg-server-hwe-16.04-1.19.3/miext/shadow/shadow.c --- xorg-server-hwe-16.04-1.18.4/miext/shadow/shadow.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/shadow/shadow.c 2017-03-15 18:05:25.000000000 +0000 @@ -65,16 +65,15 @@ } static void -shadowBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) +shadowBlockHandler(ScreenPtr pScreen, void *timeout) { - ScreenPtr pScreen = (ScreenPtr) data; + shadowBuf(pScreen); shadowRedisplay(pScreen); -} -static void -shadowWakeupHandler(void *data, int i, void *LastSelectMask) -{ + unwrap(pBuf, pScreen, BlockHandler); + pScreen->BlockHandler(pScreen, timeout); + wrap(pBuf, pScreen, BlockHandler); } static void @@ -100,6 +99,7 @@ unwrap(pBuf, pScreen, GetImage); unwrap(pBuf, pScreen, CloseScreen); + unwrap(pBuf, pScreen, BlockHandler); shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); if (pBuf->pPixmap) @@ -132,6 +132,7 @@ wrap(pBuf, pScreen, CloseScreen); wrap(pBuf, pScreen, GetImage); + wrap(pBuf, pScreen, BlockHandler); pBuf->update = 0; pBuf->window = 0; pBuf->pPixmap = 0; @@ -148,10 +149,6 @@ { shadowBuf(pScreen); - if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen)) - return FALSE; - /* * Map simple rotation values to bitmasks; fortunately, * these are all unique @@ -192,7 +189,4 @@ pBuf->closure = 0; pBuf->pPixmap = 0; } - - RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen); } diff -Nru xorg-server-hwe-16.04-1.18.4/miext/shadow/shadow.h xorg-server-hwe-16.04-1.19.3/miext/shadow/shadow.h --- xorg-server-hwe-16.04-1.18.4/miext/shadow/shadow.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/shadow/shadow.h 2017-03-15 18:05:25.000000000 +0000 @@ -54,6 +54,7 @@ /* screen wrappers */ GetImageProcPtr GetImage; CloseScreenProcPtr CloseScreen; + ScreenBlockHandlerProcPtr BlockHandler; } shadowBufRec; /* Match defines from randr extension */ diff -Nru xorg-server-hwe-16.04-1.18.4/miext/sync/Makefile.in xorg-server-hwe-16.04-1.19.3/miext/sync/Makefile.in --- xorg-server-hwe-16.04-1.18.4/miext/sync/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/miext/sync/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -93,9 +93,10 @@ subdir = miext/sync ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -390,6 +391,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -420,7 +424,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -515,6 +522,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/os/access.c xorg-server-hwe-16.04-1.19.3/os/access.c --- xorg-server-hwe-16.04-1.18.4/os/access.c 2016-07-19 17:25:35.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/access.c 2017-03-15 18:05:25.000000000 +0000 @@ -106,13 +106,13 @@ #include #endif -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #include #endif /* TCPCONN || STREAMSCONN */ #ifdef HAVE_GETPEERUCRED #include -#ifdef sun +#ifdef __sun #include #endif #endif @@ -162,7 +162,7 @@ * Test for Solaris commented out -- TSI @ UQV 2003.06.13 */ #ifdef SIOCGLIFCONF -/* #if defined(sun) */ +/* #if defined(__sun) */ #define USE_SIOCGLIFCONF /* #endif */ #endif @@ -387,7 +387,7 @@ LocalHostEnabled = FALSE; } -#if defined(SVR4) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if defined(SVR4) && !defined(__sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -430,7 +430,7 @@ void DefineSelf(int fd) { -#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) +#if !defined(TCPCONN) && !defined(UNIXCONN) return; #else register int n; @@ -938,11 +938,10 @@ char *ptr; int i, hostlen; -#if (defined(TCPCONN) || defined(STREAMSCONN) ) && \ - (!defined(IPv6) || !defined(AF_INET6)) +#if defined(TCPCONN) && (!defined(IPv6) || !defined(AF_INET6)) union { struct sockaddr sa; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) struct sockaddr_in in; #endif /* TCPCONN || STREAMSCONN */ } saddr; @@ -988,7 +987,7 @@ NewHost(family, "", 0, FALSE); LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */ } -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) else if (!strncmp("inet:", lhostname, 5)) { family = FamilyInternet; hostname = ohostname + 5; @@ -1027,7 +1026,7 @@ } else #endif /* SECURE_RPC */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) { #if defined(IPv6) && defined(AF_INET6) if ((family == FamilyInternet) || (family == FamilyInternet6) || @@ -1183,7 +1182,7 @@ if (client == NULL) return -1; ci = ((OsCommPtr) client->osPrivate)->trans_conn; -#if !(defined(sun) && defined(HAVE_GETPEERUCRED)) +#if !(defined(__sun) && defined(HAVE_GETPEERUCRED)) /* Most implementations can only determine peer credentials for Unix * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not @@ -1479,7 +1478,7 @@ int len; switch (family) { -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case FamilyInternet: if (length == sizeof(struct in_addr)) len = length; @@ -1562,7 +1561,7 @@ case AF_UNIX: #endif return FamilyLocal; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: #ifdef WIN32 if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr) diff -Nru xorg-server-hwe-16.04-1.18.4/os/auth.c xorg-server-hwe-16.04-1.19.3/os/auth.c --- xorg-server-hwe-16.04-1.18.4/os/auth.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/auth.c 2017-03-15 18:05:25.000000000 +0000 @@ -45,6 +45,9 @@ #ifdef WIN32 #include #endif +#ifdef HAVE_LIBBSD +#include /* for arc4random_buf() */ +#endif struct protocol { unsigned short name_length; @@ -52,7 +55,6 @@ AuthAddCFunc Add; /* new authorization data */ AuthCheckFunc Check; /* verify client authorization data */ AuthRstCFunc Reset; /* delete all authorization data entries */ - AuthToIDFunc ToID; /* convert cookie to ID */ AuthFromIDFunc FromID; /* convert ID to cookie */ AuthRemCFunc Remove; /* remove a specific cookie */ #ifdef XCSECURITY @@ -63,7 +65,7 @@ static struct protocol protocols[] = { {(unsigned short) 18, "MIT-MAGIC-COOKIE-1", MitAddCookie, MitCheckCookie, MitResetCookie, - MitToID, MitFromID, MitRemoveCookie, + MitFromID, MitRemoveCookie, #ifdef XCSECURITY MitGenerateCookie #endif @@ -71,7 +73,7 @@ #ifdef HASXDMAUTH {(unsigned short) 19, "XDM-AUTHORIZATION-1", XdmAddCookie, XdmCheckCookie, XdmResetCookie, - XdmToID, XdmFromID, XdmRemoveCookie, + XdmFromID, XdmRemoveCookie, #ifdef XCSECURITY NULL #endif @@ -80,7 +82,7 @@ #ifdef SECURE_RPC {(unsigned short) 9, "SUN-DES-1", SecureRPCAdd, SecureRPCCheck, SecureRPCReset, - SecureRPCToID, SecureRPCFromID, SecureRPCRemove, + SecureRPCFromID, SecureRPCRemove, #ifdef XCSECURITY NULL #endif @@ -303,11 +305,15 @@ void GenerateRandomData(int len, char *buf) { +#ifdef HAVE_ARC4RANDOM_BUF + arc4random_buf(buf, len); +#else int fd; fd = open("/dev/urandom", O_RDONLY); read(fd, buf, len); close(fd); +#endif } #endif /* XCSECURITY */ diff -Nru xorg-server-hwe-16.04-1.18.4/os/backtrace.c xorg-server-hwe-16.04-1.19.3/os/backtrace.c --- xorg-server-hwe-16.04-1.18.4/os/backtrace.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/backtrace.c 2017-03-15 18:05:25.000000000 +0000 @@ -155,7 +155,7 @@ #else /* not glibc or glibc < 2.1 */ -#if defined(sun) && defined(__SVR4) +#if defined(__sun) && defined(__SVR4) #define HAVE_PSTACK #endif diff -Nru xorg-server-hwe-16.04-1.18.4/os/busfault.c xorg-server-hwe-16.04-1.19.3/os/busfault.c --- xorg-server-hwe-16.04-1.18.4/os/busfault.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/busfault.c 2017-03-15 18:05:25.000000000 +0000 @@ -98,15 +98,16 @@ busfault_sigaction(int sig, siginfo_t *info, void *param) { void *fault = info->si_addr; - struct busfault *busfault = NULL; + struct busfault *iter, *busfault = NULL; void *new_addr; /* Locate the faulting address in our list of shared segments */ - xorg_list_for_each_entry(busfault, &busfaults, list) { - if ((char *) busfault->addr <= (char *) fault && (char *) fault < (char *) busfault->addr + busfault->size) { - break; - } + xorg_list_for_each_entry(iter, &busfaults, list) { + if ((char *) iter->addr <= (char *) fault && (char *) fault < (char *) iter->addr + iter->size) { + busfault = iter; + break; + } } if (!busfault) goto panic; @@ -132,7 +133,7 @@ if (previous_busfault_sigaction) (*previous_busfault_sigaction)(sig, info, param); else - FatalError("bus error"); + FatalError("bus error\n"); } Bool diff -Nru xorg-server-hwe-16.04-1.18.4/os/connection.c xorg-server-hwe-16.04-1.19.3/os/connection.c --- xorg-server-hwe-16.04-1.18.4/os/connection.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/connection.c 2017-03-15 18:05:25.000000000 +0000 @@ -47,8 +47,8 @@ * Stuff to create connections --- OS dependent * * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, - * CloseDownConnection, CheckConnections, AddEnabledDevice, - * RemoveEnabledDevice, OnlyListToOneClient, + * CloseDownConnection, + * OnlyListToOneClient, * ListenToAllClients, * * (WaitForSomething is in its own file) @@ -82,7 +82,7 @@ #ifndef WIN32 #include -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #include #include #ifdef apollo @@ -103,7 +103,6 @@ #endif /* WIN32 */ #include "misc.h" /* for typedef of pointer */ #include "osdep.h" -#include #include "opaque.h" #include "dixstruct.h" #include "xace.h" @@ -119,19 +118,10 @@ #include "probes.h" -static int lastfdesc; /* maximum file descriptor */ +struct ospoll *server_poll; -fd_set WellKnownConnections; /* Listener mask */ -fd_set EnabledDevices; /* mask for input devices that are on */ -fd_set AllSockets; /* select on this */ -fd_set AllClients; /* available clients */ -fd_set LastSelectMask; /* mask returned from last select call */ -fd_set ClientsWithInput; /* clients with FULL requests in buffer */ -fd_set ClientsWriteBlocked; /* clients who cannot receive output */ -fd_set OutputPending; /* clients with reply/event data ready to go */ int MaxClients = 0; Bool NewOutputPending; /* not yet attempted to write some new output */ -Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ Bool NoListenAll; /* Don't establish any listening sockets */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ @@ -141,30 +131,28 @@ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; -static Bool debug_conns = FALSE; - -fd_set IgnoredClientsWithInput; -static fd_set GrabImperviousClients; -static fd_set SavedAllClients; -static fd_set SavedAllSockets; -static fd_set SavedClientsWithInput; int GrabInProgress = 0; +static void +QueueNewConnections(int curconn, int ready, void *data); + +static void +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 between 0 and MAXSOCKS, they are unrelated, and there is + * 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. */ -#undef MAXSOCKS -#define MAXSOCKS 512 -#undef MAXSELECT -#define MAXSELECT 512 - struct _ct_node { struct _ct_node *next; int key; @@ -269,47 +257,17 @@ void InitConnectionLimits(void) { - lastfdesc = -1; - -#ifndef __CYGWIN__ - -#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) - lastfdesc = sysconf(_SC_OPEN_MAX) - 1; -#endif - -#ifdef HAVE_GETDTABLESIZE - if (lastfdesc < 0) - lastfdesc = getdtablesize() - 1; -#endif - -#ifdef _NFILE - if (lastfdesc < 0) - lastfdesc = _NFILE - 1; -#endif - -#endif /* __CYGWIN__ */ - - /* This is the fallback */ - if (lastfdesc < 0) - lastfdesc = MAXSOCKS; - - if (lastfdesc > MAXSELECT) - lastfdesc = MAXSELECT; - - if (lastfdesc > MAXCLIENTS) { - lastfdesc = MAXCLIENTS; - if (debug_conns) - ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", LimitClients); - } - MaxClients = lastfdesc; + MaxClients = MAXCLIENTS; #ifdef DEBUG ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); #endif #if !defined(WIN32) - if (!ConnectionTranslation) - ConnectionTranslation = xnfallocarray(lastfdesc + 1, sizeof(int)); + if (!ConnectionTranslation) { + ConnectionTranslation = xnfallocarray(MaxClients, sizeof(int)); + ConnectionTranslationSize = MaxClients; + } #else InitConnectionTranslation(); #endif @@ -387,20 +345,13 @@ int i; int partial; - FD_ZERO(&AllSockets); - FD_ZERO(&AllClients); - FD_ZERO(&LastSelectMask); - FD_ZERO(&ClientsWithInput); - #if !defined(WIN32) - for (i = 0; i < MaxClients; i++) + for (i = 0; i < ConnectionTranslationSize; i++) ConnectionTranslation[i] = 0; #else ClearConnectionTranslation(); #endif - FD_ZERO(&WellKnownConnections); - /* display is initialized to "0" by main(). It is then set to the display * number if specified on the command line. */ @@ -438,13 +389,13 @@ int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); ListenTransFds[i] = fd; - FD_SET(fd, &WellKnownConnections); + SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL); if (!_XSERVTransIsLocal(ListenTransConns[i])) DefineSelf (fd); } - if (!XFD_ANYSET(&WellKnownConnections) && !NoListenAll) + if (ListenTransCount == 0 && !NoListenAll) FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running"); @@ -454,7 +405,6 @@ #endif OsSignal(SIGINT, GiveUp); OsSignal(SIGTERM, GiveUp); - XFD_COPYSET(&WellKnownConnections, &AllSockets); ResetHosts(display); InitParentProcess(); @@ -481,7 +431,7 @@ * Remove it from out list. */ - FD_CLR(ListenTransFds[i], &WellKnownConnections); + RemoveNotifyFd(ListenTransFds[i]); ListenTransFds[i] = ListenTransFds[ListenTransCount - 1]; ListenTransConns[i] = ListenTransConns[ListenTransCount - 1]; ListenTransCount -= 1; @@ -494,12 +444,12 @@ int newfd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); - FD_CLR(ListenTransFds[i], &WellKnownConnections); ListenTransFds[i] = newfd; - FD_SET(newfd, &WellKnownConnections); } } } + for (i = 0; i < ListenTransCount; i++) + SetNotifyFd(ListenTransFds[i], QueueNewConnections, X_NOTIFY_READ, NULL); ResetAuthorization(); ResetHosts(display); @@ -520,6 +470,8 @@ if (ListenTransConns[i] != NULL) { _XSERVTransClose(ListenTransConns[i]); ListenTransConns[i] = NULL; + if (ListenTransFds != NULL) + RemoveNotifyFd(ListenTransFds[i]); } } ListenTransCount = 0; @@ -549,7 +501,7 @@ #endif strlcpy(addr, "local host", sizeof(addr)); break; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: snprintf(addr, sizeof(addr), "IP %s", inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); @@ -747,20 +699,29 @@ return ((char *) NULL); } +static void +ClientReady(int fd, int xevents, void *data) +{ + ClientPtr client = data; + + if (xevents & X_NOTIFY_ERROR) { + CloseDownClient(client); + return; + } + if (xevents & X_NOTIFY_READ) + mark_client_ready(client); + if (xevents & X_NOTIFY_WRITE) { + ospoll_mute(server_poll, fd, X_NOTIFY_WRITE); + NewOutputPending = TRUE; + } +} + static ClientPtr AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) { OsCommPtr oc; ClientPtr client; - if ( -#ifndef WIN32 - fd >= lastfdesc -#else - XFD_SETCOUNT(&AllClients) >= MaxClients -#endif - ) - return NullClient; oc = malloc(sizeof(OsCommRec)); if (!oc) return NullClient; @@ -770,24 +731,26 @@ oc->output = (ConnectionOutputPtr) NULL; oc->auth_id = None; oc->conn_time = conn_time; + oc->flags = 0; if (!(client = NextAvailableClient((void *) oc))) { free(oc); 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 - if (GrabInProgress) { - FD_SET(fd, &SavedAllClients); - FD_SET(fd, &SavedAllSockets); - } - else { - FD_SET(fd, &AllClients); - FD_SET(fd, &AllSockets); - } + ospoll_add(server_poll, fd, + ospoll_trigger_edge, + ClientReady, + client); + set_poll_client(client); #ifdef DEBUG ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n", @@ -807,22 +770,19 @@ * and AllSockets. *****************/ - /*ARGSUSED*/ Bool +static Bool EstablishNewConnections(ClientPtr clientUnused, void *closure) { - fd_set readyconnections; /* set of listeners that are ready */ - int curconn; /* fd of listener that's ready */ - register int newconn; /* fd of new client */ + int curconn = (int) (intptr_t) closure; + int newconn; /* fd of new client */ CARD32 connect_time; - register int i; - register ClientPtr client; - register OsCommPtr oc; - fd_set tmask; - - XFD_ANDSET(&tmask, (fd_set *) closure, &WellKnownConnections); - XFD_COPYSET(&tmask, &readyconnections); - if (!XFD_ANYSET(&readyconnections)) - return TRUE; + int i; + ClientPtr client; + OsCommPtr oc; + XtransConnInfo trans_conn, new_trans_conn; + int status; + int clientid; + connect_time = GetTimeInMillis(); /* kill off stragglers */ for (i = 1; i < currentMaxClients; i++) { @@ -834,58 +794,34 @@ CloseDownClient(client); } } -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - while (readyconnections.fds_bits[i]) -#else - for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++) -#endif - { - XtransConnInfo trans_conn, new_trans_conn; - int status; -#ifndef WIN32 - curconn = mffs(readyconnections.fds_bits[i]) - 1; - readyconnections.fds_bits[i] &= ~((fd_mask) 1 << curconn); - curconn += (i * (sizeof(fd_mask) * 8)); -#else - curconn = XFD_FD(&readyconnections, i); -#endif - - if ((trans_conn = lookup_trans_conn(curconn)) == NULL) - continue; - - if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL) - continue; + if ((trans_conn = lookup_trans_conn(curconn)) == NULL) + return TRUE; - newconn = _XSERVTransGetConnectionNumber(new_trans_conn); + if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL) + return TRUE; - if (newconn < lastfdesc) { - int clientid; + newconn = _XSERVTransGetConnectionNumber(new_trans_conn); -#if !defined(WIN32) - clientid = ConnectionTranslation[newconn]; -#else - clientid = GetConnectionTranslation(newconn); -#endif - if (clientid && (client = clients[clientid])) - CloseDownClient(client); - } + clientid = GetConnectionTranslation(newconn); + if (clientid && (client = clients[clientid])) + CloseDownClient(client); - _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); + _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); - if (trans_conn->flags & TRANS_NOXAUTH) - new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; + if (trans_conn->flags & TRANS_NOXAUTH) + new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; - if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) { - ErrorConnMax(new_trans_conn); - _XSERVTransClose(new_trans_conn); - } + if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) { + ErrorConnMax(new_trans_conn); } -#ifndef WIN32 + return TRUE; } -#endif -return TRUE; + +static void +QueueNewConnections(int fd, int ready, void *data) +{ + QueueWorkProc(EstablishNewConnections, NULL, (void *) (intptr_t) fd); } #define NOROOM "Maximum number of clients reached" @@ -895,37 +831,27 @@ * Fail a connection due to lack of client or file descriptor space ************/ -#define BOTIMEOUT 200 /* in milliseconds */ - static void -ErrorConnMax(XtransConnInfo trans_conn) +ConnMaxNotify(int fd, int events, void *data) { - int fd = _XSERVTransGetConnectionNumber(trans_conn); - xConnSetupPrefix csp; - char pad[3] = { 0, 0, 0 }; - struct iovec iov[3]; + XtransConnInfo trans_conn = data; char order = 0; - int whichbyte = 1; - struct timeval waittime; - fd_set mask; - - /* if these seems like a lot of trouble to go to, it probably is */ - waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; - waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - FD_ZERO(&mask); - FD_SET(fd, &mask); - (void) Select(fd + 1, &mask, NULL, NULL, &waittime); + /* try to read the byte-order of the connection */ (void) _XSERVTransRead(trans_conn, &order, 1); if (order == 'l' || order == 'B' || order == 'r' || order == 'R') { + xConnSetupPrefix csp; + char pad[3] = { 0, 0, 0 }; + int whichbyte = 1; + struct iovec iov[3]; + csp.success = xFalse; csp.lengthReason = sizeof(NOROOM) - 1; csp.length = (sizeof(NOROOM) + 2) >> 2; csp.majorVersion = X_PROTOCOL; csp.minorVersion = X_PROTOCOL_REVISION; - if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || - (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || + (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { swaps(&csp.majorVersion); swaps(&csp.minorVersion); swaps(&csp.length); @@ -938,6 +864,15 @@ iov[2].iov_base = pad; (void) _XSERVTransWritev(trans_conn, iov, 3); } + RemoveNotifyFd(trans_conn->fd); + _XSERVTransClose(trans_conn); +} + +static void +ErrorConnMax(XtransConnInfo trans_conn) +{ + if (!SetNotifyFd(trans_conn->fd, ConnMaxNotify, X_NOTIFY_READ, trans_conn)) + _XSERVTransClose(trans_conn); } /************ @@ -959,80 +894,7 @@ #else SetConnectionTranslation(connection, 0); #endif - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress) { - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - FD_CLR(connection, &SavedClientsWithInput); - } - FD_CLR(connection, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - FD_CLR(connection, &OutputPending); -} - -/***************** - * CheckConnections - * Some connection has died, go find which one and shut it down - * The file descriptor has been closed, but is still in AllClients. - * If would truly be wonderful if select() would put the bogus - * file descriptors in the exception mask, but nooooo. So we have - * to check each and every socket individually. - *****************/ - -void -CheckConnections(void) -{ -#ifndef WIN32 - fd_mask mask; -#endif - fd_set tmask; - int curclient, curoff; - int i; - struct timeval notime; - int r; - -#ifdef WIN32 - fd_set savedAllClients; -#endif - - notime.tv_sec = 0; - notime.tv_usec = 0; - -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - mask = AllClients.fds_bits[i]; - while (mask) { - curoff = mffs(mask) - 1; - curclient = curoff + (i * (sizeof(fd_mask) * 8)); - FD_ZERO(&tmask); - FD_SET(curclient, &tmask); - do { - r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); - } while (r < 0 && (errno == EINTR || errno == EAGAIN)); - if (r < 0) - if (ConnectionTranslation[curclient] > 0) - CloseDownClient(clients[ConnectionTranslation[curclient]]); - mask &= ~((fd_mask) 1 << curoff); - } - } -#else - XFD_COPYSET(&AllClients, &savedAllClients); - for (i = 0; i < XFD_SETCOUNT(&savedAllClients); i++) { - curclient = XFD_FD(&savedAllClients, i); - FD_ZERO(&tmask); - FD_SET(curclient, &tmask); - do { - r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); - } while (r < 0 && (errno == EINTR || errno == EAGAIN)); - if (r < 0) - if (GetConnectionTranslation(curclient) > 0) - CloseDownClient(clients[GetConnectionTranslation(curclient)]); - } -#endif + ospoll_remove(server_poll, connection); } /***************** @@ -1046,7 +908,7 @@ OsCommPtr oc = (OsCommPtr) client->osPrivate; if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); + CallCallbacks(&FlushCallback, client); if (oc->output) FlushClient(client, oc, (char *) NULL, 0); @@ -1061,34 +923,67 @@ AuditF("client %d disconnected\n", client->index); } -void -AddGeneralSocket(int fd) -{ - FD_SET(fd, &AllSockets); - if (GrabInProgress) - FD_SET(fd, &SavedAllSockets); -} +struct notify_fd { + int mask; + NotifyFdProcPtr notify; + void *data; +}; -void -AddEnabledDevice(int fd) -{ - FD_SET(fd, &EnabledDevices); - AddGeneralSocket(fd); -} +/***************** + * HandleNotifyFd + * A poll callback to be called when the registered + * file descriptor is ready. + *****************/ -void -RemoveGeneralSocket(int fd) +static void +HandleNotifyFd(int fd, int xevents, void *data) { - FD_CLR(fd, &AllSockets); - if (GrabInProgress) - FD_CLR(fd, &SavedAllSockets); + struct notify_fd *n = data; + n->notify(fd, xevents, n->data); } -void -RemoveEnabledDevice(int fd) +/***************** + * SetNotifyFd + * Registers a callback to be invoked when the specified + * file descriptor becomes readable. + *****************/ + +Bool +SetNotifyFd(int fd, NotifyFdProcPtr notify, int mask, void *data) { - FD_CLR(fd, &EnabledDevices); - RemoveGeneralSocket(fd); + struct notify_fd *n; + + n = ospoll_data(server_poll, fd); + if (!n) { + if (mask == 0) + return TRUE; + + n = calloc(1, sizeof (struct notify_fd)); + if (!n) + return FALSE; + ospoll_add(server_poll, fd, + ospoll_trigger_level, + HandleNotifyFd, + n); + } + + if (mask == 0) { + ospoll_remove(server_poll, fd); + free(n); + } else { + int listen = mask & ~n->mask; + int mute = n->mask & ~mask; + + if (listen) + ospoll_listen(server_poll, fd, listen); + if (mute) + ospoll_mute(server_poll, fd, mute); + n->mask = mask; + n->data = data; + n->notify = notify; + } + + return TRUE; } /***************** @@ -1104,30 +999,17 @@ int OnlyListenToOneClient(ClientPtr client) { - OsCommPtr oc = (OsCommPtr) client->osPrivate; - int rc, connection = oc->fd; + int rc; rc = XaceHook(XACE_SERVER_ACCESS, client, DixGrabAccess); if (rc != Success) return rc; if (!GrabInProgress) { - XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); - XFD_ANDSET(&ClientsWithInput, - &ClientsWithInput, &GrabImperviousClients); - if (FD_ISSET(connection, &SavedClientsWithInput)) { - FD_CLR(connection, &SavedClientsWithInput); - FD_SET(connection, &ClientsWithInput); - } - XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); - XFD_COPYSET(&AllSockets, &SavedAllSockets); - XFD_COPYSET(&AllClients, &SavedAllClients); - XFD_UNSET(&AllSockets, &AllClients); - XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); - FD_SET(connection, &AllClients); - XFD_ORSET(&AllSockets, &AllSockets, &AllClients); GrabInProgress = client->index; + set_poll_clients(); } + return rc; } @@ -1140,10 +1022,8 @@ ListenToAllClients(void) { if (GrabInProgress) { - XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); - XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); - XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); GrabInProgress = 0; + set_poll_clients(); } } @@ -1157,32 +1037,16 @@ IgnoreClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; client->ignoreCount++; if (client->ignoreCount > 1) return; isItTimeToYield = TRUE; - if (!GrabInProgress || FD_ISSET(connection, &AllClients)) { - if (FD_ISSET(connection, &ClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &LastSelectMask); - } - else { - if (FD_ISSET(connection, &SavedClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &SavedClientsWithInput); - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - } + mark_client_not_ready(client); + + oc->flags |= OS_COMM_IGNORED; + set_poll_client(client); } /**************** @@ -1194,25 +1058,18 @@ AttendClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; client->ignoreCount--; if (client->ignoreCount) return; - if (!GrabInProgress || GrabInProgress == client->index || - FD_ISSET(connection, &GrabImperviousClients)) { - FD_SET(connection, &AllClients); - FD_SET(connection, &AllSockets); - FD_SET(connection, &LastSelectMask); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &ClientsWithInput); - } + oc->flags &= ~OS_COMM_IGNORED; + set_poll_client(client); + if (listen_to_client(client)) + mark_client_ready(client); else { - FD_SET(connection, &SavedAllClients); - FD_SET(connection, &SavedAllSockets); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &SavedClientsWithInput); + /* grab active, mark ready when grab goes away */ + mark_client_saved_ready(client); } } @@ -1222,9 +1079,9 @@ MakeClientGrabImpervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; - FD_SET(connection, &GrabImperviousClients); + oc->flags |= OS_COMM_GRAB_IMPERVIOUS; + set_poll_client(client); if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1241,18 +1098,10 @@ MakeClientGrabPervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress && (GrabInProgress != client->index)) { - if (FD_ISSET(connection, &ClientsWithInput)) { - FD_SET(connection, &SavedClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - } - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - isItTimeToYield = TRUE; - } + oc->flags &= ~OS_COMM_GRAB_IMPERVIOUS; + set_poll_client(client); + isItTimeToYield = TRUE; if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1303,8 +1152,7 @@ ListenTransConns[ListenTransCount] = ciptr; ListenTransFds[ListenTransCount] = fd; - FD_SET(fd, &WellKnownConnections); - FD_SET(fd, &AllSockets); + SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL); /* Increment the count */ ListenTransCount++; @@ -1330,9 +1178,51 @@ if (!AllocNewConnection(ciptr, fd, connect_time)) { ErrorConnMax(ciptr); - _XSERVTransClose(ciptr); return FALSE; } return TRUE; } + +Bool +listen_to_client(ClientPtr client) +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + + if (oc->flags & OS_COMM_IGNORED) + return FALSE; + + if (!GrabInProgress) + return TRUE; + + if (client->index == GrabInProgress) + return TRUE; + + if (oc->flags & OS_COMM_GRAB_IMPERVIOUS) + return TRUE; + + return FALSE; +} + +static void +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); +} + +static void +set_poll_clients(void) +{ + int i; + + for (i = 1; i < currentMaxClients; i++) { + ClientPtr client = clients[i]; + if (client && !client->clientGone) + set_poll_client(client); + } +} diff -Nru xorg-server-hwe-16.04-1.18.4/os/inputthread.c xorg-server-hwe-16.04-1.19.3/os/inputthread.c --- xorg-server-hwe-16.04-1.18.4/os/inputthread.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/inputthread.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,559 @@ +/* inputthread.c -- Threaded generation of input events. + * + * Copyright © 2007-2008 Tiago Vignatti + * Copyright © 2010 Nokia + * + * 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. + * + * Authors: Fernando Carrijo + * Tiago Vignatti + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include "inputstr.h" +#include "opaque.h" +#include "osdep.h" + +#if INPUTTHREAD + +Bool InputThreadEnable = TRUE; + +/** + * An input device as seen by the threaded input facility + */ + +typedef enum _InputDeviceState { + device_state_added, + device_state_running, + device_state_removed +} InputDeviceState; + +typedef struct _InputThreadDevice { + struct xorg_list node; + NotifyFdProcPtr readInputProc; + void *readInputArgs; + int fd; + InputDeviceState state; +} InputThreadDevice; + +/** + * The threaded input facility. + * + * For now, we have one instance for all input devices. + */ +typedef struct { + pthread_t thread; + struct xorg_list devs; + struct ospoll *fds; + int readPipe; + int writePipe; + Bool changed; + Bool running; +} InputThreadInfo; + +static InputThreadInfo *inputThreadInfo; + +static int hotplugPipeRead = -1; +static int hotplugPipeWrite = -1; + +static int input_mutex_count; + +#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +static pthread_mutex_t input_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +#else +static pthread_mutex_t input_mutex; +static Bool input_mutex_initialized; +#endif + +int +in_input_thread(void) +{ + return inputThreadInfo && + pthread_equal(pthread_self(), inputThreadInfo->thread); +} + +void +input_lock(void) +{ +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + if (!input_mutex_initialized) { + pthread_mutexattr_t mutex_attr; + + input_mutex_initialized = TRUE; + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&input_mutex, &mutex_attr); + } +#endif + pthread_mutex_lock(&input_mutex); + ++input_mutex_count; +} + +void +input_unlock(void) +{ + --input_mutex_count; + pthread_mutex_unlock(&input_mutex); +} + +void +input_force_unlock(void) +{ + if (pthread_mutex_trylock(&input_mutex) == 0) { + input_mutex_count++; + /* unlock +1 times for the trylock */ + while (input_mutex_count > 0) + input_unlock(); + } +} + +/** + * Notify a thread about the availability of new asynchronously enqueued input + * events. + * + * @see WaitForSomething() + */ +static void +InputThreadFillPipe(int writeHead) +{ + int ret; + char byte = 0; + + do { + ret = write(writeHead, &byte, 1); + } while (ret < 0 && ETEST(errno)); +} + +/** + * Consume eventual notifications left by a thread. + * + * @see WaitForSomething() + * @see InputThreadFillPipe() + */ +static int +InputThreadReadPipe(int readHead) +{ + int ret, array[10]; + + ret = read(readHead, &array, sizeof(array)); + if (ret >= 0) + return ret; + + if (errno != EAGAIN) + FatalError("input-thread: draining pipe (%d)", errno); + + return 1; +} + +static void +InputReady(int fd, int xevents, void *data) +{ + InputThreadDevice *dev = data; + + input_lock(); + if (dev->state == device_state_running) + dev->readInputProc(fd, xevents, dev->readInputArgs); + input_unlock(); +} + +/** + * Register an input device in the threaded input facility + * + * @param fd File descriptor which identifies the input device + * @param readInputProc Procedure used to read input from the device + * @param readInputArgs Arguments to be consumed by the above procedure + * + * return 1 if success; 0 otherwise. + */ +int +InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs) +{ + InputThreadDevice *dev, *old; + + if (!inputThreadInfo) + return SetNotifyFd(fd, readInputProc, X_NOTIFY_READ, readInputArgs); + + input_lock(); + + dev = NULL; + xorg_list_for_each_entry(old, &inputThreadInfo->devs, node) { + if (old->fd == fd && old->state != device_state_removed) { + dev = old; + break; + } + } + + if (dev) { + dev->readInputProc = readInputProc; + dev->readInputArgs = readInputArgs; + } else { + dev = calloc(1, sizeof(InputThreadDevice)); + if (dev == NULL) { + DebugF("input-thread: could not register device\n"); + input_unlock(); + return 0; + } + + dev->fd = fd; + dev->readInputProc = readInputProc; + dev->readInputArgs = readInputArgs; + dev->state = device_state_added; + + /* Do not prepend, so that any dev->state == device_state_removed + * with the same dev->fd get processed first. */ + xorg_list_append(&dev->node, &inputThreadInfo->devs); + } + + inputThreadInfo->changed = TRUE; + + input_unlock(); + + DebugF("input-thread: registered device %d\n", fd); + InputThreadFillPipe(hotplugPipeWrite); + + return 1; +} + +/** + * Unregister a device in the threaded input facility + * + * @param fd File descriptor which identifies the input device + * + * @return 1 if success; 0 otherwise. + */ +int +InputThreadUnregisterDev(int fd) +{ + InputThreadDevice *dev; + Bool found_device = FALSE; + + /* return silently if input thread is already finished (e.g., at + * DisableDevice time, evdev tries to call this function again through + * xf86RemoveEnabledDevice) */ + if (!inputThreadInfo) { + RemoveNotifyFd(fd); + return 1; + } + + input_lock(); + xorg_list_for_each_entry(dev, &inputThreadInfo->devs, node) + if (dev->fd == fd) { + found_device = TRUE; + break; + } + + /* fd didn't match any registered device. */ + if (!found_device) { + input_unlock(); + return 0; + } + + dev->state = device_state_removed; + inputThreadInfo->changed = TRUE; + + input_unlock(); + + InputThreadFillPipe(hotplugPipeWrite); + DebugF("input-thread: unregistered device: %d\n", fd); + + return 1; +} + +static void +InputThreadPipeNotify(int fd, int revents, void *data) +{ + /* Empty pending input, shut down if the pipe has been closed */ + if (InputThreadReadPipe(hotplugPipeRead) == 0) { + inputThreadInfo->running = FALSE; + } +} + +/** + * The workhorse of threaded input event generation. + * + * Or if you prefer: The WaitForSomething for input devices. :) + * + * Runs in parallel with the server main thread, listening to input devices in + * an endless loop. Whenever new input data is made available, calls the + * proper device driver's routines which are ultimately responsible for the + * generation of input events. + * + * @see InputThreadPreInit() + * @see InputThreadInit() + */ + +static void* +InputThreadDoWork(void *arg) +{ + sigset_t set; + + /* Don't handle any signals on this thread */ + sigfillset(&set); + pthread_sigmask(SIG_BLOCK, &set, NULL); + + inputThreadInfo->running = TRUE; + +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) + pthread_setname_np (pthread_self(), "InputThread"); +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) + pthread_setname_np ("InputThread"); +#endif + + ospoll_add(inputThreadInfo->fds, hotplugPipeRead, + ospoll_trigger_level, + InputThreadPipeNotify, + NULL); + ospoll_listen(inputThreadInfo->fds, hotplugPipeRead, X_NOTIFY_READ); + + while (inputThreadInfo->running) + { + DebugF("input-thread: %s waiting for devices\n", __func__); + + /* Check for hotplug changes and modify the ospoll structure to suit */ + if (inputThreadInfo->changed) { + InputThreadDevice *dev, *tmp; + + input_lock(); + inputThreadInfo->changed = FALSE; + xorg_list_for_each_entry_safe(dev, tmp, &inputThreadInfo->devs, node) { + switch (dev->state) { + case device_state_added: + ospoll_add(inputThreadInfo->fds, dev->fd, + ospoll_trigger_level, + InputReady, + dev); + ospoll_listen(inputThreadInfo->fds, dev->fd, X_NOTIFY_READ); + dev->state = device_state_running; + break; + case device_state_running: + break; + case device_state_removed: + ospoll_remove(inputThreadInfo->fds, dev->fd); + xorg_list_del(&dev->node); + free(dev); + break; + } + } + input_unlock(); + } + + if (ospoll_wait(inputThreadInfo->fds, -1) < 0) { + if (errno == EINVAL) + FatalError("input-thread: %s (%s)", __func__, strerror(errno)); + else if (errno != EINTR) + ErrorF("input-thread: %s (%s)\n", __func__, strerror(errno)); + } + + /* Kick main thread to process the generated input events and drain + * events from hotplug pipe */ + InputThreadFillPipe(inputThreadInfo->writePipe); + } + + ospoll_remove(inputThreadInfo->fds, hotplugPipeRead); + + return NULL; +} + +static void +InputThreadNotifyPipe(int fd, int mask, void *data) +{ + InputThreadReadPipe(fd); +} + +/** + * Pre-initialize the facility used for threaded generation of input events + * + */ +void +InputThreadPreInit(void) +{ + int fds[2], hotplugPipe[2]; + int flags; + + if (!InputThreadEnable) + return; + + if (pipe(fds) < 0) + FatalError("input-thread: could not create pipe"); + + if (pipe(hotplugPipe) < 0) + FatalError("input-thread: could not create pipe"); + + inputThreadInfo = malloc(sizeof(InputThreadInfo)); + if (!inputThreadInfo) + FatalError("input-thread: could not allocate memory"); + + inputThreadInfo->thread = 0; + xorg_list_init(&inputThreadInfo->devs); + inputThreadInfo->fds = ospoll_create(); + + /* By making read head non-blocking, we ensure that while the main thread + * is busy servicing client requests, the dedicated input thread can work + * in parallel. + */ + inputThreadInfo->readPipe = fds[0]; + fcntl(inputThreadInfo->readPipe, F_SETFL, O_NONBLOCK); + flags = fcntl(inputThreadInfo->readPipe, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + (void)fcntl(inputThreadInfo->readPipe, F_SETFD, &flags); + } + SetNotifyFd(inputThreadInfo->readPipe, InputThreadNotifyPipe, X_NOTIFY_READ, NULL); + + inputThreadInfo->writePipe = fds[1]; + + hotplugPipeRead = hotplugPipe[0]; + fcntl(hotplugPipeRead, F_SETFL, O_NONBLOCK); + flags = fcntl(hotplugPipeRead, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + (void)fcntl(hotplugPipeRead, F_SETFD, &flags); + } + hotplugPipeWrite = hotplugPipe[1]; + +#ifndef __linux__ /* Linux does not deal well with renaming the main thread */ +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) + pthread_setname_np (pthread_self(), "MainThread"); +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) + pthread_setname_np ("MainThread"); +#endif +#endif + +} + +/** + * Start the threaded generation of input events. This routine complements what + * was previously done by InputThreadPreInit(), being only responsible for + * creating the dedicated input thread. + * + */ +void +InputThreadInit(void) +{ + pthread_attr_t attr; + + /* If the driver hasn't asked for input thread support by calling + * InputThreadPreInit, then do nothing here + */ + if (!inputThreadInfo) + return; + + pthread_attr_init(&attr); + + /* For OSes that differentiate between processes and threads, the following + * lines have sense. Linux uses the 1:1 thread model. The scheduler handles + * every thread as a normal process. Therefore this probably has no meaning + * if we are under Linux. + */ + if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0) + ErrorF("input-thread: error setting thread scope\n"); + + DebugF("input-thread: creating thread\n"); + pthread_create(&inputThreadInfo->thread, &attr, + &InputThreadDoWork, NULL); + + pthread_attr_destroy (&attr); +} + +/** + * Stop the threaded generation of input events + * + * This function is supposed to be called at server shutdown time only. + */ +void +InputThreadFini(void) +{ + InputThreadDevice *dev, *next; + + if (!inputThreadInfo) + return; + + /* Close the pipe to get the input thread to shut down */ + close(hotplugPipeWrite); + pthread_join(inputThreadInfo->thread, NULL); + + xorg_list_for_each_entry_safe(dev, next, &inputThreadInfo->devs, node) { + ospoll_remove(inputThreadInfo->fds, dev->fd); + free(dev); + } + xorg_list_init(&inputThreadInfo->devs); + ospoll_destroy(inputThreadInfo->fds); + + RemoveNotifyFd(inputThreadInfo->readPipe); + close(inputThreadInfo->readPipe); + close(inputThreadInfo->writePipe); + inputThreadInfo->readPipe = -1; + inputThreadInfo->writePipe = -1; + + close(hotplugPipeRead); + hotplugPipeRead = -1; + hotplugPipeWrite = -1; + + free(inputThreadInfo); + inputThreadInfo = NULL; +} + +int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) +{ + return pthread_sigmask(how, set, oldset); +} + +#else /* INPUTTHREAD */ + +Bool InputThreadEnable = FALSE; + +void input_lock(void) {} +void input_unlock(void) {} +void input_force_unlock(void) {} + +void InputThreadPreInit(void) {} +void InputThreadInit(void) {} +void InputThreadFini(void) {} +int in_input_thread(void) { return 0; } + +int InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs) +{ + return SetNotifyFd(fd, readInputProc, X_NOTIFY_READ, readInputArgs); +} + +extern int InputThreadUnregisterDev(int fd) +{ + RemoveNotifyFd(fd); + return 1; +} + +int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) +{ + return sigprocmask(how, set, oldset); +} + +#endif diff -Nru xorg-server-hwe-16.04-1.18.4/os/io.c xorg-server-hwe-16.04-1.19.3/os/io.c --- xorg-server-hwe-16.04-1.18.4/os/io.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/io.c 2017-03-15 18:05:25.000000000 +0000 @@ -74,7 +74,6 @@ #include #include "os.h" #include "osdep.h" -#include #include "opaque.h" #include "dixstruct.h" #include "misc.h" @@ -102,20 +101,6 @@ static ConnectionInputPtr AllocateInputBuffer(void); static ConnectionOutputPtr AllocateOutputBuffer(void); -/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno - * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifndef WIN32 -# if (EAGAIN != EWOULDBLOCK) -# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) -# else -# define ETEST(err) (err == EAGAIN) -# endif -#else /* WIN32 The socket errorcodes differ from the normal errors */ -#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) -#endif - static Bool CriticalOutputPending; static int timesThisConnection = 0; static ConnectionInputPtr FreeInputs = (ConnectionInputPtr) NULL; @@ -132,8 +117,8 @@ ((xBigReq *)(req))->length) #define MAX_TIMES_PER 10 -#define BUFSIZE 4096 -#define BUFWATERMARK 8192 +#define BUFSIZE 16384 +#define BUFWATERMARK 32768 /* * A lot of the code in this file manipulates a ConnectionInputPtr: @@ -202,7 +187,7 @@ YieldControlNoInput(int fd) { YieldControl(); - FD_CLR(fd, &ClientsWithInput); + ospoll_reset_events(server_poll, fd); } static void @@ -368,7 +353,8 @@ oci->size - oci->bufcnt); if (result <= 0) { if ((result < 0) && ETEST(errno)) { -#if defined(SVR4) && defined(__i386__) && !defined(sun) + mark_client_not_ready(client); +#if defined(SVR4) && defined(__i386__) && !defined(__sun) if (0) #endif { @@ -452,33 +438,8 @@ */ gotnow -= needed; - if (gotnow >= sizeof(xReq)) { - request = (xReq *) (oci->bufptr + needed); - if (gotnow >= (result = (get_req_len(request, client) << 2)) - && (result || - (client->big_requests && - (gotnow >= sizeof(xBigReq) && - gotnow >= (get_big_req_len(request, client) << 2)))) - ) - FD_SET(fd, &ClientsWithInput); - else { - if (!SmartScheduleDisable) - FD_CLR(fd, &ClientsWithInput); - else - YieldControlNoInput(fd); - } - } - else { - if (!gotnow) - AvailableInput = oc; - if (!SmartScheduleDisable) - FD_CLR(fd, &ClientsWithInput); - else - YieldControlNoInput(fd); - } - if (SmartScheduleDisable) - if (++timesThisConnection >= MAX_TIMES_PER) - YieldControl(); + if (!gotnow) + AvailableInput = oc; if (move_header) { request = (xReq *) oci->bufptr; oci->bufptr += (sizeof(xBigReq) - sizeof(xReq)); @@ -571,7 +532,7 @@ gotnow += count; if ((gotnow >= sizeof(xReq)) && (gotnow >= (int) (get_req_len((xReq *) oci->bufptr, client) << 2))) - FD_SET(fd, &ClientsWithInput); + mark_client_ready(client); else YieldControlNoInput(fd); return TRUE; @@ -611,12 +572,8 @@ } } if (gotnow >= (needed << 2)) { - if (FD_ISSET(fd, &AllClients)) { - FD_SET(fd, &ClientsWithInput); - } - else { - FD_SET(fd, &IgnoredClientsWithInput); - } + if (listen_to_client(client)) + mark_client_ready(client); YieldControl(); } else @@ -637,19 +594,10 @@ void FlushAllOutput(void) { - register int index, base; - register fd_mask mask; /* raphael */ OsCommPtr oc; - register ClientPtr client; + register ClientPtr client, tmp; Bool newoutput = NewOutputPending; -#if defined(WIN32) - fd_set newOutputPending; -#endif - - if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); - if (!newoutput) return; @@ -661,48 +609,15 @@ CriticalOutputPending = FALSE; NewOutputPending = FALSE; -#ifndef WIN32 - for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++) { - mask = OutputPending.fds_bits[base]; - OutputPending.fds_bits[base] = 0; - while (mask) { - index = ffs(mask) - 1; - mask &= ~lowbit(mask); - if ((index = - ConnectionTranslation[(base * (sizeof(fd_mask) * 8)) + - index]) == 0) - continue; - client = clients[index]; - if (client->clientGone) - continue; - oc = (OsCommPtr) client->osPrivate; - if (FD_ISSET(oc->fd, &ClientsWithInput)) { - FD_SET(oc->fd, &OutputPending); /* set the bit again */ - NewOutputPending = TRUE; - } - else - (void) FlushClient(client, oc, (char *) NULL, 0); - } - } -#else /* WIN32 */ - FD_ZERO(&newOutputPending); - for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++) { - index = XFD_FD(&OutputPending, base); - if ((index = GetConnectionTranslation(index)) == 0) - continue; - client = clients[index]; + xorg_list_for_each_entry_safe(client, tmp, &output_pending_clients, output_pending) { if (client->clientGone) continue; - oc = (OsCommPtr) client->osPrivate; - if (FD_ISSET(oc->fd, &ClientsWithInput)) { - FD_SET(oc->fd, &newOutputPending); /* set the bit again */ - NewOutputPending = TRUE; - } - else + if (!client_is_ready(client)) { + oc = (OsCommPtr) client->osPrivate; (void) FlushClient(client, oc, (char *) NULL, 0); + } else + NewOutputPending = TRUE; } - XFD_COPYSET(&newOutputPending, &OutputPending); -#endif /* WIN32 */ } void @@ -737,6 +652,9 @@ int padBytes; const char *buf = __buf; + BUG_RETURN_VAL_MSG(in_input_thread(), 0, + "******** %s called from input thread *********\n", __func__); + #ifdef DEBUG_COMMUNICATION Bool multicount = FALSE; #endif @@ -844,20 +762,17 @@ } #endif if (oco->count == 0 || oco->count + count + padBytes > oco->size) { - FD_CLR(oc->fd, &OutputPending); - if (!XFD_ANYSET(&OutputPending)) { + output_pending_clear(who); + if (!any_output_pending()) { CriticalOutputPending = FALSE; NewOutputPending = FALSE; } - if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); - return FlushClient(who, oc, buf, count); } NewOutputPending = TRUE; - FD_SET(oc->fd, &OutputPending); + output_pending_mark(who); memmove((char *) oco->buf + oco->count, buf, count); oco->count += count; if (padBytes) { @@ -881,7 +796,6 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) { ConnectionOutputPtr oco = oc->output; - int connection = oc->fd; XtransConnInfo trans_conn = oc->trans_conn; struct iovec iov[3]; static char padBuffer[3]; @@ -899,6 +813,9 @@ if (!notWritten) return 0; + if (FlushCallback) + CallCallbacks(&FlushCallback, who); + todo = notWritten; while (notWritten) { long before = written; /* amount of whole thing written */ @@ -954,8 +871,7 @@ /* If we've arrived here, then the client is stuffed to the gills and not ready to accept more. Make a note of it and buffer the rest. */ - FD_SET(connection, &ClientsWriteBlocked); - AnyClientsWriteBlocked = TRUE; + output_pending_mark(who); if (written < oco->count) { if (written > 0) { @@ -995,6 +911,8 @@ extraBuf + written, len); oco->count = notWritten; /* this will include the pad */ + ospoll_listen(server_poll, oc->fd, X_NOTIFY_WRITE); + /* return only the amount explicitly requested */ return extraCount; } @@ -1017,12 +935,8 @@ /* everything was flushed out */ oco->count = 0; - /* check to see if this client was write blocked */ - if (AnyClientsWriteBlocked) { - FD_CLR(oc->fd, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } + output_pending_clear(who); + if (oco->size > BUFWATERMARK) { free(oco->buf); free(oco); diff -Nru xorg-server-hwe-16.04-1.18.4/os/Makefile.am xorg-server-hwe-16.04-1.19.3/os/Makefile.am --- xorg-server-hwe-16.04-1.18.4/os/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -7,6 +7,8 @@ XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c +XSERVER_POLL_SRCS=xserver_poll.c + libos_la_SOURCES = \ WaitFor.c \ access.c \ @@ -14,11 +16,14 @@ backtrace.c \ client.c \ connection.c \ + inputthread.c \ io.c \ mitauth.c \ oscolor.c \ osdep.h \ osinit.c \ + ospoll.c \ + ospoll.h \ utils.c \ xdmauth.c \ xsha1.c \ @@ -31,6 +36,11 @@ libos_la_SOURCES += $(SECURERPC_SRCS) endif +if POLL +else +libos_la_SOURCES += $(XSERVER_POLL_SRCS) +endif + if XDMCP libos_la_SOURCES += $(XDMCP_SRCS) endif @@ -48,12 +58,12 @@ if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libos & libdix -dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) +dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o noinst_PROGRAMS = os.O os_O_SOURCES = -os.O: dtrace.o $(am_libos_la_OBJECTS) +os.O: dtrace.o libos.la $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o endif diff -Nru xorg-server-hwe-16.04-1.18.4/os/Makefile.in xorg-server-hwe-16.04-1.19.3/os/Makefile.in --- xorg-server-hwe-16.04-1.18.4/os/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -90,17 +90,19 @@ build_triplet = @build@ host_triplet = @host@ @SECURE_RPC_TRUE@am__append_1 = $(SECURERPC_SRCS) -@XDMCP_TRUE@am__append_2 = $(XDMCP_SRCS) -@HAVE_LIBUNWIND_TRUE@am__append_3 = $(LIBUNWIND_CFLAGS) -@HAVE_LIBUNWIND_TRUE@am__append_4 = $(LIBUNWIND_LIBS) -@BUSFAULT_TRUE@am__append_5 = $(BUSFAULT_SRCS) +@POLL_FALSE@am__append_2 = $(XSERVER_POLL_SRCS) +@XDMCP_TRUE@am__append_3 = $(XDMCP_SRCS) +@HAVE_LIBUNWIND_TRUE@am__append_4 = $(LIBUNWIND_CFLAGS) +@HAVE_LIBUNWIND_TRUE@am__append_5 = $(LIBUNWIND_LIBS) +@BUSFAULT_TRUE@am__append_6 = $(BUSFAULT_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@noinst_PROGRAMS = os.O$(EXEEXT) subdir = os ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -121,21 +123,24 @@ libos_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LTLIBOBJS) \ $(am__DEPENDENCIES_2) am__libos_la_SOURCES_DIST = WaitFor.c access.c auth.c backtrace.c \ - client.c connection.c io.c mitauth.c oscolor.c osdep.h \ - osinit.c utils.c xdmauth.c xsha1.c xstrans.c xprintf.c log.c \ - rpcauth.c xdmcp.c busfault.c + client.c connection.c inputthread.c io.c mitauth.c oscolor.c \ + osdep.h osinit.c ospoll.c ospoll.h utils.c xdmauth.c xsha1.c \ + xstrans.c xprintf.c log.c rpcauth.c xserver_poll.c xdmcp.c \ + busfault.c am__objects_1 = log.lo am__objects_2 = rpcauth.lo @SECURE_RPC_TRUE@am__objects_3 = $(am__objects_2) -am__objects_4 = xdmcp.lo -@XDMCP_TRUE@am__objects_5 = $(am__objects_4) -am__objects_6 = busfault.lo -@BUSFAULT_TRUE@am__objects_7 = $(am__objects_6) +am__objects_4 = xserver_poll.lo +@POLL_FALSE@am__objects_5 = $(am__objects_4) +am__objects_6 = xdmcp.lo +@XDMCP_TRUE@am__objects_7 = $(am__objects_6) +am__objects_8 = busfault.lo +@BUSFAULT_TRUE@am__objects_9 = $(am__objects_8) am_libos_la_OBJECTS = WaitFor.lo access.lo auth.lo backtrace.lo \ - client.lo connection.lo io.lo mitauth.lo oscolor.lo osinit.lo \ - utils.lo xdmauth.lo xsha1.lo xstrans.lo xprintf.lo \ - $(am__objects_1) $(am__objects_3) $(am__objects_5) \ - $(am__objects_7) + client.lo connection.lo inputthread.lo io.lo mitauth.lo \ + oscolor.lo osinit.lo ospoll.lo utils.lo xdmauth.lo xsha1.lo \ + xstrans.lo xprintf.lo $(am__objects_1) $(am__objects_3) \ + $(am__objects_5) $(am__objects_7) $(am__objects_9) libos_la_OBJECTS = $(am_libos_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -207,7 +212,7 @@ CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ reallocarray.c strcasecmp.c strcasestr.c strlcat.c strlcpy.c \ - strndup.c + strndup.c timingsafe_memcmp.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ @@ -384,6 +389,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -414,7 +422,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -509,6 +520,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -557,17 +569,19 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libos.la -AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) $(am__append_3) +AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) $(am__append_4) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c +XSERVER_POLL_SRCS = xserver_poll.c libos_la_SOURCES = WaitFor.c access.c auth.c backtrace.c client.c \ - connection.c io.c mitauth.c oscolor.c osdep.h osinit.c utils.c \ - xdmauth.c xsha1.c xstrans.c xprintf.c $(XORG_SRCS) \ - $(am__append_1) $(am__append_2) $(am__append_5) + connection.c inputthread.c io.c mitauth.c oscolor.c osdep.h \ + osinit.c ospoll.c ospoll.h utils.c xdmauth.c xsha1.c xstrans.c \ + xprintf.c $(XORG_SRCS) $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_6) libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) \ - $(am__append_4) + $(am__append_5) EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@os_O_SOURCES = all: all-am @@ -643,6 +657,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/timingsafe_memcmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WaitFor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Plo@am__quote@ @@ -650,16 +665,19 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/busfault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oscolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospoll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xserver_poll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsha1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrans.Plo@am__quote@ @@ -897,9 +915,9 @@ # Generate dtrace object code for probes in libos & libdix -@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o -@SPECIAL_DTRACE_OBJECTS_TRUE@os.O: dtrace.o $(am_libos_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@os.O: dtrace.o libos.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xorg-server-hwe-16.04-1.18.4/os/mitauth.c xorg-server-hwe-16.04-1.19.3/os/mitauth.c --- xorg-server-hwe-16.04-1.18.4/os/mitauth.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/mitauth.c 2017-03-15 18:05:25.000000000 +0000 @@ -76,7 +76,7 @@ for (auth = mit_auth; auth; auth = auth->next) { if (data_length == auth->len && - memcmp(data, auth->data, (int) data_length) == 0) + timingsafe_memcmp(data, auth->data, (int) data_length) == 0) return auth->id; } *reason = "Invalid MIT-MAGIC-COOKIE-1 key"; @@ -97,19 +97,6 @@ return 0; } -XID -MitToID(unsigned short data_length, char *data) -{ - struct auth *auth; - - for (auth = mit_auth; auth; auth = auth->next) { - if (data_length == auth->len && - memcmp(data, auth->data, data_length) == 0) - return auth->id; - } - return (XID) -1; -} - int MitFromID(XID id, unsigned short *data_lenp, char **datap) { diff -Nru xorg-server-hwe-16.04-1.18.4/os/osdep.h xorg-server-hwe-16.04-1.19.3/os/osdep.h --- xorg-server-hwe-16.04-1.18.4/os/osdep.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/osdep.h 2017-03-15 18:05:25.000000000 +0000 @@ -63,43 +63,23 @@ #undef _POSIX_SOURCE #endif -#ifndef OPEN_MAX -#ifdef SVR4 -#define OPEN_MAX 512 -#else -#include -#ifndef OPEN_MAX -#if defined(NOFILE) && !defined(NOFILES_MAX) -#define OPEN_MAX NOFILE -#else -#if !defined(WIN32) || defined(__CYGWIN__) -#define OPEN_MAX NOFILES_MAX -#else -#define OPEN_MAX 512 -#endif -#endif -#endif -#endif -#endif - -#include +#include +#include -/* - * MAXSOCKS is used only for initialising MaxClients when no other method - * like sysconf(_SC_OPEN_MAX) is not supported. +/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno + * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX + * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ - -#if OPEN_MAX <= 512 -#define MAXSOCKS (OPEN_MAX - 1) -#else -#define MAXSOCKS 512 +#ifndef WIN32 +# if (EAGAIN != EWOULDBLOCK) +# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) +# else +# define ETEST(err) (err == EAGAIN) +# endif +#else /* WIN32 The socket errorcodes differ from the normal errors */ +#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif -/* MAXSELECT is the number of fds that select() can handle */ -#define MAXSELECT (sizeof(fd_set) * NBBY) - -#include - #if defined(XDMCP) || defined(HASXDMAUTH) typedef Bool (*ValidatorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type); typedef Bool (*GeneratorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type); @@ -133,9 +113,6 @@ #define AuthRstCArgs void typedef int (*AuthRstCFunc) (AuthRstCArgs); -#define AuthToIDArgs unsigned short data_length, char *data -typedef XID (*AuthToIDFunc) (AuthToIDArgs); - typedef void (*OsCloseFunc) (ClientPtr); typedef int (*OsFlushFunc) (ClientPtr who, struct _osComm * oc, char *extraBuf, @@ -148,8 +125,12 @@ XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ + int flags; } OsCommRec, *OsCommPtr; +#define OS_COMM_GRAB_IMPERVIOUS 1 +#define OS_COMM_IGNORED 2 + extern int FlushClient(ClientPtr /*who */ , OsCommPtr /*oc */ , const void * /*extraBuf */ , @@ -160,19 +141,21 @@ ); #include "dix.h" +#include "ospoll.h" + +extern struct ospoll *server_poll; -extern fd_set AllSockets; -extern fd_set AllClients; -extern fd_set LastSelectMask; -extern fd_set WellKnownConnections; -extern fd_set EnabledDevices; -extern fd_set ClientsWithInput; -extern fd_set ClientsWriteBlocked; -extern fd_set OutputPending; -extern fd_set IgnoredClientsWithInput; +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); @@ -180,7 +163,6 @@ #endif extern Bool NewOutputPending; -extern Bool AnyClientsWriteBlocked; extern WorkQueuePtr workQueue; @@ -200,7 +182,6 @@ /* in mitauth.c */ extern XID MitCheckCookie(AuthCheckArgs); extern XID MitGenerateCookie(AuthGenCArgs); -extern XID MitToID(AuthToIDArgs); extern int MitAddCookie(AuthAddCArgs); extern int MitFromID(AuthFromIDArgs); extern int MitRemoveCookie(AuthRemCArgs); @@ -209,7 +190,6 @@ /* in xdmauth.c */ #ifdef HASXDMAUTH extern XID XdmCheckCookie(AuthCheckArgs); -extern XID XdmToID(AuthToIDArgs); extern int XdmAddCookie(AuthAddCArgs); extern int XdmFromID(AuthFromIDArgs); extern int XdmRemoveCookie(AuthRemCArgs); @@ -220,7 +200,6 @@ #ifdef SECURE_RPC extern void SecureRPCInit(AuthInitArgs); extern XID SecureRPCCheck(AuthCheckArgs); -extern XID SecureRPCToID(AuthToIDArgs); extern int SecureRPCAdd(AuthAddCArgs); extern int SecureRPCFromID(AuthFromIDArgs); extern int SecureRPCRemove(AuthRemCArgs); diff -Nru xorg-server-hwe-16.04-1.18.4/os/osinit.c xorg-server-hwe-16.04-1.19.3/os/osinit.c --- xorg-server-hwe-16.04-1.18.4/os/osinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/osinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -114,10 +114,14 @@ #endif { #ifdef RTLD_DI_SETSIGNAL - const char *dlerr = dlerror(); - - if (dlerr) { - LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr); +# define SIGNAL_FOR_RTLD_ERROR SIGQUIT + if (signo == SIGNAL_FOR_RTLD_ERROR) { + const char *dlerr = dlerror(); + + if (dlerr) { + LogMessageVerbSigSafe(X_ERROR, 1, + "Dynamic loader error: %s\n", dlerr); + } } #endif /* RTLD_DI_SETSIGNAL */ @@ -195,6 +199,9 @@ #ifdef BUSFAULT busfault_init(); #endif + server_poll = ospoll_create(); + if (!server_poll) + FatalError("failed to allocate poll structure"); #ifdef HAVE_BACKTRACE /* @@ -214,24 +221,13 @@ * after ourselves. */ { - int failure_signal = SIGQUIT; + int failure_signal = SIGNAL_FOR_RTLD_ERROR; dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); } #endif #if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */ -# if defined(__APPLE__) - int devnullfd = open(devnull, O_RDWR, 0); - assert(devnullfd > 2); - - dup2(devnullfd, STDIN_FILENO); - dup2(devnullfd, STDOUT_FILENO); - close(devnullfd); -# elif !defined(__CYGWIN__) - fclose(stdin); - fclose(stdout); -# endif /* * If a write of zero bytes to stderr returns non-zero, i.e. -1, * then writing to stderr failed, and we'll write somewhere else diff -Nru xorg-server-hwe-16.04-1.18.4/os/ospoll.c xorg-server-hwe-16.04-1.19.3/os/ospoll.c --- xorg-server-hwe-16.04-1.18.4/os/ospoll.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/ospoll.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,477 @@ +/* + * Copyright © 2016 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_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include "misc.h" /* for typedef of pointer */ +#include "ospoll.h" +#include "list.h" + +#if !HAVE_OSPOLL && HAVE_EPOLL_CREATE1 +#include +#define EPOLL 1 +#define HAVE_OSPOLL 1 +#endif + +#if !HAVE_OSPOLL +#include "xserver_poll.h" +#define POLL 1 +#define HAVE_OSPOLL 1 +#endif + +#if EPOLL +#include + +/* epoll-based implementation */ +struct ospollfd { + int fd; + int xevents; + enum ospoll_trigger trigger; + void (*callback)(int fd, int xevents, void *data); + void *data; + struct xorg_list deleted; +}; + +struct ospoll { + int epoll_fd; + struct ospollfd **fds; + int num; + int size; + struct xorg_list deleted; +}; + +#endif + +#if POLL + +/* poll-based implementation */ +struct ospollfd { + short revents; + enum ospoll_trigger trigger; + void (*callback)(int fd, int revents, void *data); + void *data; +}; + +struct ospoll { + struct pollfd *fds; + struct ospollfd *osfds; + int num; + int size; + Bool changed; +}; + +#endif + +/* Binary search for the specified file descriptor + * + * Returns position if found + * Returns -position - 1 if not found + */ + +static int +ospoll_find(struct ospoll *ospoll, int fd) +{ + int lo = 0; + int hi = ospoll->num - 1; + + while (lo <= hi) { + int m = (lo + hi) >> 1; +#if EPOLL + int t = ospoll->fds[m]->fd; +#endif +#if POLL + int t = ospoll->fds[m].fd; +#endif + + if (t < fd) + lo = m + 1; + else if (t > fd) + hi = m - 1; + else + return m; + } + return -(lo + 1); +} + +#if EPOLL +static void +ospoll_clean_deleted(struct ospoll *ospoll) +{ + struct ospollfd *osfd, *tmp; + + xorg_list_for_each_entry_safe(osfd, tmp, &ospoll->deleted, deleted) { + xorg_list_del(&osfd->deleted); + free(osfd); + } +} +#endif + +/* Insert an element into an array + * + * base: base address of array + * num: number of elements in the array before the insert + * size: size of each element + * pos: position to insert at + */ +static inline void +array_insert(void *base, size_t num, size_t size, size_t pos) +{ + char *b = base; + + memmove(b + (pos+1) * size, + b + pos * size, + (num - pos) * size); +} + +/* Delete an element from an array + * + * base: base address of array + * num: number of elements in the array before the delete + * size: size of each element + * pos: position to delete from + */ +static inline void +array_delete(void *base, size_t num, size_t size, size_t pos) +{ + char *b = base; + + memmove(b + pos * size, b + (pos + 1) * size, + (num - pos - 1) * size); +} + + +struct ospoll * +ospoll_create(void) +{ +#if EPOLL + struct ospoll *ospoll = calloc(1, sizeof (struct ospoll)); + + ospoll->epoll_fd = epoll_create1(EPOLL_CLOEXEC); + if (ospoll->epoll_fd < 0) { + free (ospoll); + return NULL; + } + xorg_list_init(&ospoll->deleted); + return ospoll; +#endif +#if POLL + return calloc(1, sizeof (struct ospoll)); +#endif +} + +void +ospoll_destroy(struct ospoll *ospoll) +{ +#if EPOLL + if (ospoll) { + assert (ospoll->num == 0); + close(ospoll->epoll_fd); + ospoll_clean_deleted(ospoll); + free(ospoll->fds); + free(ospoll); + } +#endif +#if POLL + if (ospoll) { + assert (ospoll->num == 0); + free (ospoll->fds); + free (ospoll->osfds); + free (ospoll); + } +#endif +} + +Bool +ospoll_add(struct ospoll *ospoll, int fd, + enum ospoll_trigger trigger, + void (*callback)(int fd, int xevents, void *data), + void *data) +{ + int pos = ospoll_find(ospoll, fd); +#if EPOLL + struct ospollfd *osfd; + + if (pos < 0) { + + struct epoll_event ev; + + 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; + } + + ev.events = 0; + ev.data.ptr = osfd; + if (trigger == ospoll_trigger_edge) + ev.events |= EPOLLET; + if (epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_ADD, fd, &ev) == -1) { + free(osfd); + return FALSE; + } + 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 POLL + if (pos < 0) { + if (ospoll->num == ospoll->size) { + struct pollfd *new_fds; + struct ospollfd *new_osfds; + 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; + new_osfds = reallocarray(ospoll->osfds, new_size, sizeof (ospoll->osfds[0])); + if (!new_osfds) + return FALSE; + ospoll->osfds = new_osfds; + ospoll->size = new_size; + } + pos = -pos - 1; + array_insert(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + array_insert(ospoll->osfds, ospoll->num, sizeof (ospoll->osfds[0]), pos); + ospoll->num++; + ospoll->changed = TRUE; + + ospoll->fds[pos].fd = fd; + ospoll->fds[pos].events = 0; + ospoll->fds[pos].revents = 0; + ospoll->osfds[pos].revents = 0; + } + ospoll->osfds[pos].trigger = trigger; + ospoll->osfds[pos].callback = callback; + ospoll->osfds[pos].data = data; +#endif + return TRUE; +} + +void +ospoll_remove(struct ospoll *ospoll, int fd) +{ + int pos = ospoll_find(ospoll, fd); + + pos = ospoll_find(ospoll, fd); + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + struct epoll_event ev; + ev.events = 0; + ev.data.ptr = osfd; + (void) epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_DEL, fd, &ev); + + 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 POLL + array_delete(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + array_delete(ospoll->osfds, ospoll->num, sizeof (ospoll->osfds[0]), pos); + ospoll->num--; + ospoll->changed = TRUE; +#endif + } +} + +#if EPOLL +static void +epoll_mod(struct ospoll *ospoll, struct ospollfd *osfd) +{ + struct epoll_event ev; + ev.events = 0; + if (osfd->xevents & X_NOTIFY_READ) + ev.events |= EPOLLIN; + if (osfd->xevents & X_NOTIFY_WRITE) + ev.events |= EPOLLOUT; + if (osfd->trigger == ospoll_trigger_edge) + ev.events |= EPOLLET; + ev.data.ptr = osfd; + (void) epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_MOD, osfd->fd, &ev); +} +#endif + +void +ospoll_listen(struct ospoll *ospoll, int fd, int xevents) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + osfd->xevents |= xevents; + epoll_mod(ospoll, osfd); +#endif +#if POLL + if (xevents & X_NOTIFY_READ) { + ospoll->fds[pos].events |= POLLIN; + ospoll->osfds[pos].revents &= ~POLLIN; + } + if (xevents & X_NOTIFY_WRITE) { + ospoll->fds[pos].events |= POLLOUT; + ospoll->osfds[pos].revents &= ~POLLOUT; + } +#endif + } +} + +void +ospoll_mute(struct ospoll *ospoll, int fd, int xevents) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + osfd->xevents &= ~xevents; + epoll_mod(ospoll, osfd); +#endif +#if POLL + if (xevents & X_NOTIFY_READ) + ospoll->fds[pos].events &= ~POLLIN; + if (xevents & X_NOTIFY_WRITE) + ospoll->fds[pos].events &= ~POLLOUT; +#endif + } +} + + +int +ospoll_wait(struct ospoll *ospoll, int timeout) +{ + int nready; +#if EPOLL +#define MAX_EVENTS 256 + struct epoll_event events[MAX_EVENTS]; + int i; + + nready = epoll_wait(ospoll->epoll_fd, events, MAX_EVENTS, timeout); + for (i = 0; i < nready; i++) { + struct epoll_event *ev = &events[i]; + struct ospollfd *osfd = ev->data.ptr; + uint32_t revents = ev->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); + } + ospoll_clean_deleted(ospoll); +#endif +#if POLL + nready = xserver_poll(ospoll->fds, ospoll->num, timeout); + ospoll->changed = FALSE; + if (nready > 0) { + int f; + for (f = 0; f < ospoll->num; f++) { + short revents = ospoll->fds[f].revents; + short oldevents = ospoll->osfds[f].revents; + + ospoll->osfds[f].revents = (revents & (POLLIN|POLLOUT)); + if (ospoll->osfds[f].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; + ospoll->osfds[f].callback(ospoll->fds[f].fd, xevents, + ospoll->osfds[f].data); + + /* Check to see if the arrays have changed, and just go back + * around again + */ + if (ospoll->changed) + break; + } + } + } +#endif + return nready; +} + +void +ospoll_reset_events(struct ospoll *ospoll, int fd) +{ +#if POLL + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return; + + ospoll->osfds[pos].revents = 0; +#endif +} + +void * +ospoll_data(struct ospoll *ospoll, int fd) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return NULL; +#if EPOLL + return ospoll->fds[pos]->data; +#endif +#if POLL + return ospoll->osfds[pos].data; +#endif +} diff -Nru xorg-server-hwe-16.04-1.18.4/os/ospoll.h xorg-server-hwe-16.04-1.19.3/os/ospoll.h --- xorg-server-hwe-16.04-1.18.4/os/ospoll.h 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/ospoll.h 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * Copyright © 2016 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. + */ + +#ifndef _OSPOLL_H_ +#define _OSPOLL_H_ + +/* Forward declaration */ +struct ospoll; + +/** + * ospoll_wait trigger mode + * + * @ospoll_trigger_edge + * Trigger only when going from no data available + * to data available. + * + * @ospoll_trigger_level + * Trigger whenever there is data available + */ +enum ospoll_trigger { + ospoll_trigger_edge, + ospoll_trigger_level +}; + +/** + * Create a new ospoll structure + */ +struct ospoll * +ospoll_create(void); + +/** + * Destroy an ospoll structure + * + * @param ospoll ospoll to destroy + */ +void +ospoll_destroy(struct ospoll *ospoll); + +/** + * Add a file descriptor to monitor + * + * @param ospoll ospoll to add to + * @param fd File descriptor to monitor + * @param trigger Trigger mode for ospoll_wait + * @param callback Function to call when triggered + * @param data Extra data to pass callback + */ +Bool +ospoll_add(struct ospoll *ospoll, int fd, + enum ospoll_trigger trigger, + void (*callback)(int fd, int xevents, void *data), + void *data); + +/** + * Remove a monitored file descriptor + * + * @param ospoll ospoll to remove from + * @param fd File descriptor to stop monitoring + */ +void +ospoll_remove(struct ospoll *ospoll, int fd); + +/** + * Listen on additional events + * + * @param ospoll ospoll monitoring fd + * @param fd File descriptor to change + * @param events Additional events to trigger on + */ +void +ospoll_listen(struct ospoll *ospoll, int fd, int xevents); + +/** + * Stop listening on events + * + * @param ospoll ospoll monitoring fd + * @param fd File descriptor to change + * @param events events to stop triggering on + */ +void +ospoll_mute(struct ospoll *ospoll, int fd, int xevents); + +/** + * Wait for events + * + * @param ospoll ospoll to wait on + * @param timeout < 0 wait forever + * = 0 check and return + * > 0 timeout in milliseconds + * @return < 0 error + * = 0 timeout + * > 0 number of events delivered + */ +int +ospoll_wait(struct ospoll *ospoll, int timeout); + +/** + * Reset edge trigger status + * + * @param ospoll ospoll monitoring fd + * @param fd file descriptor + * + * ospoll_reset_events resets the state of an edge-triggered + * fd so that ospoll_wait calls will report events again. + * + * Call this after a read/recv operation reports no more data available. + */ +void +ospoll_reset_events(struct ospoll *ospoll, int fd); + +/** + * Fetch the data associated with an fd + * + * @param ospoll ospoll monitoring fd + * @param fd file descriptor + * + * @return data parameter passed to ospoll_add call on + * this file descriptor + */ +void * +ospoll_data(struct ospoll *ospoll, int fd); + +#endif /* _OSPOLL_H_ */ diff -Nru xorg-server-hwe-16.04-1.18.4/os/rpcauth.c xorg-server-hwe-16.04-1.19.3/os/rpcauth.c --- xorg-server-hwe-16.04-1.18.4/os/rpcauth.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/rpcauth.c 2017-03-15 18:05:25.000000000 +0000 @@ -46,7 +46,7 @@ #include -#ifdef sun +#ifdef __sun /* only includes this if _KERNEL is #defined... */ extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif @@ -175,12 +175,6 @@ return 1; } -_X_HIDDEN XID -SecureRPCToID(unsigned short data_length, char *data) -{ - return rpc_id; -} - _X_HIDDEN int SecureRPCFromID(XID id, unsigned short *data_lenp, char **datap) { diff -Nru xorg-server-hwe-16.04-1.18.4/os/timingsafe_memcmp.c xorg-server-hwe-16.04-1.19.3/os/timingsafe_memcmp.c --- xorg-server-hwe-16.04-1.18.4/os/timingsafe_memcmp.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/timingsafe_memcmp.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014 Google Inc. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, 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 +#include +#include +#include +#include "os.h" + +int +timingsafe_memcmp(const void *b1, const void *b2, size_t len) +{ + const unsigned char *p1 = b1, *p2 = b2; + size_t i; + int res = 0, done = 0; + + for (i = 0; i < len; i++) { + /* lt is -1 if p1[i] < p2[i]; else 0. */ + int lt = (p1[i] - p2[i]) >> CHAR_BIT; + + /* gt is -1 if p1[i] > p2[i]; else 0. */ + int gt = (p2[i] - p1[i]) >> CHAR_BIT; + + /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */ + int cmp = lt - gt; + + /* set res = cmp if !done. */ + res |= cmp & ~done; + + /* set done if p1[i] != p2[i]. */ + done |= lt | gt; + } + + return (res); +} diff -Nru xorg-server-hwe-16.04-1.18.4/os/utils.c xorg-server-hwe-16.04-1.19.3/os/utils.c --- xorg-server-hwe-16.04-1.18.4/os/utils.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/utils.c 2017-03-15 18:05:25.000000000 +0000 @@ -71,7 +71,6 @@ #if !defined(WIN32) || !defined(__MINGW32__) #include #include -# define SMART_SCHEDULE_POSSIBLE #endif #include "misc.h" #include @@ -81,7 +80,7 @@ #include #include "input.h" #include "dixfont.h" -#include +#include #include "osdep.h" #include "extension.h" #ifdef X_POSIX_C_SOURCE @@ -109,7 +108,7 @@ #include /* for malloc() */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #ifndef WIN32 #include #endif @@ -211,6 +210,10 @@ #define HAS_SAVED_IDS_AND_SETEUID #endif +#ifdef MONOTONIC_CLOCK +static clockid_t clockid; +#endif + OsSigHandlerPtr OsSignal(int sig, OsSigHandlerPtr handler) { @@ -428,6 +431,24 @@ errno = olderrno; } +#ifdef MONOTONIC_CLOCK +void +ForceClockId(clockid_t forced_clockid) +{ + struct timespec tp; + + BUG_RETURN (clockid); + + clockid = forced_clockid; + + if (clock_gettime(clockid, &tp) != 0) { + FatalError("Forced clock id failed to retrieve current time: %s\n", + strerror(errno)); + return; + } +} +#endif + #if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__) CARD32 GetTimeInMillis(void) @@ -447,7 +468,6 @@ #ifdef MONOTONIC_CLOCK struct timespec tp; - static clockid_t clockid; if (!clockid) { #ifdef CLOCK_MONOTONIC_COARSE @@ -476,7 +496,6 @@ struct timeval tv; #ifdef MONOTONIC_CLOCK struct timespec tp; - static clockid_t clockid; if (!clockid) { if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) @@ -494,27 +513,6 @@ #endif void -AdjustWaitForDelay(void *waitTime, unsigned long newdelay) -{ - static struct timeval delay_val; - struct timeval **wt = (struct timeval **) waitTime; - unsigned long olddelay; - - if (*wt == NULL) { - delay_val.tv_sec = newdelay / 1000; - delay_val.tv_usec = 1000 * (newdelay % 1000); - *wt = &delay_val; - } - else { - olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000; - if (newdelay < olddelay) { - (*wt)->tv_sec = newdelay / 1000; - (*wt)->tv_usec = 1000 * (newdelay % 1000); - } - } -} - -void UseMsg(void) { ErrorF("use: X [:] [option]\n"); @@ -587,7 +585,7 @@ ErrorF("-xinerama Disable XINERAMA extension\n"); #endif ErrorF - ("-dumbSched Disable smart scheduling, enable old behavior\n"); + ("-dumbSched Disable smart scheduling and threaded input, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); ErrorF("-sigstop Enable SIGSTOP based startup\n"); ErrorF("+extension name Enable extension\n"); @@ -779,7 +777,7 @@ DPMSDisabledSwitch = TRUE; #endif else if (strcmp(argv[i], "-deferglyphs") == 0) { - if (++i >= argc || !ParseGlyphCachingMode(argv[i])) + if (++i >= argc || !xfont2_parse_glyph_caching_mode(argv[i])) UseMsg(); } else if (strcmp(argv[i], "-f") == 0) { @@ -869,8 +867,10 @@ if (LimitClients != 64 && LimitClients != 128 && LimitClients != 256 && - LimitClients != 512) { - FatalError("maxclients must be one of 64, 128, 256 or 512\n"); + LimitClients != 512 && + LimitClients != 1024 && + LimitClients != 2048) { + FatalError("maxclients must be one of 64, 128, 256, 512, 1024 or 2048\n"); } } else UseMsg(); @@ -1005,9 +1005,11 @@ i = skip - 1; } #endif -#ifdef SMART_SCHEDULE_POSSIBLE else if (strcmp(argv[i], "-dumbSched") == 0) { - SmartScheduleDisable = TRUE; + InputThreadEnable = FALSE; +#if HAVE_SETITIMER + SmartScheduleSignalEnable = FALSE; +#endif } else if (strcmp(argv[i], "-schedInterval") == 0) { if (++i < argc) { @@ -1024,7 +1026,6 @@ else UseMsg(); } -#endif else if (strcmp(argv[i], "-render") == 0) { if (++i < argc) { int policy = PictureParseCmapPolicy(argv[i]); @@ -1070,7 +1071,7 @@ set_font_authorizations(char **authorizations, int *authlen, void *client) { #define AUTHORIZATION_NAME "hp-hostname-1" -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) static char *result = NULL; static char *p = NULL; @@ -1208,10 +1209,10 @@ void SmartScheduleStopTimer(void) { -#ifdef SMART_SCHEDULE_POSSIBLE +#if HAVE_SETITIMER struct itimerval timer; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = 0; @@ -1224,10 +1225,10 @@ void SmartScheduleStartTimer(void) { -#ifdef SMART_SCHEDULE_POSSIBLE +#if HAVE_SETITIMER struct itimerval timer; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = SmartScheduleInterval * 1000; @@ -1237,6 +1238,7 @@ #endif } +#if HAVE_SETITIMER static void SmartScheduleTimer(int sig) { @@ -1247,10 +1249,9 @@ SmartScheduleEnable(void) { int ret = 0; -#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return 0; memset((char *) &act, 0, sizeof(struct sigaction)); @@ -1261,7 +1262,6 @@ sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); ret = sigaction(SIGALRM, &act, 0); -#endif return ret; } @@ -1269,10 +1269,9 @@ SmartSchedulePause(void) { int ret = 0; -#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return 0; memset((char *) &act, 0, sizeof(struct sigaction)); @@ -1280,20 +1279,19 @@ act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); ret = sigaction(SIGALRM, &act, 0); -#endif return ret; } +#endif void SmartScheduleInit(void) { - if (SmartScheduleDisable) - return; - +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("sigaction for smart scheduler"); - SmartScheduleDisable = TRUE; + SmartScheduleSignalEnable = FALSE; } +#endif } #ifdef SIG_BLOCK @@ -1308,9 +1306,6 @@ if (BlockedSignalCount++ == 0) { sigset_t set; -#ifdef SIGIO - OsBlockSIGIO(); -#endif sigemptyset(&set); sigaddset(&set, SIGALRM); sigaddset(&set, SIGVTALRM); @@ -1321,53 +1316,9 @@ sigaddset(&set, SIGTTIN); sigaddset(&set, SIGTTOU); sigaddset(&set, SIGCHLD); - sigprocmask(SIG_BLOCK, &set, &PreviousSignalMask); - } -#endif -} - -#ifdef SIG_BLOCK -static sig_atomic_t sigio_blocked; -static sigset_t PreviousSigIOMask; -#endif - -/** - * returns zero if this call caused SIGIO to be blocked now, non-zero if it - * was already blocked by a previous call to this function. - */ -int -OsBlockSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (sigio_blocked++ == 0) { - sigset_t set; - int ret; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask); - ret = sigismember(&PreviousSigIOMask, SIGIO); - return ret; + xthread_sigmask(SIG_BLOCK, &set, &PreviousSignalMask); } #endif -#endif - return 1; -} - -void -OsReleaseSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (--sigio_blocked == 0) { - sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0); - } else if (sigio_blocked < 0) { - BUG_WARN(sigio_blocked < 0); - sigio_blocked = 0; - } -#endif -#endif } void @@ -1375,8 +1326,7 @@ { #ifdef SIG_BLOCK if (--BlockedSignalCount == 0) { - sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0); - OsReleaseSIGIO(); + xthread_sigmask(SIG_SETMASK, &PreviousSignalMask, 0); } #endif } @@ -1387,10 +1337,7 @@ #ifdef SIG_BLOCK while (BlockedSignalCount > 0) OsReleaseSignals(); -#ifdef SIGIO - while (sigio_blocked > 0) - OsReleaseSIGIO(); -#endif + input_force_unlock(); #endif } @@ -1429,7 +1376,7 @@ if (!command) return 1; - csig = signal(SIGCHLD, SIG_DFL); + csig = OsSignal(SIGCHLD, SIG_DFL); if (csig == SIG_ERR) { perror("signal"); return -1; @@ -1454,7 +1401,7 @@ } - if (signal(SIGCHLD, csig) == SIG_ERR) { + if (OsSignal(SIGCHLD, csig) == SIG_ERR) { perror("signal"); return -1; } @@ -1490,6 +1437,7 @@ } /* Ignore the smart scheduler while this is going on */ +#if HAVE_SETITIMER if (SmartSchedulePause() < 0) { close(pdes[0]); close(pdes[1]); @@ -1497,14 +1445,17 @@ perror("signal"); return NULL; } +#endif switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); free(cur); +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) perror("signal"); +#endif return NULL; case 0: /* child */ if (setgid(getgid()) == -1) @@ -1678,10 +1629,12 @@ /* allow EINTR again */ OsReleaseSignals(); +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("signal"); return -1; } +#endif return pid == -1 ? -1 : pstat; } diff -Nru xorg-server-hwe-16.04-1.18.4/os/WaitFor.c xorg-server-hwe-16.04-1.19.3/os/WaitFor.c --- xorg-server-hwe-16.04-1.18.4/os/WaitFor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/WaitFor.c 2017-03-15 18:05:25.000000000 +0000 @@ -66,7 +66,6 @@ #include "misc.h" #include "osdep.h" -#include #include "dixstruct.h" #include "opaque.h" #ifdef DPMSExtension @@ -114,16 +113,55 @@ #endif struct _OsTimerRec { - OsTimerPtr next; + struct xorg_list list; CARD32 expires; CARD32 delta; OsTimerCallback callback; void *arg; }; -static void DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev); +static void DoTimer(OsTimerPtr timer, CARD32 now); +static void DoTimers(CARD32 now); static void CheckAllTimers(void); -static volatile OsTimerPtr timers = NULL; +static volatile struct xorg_list timers; + +static inline OsTimerPtr +first_timer(void) +{ + /* inline xorg_list_is_empty which can't handle volatile */ + if (timers.next == &timers) + return NULL; + return xorg_list_first_entry(&timers, struct _OsTimerRec, list); +} + +/* + * Compute timeout until next timer, running + * any expired timers + */ +static int +check_timers(void) +{ + OsTimerPtr timer; + + if ((timer = first_timer()) != NULL) { + CARD32 now = GetTimeInMillis(); + int timeout = timer->expires - now; + + if (timeout <= 0) { + DoTimers(now); + } else { + /* Make sure the timeout is sane */ + if (timeout < timer->delta + 250) + return timeout; + + /* time has rewound. reset the timers. */ + CheckAllTimers(); + } + + return 0; + } + return -1; +} /***************** * WaitForSomething: @@ -142,27 +180,23 @@ * pClientsReady is an array to store ready client->index values into. *****************/ -int -WaitForSomething(int *pClientsReady) +Bool +WaitForSomething(Bool are_ready) { int i; - struct timeval waittime, *wt; - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; - int curclient; - int selecterr; - static int nready; - fd_set devicesReadable; - CARD32 now = 0; - Bool someReady = FALSE; + int timeout; + int pollerr; + static Bool were_ready; + Bool timer_is_running; - FD_ZERO(&clientsReadable); - FD_ZERO(&clientsWritable); + timer_is_running = were_ready; - if (nready) + if (were_ready && !are_ready) { + timer_is_running = FALSE; SmartScheduleStopTimer(); - nready = 0; + } + + were_ready = FALSE; #ifdef BUSFAULT busfault_check(); @@ -172,218 +206,62 @@ crashed connections and the screen saver timeout */ while (1) { /* deal with any blocked jobs */ - if (workQueue) + if (workQueue) { ProcessWorkQueue(); - if (XFD_ANYSET(&ClientsWithInput)) { - if (!SmartScheduleDisable) { - someReady = TRUE; - waittime.tv_sec = 0; - waittime.tv_usec = 0; - wt = &waittime; - } - else { - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } - } - if (someReady) { - XFD_COPYSET(&AllSockets, &LastSelectMask); - XFD_UNSET(&LastSelectMask, &ClientsWithInput); + are_ready = clients_are_ready(); } - else { - wt = NULL; - if (timers) { - now = GetTimeInMillis(); - timeout = timers->expires - now; - if (timeout > 0 && timeout > timers->delta + 250) { - /* time has rewound. reset the timers. */ - CheckAllTimers(); - } - if (timers) { - timeout = timers->expires - now; - if (timeout < 0) - timeout = 0; - waittime.tv_sec = timeout / MILLI_PER_SECOND; - waittime.tv_usec = (timeout % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - wt = &waittime; - } - } - XFD_COPYSET(&AllSockets, &LastSelectMask); - } + if (are_ready) + timeout = 0; + else + timeout = check_timers(); - BlockHandler((void *) &wt, (void *) &LastSelectMask); + BlockHandler(&timeout); if (NewOutputPending) FlushAllOutput(); /* keep this check close to select() call to minimize race */ if (dispatchException) i = -1; - else if (AnyClientsWriteBlocked) { - XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); - i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else { - i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); - } - selecterr = GetErrno(); - WakeupHandler(i, (void *) &LastSelectMask); + else + i = ospoll_wait(server_poll, timeout); + pollerr = GetErrno(); + WakeupHandler(i); if (i <= 0) { /* An error or timeout occurred */ if (dispatchException) - return 0; + return FALSE; if (i < 0) { - if (selecterr == EBADF) { /* Some client disconnected */ - CheckConnections(); - if (!XFD_ANYSET(&AllClients)) - return 0; - } - else if (selecterr == EINVAL) { - FatalError("WaitForSomething(): select: %s\n", - strerror(selecterr)); - } - else if (selecterr != EINTR && selecterr != EAGAIN) { - ErrorF("WaitForSomething(): select: %s\n", - strerror(selecterr)); - } - } - else if (someReady) { - /* - * If no-one else is home, bail quickly - */ - XFD_COPYSET(&ClientsWithInput, &LastSelectMask); - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } - if (*checkForInput[0] != *checkForInput[1]) - return 0; - - if (timers) { - int expired = 0; - - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - if (expired) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); - - return 0; + if (pollerr != EINTR && !ETEST(pollerr)) { + ErrorF("WaitForSomething(): poll: %s\n", + strerror(pollerr)); } } - } - else { - fd_set tmp_set; + } else + are_ready = clients_are_ready(); - if (*checkForInput[0] == *checkForInput[1]) { - if (timers) { - int expired = 0; - - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - if (expired) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); + if (InputCheckPending()) + return FALSE; - return 0; - } - } - } - if (someReady) - XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); - if (AnyClientsWriteBlocked && XFD_ANYSET(&clientsWritable)) { - NewOutputPending = TRUE; - XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); - XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } - - XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices); - XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); - XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); - if (XFD_ANYSET(&tmp_set)) - QueueWorkProc(EstablishNewConnections, NULL, - (void *) &LastSelectMask); - - if (XFD_ANYSET(&devicesReadable) || XFD_ANYSET(&clientsReadable)) - break; - /* check here for DDXes that queue events during Block/Wakeup */ - if (*checkForInput[0] != *checkForInput[1]) - return 0; + if (are_ready) { + were_ready = TRUE; + if (!timer_is_running) + SmartScheduleStartTimer(); + return TRUE; } } +} - nready = 0; - if (XFD_ANYSET(&clientsReadable)) { -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - int highest_priority = 0; - - while (clientsReadable.fds_bits[i]) { - int client_priority, client_index; - - curclient = mffs(clientsReadable.fds_bits[i]) - 1; - client_index = /* raphael: modified */ - ConnectionTranslation[curclient + - (i * (sizeof(fd_mask) * 8))]; -#else - int highest_priority = 0; - fd_set savedClientsReadable; - - XFD_COPYSET(&clientsReadable, &savedClientsReadable); - for (i = 0; i < XFD_SETCOUNT(&savedClientsReadable); i++) { - int client_priority, client_index; - - curclient = XFD_FD(&savedClientsReadable, i); - client_index = GetConnectionTranslation(curclient); -#endif - /* We implement "strict" priorities. - * Only the highest priority client is returned to - * dix. If multiple clients at the same priority are - * ready, they are all returned. This means that an - * aggressive client could take over the server. - * This was not considered a big problem because - * aggressive clients can hose the server in so many - * other ways :) - */ - client_priority = clients[client_index]->priority; - if (nready == 0 || client_priority > highest_priority) { - /* Either we found the first client, or we found - * a client whose priority is greater than all others - * that have been found so far. Either way, we want - * to initialize the list of clients to contain just - * this client. - */ - pClientsReady[0] = client_index; - highest_priority = client_priority; - nready = 1; - } - /* the following if makes sure that multiple same-priority - * clients get batched together - */ - else if (client_priority == highest_priority) { - pClientsReady[nready++] = client_index; - } -#ifndef WIN32 - clientsReadable.fds_bits[i] &= ~(((fd_mask) 1L) << curclient); - } -#else - FD_CLR(curclient, &clientsReadable); -#endif - } - } +void +AdjustWaitForDelay(void *waitTime, int newdelay) +{ + int *timeoutp = waitTime; + int timeout = *timeoutp; - if (nready) - SmartScheduleStartTimer(); + if (timeout < 0 || newdelay < timeout) + *timeoutp = newdelay; +} - return nready; +static inline Bool timer_pending(OsTimerPtr timer) { + return !xorg_list_is_empty(&timer->list); } /* If time has rewound, re-run every affected timer. @@ -394,57 +272,65 @@ OsTimerPtr timer; CARD32 now; - OsBlockSignals(); + input_lock(); start: now = GetTimeInMillis(); - for (timer = timers; timer; timer = timer->next) { + xorg_list_for_each_entry(timer, &timers, list) { if (timer->expires - now > timer->delta + 250) { - TimerForce(timer); + DoTimer(timer, now); goto start; } } - OsReleaseSignals(); + input_unlock(); } static void -DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev) +DoTimer(OsTimerPtr timer, CARD32 now) { CARD32 newTime; - OsBlockSignals(); - *prev = timer->next; - timer->next = NULL; - OsReleaseSignals(); - + xorg_list_del(&timer->list); newTime = (*timer->callback) (timer, now, timer->arg); if (newTime) TimerSet(timer, 0, newTime, timer->callback, timer->arg); } +static void +DoTimers(CARD32 now) +{ + OsTimerPtr timer; + + input_lock(); + while ((timer = first_timer())) { + if ((int) (timer->expires - now) > 0) + break; + DoTimer(timer, now); + } + input_unlock(); +} + OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, OsTimerCallback func, void *arg) { - volatile OsTimerPtr *prev; + OsTimerPtr existing, tmp; CARD32 now = GetTimeInMillis(); if (!timer) { - timer = malloc(sizeof(struct _OsTimerRec)); + timer = calloc(1, sizeof(struct _OsTimerRec)); if (!timer) return NULL; + xorg_list_init(&timer->list); } else { - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - *prev = timer->next; - if (flags & TimerForceOld) - (void) (*timer->callback) (timer, now, timer->arg); - break; - } + input_lock(); + if (timer_pending(timer)) { + xorg_list_del(&timer->list); + if (flags & TimerForceOld) + (void) (*timer->callback) (timer, now, timer->arg); } - OsReleaseSignals(); + input_unlock(); } if (!millis) return timer; @@ -458,55 +344,44 @@ timer->expires = millis; timer->callback = func; timer->arg = arg; - if ((int) (millis - now) <= 0) { - timer->next = NULL; - millis = (*timer->callback) (timer, now, timer->arg); - if (!millis) - return timer; - } - OsBlockSignals(); - for (prev = &timers; - *prev && (int) ((*prev)->expires - millis) <= 0; - prev = &(*prev)->next); - timer->next = *prev; - *prev = timer; - OsReleaseSignals(); + input_lock(); + + /* Sort into list */ + xorg_list_for_each_entry_safe(existing, tmp, &timers, list) + if ((int) (existing->expires - millis) > 0) + break; + /* This even works at the end of the list -- existing->list will be timers */ + xorg_list_add(&timer->list, existing->list.prev); + + /* Check to see if the timer is ready to run now */ + if ((int) (millis - now) <= 0) + DoTimer(timer, now); + + input_unlock(); return timer; } Bool TimerForce(OsTimerPtr timer) { - int rc = FALSE; - volatile OsTimerPtr *prev; + int pending; - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - DoTimer(timer, GetTimeInMillis(), prev); - rc = TRUE; - break; - } - } - OsReleaseSignals(); - return rc; + input_lock(); + pending = timer_pending(timer); + if (pending) + DoTimer(timer, GetTimeInMillis()); + input_unlock(); + return pending; } void TimerCancel(OsTimerPtr timer) { - volatile OsTimerPtr *prev; - if (!timer) return; - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - *prev = timer->next; - break; - } - } - OsReleaseSignals(); + input_lock(); + xorg_list_del(&timer->list); + input_unlock(); } void @@ -521,23 +396,22 @@ void TimerCheck(void) { - CARD32 now = GetTimeInMillis(); - - if (timers && (int) (timers->expires - now) <= 0) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); - } + DoTimers(GetTimeInMillis()); } void TimerInit(void) { - OsTimerPtr timer; + static Bool been_here; + OsTimerPtr timer, tmp; + + if (!been_here) { + been_here = TRUE; + xorg_list_init((struct xorg_list*) &timers); + } - while ((timer = timers)) { - timers = timer->next; + xorg_list_for_each_entry_safe(timer, tmp, &timers, list) { + xorg_list_del(&timer->list); free(timer); } } diff -Nru xorg-server-hwe-16.04-1.18.4/os/xdmauth.c xorg-server-hwe-16.04-1.19.3/os/xdmauth.c --- xorg-server-hwe-16.04-1.18.4/os/xdmauth.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/xdmauth.c 2017-03-15 18:05:25.000000000 +0000 @@ -277,7 +277,7 @@ if (_XSERVTransGetPeerAddr(((OsCommPtr) xclient->osPrivate)->trans_conn, &family, &addr_len, &addr) == 0 && _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) { -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) if (family == FamilyInternet && memcmp((char *) addr, client->client, 4) != 0) { free(client); @@ -411,33 +411,6 @@ return 1; } -XID -XdmToID(unsigned short cookie_length, char *cookie) -{ - XdmAuthorizationPtr auth; - XdmClientAuthPtr client; - unsigned char *plain; - - plain = malloc(cookie_length); - if (!plain) - return (XID) -1; - for (auth = xdmAuth; auth; auth = auth->next) { - XdmcpUnwrap((unsigned char *) cookie, (unsigned char *) &auth->key, - plain, cookie_length); - if ((client = - XdmAuthorizationValidate(plain, cookie_length, &auth->rho, NULL, - NULL)) != NULL) { - free(client); - free(cookie); - free(plain); - return auth->id; - } - } - free(cookie); - free(plain); - return (XID) -1; -} - int XdmFromID(XID id, unsigned short *data_lenp, char **datap) { diff -Nru xorg-server-hwe-16.04-1.18.4/os/xdmcp.c xorg-server-hwe-16.04-1.19.3/os/xdmcp.c --- xorg-server-hwe-16.04-1.18.4/os/xdmcp.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/xdmcp.c 2017-03-15 18:05:25.000000000 +0000 @@ -39,19 +39,12 @@ #include #include #include "misc.h" -#include #include "osdep.h" #include "input.h" #include "dixstruct.h" #include "opaque.h" #include "site.h" -#ifdef STREAMSCONN -#include -#include -#include -#endif - #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN @@ -82,10 +75,10 @@ #endif static int req_socklen; static CARD32 SessionID; -static CARD32 timeOutTime; static int timeOutRtx; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; +static OsTimerPtr xdmcp_timer; #ifdef HASXDMAUTH static char *xdmAuthCookie; @@ -197,13 +190,9 @@ static void timeout(void); -static void XdmcpBlockHandler(void *data , - struct timeval **wt, - void *LastSelectMask); - -static void XdmcpWakeupHandler(void *data, - int i, - void *LastSelectMask); +static void XdmcpSocketNotify(int fd, int ready, void *data); + +static CARD32 XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg); /* * Register the Manufacturer display ID @@ -579,6 +568,21 @@ DisplayClass.data[i] = (CARD8) name[i]; } +static void +xdmcp_start(void) +{ + timeOutRtx = 0; + get_xdmcp_sock(); + if (xdmcpSocket >= 0) + SetNotifyFd(xdmcpSocket, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#if defined(IPv6) && defined(AF_INET6) + if (xdmcpSocket6 >= 0) + SetNotifyFd(xdmcpSocket6, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#endif + xdmcp_timer = TimerSet(NULL, 0, 0, XdmcpTimerNotify, NULL); + send_packet(); +} + /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine @@ -597,12 +601,8 @@ XdmcpRegisterDisplayClass(defaultDisplayClass, strlen(defaultDisplayClass)); AccessUsingXdmcp(); - RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); - timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); - get_xdmcp_sock(); - send_packet(); + xdmcp_start(); } } @@ -610,12 +610,8 @@ XdmcpReset(void) { state = XDM_INIT_STATE; - if (state != XDM_OFF) { - RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); - timeOutRtx = 0; - send_packet(); - } + if (state != XDM_OFF) + xdmcp_start(); } /* @@ -630,7 +626,7 @@ if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; - timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; + TimerSet(xdmcp_timer, 0, XDM_DEF_DORMANCY * 1000, XdmcpTimerNotify, NULL); sessionSocket = sock; } @@ -648,69 +644,24 @@ isItTimeToYield = TRUE; } -/* - * called before going to sleep, this routine - * may modify the timeout value about to be sent - * to select; in this way XDMCP can do appropriate things - * dynamically while starting up - */ - - /*ARGSUSED*/ static void -XdmcpBlockHandler(void *data, /* unused */ - struct timeval **wt, void *pReadmask) +static void +XdmcpSocketNotify(int fd, int ready, void *data) { - fd_set *last_select_mask = (fd_set *) pReadmask; - CARD32 millisToGo; - if (state == XDM_OFF) return; - FD_SET(xdmcpSocket, last_select_mask); -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0) - FD_SET(xdmcpSocket6, last_select_mask); -#endif - if (timeOutTime == 0) - return; - millisToGo = timeOutTime - GetTimeInMillis(); - if ((int) millisToGo < 0) - millisToGo = 0; - AdjustWaitForDelay(wt, millisToGo); + receive_packet(fd); } -/* - * called after select returns; this routine will - * recognise when XDMCP packets await and - * process them appropriately - */ - - /*ARGSUSED*/ static void -XdmcpWakeupHandler(void *data, /* unused */ - int i, void *pReadmask) +static CARD32 +XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg) { - fd_set *last_select_mask = (fd_set *) pReadmask; - - if (state == XDM_OFF) - return; - if (i > 0) { - if (FD_ISSET(xdmcpSocket, last_select_mask)) { - receive_packet(xdmcpSocket); - FD_CLR(xdmcpSocket, last_select_mask); - } -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, last_select_mask)) { - receive_packet(xdmcpSocket6); - FD_CLR(xdmcpSocket6, last_select_mask); - } -#endif - } - else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) { - if (state == XDM_RUN_SESSION) { - state = XDM_KEEPALIVE; - send_packet(); - } - else - timeout(); + if (state == XDM_RUN_SESSION) { + state = XDM_KEEPALIVE; + send_packet(); } + else + timeout(); + return 0; } /* @@ -832,7 +783,7 @@ rtx = (XDM_MIN_RTX << timeOutRtx); if (rtx > XDM_MAX_RTX) rtx = XDM_MAX_RTX; - timeOutTime = GetTimeInMillis() + rtx * 1000; + TimerSet(xdmcp_timer, 0, rtx * 1000, XdmcpTimerNotify, NULL); } /* @@ -847,7 +798,7 @@ state = XDM_INIT_STATE; isItTimeToYield = TRUE; dispatchException |= DE_RESET; - timeOutTime = 0; + TimerCancel(xdmcp_timer); timeOutRtx = 0; send_packet(); } @@ -954,43 +905,6 @@ static void get_xdmcp_sock(void) { -#ifdef STREAMSCONN - struct netconfig *nconf; - - if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) { - XdmcpWarning("t_open() of /dev/udp failed"); - return; - } - - if (t_bind(xdmcpSocket, NULL, NULL) < 0) { - XdmcpWarning("UDP socket creation failed"); - t_error("t_bind(xdmcpSocket) failed"); - t_close(xdmcpSocket); - return; - } - - /* - * This part of the code looks contrived. It will actually fit in nicely - * when the CLTS part of Xtrans is implemented. - */ - - if ((nconf = getnetconfigent("udp")) == NULL) { - XdmcpWarning("UDP socket creation failed: getnetconfigent()"); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - if (netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL)) { - XdmcpWarning("UDP set broadcast option failed: netdir_options()"); - freenetconfigent(nconf); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - freenetconfigent(nconf); -#else int soopts = 1; #if defined(IPv6) && defined(AF_INET6) @@ -1011,7 +925,6 @@ xdm_from); } } -#endif /* STREAMSCONN */ } static void @@ -1391,7 +1304,7 @@ XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { state = XDM_RUN_SESSION; - timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; + TimerSet(xdmcp_timer, 0, XDM_DEF_DORMANCY * 1000, XdmcpTimerNotify, NULL); } else { XdmcpDeadSession("Alive response indicates session dead"); diff -Nru xorg-server-hwe-16.04-1.18.4/os/xserver_poll.c xorg-server-hwe-16.04-1.19.3/os/xserver_poll.c --- xorg-server-hwe-16.04-1.18.4/os/xserver_poll.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/os/xserver_poll.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,277 @@ +/*---------------------------------------------------------------------------*\ + $Id$ + + NAME + + poll - select(2)-based poll() emulation function for BSD systems. + + SYNOPSIS + #include "poll.h" + + struct pollfd + { + int fd; + short events; + short revents; + } + + int poll (struct pollfd *pArray, unsigned long n_fds, int timeout) + + DESCRIPTION + + This file, and the accompanying "poll.h", implement the System V + poll(2) system call for BSD systems (which typically do not provide + poll()). Poll() provides a method for multiplexing input and output + on multiple open file descriptors; in traditional BSD systems, that + capability is provided by select(). While the semantics of select() + differ from those of poll(), poll() can be readily emulated in terms + of select() -- which is how this function is implemented. + + REFERENCES + Stevens, W. Richard. Unix Network Programming. Prentice-Hall, 1990. + + NOTES + 1. This software requires an ANSI C compiler. + + LICENSE + + This software is released under the following BSD license, adapted from + http://opensource.org/licenses/bsd-license.php + + Copyright (c) 1995-2011, Brian M. Clapper + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the clapper.org nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\*---------------------------------------------------------------------------*/ + + +/*---------------------------------------------------------------------------*\ + Includes +\*---------------------------------------------------------------------------*/ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include /* standard Unix definitions */ +#include /* system types */ +#include /* time definitions */ +#include /* assertion macros */ +#include /* string functions */ +#include "xserver_poll.h" + +/*---------------------------------------------------------------------------*\ + Macros +\*---------------------------------------------------------------------------*/ + +#ifndef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +/*---------------------------------------------------------------------------*\ + Private Functions +\*---------------------------------------------------------------------------*/ + +static int map_poll_spec + (struct pollfd *pArray, + nfds_t n_fds, + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) +{ + register nfds_t i; /* loop control */ + register struct pollfd *pCur; /* current array element */ + register int max_fd = -1; /* return value */ + + /* + Map the poll() structures into the file descriptor sets required + by select(). + */ + for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) + { + /* Skip any bad FDs in the array. */ + + if (pCur->fd < 0) + continue; + + if (pCur->events & POLLIN) + { + /* "Input Ready" notification desired. */ + FD_SET (pCur->fd, pReadSet); + } + + if (pCur->events & POLLOUT) + { + /* "Output Possible" notification desired. */ + FD_SET (pCur->fd, pWriteSet); + } + + if (pCur->events & POLLPRI) + { + /* + "Exception Occurred" notification desired. (Exceptions + include out of band data. + */ + FD_SET (pCur->fd, pExceptSet); + } + + max_fd = MAX (max_fd, pCur->fd); + } + + return max_fd; +} + +static struct timeval *map_timeout + (int poll_timeout, struct timeval *pSelTimeout) +{ + struct timeval *pResult; + + /* + Map the poll() timeout value into a select() timeout. The possible + values of the poll() timeout value, and their meanings, are: + + VALUE MEANING + + -1 wait indefinitely (until signal occurs) + 0 return immediately, don't block + >0 wait specified number of milliseconds + + select() uses a "struct timeval", which specifies the timeout in + seconds and microseconds, so the milliseconds value has to be mapped + accordingly. + */ + + assert (pSelTimeout != (struct timeval *) NULL); + + switch (poll_timeout) + { + case -1: + /* + A NULL timeout structure tells select() to wait indefinitely. + */ + pResult = (struct timeval *) NULL; + break; + + case 0: + /* + "Return immediately" (test) is specified by all zeros in + a timeval structure. + */ + pSelTimeout->tv_sec = 0; + pSelTimeout->tv_usec = 0; + pResult = pSelTimeout; + break; + + default: + /* Wait the specified number of milliseconds. */ + pSelTimeout->tv_sec = poll_timeout / 1000; /* get seconds */ + poll_timeout %= 1000; /* remove seconds */ + pSelTimeout->tv_usec = poll_timeout * 1000; /* get microseconds */ + pResult = pSelTimeout; + break; + } + + + return pResult; +} + +static void map_select_results + (struct pollfd *pArray, + unsigned long n_fds, + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) +{ + register unsigned long i; /* loop control */ + register struct pollfd *pCur; /* current array element */ + + for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) + { + /* Skip any bad FDs in the array. */ + + if (pCur->fd < 0) + continue; + + /* Exception events take priority over input events. */ + + pCur->revents = 0; + if (FD_ISSET (pCur->fd, pExceptSet)) + pCur->revents |= POLLPRI; + + else if (FD_ISSET (pCur->fd, pReadSet)) + pCur->revents |= POLLIN; + + if (FD_ISSET (pCur->fd, pWriteSet)) + pCur->revents |= POLLOUT; + } + + return; +} + +/*---------------------------------------------------------------------------*\ + Public Functions +\*---------------------------------------------------------------------------*/ + +int xserver_poll + (struct pollfd *pArray, unsigned long n_fds, int timeout) +{ + fd_set read_descs; /* input file descs */ + fd_set write_descs; /* output file descs */ + fd_set except_descs; /* exception descs */ + struct timeval stime; /* select() timeout value */ + int ready_descriptors; /* function result */ + int max_fd; /* maximum fd value */ + struct timeval *pTimeout; /* actually passed */ + + FD_ZERO (&read_descs); + FD_ZERO (&write_descs); + FD_ZERO (&except_descs); + + assert (pArray != (struct pollfd *) NULL); + + /* Map the poll() file descriptor list in the select() data structures. */ + + max_fd = map_poll_spec (pArray, n_fds, + &read_descs, &write_descs, &except_descs); + + /* Map the poll() timeout value in the select() timeout structure. */ + + pTimeout = map_timeout (timeout, &stime); + + /* Make the select() call. */ + + ready_descriptors = select (max_fd + 1, &read_descs, &write_descs, + &except_descs, pTimeout); + + if (ready_descriptors >= 0) + { + map_select_results (pArray, n_fds, + &read_descs, &write_descs, &except_descs); + } + + return ready_descriptors; +} diff -Nru xorg-server-hwe-16.04-1.18.4/present/Makefile.in xorg-server-hwe-16.04-1.19.3/present/Makefile.in --- xorg-server-hwe-16.04-1.18.4/present/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -92,9 +92,10 @@ subdir = present ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sdk_HEADERS) $(am__DIST_COMMON) @@ -385,6 +386,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -415,7 +419,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -510,6 +517,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/present/present.c xorg-server-hwe-16.04-1.19.3/present/present.c --- xorg-server-hwe-16.04-1.18.4/present/present.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present.c 2017-03-15 18:05:25.000000000 +0000 @@ -118,6 +118,18 @@ } 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, @@ -145,7 +157,7 @@ return FALSE; /* Fail to flip if we have slave outputs */ - if (!xorg_list_is_empty(&screen->output_slave_list)) + if (screen->output_slaves && present_check_output_slaves_active(screen)) return FALSE; /* Make sure the window hasn't been redirected with Composite */ @@ -417,7 +429,7 @@ TraverseTree(window, present_set_tree_pixmap_visit, &visit); } -static void +void present_restore_screen_pixmap(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); @@ -439,7 +451,7 @@ * Only do this the first time for a particular unflip operation, or * we'll probably scribble over other windows */ - if (screen->GetWindowPixmap(screen->root) == flip_pixmap) + 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 @@ -447,17 +459,19 @@ */ if (flip_window) present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap); - present_set_tree_pixmap(screen->root, NULL, screen_pixmap); + if (screen->root) + present_set_tree_pixmap(screen->root, NULL, screen_pixmap); } -static void +void present_set_abort_flip(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_restore_screen_pixmap(screen); - - screen_priv->flip_pending->abort_flip = TRUE; + if (!screen_priv->flip_pending->abort_flip) { + present_restore_screen_pixmap(screen); + screen_priv->flip_pending->abort_flip = TRUE; + } } static void @@ -534,7 +548,10 @@ } xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { - present_flip_notify(vblank, ust, msc); + if (vblank->queued) + present_execute(vblank, ust, msc); + else + present_flip_notify(vblank, ust, msc); return; } } diff -Nru xorg-server-hwe-16.04-1.18.4/present/present_event.c xorg-server-hwe-16.04-1.19.3/present/present_event.c --- xorg-server-hwe-16.04-1.18.4/present/present_event.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present_event.c 2017-03-15 18:05:25.000000000 +0000 @@ -208,14 +208,37 @@ int present_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask) { - present_window_priv_ptr window_priv = present_get_window_priv(window, mask != 0); + present_window_priv_ptr window_priv; present_event_ptr event; + int ret; + + /* Check to see if we're modifying an existing event selection */ + ret = dixLookupResourceByType((void **) &event, eid, present_event_type, + client, DixWriteAccess); + if (ret == Success) { + /* Match error for the wrong window; also don't modify some other + * client's event selection + */ + if (event->window != window || event->client != client) + return BadMatch; - if (!window_priv) { if (mask) - return BadAlloc; + event->mask = mask; + else + FreeResource(eid, RT_NONE); return Success; } + if (ret != BadValue) + return ret; + + if (mask == 0) + return Success; + + LEGAL_NEW_RESOURCE(eid, client); + + window_priv = present_get_window_priv(window, TRUE); + if (!window_priv) + return BadAlloc; event = calloc (1, sizeof (present_event_rec)); if (!event) diff -Nru xorg-server-hwe-16.04-1.18.4/present/present_fake.c xorg-server-hwe-16.04-1.19.3/present/present_fake.c --- xorg-server-hwe-16.04-1.18.4/present/present_fake.c 2016-07-15 16:17:59.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present_fake.c 2017-03-15 18:05:25.000000000 +0000 @@ -64,6 +64,7 @@ present_fake_notify(fake_vblank->screen, fake_vblank->event_id); xorg_list_del(&fake_vblank->list); + TimerFree(fake_vblank->timer); free(fake_vblank); return 0; } @@ -75,7 +76,7 @@ xorg_list_for_each_entry_safe(fake_vblank, tmp, &fake_vblank_queue, list) { if (fake_vblank->event_id == event_id) { - TimerCancel(fake_vblank->timer); + TimerFree(fake_vblank->timer); /* TimerFree will call TimerCancel() */ xorg_list_del(&fake_vblank->list); free (fake_vblank); break; diff -Nru xorg-server-hwe-16.04-1.18.4/present/present_priv.h xorg-server-hwe-16.04-1.19.3/present/present_priv.h --- xorg-server-hwe-16.04-1.18.4/present/present_priv.h 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present_priv.h 2017-03-15 18:05:25.000000000 +0000 @@ -187,6 +187,12 @@ 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 diff -Nru xorg-server-hwe-16.04-1.18.4/present/present_request.c xorg-server-hwe-16.04-1.19.3/present/present_request.c --- xorg-server-hwe-16.04-1.18.4/present/present_request.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present_request.c 2017-03-15 18:05:25.000000000 +0000 @@ -184,8 +184,6 @@ REQUEST_SIZE_MATCH(xPresentSelectInputReq); - LEGAL_NEW_RESOURCE(stuff->eid, client); - rc = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; diff -Nru xorg-server-hwe-16.04-1.18.4/present/present_screen.c xorg-server-hwe-16.04-1.19.3/present/present_screen.c --- xorg-server-hwe-16.04-1.18.4/present/present_screen.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/present/present_screen.c 2017-03-15 18:05:25.000000000 +0000 @@ -92,11 +92,13 @@ present_vblank_ptr flip_pending = screen_priv->flip_pending; if (flip_pending && flip_pending->window == window) { - assert (flip_pending->abort_flip); + present_set_abort_flip(screen); flip_pending->window = NULL; } - if (screen_priv->flip_window == window) + if (screen_priv->flip_window == window) { + present_restore_screen_pixmap(screen); screen_priv->flip_window = NULL; + } } /* diff -Nru xorg-server-hwe-16.04-1.18.4/pseudoramiX/Makefile.in xorg-server-hwe-16.04-1.19.3/pseudoramiX/Makefile.in --- xorg-server-hwe-16.04-1.18.4/pseudoramiX/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/pseudoramiX/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -93,9 +93,10 @@ subdir = pseudoramiX ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -355,6 +356,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/randr/Makefile.in xorg-server-hwe-16.04-1.19.3/randr/Makefile.in --- xorg-server-hwe-16.04-1.18.4/randr/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -93,9 +93,10 @@ subdir = randr ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -396,6 +397,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -426,7 +430,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -521,6 +528,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/randr/randr.c xorg-server-hwe-16.04-1.19.3/randr/randr.c --- xorg-server-hwe-16.04-1.18.4/randr/randr.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/randr.c 2017-03-15 18:05:25.000000000 +0000 @@ -483,7 +483,10 @@ RRDeliverCrtcEvent(client, pWin, crtc); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i]; @@ -502,7 +505,10 @@ RRDeliverOutputEvent(client, pWin, output); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numOutputs; i++) { RROutputPtr output = pSlaveScrPriv->outputs[i]; @@ -514,17 +520,7 @@ } if (pRREvent->mask & RRProviderChangeNotifyMask) { - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); if (pSlaveScrPriv->provider->changed) RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); @@ -584,6 +580,18 @@ mastersp = pScrPriv; } + xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { + pSlaveScrPriv = rrGetScrPriv(iter); + + if (!iter->is_output_slave) + continue; + + if (CompareTimeStamps(mastersp->lastSetTime, + pSlaveScrPriv->lastSetTime) == EARLIER) { + mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; + } + } + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { @@ -602,21 +610,15 @@ for (i = 0; i < pScrPriv->numCrtcs; i++) pScrPriv->crtcs[i]->changed = FALSE; - xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numOutputs; i++) - pSlaveScrPriv->outputs[i]->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) - pSlaveScrPriv->crtcs[i]->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); pSlaveScrPriv->provider->changed = FALSE; + if (iter->is_output_slave) { + for (i = 0; i < pSlaveScrPriv->numOutputs; i++) + pSlaveScrPriv->outputs[i]->changed = FALSE; + for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) + pSlaveScrPriv->crtcs[i]->changed = FALSE; + } } if (mastersp->layoutChanged) { @@ -676,6 +678,7 @@ REQUEST(xReq); if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*ProcRandrVector[stuff->data]) (client); } @@ -685,5 +688,6 @@ REQUEST(xReq); if (stuff->data >= RRNumberRequests || !SProcRandrVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*SProcRandrVector[stuff->data]) (client); } diff -Nru xorg-server-hwe-16.04-1.18.4/randr/randrstr.h xorg-server-hwe-16.04-1.19.3/randr/randrstr.h --- xorg-server-hwe-16.04-1.18.4/randr/randrstr.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/randrstr.h 2017-03-15 18:05:25.000000000 +0000 @@ -130,6 +130,7 @@ struct pict_f_transform f_inverse; PixmapPtr scanout_pixmap; + PixmapPtr scanout_pixmap_back; }; struct _rrOutput { @@ -278,6 +279,19 @@ typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap); +typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, PixmapPtr, + PixmapPtr, PixmapPtr, + int x, int y, + int dst_x, int dst_y, + Rotation rotation); + +typedef Bool (*RREnableSharedPixmapFlippingProcPtr)(RRCrtcPtr, + PixmapPtr front, + PixmapPtr back); + +typedef void (*RRDisableSharedPixmapFlippingProcPtr)(RRCrtcPtr); + + typedef struct _rrScrPriv { /* * 'public' part of the structure; DDXen fill this in @@ -304,6 +318,10 @@ /* TODO #if RANDR_15_INTERFACE */ RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap; + RRStartFlippingPixmapTrackingProcPtr rrStartFlippingPixmapTracking; + RREnableSharedPixmapFlippingProcPtr rrEnableSharedPixmapFlipping; + RRDisableSharedPixmapFlippingProcPtr rrDisableSharedPixmapFlipping; + RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource; RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink; RRProviderGetPropertyProcPtr rrProviderGetProperty; @@ -708,6 +726,12 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable); /* + * Return if the screen has any scanout_pixmap's attached + */ +extern _X_EXPORT Bool + RRHasScanoutPixmap(ScreenPtr pScreen); + +/* * Crtc dispatch */ @@ -917,6 +941,7 @@ ProcRRDeleteOutputProperty(ClientPtr client); /* rrprovider.c */ +#define PRIME_SYNC_PROP "PRIME Synchronization" extern _X_EXPORT void RRProviderInitErrorValue(void); diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rrcrtc.c xorg-server-hwe-16.04-1.19.3/randr/rrcrtc.c --- xorg-server-hwe-16.04-1.18.4/randr/rrcrtc.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rrcrtc.c 2017-03-15 18:05:25.000000000 +0000 @@ -25,6 +25,8 @@ #include "swaprep.h" #include "mipointer.h" +#include + RESTYPE RRCrtcType; /* @@ -279,7 +281,7 @@ *left = crtc->x; *top = crtc->y; - switch (crtc->rotation) { + switch (crtc->rotation & 0xf) { case RR_Rotate_0: case RR_Rotate_180: default: @@ -361,52 +363,160 @@ pScrPriv->discontiguous = discontiguous; } -void -RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) -{ +static void +rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) { ScreenPtr master = crtc->pScreen->current_master; - PixmapPtr mscreenpix; - rrScrPriv(crtc->pScreen); - mscreenpix = master->GetScreenPixmap(master); - - pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); - if (crtc->scanout_pixmap) { - master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + if (master && pPixmap->master_pixmap) { /* * Unref the pixmap twice: once for the original reference, and once * for the reference implicitly added by PixmapShareToSlave. */ - master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); - master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); - crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap); + PixmapUnshareSlavePixmap(pPixmap); + + master->DestroyPixmap(pPixmap->master_pixmap); + master->DestroyPixmap(pPixmap->master_pixmap); } - crtc->scanout_pixmap = NULL; + + crtc->pScreen->DestroyPixmap(pPixmap); +} + +void +RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) +{ + rrScrPriv(crtc->pScreen); + + if (crtc->scanout_pixmap) { + ScreenPtr master = crtc->pScreen->current_master; + PixmapPtr mscreenpix = master->GetScreenPixmap(master); + + if (crtc->scanout_pixmap_back) { + pScrPriv->rrDisableSharedPixmapFlipping(crtc); + + master->StopFlippingPixmapTracking(mscreenpix, + crtc->scanout_pixmap, + crtc->scanout_pixmap_back); + + rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back); + crtc->scanout_pixmap_back = NULL; + } + else { + pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); + master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + } + + rrDestroySharedPixmap(crtc, crtc->scanout_pixmap); + crtc->scanout_pixmap = NULL; + } + RRCrtcChanged(crtc, TRUE); } -static Bool -rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height, +static PixmapPtr +rrCreateSharedPixmap(RRCrtcPtr crtc, ScreenPtr master, + int width, int height, int depth, int x, int y, Rotation rotation) { PixmapPtr mpix, spix; + + mpix = master->CreatePixmap(master, width, height, depth, + CREATE_PIXMAP_USAGE_SHARED); + if (!mpix) + return NULL; + + spix = PixmapShareToSlave(mpix, crtc->pScreen); + if (spix == NULL) { + master->DestroyPixmap(mpix); + return NULL; + } + + return spix; +} + +static Bool +rrGetPixmapSharingSyncProp(int numOutputs, RROutputPtr * outputs) +{ + /* Determine if the user wants prime syncing */ + int o; + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return TRUE; + + /* If one output doesn't want sync, no sync */ + for (o = 0; o < numOutputs; o++) { + RRPropertyValuePtr val; + + /* Try pending value first, then current value */ + if ((val = RRGetOutputProperty(outputs[o], syncProp, TRUE)) && + val->data) { + if (!(*(char *) val->data)) + return FALSE; + continue; + } + + if ((val = RRGetOutputProperty(outputs[o], syncProp, FALSE)) && + val->data) { + if (!(*(char *) val->data)) + return FALSE; + continue; + } + } + + return TRUE; +} + +static void +rrSetPixmapSharingSyncProp(char val, int numOutputs, RROutputPtr * outputs) +{ + int o; + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return; + + for (o = 0; o < numOutputs; o++) { + RRPropertyPtr prop = RRQueryOutputProperty(outputs[o], syncProp); + if (prop) + RRChangeOutputProperty(outputs[o], syncProp, XA_INTEGER, + 8, PropModeReplace, 1, &val, FALSE, TRUE); + } +} + +static Bool +rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, + int x, int y, Rotation rotation, Bool sync, + int numOutputs, RROutputPtr * outputs) +{ ScreenPtr master = crtc->pScreen->current_master; - Bool ret; + rrScrPrivPtr pMasterScrPriv = rrGetScrPriv(master); + rrScrPrivPtr pSlaveScrPriv = rrGetScrPriv(crtc->pScreen); + int depth; PixmapPtr mscreenpix; - PixmapPtr protopix = master->GetScreenPixmap(master); - rrScrPriv(crtc->pScreen); + PixmapPtr spix_front; - /* create a pixmap on the master screen, - then get a shared handle for it - create a shared pixmap on the slave screen using the handle - set the master screen to do dirty updates to the shared pixmap - from the screen pixmap. - set slave screen to scanout shared linear pixmap + /* Create a pixmap on the master screen, then get a shared handle for it. + Create a shared pixmap on the slave screen using the handle. + + If sync == FALSE -- + Set slave screen to scanout shared linear pixmap. + Set the master screen to do dirty updates to the shared pixmap + from the screen pixmap on its own accord. + + If sync == TRUE -- + If any of the below steps fail, clean up and fall back to sync == FALSE. + Create another shared pixmap on the slave screen using the handle. + Set slave screen to prepare for scanout and flipping between shared + linear pixmaps. + Set the master screen to do dirty updates to the shared pixmaps from the + screen pixmap when prompted to by us or the slave. + Prompt the master to do a dirty update on the first shared pixmap, then + defer to the slave. */ mscreenpix = master->GetScreenPixmap(master); - depth = protopix->drawable.depth; + depth = mscreenpix->drawable.depth; if (crtc->scanout_pixmap) RRCrtcDetachScanoutPixmap(crtc); @@ -415,26 +525,71 @@ return TRUE; } - mpix = master->CreatePixmap(master, width, height, depth, - CREATE_PIXMAP_USAGE_SHARED); - if (!mpix) + spix_front = rrCreateSharedPixmap(crtc, master, + width, height, depth, + x, y, rotation); + if (spix_front == NULL) { return FALSE; + } - spix = PixmapShareToSlave(mpix, crtc->pScreen); - if (spix == NULL) { - master->DestroyPixmap(mpix); - return FALSE; + /* Both source and sink must support required ABI funcs for flipping */ + if (sync && + pSlaveScrPriv->rrEnableSharedPixmapFlipping && + pSlaveScrPriv->rrDisableSharedPixmapFlipping && + pMasterScrPriv->rrStartFlippingPixmapTracking && + master->PresentSharedPixmap && + master->StopFlippingPixmapTracking) { + + PixmapPtr spix_back = rrCreateSharedPixmap(crtc, master, + width, height, depth, + x, y, rotation); + if (spix_back == NULL) + goto fail; + + if (!pSlaveScrPriv->rrEnableSharedPixmapFlipping(crtc, + spix_front, spix_back)) + goto fail; + + crtc->scanout_pixmap = spix_front; + crtc->scanout_pixmap_back = spix_back; + + if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, mscreenpix, + spix_front, + spix_back, + x, y, 0, 0, + rotation)) { + pSlaveScrPriv->rrDisableSharedPixmapFlipping(crtc); + goto fail; + } + + master->PresentSharedPixmap(spix_front); + + return TRUE; + +fail: /* If flipping funcs fail, just fall back to unsynchronized */ + if (spix_back) + rrDestroySharedPixmap(crtc, spix_back); + + crtc->scanout_pixmap = NULL; + crtc->scanout_pixmap_back = NULL; } - ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix); - if (ret == FALSE) { + if (sync) { /* Wanted sync, didn't get it */ + ErrorF("randr: falling back to unsynchronized pixmap sharing\n"); + + /* Set output property to 0 to indicate to user */ + rrSetPixmapSharingSyncProp(0, numOutputs, outputs); + } + + if (!pSlaveScrPriv->rrCrtcSetScanoutPixmap(crtc, spix_front)) { + rrDestroySharedPixmap(crtc, spix_front); ErrorF("randr: failed to set shadow slave pixmap\n"); return FALSE; } + crtc->scanout_pixmap = spix_front; - crtc->scanout_pixmap = spix; + master->StartPixmapTracking(mscreenpix, spix_front, x, y, 0, 0, rotation); - master->StartPixmapTracking(mscreenpix, spix, x, y, 0, 0, rotation); return TRUE; } @@ -499,8 +654,12 @@ RegionUnion(&total_region, &total_region, &new_crtc_region); } - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { rrScrPrivPtr slave_priv = rrGetScrPriv(slave); + + if (!slave->is_output_slave) + continue; + for (c = 0; c < slave_priv->numCrtcs; c++) { RRCrtcPtr slave_crtc = slave_priv->crtcs[c]; @@ -527,8 +686,14 @@ } newsize = RegionExtents(&total_region); - new_width = newsize->x2 - newsize->x1; - new_height = newsize->y2 - newsize->y1; + new_width = newsize->x2; + new_height = newsize->y2; + + if (new_width < screen_pixmap->drawable.width) + new_width = screen_pixmap->drawable.width; + + 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) { @@ -592,7 +757,10 @@ return FALSE; if (pScreen->current_master) { - ret = rrCreateSharedPixmap(crtc, width, height, x, y, rotation); + Bool sync = rrGetPixmapSharingSyncProp(numOutputs, outputs); + ret = rrSetupPixmapSharing(crtc, width, height, + x, y, rotation, sync, + numOutputs, outputs); } } #if RANDR_12_INTERFACE @@ -1673,7 +1841,10 @@ if (ret == TRUE) return; - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + ret = check_all_screen_crtcs(slave, x, y); if (ret == TRUE) return; @@ -1684,7 +1855,10 @@ if (ret == TRUE) return; - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + ret = constrain_all_screen_crtcs(pDev, slave, x, y); if (ret == TRUE) return; @@ -1714,6 +1888,12 @@ if (!crtc->scanout_pixmap && !enable) continue; + /* not supported with double buffering, needs ABI change for 2 ppix */ + if (crtc->scanout_pixmap_back) { + ret = FALSE; + continue; + } + size_fits = (crtc->mode && crtc->x == pDrawable->x && crtc->y == pDrawable->y && @@ -1771,3 +1951,22 @@ return ret; } + +Bool +RRHasScanoutPixmap(ScreenPtr pScreen) +{ + rrScrPriv(pScreen); + int i; + + if (!pScreen->is_output_slave) + return FALSE; + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (crtc->scanout_pixmap) + return TRUE; + } + + return FALSE; +} diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rrmonitor.c xorg-server-hwe-16.04-1.19.3/randr/rrmonitor.c --- xorg-server-hwe-16.04-1.18.4/randr/rrmonitor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rrmonitor.c 2017-03-15 18:05:25.000000000 +0000 @@ -202,8 +202,12 @@ /* Count the number of crtcs in this and any slave screens */ numCrtcs = pScrPriv->numCrtcs; - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { rrScrPrivPtr pSlavePriv; + + if (!slave->is_output_slave) + continue; + pSlavePriv = rrGetScrPriv(slave); numCrtcs += pSlavePriv->numCrtcs; } @@ -220,8 +224,12 @@ mon_list->server_crtc[c] = pScrPriv->crtcs[sc]; } - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { rrScrPrivPtr pSlavePriv; + + if (!slave->is_output_slave) + continue; + pSlavePriv = rrGetScrPriv(slave); for (sc = 0; sc < pSlavePriv->numCrtcs; sc++, c++) { if (pSlavePriv->crtcs[sc]->mode != NULL) @@ -471,7 +479,10 @@ return BadValue; } - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + if (RRMonitorMatchesOutputName(slave, monitor->name)) { client->errorValue = monitor->name; return BadValue; diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rroutput.c xorg-server-hwe-16.04-1.19.3/randr/rroutput.c --- xorg-server-hwe-16.04-1.18.4/randr/rroutput.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rroutput.c 2017-03-15 18:05:25.000000000 +0000 @@ -570,12 +570,10 @@ RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); xorg_list_for_each_entry(slave, - &pWin->drawable.pScreen->output_slave_list, - output_head) { - rrScrPrivPtr pSlavePriv; - pSlavePriv = rrGetScrPriv(slave); - - RRSetPrimaryOutput(slave, pSlavePriv, output); + &pWin->drawable.pScreen->slave_list, + slave_head) { + if (slave->is_output_slave) + RRSetPrimaryOutput(slave, rrGetScrPriv(slave), output); } } diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rrprovider.c xorg-server-hwe-16.04-1.19.3/randr/rrprovider.c --- xorg-server-hwe-16.04-1.18.4/randr/rrprovider.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rrprovider.c 2017-03-15 18:05:25.000000000 +0000 @@ -25,6 +25,8 @@ #include "randrstr.h" #include "swaprep.h" +#include + RESTYPE RRProviderType; /* @@ -72,15 +74,7 @@ if (pScrPriv->provider) total_providers++; - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - pScrPriv = rrGetScrPriv(iter); - total_providers += pScrPriv->provider ? 1 : 0; - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - pScrPriv = rrGetScrPriv(iter); - total_providers += pScrPriv->provider ? 1 : 0; - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { pScrPriv = rrGetScrPriv(iter); total_providers += pScrPriv->provider ? 1 : 0; } @@ -116,13 +110,7 @@ providers = (RRProvider *)extra; ADD_PROVIDER(pScreen); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - ADD_PROVIDER(iter); - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - ADD_PROVIDER(iter); - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { ADD_PROVIDER(iter); } } @@ -182,12 +170,13 @@ /* count associated providers */ if (provider->offload_sink) rep.nAssociatedProviders++; - if (provider->output_source) - rep.nAssociatedProviders++; - xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) - rep.nAssociatedProviders++; - xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) + if (provider->output_source && + provider->output_source != provider->offload_sink) rep.nAssociatedProviders++; + xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { + if (provscreen->is_output_slave || provscreen->is_offload_slave) + rep.nAssociatedProviders++; + } rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + (rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength)); @@ -237,27 +226,22 @@ swapl(&prov_cap[i]); i++; } - xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { + if (!provscreen->is_output_slave && !provscreen->is_offload_slave) + continue; pScrProvPriv = rrGetScrPriv(provscreen); providers[i] = pScrProvPriv->provider->id; if (client->swapped) swapl(&providers[i]); - prov_cap[i] = RR_Capability_SinkOutput; + prov_cap[i] = 0; + if (provscreen->is_output_slave) + prov_cap[i] |= RR_Capability_SinkOutput; + if (provscreen->is_offload_slave) + prov_cap[i] |= RR_Capability_SourceOffload; if (client->swapped) swapl(&prov_cap[i]); i++; } - xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) { - pScrProvPriv = rrGetScrPriv(provscreen); - providers[i] = pScrProvPriv->provider->id; - if (client->swapped) - swapl(&providers[i]); - prov_cap[i] = RR_Capability_SourceOffload; - if (client->swapped) - swapl(&prov_cap[i]); - i++; - } - memcpy(name, provider->name, rep.nameLength); if (client->swapped) { @@ -277,6 +261,58 @@ return Success; } +static void +RRInitPrimeSyncProps(ScreenPtr pScreen) +{ + /* + * TODO: When adding support for different sources for different outputs, + * make sure this sets up the output properties only on outputs associated + * with the correct source provider. + */ + + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); + + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), TRUE); + + int defaultVal = TRUE; + int validVals[2] = {FALSE, TRUE}; + + int i; + for (i = 0; i < pScrPriv->numOutputs; i++) { + if (!RRQueryOutputProperty(pScrPriv->outputs[i], syncProp)) { + RRConfigureOutputProperty(pScrPriv->outputs[i], syncProp, + TRUE, FALSE, FALSE, + 2, &validVals[0]); + RRChangeOutputProperty(pScrPriv->outputs[i], syncProp, XA_INTEGER, + 8, PropModeReplace, 1, &defaultVal, + FALSE, FALSE); + } + } +} + +static void +RRFiniPrimeSyncProps(ScreenPtr pScreen) +{ + /* + * TODO: When adding support for different sources for different outputs, + * make sure this tears down the output properties only on outputs + * associated with the correct source provider. + */ + + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); + int i; + + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return; + + for (i = 0; i < pScrPriv->numOutputs; i++) { + RRDeleteOutputProperty(pScrPriv->outputs[i], syncProp); + } +} + int ProcRRSetProviderOutputSource(ClientPtr client) { @@ -302,8 +338,13 @@ pScreen = provider->pScreen; pScrPriv = rrGetScrPriv(pScreen); + if (!pScreen->isGPU) + return BadValue; + pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider); + RRInitPrimeSyncProps(pScreen); + provider->changed = TRUE; RRSetChanged(pScreen); @@ -379,6 +420,7 @@ void RRProviderDestroy (RRProviderPtr provider) { + RRFiniPrimeSyncProps(provider->pScreen); FreeResource (provider->id, 0); } diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rrscreen.c xorg-server-hwe-16.04-1.19.3/randr/rrscreen.c --- xorg-server-hwe-16.04-1.18.4/randr/rrscreen.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rrscreen.c 2017-03-15 18:05:25.000000000 +0000 @@ -41,6 +41,9 @@ int screen = 0; int d; + if (ConnectionInfo == NULL) + return; + connSetup = (xConnSetup *) ConnectionInfo; vendor = (char *) connSetup + sizeof(xConnSetup); formats = (xPixmapFormat *) ((char *) vendor + @@ -391,7 +394,10 @@ update_totals(pScreen, pScrPriv); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pScrPriv = rrGetScrPriv(iter); if (query) @@ -447,7 +453,10 @@ } update_arrays(pScreen, pScrPriv, primary_crtc, has_primary); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pScrPriv = rrGetScrPriv(iter); update_arrays(iter, pScrPriv, primary_crtc, has_primary); @@ -500,7 +509,7 @@ if (!RRGetInfo(pScreen, query)) return BadAlloc; - if (!xorg_list_is_empty(&pScreen->output_slave_list)) + if (pScreen->output_slaves) return rrGetMultiScreenResources(client, query, pScreen); if (!pScrPriv) { diff -Nru xorg-server-hwe-16.04-1.18.4/randr/rrxinerama.c xorg-server-hwe-16.04-1.19.3/randr/rrxinerama.c --- xorg-server-hwe-16.04-1.18.4/randr/rrxinerama.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/randr/rrxinerama.c 2017-03-15 18:05:25.000000000 +0000 @@ -260,6 +260,13 @@ scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1; scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1; + if (client->swapped) { + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); + } + WriteToClient(client, sz_XineramaScreenInfo, &scratch); } diff -Nru xorg-server-hwe-16.04-1.18.4/record/Makefile.in xorg-server-hwe-16.04-1.19.3/record/Makefile.in --- xorg-server-hwe-16.04-1.18.4/record/Makefile.in 2016-07-19 17:27:30.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/record/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -91,9 +91,10 @@ subdir = record ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -353,6 +354,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -383,7 +387,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -478,6 +485,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/render/animcur.c xorg-server-hwe-16.04-1.19.3/render/animcur.c --- xorg-server-hwe-16.04-1.18.4/render/animcur.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/render/animcur.c 2017-03-15 18:05:25.000000000 +0000 @@ -59,15 +59,14 @@ typedef struct _AnimScrPriv { CloseScreenProcPtr CloseScreen; - - ScreenBlockHandlerProcPtr BlockHandler; - CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; SetCursorPositionProcPtr SetCursorPosition; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; + OsTimerPtr timer; + Bool timer_set; } AnimCurScreenRec, *AnimCurScreenPtr; static unsigned char empty[4]; @@ -129,28 +128,23 @@ } /* - * This has to be a screen block handler instead of a generic - * block handler so that it is well ordered with respect to the DRI - * block handler responsible for releasing the hardware to DRI clients + * The cursor animation timer has expired, go display any relevant cursor changes + * and compute a new timeout value */ -static void -AnimCurScreenBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +static CARD32 +AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) { + ScreenPtr pScreen = arg; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; Bool activeDevice = FALSE; - CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ - - Unwrap(as, pScreen, BlockHandler); + CARD32 soonest = ~0; /* earliest time to wakeup again */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { - if (!activeDevice) { - now = GetTimeInMillis(); + if (!activeDevice) activeDevice = TRUE; - } if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); @@ -180,13 +174,11 @@ } if (activeDevice) - AdjustWaitForDelay(pTimeout, soonest - now); - - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); - if (activeDevice) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen); else - as->BlockHandler = NULL; + as->timer_set = FALSE; + + return 0; } static Bool @@ -212,8 +204,11 @@ pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; - if (!as->BlockHandler) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + if (!as->timer_set) { + TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); + as->timer_set = TRUE; + } } } else @@ -239,8 +234,11 @@ if (pDev->spriteInfo->anim.pCursor) { pDev->spriteInfo->anim.pScreen = pScreen; - if (!as->BlockHandler) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + if (!as->timer_set) { + TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); + as->timer_set = TRUE; + } } ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); @@ -316,9 +314,14 @@ as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec)); if (!as) return FALSE; - Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); + as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen); + if (!as->timer) { + free(as); + return FALSE; + } + as->timer_set = FALSE; - as->BlockHandler = NULL; + Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); diff -Nru xorg-server-hwe-16.04-1.18.4/render/Makefile.in xorg-server-hwe-16.04-1.19.3/render/Makefile.in --- xorg-server-hwe-16.04-1.18.4/render/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/render/Makefile.in 2017-03-15 18:05:45.000000000 +0000 @@ -92,9 +92,10 @@ subdir = render ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -387,6 +388,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/render/render.c xorg-server-hwe-16.04-1.19.3/render/render.c --- xorg-server-hwe-16.04-1.18.4/render/render.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/render/render.c 2017-03-15 18:05:25.000000000 +0000 @@ -219,17 +219,6 @@ #define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey)) -static void -RenderClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient(pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - #ifdef PANORAMIX RESTYPE XRT_PICTURE; #endif @@ -246,8 +235,6 @@ if (!dixRegisterPrivateKey (&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec))) return; - if (!AddCallback(&ClientStateCallback, RenderClientCallback, 0)) - return; extEntry = AddExtension(RENDER_NAME, 0, RenderNumberErrors, ProcRenderDispatch, SProcRenderDispatch, @@ -1921,6 +1908,8 @@ LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); + if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) + return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; @@ -1959,6 +1948,8 @@ LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); + if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) + return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; diff -Nru xorg-server-hwe-16.04-1.18.4/test/ddxstubs.c xorg-server-hwe-16.04-1.19.3/test/ddxstubs.c --- xorg-server-hwe-16.04-1.18.4/test/ddxstubs.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/ddxstubs.c 2017-03-15 18:05:25.000000000 +0000 @@ -83,26 +83,10 @@ } #ifdef XQUARTZ -#include - -BOOL serverRunning = TRUE; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; - int darwinMainScreenX = 0; int darwinMainScreenY = 0; BOOL no_configure_window = FALSE; - -void -darwinEvents_lock(void) -{ -} - -void -darwinEvents_unlock(void) -{ -} #endif #ifdef DDXBEFORERESET diff -Nru xorg-server-hwe-16.04-1.18.4/test/Makefile.am xorg-server-hwe-16.04-1.19.3/test/Makefile.am --- xorg-server-hwe-16.04-1.18.4/test/Makefile.am 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/Makefile.am 2017-03-15 18:05:25.000000000 +0000 @@ -1,19 +1,46 @@ if ENABLE_UNIT_TESTS SUBDIRS= . -noinst_PROGRAMS = list string +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 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 os signal-logging touch +TEST_PROGS += xkb input xtest misc fixes xfree86 signal-logging touch if RES -noinst_PROGRAMS += hashtabletest +TEST_PROGS += hashtabletest endif endif check_LTLIBRARIES = libxservertest.la -TESTS=$(noinst_PROGRAMS) -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) +noinst_PROGRAMS = \ + simple-xinit \ + $(TEST_PROGS) \ + $(NULL) + +if XVFB +XVFB_TESTS = scripts/xvfb-piglit.sh +if XEPHYR +if GLAMOR +XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh +endif +endif +endif + +SCRIPT_TESTS = \ + $(XVFB_TESTS) \ + $(XEPHYR_GLAMOR_TESTS) \ + $(NULL) + +TESTS = \ + $(TEST_PROGS) \ + $(SCRIPT_TESTS) \ + $(NULL) + +TESTS_ENVIRONMENT = \ + XSERVER_DIR=$(abs_top_srcdir) \ + XSERVER_BUILDDIR=$(abs_top_builddir) \ + $(XORG_MALLOC_DEBUG_ENV) \ + $(NULL) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) @@ -39,7 +66,6 @@ touch_LDADD=$(TEST_LDADD) signal_logging_LDADD=$(TEST_LDADD) hashtabletest_LDADD=$(TEST_LDADD) -os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG @@ -139,5 +165,11 @@ libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) endif -EXTRA_DIST = ddxstubs.c +EXTRA_DIST = \ + scripts/xvfb-piglit.sh \ + scripts/xephyr-glamor-piglit.sh \ + scripts/xinit-piglit-session.sh \ + scripts/run-piglit.sh \ + ddxstubs.c \ + $(NULL) diff -Nru xorg-server-hwe-16.04-1.18.4/test/Makefile.in xorg-server-hwe-16.04-1.19.3/test/Makefile.in --- xorg-server-hwe-16.04-1.18.4/test/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/Makefile.in 2017-03-15 18:05:46.000000000 +0000 @@ -88,14 +88,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = list$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@ string$(EXEEXT) $(am__EXEEXT_1) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_2) # 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 os signal-logging touch +@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@ -I$(top_srcdir)/hw/xfree86/ddc \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ @@ -162,9 +162,10 @@ subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -207,10 +208,11 @@ @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@ os$(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) @@ -236,13 +238,13 @@ misc_SOURCES = misc.c misc_OBJECTS = misc.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@misc_DEPENDENCIES = $(am__DEPENDENCIES_4) -os_SOURCES = os.c -os_OBJECTS = os.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@os_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) @@ -293,10 +295,11 @@ 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 os.c signal-logging.c string.c touch.c \ - xfree86.c xkb.c xtest.c -DIST_SOURCES = fixes.c hashtabletest.c input.c list.c misc.c os.c \ - signal-logging.c string.c touch.c xfree86.c xkb.c xtest.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 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -520,6 +523,8 @@ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) +@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_4 = $(XVFB_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XEPHYR_GLAMOR_TESTS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver @@ -744,6 +749,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -774,7 +782,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -869,6 +880,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -917,9 +929,22 @@ 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@TESTS = $(noinst_PROGRAMS) -@ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) +@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 = \ +@ENABLE_UNIT_TESTS_TRUE@ $(XVFB_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XEPHYR_GLAMOR_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(NULL) + +@ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = \ +@ENABLE_UNIT_TESTS_TRUE@ XSERVER_DIR=$(abs_top_srcdir) \ +@ENABLE_UNIT_TESTS_TRUE@ XSERVER_BUILDDIR=$(abs_top_builddir) \ +@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 \ @@ -935,7 +960,6 @@ @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@os_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) \ @@ -951,7 +975,14 @@ @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 = ddxstubs.c +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) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -1030,14 +1061,14 @@ @rm -f misc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(misc_OBJECTS) $(misc_LDADD) $(LIBS) -os$(EXEEXT): $(os_OBJECTS) $(os_DEPENDENCIES) $(EXTRA_os_DEPENDENCIES) - @rm -f os$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(os_OBJECTS) $(os_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) @@ -1071,9 +1102,9 @@ @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)/os.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@ @@ -1410,13 +1441,6 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -os.log: os$(EXEEXT) - @p='os$(EXEEXT)'; \ - b='os'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) signal-logging.log: signal-logging$(EXEEXT) @p='signal-logging$(EXEEXT)'; \ b='signal-logging'; \ @@ -1437,6 +1461,20 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +scripts/xvfb-piglit.sh.log: scripts/xvfb-piglit.sh + @p='scripts/xvfb-piglit.sh'; \ + b='scripts/xvfb-piglit.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +scripts/xephyr-glamor-piglit.sh.log: scripts/xephyr-glamor-piglit.sh + @p='scripts/xephyr-glamor-piglit.sh'; \ + b='scripts/xephyr-glamor-piglit.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ diff -Nru xorg-server-hwe-16.04-1.18.4/test/os.c xorg-server-hwe-16.04-1.19.3/test/os.c --- xorg-server-hwe-16.04-1.18.4/test/os.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/os.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -/** - * Copyright © 2012 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "os.h" - -static int last_signal = 0; -static int expect_signal = 0; - -static void sighandler(int signal) -{ - assert(expect_signal); - expect_signal = 0; - if (!last_signal) - raise(signal); - OsBlockSignals(); - OsReleaseSignals(); - last_signal = 1; - expect_signal = 1; -} - -static int -sig_is_blocked(int sig) -{ - sigset_t current; - - sigemptyset(¤t); - assert(sigprocmask(SIG_BLOCK, NULL, ¤t) == 0); - return sigismember(¤t, sig); -} - -static void block_sigio_test(void) -{ -#ifdef SIG_BLOCK - sigset_t current; - - sigemptyset(¤t); - assert(!sig_is_blocked(SIGIO)); - - /* block once */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* block twice, nested */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* block all */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* block all nested */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* mix the two */ - /* ABBA */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* ABAB */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* BAAB */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* BABA */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); -#endif -} - -static void block_sigio_test_nested(void) -{ -#ifdef SIG_BLOCK - /* Check for bug releasing SIGIO during SIGIO signal handling. - test case: - raise signal - → in signal handler: - raise signal - OsBlockSignals() - OsReleaseSignals() - tail guard - tail guard must be hit. - */ - void (*old_handler)(int); - old_handler = OsSignal(SIGIO, sighandler); - expect_signal = 1; - assert(raise(SIGIO) == 0); - assert(OsSignal(SIGIO, old_handler) == sighandler); -#endif -} - -int -main(int argc, char **argv) -{ - block_sigio_test(); - block_sigio_test_nested(); - return 0; -} diff -Nru xorg-server-hwe-16.04-1.18.4/test/scripts/run-piglit.sh xorg-server-hwe-16.04-1.19.3/test/scripts/run-piglit.sh --- xorg-server-hwe-16.04-1.18.4/test/scripts/run-piglit.sh 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/scripts/run-piglit.sh 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,80 @@ +#!/bin/sh + +set -e + +if test "x$XTEST_DIR" = "x"; then + echo "XTEST_DIR must be set to the directory of the xtest repository." + # Exit as a "skip" so make check works even without piglit. + exit 77 +fi + +if test "x$PIGLIT_DIR" = "x"; then + echo "PIGLIT_DIR must be set to the directory of the piglit repository." + # Exit as a "skip" so make check works even without piglit. + exit 77 +fi + +if test "x$PIGLIT_RESULTS_DIR" = "x"; then + echo "PIGLIT_RESULTS_DIR must be set to where to output piglit results." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$XSERVER_DIR" = "x"; then + echo "XSERVER_DIR must be set to the directory of the xserver repository." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$XSERVER_BUILDDIR" = "x"; then + echo "XSERVER_BUILDDIR must be set to the build directory of the xserver repository." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$SERVER_COMMAND" = "x"; then + echo "SERVER_COMMAND must be set to the server to be spawned." + # Exit as a real failure because it should always be set. + exit 1 +fi + +$XSERVER_BUILDDIR/test/simple-xinit \ + $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \ + -- \ + $SERVER_COMMAND + +# 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 + +# Write the short summary to make check's log file. +cat $SHORT_SUMMARY + +# Parse the piglit summary to decide on our exit status. +status=0 +# "pass: 0" would mean no tests actually ran. +if grep "^ *pass: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi +# Fails or crashes should be failures from make check's perspective. +if ! grep "^ *fail: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi +if ! grep "^ *crash: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi + +$PIGLIT_DIR/piglit-summary-html.py \ + --overwrite \ + $PIGLIT_RESULTS_DIR/html \ + $PIGLIT_RESULTS_DIR + +if test $status != 0; then + echo "Some piglit tests failed." + echo "The list of failing tests can be found in $LONG_SUMMARY." +fi +echo "An html page of the test status can be found at $PIGLIT_RESULTS_DIR/html/index.html" + +exit $status diff -Nru xorg-server-hwe-16.04-1.18.4/test/scripts/xephyr-glamor-piglit.sh xorg-server-hwe-16.04-1.19.3/test/scripts/xephyr-glamor-piglit.sh --- xorg-server-hwe-16.04-1.18.4/test/scripts/xephyr-glamor-piglit.sh 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/scripts/xephyr-glamor-piglit.sh 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,16 @@ +# 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 + +export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \ + -glamor \ + -glamor-skip-present \ + -noreset \ + -schedMax 2000 \ + -screen 1280x1024" + +$XSERVER_BUILDDIR/test/simple-xinit \ + $XSERVER_DIR/test/scripts/run-piglit.sh \ + -- \ + $XSERVER_BUILDDIR/hw/vfb/Xvfb \ + -screen scrn 1280x1024x24 diff -Nru xorg-server-hwe-16.04-1.18.4/test/scripts/xinit-piglit-session.sh xorg-server-hwe-16.04-1.19.3/test/scripts/xinit-piglit-session.sh --- xorg-server-hwe-16.04-1.18.4/test/scripts/xinit-piglit-session.sh 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/scripts/xinit-piglit-session.sh 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,44 @@ +#!/bin/sh + +# .xinitrc replacement to run piglit and exit. +# +# Note that piglit will run many processes against the server, so +# running the server with -noreset is recommended to improve runtime. + +set -e + +if test "x$PIGLIT_DIR" = "x"; then + echo "PIGLIT_DIR must be set to the directory of the piglit repository." + exit 1 +fi + +if test "x$PIGLIT_RESULTS_DIR" = "x"; then + echo "PIGLIT_RESULTS_DIR must be defined" + exit 1 +fi + +if test "x$XTEST_DIR" = "x"; then + echo "XTEST_DIR must be set to the root of the built xtest tree." + exit 1 +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" +PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@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 diff -Nru xorg-server-hwe-16.04-1.18.4/test/scripts/xvfb-piglit.sh xorg-server-hwe-16.04-1.19.3/test/scripts/xvfb-piglit.sh --- xorg-server-hwe-16.04-1.18.4/test/scripts/xvfb-piglit.sh 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/scripts/xvfb-piglit.sh 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,7 @@ +export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/vfb/Xvfb \ + -noreset \ + -screen scrn 1280x1024x24" +export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb + +exec $XSERVER_DIR/test/scripts/run-piglit.sh + diff -Nru xorg-server-hwe-16.04-1.18.4/test/simple-xinit.c xorg-server-hwe-16.04-1.19.3/test/simple-xinit.c --- xorg-server-hwe-16.04-1.18.4/test/simple-xinit.c 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/simple-xinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -0,0 +1,229 @@ +/* + * Copyright © 2016 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. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +static void +kill_server(int server_pid) +{ + int ret = kill(server_pid, SIGTERM); + int wstatus; + + if (ret) { + fprintf(stderr, "Failed to send kill to the server: %s\n", + strerror(errno)); + exit(1); + } + + ret = waitpid(server_pid, &wstatus, 0); + if (ret < 0) { + fprintf(stderr, "Failed to wait for X to die: %s\n", strerror(errno)); + exit(1); + } +} + +static void +usage(int argc, char **argv) +{ + fprintf(stderr, "%s -- \n", argv[0]); + exit(1); +} + +/* Starts the X server, returning its pid. */ +static int +start_server(char *const *server_args) +{ + int server_pid = fork(); + + if (server_pid == -1) { + fprintf(stderr, "Fork failed: %s\n", strerror(errno)); + exit(1); + } else if (server_pid != 0) { + /* Continue along the main process that will exec the client. */ + return server_pid; + } + + /* Execute the server. This only returns if an error occurred. */ + execvp(server_args[0], server_args); + fprintf(stderr, "Error starting the server: %s\n", strerror(errno)); + exit(1); +} + +/* Reads the display number out of the started server's display socket. */ +static int +get_display(int displayfd) +{ + char display_string[10]; + ssize_t ret; + + ret = read(displayfd, display_string, sizeof(display_string - 1)); + if (ret <= 0) { + fprintf(stderr, "Failed reading displayfd: %s\n", strerror(errno)); + exit(1); + } + + /* We've read in the display number as a string terminated by + * '\n', but not '\0'. Cap it and parse the number. + */ + display_string[ret] = '\0'; + return atoi(display_string); +} + +static int +start_client(char *const *client_args, int display) +{ + char *display_string; + int ret; + int client_pid; + + ret = asprintf(&display_string, ":%d", display); + if (ret < 0) { + fprintf(stderr, "asprintf fail\n"); + exit(1); + } + + ret = setenv("DISPLAY", display_string, true); + if (ret) { + fprintf(stderr, "Failed to set DISPLAY\n"); + exit(1); + } + + client_pid = fork(); + if (client_pid == -1) { + fprintf(stderr, "Fork failed: %s\n", strerror(errno)); + exit(1); + } else if (client_pid) { + int wstatus; + + ret = waitpid(client_pid, &wstatus, 0); + if (ret < 0) { + fprintf(stderr, "Error waiting for client to start: %s\n", + strerror(errno)); + return 1; + } + + return WEXITSTATUS(wstatus); + } else { + execvp(client_args[0], client_args); + /* exec only returns if an error occurred. */ + fprintf(stderr, "Error starting the client: %s\n", strerror(errno)); + exit(1); + } +} + +/* Splits the incoming argc/argv into a pair of NULL-terminated arrays + * of args. + */ +static void +parse_args(int argc, char **argv, + char * const **out_client_args, + char * const **out_server_args, + int displayfd) +{ + /* We're stripping the -- and the program name, inserting two + * NULLs, and also the -displayfd and fd number. + */ + char **args_storage = calloc(argc + 2, sizeof(char *)); + char *const *client_args; + char *const *server_args = NULL; + char **next_arg = args_storage; + bool parsing_client = true; + int i, ret; + char *displayfd_string; + + if (!args_storage) + exit(1); + + client_args = args_storage; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--") == 0) { + if (!parsing_client) + usage(argc, argv); + + /* Cap the client list */ + *next_arg = NULL; + next_arg++; + + /* Move to adding into server_args. */ + server_args = next_arg; + parsing_client = false; + continue; + } + + *next_arg = argv[i]; + next_arg++; + } + + if (client_args[0] == NULL || !server_args || server_args[0] == NULL) + usage(argc, argv); + + /* Give the server -displayfd X */ + *next_arg = (char *)"-displayfd"; + next_arg++; + + ret = asprintf(&displayfd_string, "%d", displayfd); + if (ret < 0) { + fprintf(stderr, "asprintf fail\n"); + exit(1); + } + *next_arg = displayfd_string; + next_arg++; + + *out_client_args = client_args; + *out_server_args = server_args; +} + +int +main(int argc, char **argv) +{ + char * const *client_args; + char * const *server_args; + int displayfd_pipe[2]; + int display, server_pid; + int ret; + + ret = pipe(displayfd_pipe); + if (ret) { + fprintf(stderr, "Pipe creation failure: %s", strerror(errno)); + exit(1); + } + + parse_args(argc, argv, &client_args, &server_args, displayfd_pipe[1]); + server_pid = start_server(server_args); + display = get_display(displayfd_pipe[0]); + ret = start_client(client_args, display); + kill_server(server_pid); + + exit(ret); +} diff -Nru xorg-server-hwe-16.04-1.18.4/test/touch.c xorg-server-hwe-16.04-1.19.3/test/touch.c --- xorg-server-hwe-16.04-1.18.4/test/touch.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/touch.c 2017-03-15 18:05:25.000000000 +0000 @@ -58,9 +58,8 @@ dev.last.touches[i].client_id = i * 2; } - /* no more space, should've scheduled a workproc */ - assert(TouchBeginDDXTouch(&dev, 1234) == NULL); - ProcessWorkQueue(); + /* no more space, should've reallocated and succeeded */ + assert(TouchBeginDDXTouch(&dev, 1234) != NULL); new_size = size + size / 2 + 1; assert(dev.last.num_touches == new_size); @@ -74,8 +73,12 @@ assert(t->client_id == i * 2); } + assert(dev.last.touches[size].active == TRUE); + assert(dev.last.touches[size].ddx_id == 1234); + assert(dev.last.touches[size].client_id == 1); + /* make sure those are zero-initialized */ - for (i = size; i < new_size; i++) { + for (i = size + 1; i < new_size; i++) { DDXTouchPointInfoPtr t = &dev.last.touches[i]; assert(t->active == FALSE); @@ -90,7 +93,7 @@ touch_find_ddxid(void) { DeviceIntRec dev; - DDXTouchPointInfoPtr ti; + DDXTouchPointInfoPtr ti, ti2; ValuatorClassRec val; TouchClassRec touch; int size = 5; @@ -136,22 +139,20 @@ for (i = 0; i < size; i++) dev.last.touches[i].active = TRUE; - /* Try to create more, fail */ - ti = TouchFindByDDXID(&dev, 30, TRUE); - assert(ti == NULL); + /* Try to create more, succeed */ ti = TouchFindByDDXID(&dev, 30, TRUE); - assert(ti == NULL); - /* make sure we haven't resized, we're in the signal handler */ - assert(dev.last.num_touches == size); + assert(ti != NULL); + ti2 = TouchFindByDDXID(&dev, 30, TRUE); + assert(ti == ti2); + /* make sure we have resized */ + assert(dev.last.num_touches == 8); /* EQ grows from 5 to 8 */ /* stop one touchpoint, try to create, succeed */ dev.last.touches[2].active = FALSE; - ti = TouchFindByDDXID(&dev, 30, TRUE); + ti = TouchFindByDDXID(&dev, 35, TRUE); assert(ti == &dev.last.touches[2]); - /* but still grow anyway */ - ProcessWorkQueue(); ti = TouchFindByDDXID(&dev, 40, TRUE); - assert(ti == &dev.last.touches[size]); + assert(ti == &dev.last.touches[size+1]); free(dev.name); } diff -Nru xorg-server-hwe-16.04-1.18.4/test/xi1/Makefile.in xorg-server-hwe-16.04-1.19.3/test/xi1/Makefile.in --- xorg-server-hwe-16.04-1.18.4/test/xi1/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/xi1/Makefile.in 2017-03-15 18:05:46.000000000 +0000 @@ -93,9 +93,10 @@ subdir = test/xi1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -579,6 +580,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -609,7 +613,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -704,6 +711,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/test/xi2/Makefile.in xorg-server-hwe-16.04-1.19.3/test/xi2/Makefile.in --- xorg-server-hwe-16.04-1.18.4/test/xi2/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/xi2/Makefile.in 2017-03-15 18:05:46.000000000 +0000 @@ -103,9 +103,10 @@ subdir = test/xi2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -709,6 +710,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -739,7 +743,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -834,6 +841,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/test/xi2/protocol-xiquerypointer.c xorg-server-hwe-16.04-1.19.3/test/xi2/protocol-xiquerypointer.c --- xorg-server-hwe-16.04-1.18.4/test/xi2/protocol-xiquerypointer.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/test/xi2/protocol-xiquerypointer.c 2017-03-15 18:05:25.000000000 +0000 @@ -140,6 +140,7 @@ client_request.swapped = TRUE; swaps(&req->deviceid); + swapl(&req->win); swaps(&req->length); rc = SProcXIQueryPointer(&client_request); assert(rc == error); diff -Nru xorg-server-hwe-16.04-1.18.4/TODO xorg-server-hwe-16.04-1.19.3/TODO --- xorg-server-hwe-16.04-1.18.4/TODO 2016-06-29 17:21:18.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -tree inheritance: - -init-cleanup - -driver todo for megamerge: -nuke ddc1 paths -nuke weak functions -i810 kms -mach64 LinearVidMem removal -openbsd pciaccess fd inversion -fix linux int10 ReadBIOS and/or merge int10 and generic -geode/sis/xgi *apVidMem removal -i128/mga BiosBase removal -sis virtualFrom removal -mach64/rendition max[HV]Value removal -cirrus should prefer 16bpp -external RAMDAC code motion for glint/s3/tga -freedreno oslib.h detangle - -unify xinerama protocol ~-1kloc -- add screen id token -- add removal api -- add primary flag dealie? - -fold up pre-1.2 randr -s/xf86DefaultModes/DMTModes/ -100 -GLX for Xnest (works-ish on other branch) -rootless-merge merge -rootless-using xwayland -glxproxy something something, -15kloc if you can delete it... -maybe merge int10/vbe -fix shadow for multiple pixmaps -top-level loader (almost, ported api, needs motion) -loadable glx for all ddxes -un-special-case colormap privates -redo fbbits a la sna -merge the one snafb bugfix -render: FindGlyph -> FindGlyphs -miValidateTree: 'forward' might be a pessimization -RegionOp's overlapFunc is constant -detach dmx from fb -destroywindow should return void -redo de-sdking of opaque.h - -PRIVATE_COLORMAP -only reason this is special is xf86HandleColormaps, which the ddx drivers -call _after_ creating default colormap, but which registers a devprivate. -should find some symbol always called before xf86HC but never called in -randr 1.2 drivers? xf86ValidateModes perhaps? - -XRT Must Die -Class: Drawable -Types: Colormap, Damage, GC, Picture, Pixmap, Window - -colormaps: -CreateColormap has a special case for the default cmap -uninstall is skipped for server cmaps? because default? -WindowOptRec->colormap is an id not a pointer -ScreenRec->defColormap is an id not a pointer, but, okay? -CopyColormapAndFree is... odd. -AllocColor's CMAPENTRY special case should be moved -ListInstalledColormaps is godawful -not clear why vfb/nest duplicate micmap so much - -pixmap/window: -aaaaaaaaaa - ---- - -FakeClientID(0): -weird lifetimes: - screensaver window - applewm/winwm event resource -visuals should use separate allocator (fbconfigs too?) -GetNewFontClientID? -hmm: xwin GenerateAuthorization, auth .Add - -FakeClientID(client->index): - dri2 add_frame_event hurrr - DRI2CreateDrawable2 - ---- - -dmx wraps render, fuck. - -Create/Free GlyphSet: Annoying because GlyphSets are display-wide, so there's -no obvious place to add a wrap chain. Likewise Add/FreeGlyphs, although there -the problem is that glyphs embed their own per-screen list! Fuck sake. - -RenderCompositeGlyphs is correspondingly weird. - -Not entirely sure why SetPictureTransform/Filter are wrapped. diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/geext.c xorg-server-hwe-16.04-1.19.3/Xext/geext.c --- xorg-server-hwe-16.04-1.18.4/Xext/geext.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/geext.c 2017-03-15 18:05:25.000000000 +0000 @@ -145,28 +145,10 @@ return (*SProcGEVector[stuff->ReqType]) (client); } -/** - * Called when a new client inits a connection to the X server. - * - * We alloc a simple struct to store the client's major/minor version. Can be - * used in the furture for versioning support. - */ -static void -GEClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - GEClientInfoPtr pGEClient = GEGetClient(pClient); - - pGEClient->major_version = 0; - pGEClient->minor_version = 0; -} - /* Reset extension. Called on server shutdown. */ static void GEResetProc(ExtensionEntry * extEntry) { - DeleteCallback(&ClientStateCallback, GEClientCallback, 0); EventSwapVector[GenericEvent] = NotImplemented; } @@ -205,10 +187,6 @@ (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) FatalError("GEExtensionInit: GE private request failed.\n"); - if (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) { - FatalError("GEExtensionInit: register client callback failed.\n"); - } - if ((extEntry = AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch, diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/Makefile.in xorg-server-hwe-16.04-1.19.3/Xext/Makefile.in --- xorg-server-hwe-16.04-1.18.4/Xext/Makefile.in 2016-07-19 17:27:25.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -105,9 +105,10 @@ subdir = Xext ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__sdk_HEADERS_DIST) \ @@ -443,6 +444,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -473,7 +477,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -568,6 +575,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/security.c xorg-server-hwe-16.04-1.19.3/Xext/security.c --- xorg-server-hwe-16.04-1.18.4/Xext/security.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/security.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,7 +63,7 @@ XID authId; } SecurityStateRec; -/* Extensions that untrusted clients shouldn't have access to */ +/* The only extensions that untrusted clients have access to */ static const char *SecurityTrustedExtensions[] = { "XC-MISC", "BIG-REQUESTS", diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/shape.c xorg-server-hwe-16.04-1.19.3/Xext/shape.c --- xorg-server-hwe-16.04-1.18.4/Xext/shape.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/shape.c 2017-03-15 18:05:25.000000000 +0000 @@ -881,6 +881,7 @@ default: return; } + UpdateCurrentTimeIf(); for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { xShapeNotifyEvent se = { .type = ShapeNotify + ShapeEventBase, diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/shm.c xorg-server-hwe-16.04-1.19.3/Xext/shm.c --- xorg-server-hwe-16.04-1.18.4/Xext/shm.c 2016-07-19 17:14:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/shm.c 2017-03-15 18:05:25.000000000 +0000 @@ -153,7 +153,6 @@ } #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) -#include static Bool badSysCall = FALSE; @@ -170,7 +169,7 @@ int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); + oldHandler = OsSignal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); @@ -183,7 +182,7 @@ /* Allocation failed */ badSysCall = TRUE; } - signal(SIGSYS, oldHandler); + OsSignal(SIGSYS, oldHandler); return !badSysCall; } @@ -992,7 +991,7 @@ RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); if (result != Success) { pDraw->pScreen->DestroyPixmap(pMap); - return result; + break; } dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; @@ -1009,7 +1008,7 @@ } } - if (result == BadAlloc) { + if (result != Success) { while (j--) FreeResource(newPix->info[j].id, RT_NONE); free(newPix); @@ -1214,7 +1213,8 @@ if (fd < 0) return -1; unlink(template); - if (fcntl(fd, F_GETFD, &flags) >= 0) { + flags = fcntl(fd, F_GETFD); + if (flags != -1) { flags |= FD_CLOEXEC; (void) fcntl(fd, F_SETFD, &flags); } diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/sleepuntil.c xorg-server-hwe-16.04-1.19.3/Xext/sleepuntil.c --- xorg-server-hwe-16.04-1.18.4/Xext/sleepuntil.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/sleepuntil.c 2017-03-15 18:05:25.000000000 +0000 @@ -63,14 +63,11 @@ static int SertafiedDelete(void * /* value */ , XID /* id */ ); -static void SertafiedBlockHandler(void * /* data */ , - OSTimePtr /* wt */ , - void * /* LastSelectMask */ - ); -static void SertafiedWakeupHandler(void * /* data */ , - int /* i */ , - void * /* LastSelectMask */ - ); +static void SertafiedBlockHandler(void *data, + void *timeout); + +static void SertafiedWakeupHandler(void *data, + int i); int ClientSleepUntil(ClientPtr client, @@ -154,7 +151,7 @@ } static void -SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) +SertafiedBlockHandler(void *data, void *wt) { SertafiedPtr pReq, pNext; unsigned long delay; @@ -186,7 +183,7 @@ } static void -SertafiedWakeupHandler(void *data, int i, void *LastSelectMask) +SertafiedWakeupHandler(void *data, int i) { SertafiedPtr pReq, pNext; TimeStamp now; diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/sync.c xorg-server-hwe-16.04-1.19.3/Xext/sync.c --- xorg-server-hwe-16.04-1.18.4/Xext/sync.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/sync.c 2017-03-15 18:05:25.000000000 +0000 @@ -984,20 +984,7 @@ SyncSystemCounterBracketValues BracketValues ) { - SyncCounter *pCounter; - - /* this function may be called before SYNC has been initialized, so we - * have to make sure RTCounter is created. - */ - if (RTCounter == 0) { - RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); - if (RTCounter == 0) { - return NULL; - } - xorg_list_init(&SysCounterList); - } - - pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); + SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); if (pCounter) { SysCounterInfo *psci; @@ -1912,7 +1899,7 @@ if (!AddResource(stuff->fid, RTFence, (void *) pFence)) return BadAlloc; - return client->noClientException; + return Success; } static int @@ -1953,7 +1940,7 @@ miSyncTriggerFence(pFence); - return client->noClientException; + return Success; } static int @@ -1975,7 +1962,7 @@ pFence->funcs.Reset(pFence); - return client->noClientException; + return Success; } static int @@ -1993,7 +1980,7 @@ return rc; FreeResource(stuff->fid, RT_NONE); - return client->noClientException; + return Success; } static int @@ -2025,7 +2012,7 @@ } WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep); - return client->noClientException; + return Success; } static int @@ -2103,7 +2090,7 @@ SyncAwaitEpilogue(client, items, pAwaitUnion); - return client->noClientException; + return Success; } /* @@ -2501,10 +2488,8 @@ for (s = 0; s < screenInfo.numScreens; s++) miSyncSetup(screenInfo.screens[s]); - if (RTCounter == 0) { - RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); - xorg_list_init(&SysCounterList); - } + RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); + xorg_list_init(&SysCounterList); RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); RTFence = CreateNewResourceType(FreeFence, "SyncFence"); @@ -2571,8 +2556,8 @@ *** Server Block Handler *** code inspired by multibuffer extension (now deprecated) */ - /*ARGSUSED*/ static void -ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeBlockHandler(void *env, void *wt) { XSyncValue delay; unsigned long timeout; @@ -2597,8 +2582,8 @@ /* *** Wakeup Handler */ - /*ARGSUSED*/ static void -ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeWakeupHandler(void *env, int rc) { if (pnext_time) { GetTime(); @@ -2673,7 +2658,7 @@ } static void -IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) +IdleTimeBlockHandler(void *pCounter, void *wt) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); @@ -2766,7 +2751,7 @@ } static void -IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask) +IdleTimeWakeupHandler(void *pCounter, int rc) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/vidmode.c xorg-server-hwe-16.04-1.19.3/Xext/vidmode.c --- xorg-server-hwe-16.04-1.18.4/Xext/vidmode.c 2016-07-18 19:08:16.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/vidmode.c 2017-03-15 18:05:25.000000000 +0000 @@ -1364,7 +1364,7 @@ WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep); if (!ClockProg) { for (n = 0; n < numClocks; n++) { - dotclock = *Clocks++; + dotclock = Clocks[n]; if (client->swapped) { WriteSwappedDataToClient(client, 4, (char *) &dotclock); } diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xace.c xorg-server-hwe-16.04-1.19.3/Xext/xace.c --- xorg-server-hwe-16.04-1.18.4/Xext/xace.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xace.c 2017-03-15 18:05:25.000000000 +0000 @@ -33,28 +33,17 @@ /* Special-cased hook functions. Called by Xserver. */ +#undef XaceHookDispatch int XaceHookDispatch(ClientPtr client, int major) { - /* Call the audit begin callback, there is no return value. */ - XaceAuditRec rec = { client, 0 }; - CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec); - - if (major < 128) { - /* Call the core dispatch hook */ - XaceCoreDispatchRec drec = { client, Success /* default allow */ }; - CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec); - return drec.status; - } - else { - /* Call the extension dispatch hook */ - ExtensionEntry *ext = GetExtensionEntry(major); - XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; - if (ext) - CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); - /* On error, pretend extension doesn't exist */ - return (erec.status == Success) ? Success : BadRequest; - } + /* Call the extension dispatch hook */ + ExtensionEntry *ext = GetExtensionEntry(major); + XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; + if (ext) + CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); + /* On error, pretend extension doesn't exist */ + return (erec.status == Success) ? Success : BadRequest; } int @@ -74,14 +63,6 @@ return rec.status; } -void -XaceHookAuditEnd(ClientPtr ptr, int result) -{ - XaceAuditRec rec = { ptr, result }; - /* call callbacks, there is no return value. */ - CallCallbacks(&XaceHooks[XACE_AUDIT_END], &rec); -} - /* Entry point for hook functions. Called by Xserver. */ int @@ -255,10 +236,10 @@ BoxRec imageBox; int nRects; - imageBox.x1 = x; - imageBox.y1 = y; - imageBox.x2 = x + w; - imageBox.y2 = y + h; + imageBox.x1 = pDraw->x + x; + imageBox.y1 = pDraw->y + y; + imageBox.x2 = pDraw->x + x + w; + imageBox.y2 = pDraw->y + y + h; RegionInit(&imageRegion, &imageBox, 1); RegionNull(&censorRegion); @@ -283,7 +264,7 @@ goto failSafe; } for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { - pRects[i].x = pBox->x1; + pRects[i].x = pBox->x1 - imageBox.x1; pRects[i].y = pBox->y1 - imageBox.y1; pRects[i].width = pBox->x2 - pBox->x1; pRects[i].height = pBox->y2 - pBox->y1; diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xace.h xorg-server-hwe-16.04-1.19.3/Xext/xace.h --- xorg-server-hwe-16.04-1.18.4/Xext/xace.h 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xace.h 2017-03-15 18:05:25.000000000 +0000 @@ -52,9 +52,7 @@ #define XACE_SCREENSAVER_ACCESS 12 #define XACE_AUTH_AVAIL 13 #define XACE_KEY_AVAIL 14 -#define XACE_AUDIT_BEGIN 15 -#define XACE_AUDIT_END 16 -#define XACE_NUM_HOOKS 17 +#define XACE_NUM_HOOKS 15 extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS]; @@ -71,12 +69,16 @@ /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); +#define XaceHookDispatch(c, m) \ + ((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \ + XaceHookDispatch((c), (m)) : \ + Success) + extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp, Mask access_mode); extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode); -extern _X_EXPORT void XaceHookAuditEnd(ClientPtr ptr, int result); /* Register a callback for a given hook. */ @@ -116,7 +118,6 @@ #define XaceHookDispatch(args...) Success #define XaceHookPropertyAccess(args...) Success #define XaceHookSelectionAccess(args...) Success -#define XaceHookAuditEnd(args...) { ; } #define XaceCensorImage(args...) { ; } #else #define XaceHook(...) Success @@ -124,7 +125,6 @@ #define XaceHookDispatch(...) Success #define XaceHookPropertyAccess(...) Success #define XaceHookSelectionAccess(...) Success -#define XaceHookAuditEnd(...) { ; } #define XaceCensorImage(...) { ; } #endif diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xf86bigfont.c xorg-server-hwe-16.04-1.19.3/Xext/xf86bigfont.c --- xorg-server-hwe-16.04-1.18.4/Xext/xf86bigfont.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xf86bigfont.c 2017-03-15 18:05:25.000000000 +0000 @@ -96,8 +96,6 @@ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) -#include - static void SigSysHandler(int signo) { @@ -111,7 +109,7 @@ int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); + oldHandler = OsSignal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); @@ -123,7 +121,7 @@ /* Allocation failed */ badSysCall = TRUE; } - signal(SIGSYS, oldHandler); + OsSignal(SIGSYS, oldHandler); return !badSysCall; } @@ -439,7 +437,7 @@ #ifdef HAS_SHM if (pDesc && !badSysCall) { *(CARD32 *) (pCI + nCharInfos) = signature; - if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { + if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) { shmdealloc(pDesc); return BadAlloc; } @@ -723,7 +721,7 @@ + (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()); /* fprintf(stderr, "signature = 0x%08X\n", signature); */ - FontShmdescIndex = AllocateFontPrivateIndex(); + FontShmdescIndex = xfont2_allocate_font_private_index(); #if !defined(CSRG_BASED) && !defined(__CYGWIN__) pagesize = SHMLBA; diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xres.c xorg-server-hwe-16.04-1.19.3/Xext/xres.c --- xorg-server-hwe-16.04-1.18.4/Xext/xres.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xres.c 2017-03-15 18:05:25.000000000 +0000 @@ -349,21 +349,6 @@ return Success; } -static unsigned long -ResGetApproxPixmapBytes(PixmapPtr pix) -{ - unsigned long nPixels; - float bytesPerPixel; - - bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; - nPixels = pix->drawable.width * pix->drawable.height; - - /* Divide by refcnt as pixmap could be shared between clients, - * so total pixmap mem is shared between these. - */ - return (nPixels * bytesPerPixel) / pix->refcnt; -} - static void ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) { @@ -375,57 +360,6 @@ *bytes += size.pixmapRefSize; } -static void -ResFindPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - PixmapPtr pix = (PixmapPtr) value; - - *bytes += ResGetApproxPixmapBytes(pix); -} - -static void -ResFindWindowPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - WindowPtr pWin = (WindowPtr) value; - - if (pWin->backgroundState == BackgroundPixmap) - *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap); - - if (pWin->border.pixmap != NULL && !pWin->borderIsPixel) - *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap); -} - -static void -ResFindGCPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - GCPtr pGC = (GCPtr) value; - - if (pGC->stipple != NULL) - *bytes += ResGetApproxPixmapBytes(pGC->stipple); - - if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel) - *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap); -} - -#ifdef RENDER -static void -ResFindPicturePixmaps(void *value, XID id, void *cdata) -{ - ResFindResourcePixmaps(value, id, PictureType, cdata); -} -#endif - -#ifdef COMPOSITE -static void -ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata) -{ - ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata); -} -#endif - static int ProcXResQueryClientPixmapBytes(ClientPtr client) { @@ -445,34 +379,8 @@ bytes = 0; - FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, - (void *) (&bytes)); - - /* - * Make sure win background pixmaps also held to account. - */ - FindClientResourcesByType(clients[clientID], RT_WINDOW, - ResFindWindowPixmaps, (void *) (&bytes)); - - /* - * GC Tile & Stipple pixmaps too. - */ - FindClientResourcesByType(clients[clientID], RT_GC, - ResFindGCPixmaps, (void *) (&bytes)); - -#ifdef RENDER - /* Render extension picture pixmaps. */ - FindClientResourcesByType(clients[clientID], PictureType, - ResFindPicturePixmaps, - (void *)(&bytes)); -#endif - -#ifdef COMPOSITE - /* Composite extension client window pixmaps. */ - FindClientResourcesByType(clients[clientID], CompositeClientWindowType, - ResFindCompositeClientWindowPixmaps, - (void *)(&bytes)); -#endif + FindAllClientResources(clients[clientID], ResFindResourcePixmaps, + (void *) (&bytes)); rep = (xXResQueryClientPixmapBytesReply) { .type = X_Reply, diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xselinux_hooks.c xorg-server-hwe-16.04-1.19.3/Xext/xselinux_hooks.c --- xorg-server-hwe-16.04-1.18.4/Xext/xselinux_hooks.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xselinux_hooks.c 2017-03-15 18:05:25.000000000 +0000 @@ -810,15 +810,9 @@ static int netlink_fd; static void -SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask) +SELinuxNetlinkNotify(int fd, int ready, void *data) { -} - -static void -SELinuxWakeupHandler(void *data, int num_fds, void *read_mask) -{ - if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask)) - avc_netlink_check_nb(); + avc_netlink_check_nb(); } void @@ -844,9 +838,7 @@ /* Tear down SELinux stuff */ audit_close(audit_fd); avc_netlink_release_fd(); - RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); - RemoveGeneralSocket(netlink_fd); + RemoveNotifyFd(netlink_fd); avc_destroy(); } @@ -918,9 +910,7 @@ FatalError("SELinux: Failed to create atom\n"); netlink_fd = avc_netlink_acquire_fd(); - AddGeneralSocket(netlink_fd); - RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); + SetNotifyFd(netlink_fd, SELinuxNetlinkNotify, X_NOTIFY_READ, NULL); /* Register callbacks */ ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL); diff -Nru xorg-server-hwe-16.04-1.18.4/Xext/xvdisp.c xorg-server-hwe-16.04-1.19.3/Xext/xvdisp.c --- xorg-server-hwe-16.04-1.18.4/Xext/xvdisp.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xext/xvdisp.c 2017-03-15 18:05:25.000000000 +0000 @@ -949,7 +949,6 @@ static int ProcXvShmPutImage(ClientPtr client) { - SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation); return BadImplementation; } #endif @@ -1108,7 +1107,6 @@ UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } @@ -1429,7 +1427,6 @@ UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } diff -Nru xorg-server-hwe-16.04-1.18.4/xfixes/cursor.c xorg-server-hwe-16.04-1.19.3/xfixes/cursor.c --- xorg-server-hwe-16.04-1.18.4/xfixes/cursor.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xfixes/cursor.c 2017-03-15 18:05:25.000000000 +0000 @@ -153,6 +153,7 @@ if (pCursor != CursorCurrent[pDev->id]) { CursorEventPtr e; + UpdateCurrentTimeIf(); CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { diff -Nru xorg-server-hwe-16.04-1.18.4/xfixes/Makefile.in xorg-server-hwe-16.04-1.19.3/xfixes/Makefile.in --- xorg-server-hwe-16.04-1.18.4/xfixes/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xfixes/Makefile.in 2017-03-15 18:05:46.000000000 +0000 @@ -91,9 +91,10 @@ subdir = xfixes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -354,6 +355,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -384,7 +388,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -479,6 +486,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/xfixes/select.c xorg-server-hwe-16.04-1.19.3/xfixes/select.c --- xorg-server-hwe-16.04-1.18.4/xfixes/select.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xfixes/select.c 2017-03-15 18:05:25.000000000 +0000 @@ -75,6 +75,7 @@ default: return; } + UpdateCurrentTimeIf(); for (e = selectionEvents; e; e = e->next) { if (e->selection == selection->selection && (e->eventMask & eventMask)) { xXFixesSelectionNotifyEvent ev = { diff -Nru xorg-server-hwe-16.04-1.18.4/xfixes/xfixes.c xorg-server-hwe-16.04-1.19.3/xfixes/xfixes.c --- xorg-server-hwe-16.04-1.18.4/xfixes/xfixes.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xfixes/xfixes.c 2017-03-15 18:05:25.000000000 +0000 @@ -212,23 +212,6 @@ return (*SProcXFixesVector[stuff->xfixesReqType]) (client); } -static void -XFixesClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - XFixesClientPtr pXFixesClient = GetXFixesClient(pClient); - - pXFixesClient->major_version = 0; - pXFixesClient->minor_version = 0; -} - - /*ARGSUSED*/ static void -XFixesResetProc(ExtensionEntry * extEntry) -{ - DeleteCallback(&ClientStateCallback, XFixesClientCallback, 0); -} - void XFixesExtensionInit(void) { @@ -237,14 +220,12 @@ if (!dixRegisterPrivateKey (&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XFixesClientRec))) return; - if (!AddCallback(&ClientStateCallback, XFixesClientCallback, 0)) - return; if (XFixesSelectionInit() && XFixesCursorInit() && XFixesRegionInit() && (extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents, XFixesNumberErrors, ProcXFixesDispatch, SProcXFixesDispatch, - XFixesResetProc, StandardMinorOpcode)) != 0) { + NULL, StandardMinorOpcode)) != 0) { XFixesReqCode = (unsigned char) extEntry->base; XFixesEventBase = extEntry->eventBase; XFixesErrorBase = extEntry->errorBase; diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/exevents.c xorg-server-hwe-16.04-1.19.3/Xi/exevents.c --- xorg-server-hwe-16.04-1.18.4/Xi/exevents.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/exevents.c 2017-03-15 18:05:25.000000000 +0000 @@ -661,7 +661,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, DeviceChangedEvent *dce) { - OsBlockSIGIO(); + input_lock(); /* generic feedback classes, not tied to pointer and/or keyboard */ DeepCopyFeedbackClasses(from, to); @@ -671,7 +671,7 @@ if ((dce->flags & DEVCHANGE_POINTER_EVENT)) DeepCopyPointerClasses(from, to); - OsReleaseSIGIO(); + input_unlock(); } /** @@ -1763,6 +1763,10 @@ switch (event->type) { case ET_KeyPress: + /* Don't deliver focus events (e.g. from KeymapNotify when running + * nested) to clients. */ + if (event->source_type == EVENT_SOURCE_FOCUS) + return; if (!grab && CheckDeviceGrabs(device, event, 0)) return; break; @@ -1794,15 +1798,19 @@ break; } - if (grab) - DeliverGrabbedEvent((InternalEvent *) event, device, - deactivateDeviceGrab); - else if (device->focus && !IsPointerEvent(ev)) - DeliverFocusedEvent(device, (InternalEvent *) event, - GetSpriteWindow(device)); - else - DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, - NullGrab, NullWindow, device); + /* Don't deliver focus events (e.g. from KeymapNotify when running + * nested) to clients. */ + if (event->source_type != EVENT_SOURCE_FOCUS) { + if (grab) + DeliverGrabbedEvent((InternalEvent *) event, device, + deactivateDeviceGrab); + else if (device->focus && !IsPointerEvent(ev)) + DeliverFocusedEvent(device, (InternalEvent *) event, + GetSpriteWindow(device)); + else + DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, + NullGrab, NullWindow, device); + } if (deactivateDeviceGrab == TRUE) { (*device->deviceGrab.DeactivateGrab) (device); diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/extinit.c xorg-server-hwe-16.04-1.19.3/Xi/extinit.c --- xorg-server-hwe-16.04-1.18.4/Xi/extinit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/extinit.c 2017-03-15 18:05:25.000000000 +0000 @@ -380,18 +380,6 @@ * */ -static void -XIClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - XIClientPtr pXIClient; - - pXIClient = dixLookupPrivate(&pClient->devPrivates, XIClientPrivateKey); - pXIClient->major_version = 0; - pXIClient->minor_version = 0; -} - /************************************************************************* * * ProcIDispatch - main dispatch routine for requests to this extension. @@ -406,6 +394,7 @@ if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*ProcIVector[stuff->data]) (client); } @@ -425,6 +414,7 @@ if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*SProcIVector[stuff->data]) (client); } @@ -1296,9 +1286,6 @@ (&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec))) FatalError("Cannot request private for XI.\n"); - if (!AddCallback(&ClientStateCallback, XIClientCallback, 0)) - FatalError("Failed to add callback to XI.\n"); - if (!XIBarrierInit()) FatalError("Could not initialize barriers.\n"); diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/Makefile.in xorg-server-hwe-16.04-1.19.3/Xi/Makefile.in --- xorg-server-hwe-16.04-1.18.4/Xi/Makefile.in 2016-07-19 17:27:25.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/Makefile.in 2017-03-15 18:05:41.000000000 +0000 @@ -91,9 +91,10 @@ subdir = Xi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -367,6 +368,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -397,7 +401,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -492,6 +499,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/stubs.c xorg-server-hwe-16.04-1.19.3/Xi/stubs.c --- xorg-server-hwe-16.04-1.18.4/Xi/stubs.c 2016-07-15 16:17:21.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/stubs.c 2017-03-15 18:05:25.000000000 +0000 @@ -143,3 +143,17 @@ { RemoveDevice(dev, TRUE); } + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove any traces of the input device specified in config_info. + * This is only necessary if the ddx keeps information around beyond + * the NewInputDeviceRequest/DeleteInputDeviceRequest + * + */ +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/xichangehierarchy.c xorg-server-hwe-16.04-1.19.3/Xi/xichangehierarchy.c --- xorg-server-hwe-16.04-1.18.4/Xi/xichangehierarchy.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/xichangehierarchy.c 2017-03-15 18:05:25.000000000 +0000 @@ -194,7 +194,8 @@ flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; - XIBarrierNewMasterDevice(client, ptr->id); + for (int i = 0; i < currentMaxClients; i++) + XIBarrierNewMasterDevice(clients[i], ptr->id); unwind: free(name); @@ -300,7 +301,8 @@ } } - XIBarrierRemoveMasterDevice(client, ptr->id); + for (int i = 0; i < currentMaxClients; i++) + XIBarrierRemoveMasterDevice(clients[i], ptr->id); /* disable the remove the devices, XTest devices must be done first else the sprites they rely on will be destroyed */ diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/xiproperty.c xorg-server-hwe-16.04-1.19.3/Xi/xiproperty.c --- xorg-server-hwe-16.04-1.18.4/Xi/xiproperty.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/xiproperty.c 2017-03-15 18:05:25.000000000 +0000 @@ -622,6 +622,7 @@ XIPropertyPtr prop, next; XIPropertyHandlerPtr curr_handler, next_handler; + UpdateCurrentTimeIf(); for (prop = device->properties.properties; prop; prop = next) { next = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); @@ -672,6 +673,7 @@ } if (prop) { + UpdateCurrentTimeIf(); *prev = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); XIDestroyDeviceProperty(prop); @@ -767,8 +769,10 @@ handler = dev->properties.handlers; while (handler) { if (handler->SetProperty) { + input_lock(); rc = handler->SetProperty(dev, prop->propertyName, &new_value, checkonly); + input_unlock(); if (checkonly && rc != Success) { free(new_value.data); if (add) @@ -793,9 +797,11 @@ dev->properties.properties = prop; } - if (sendevent) + if (sendevent) { + UpdateCurrentTimeIf(); send_property_event(dev, prop->propertyName, (add) ? XIPropertyCreated : XIPropertyModified); + } return Success; } diff -Nru xorg-server-hwe-16.04-1.18.4/Xi/xiquerypointer.c xorg-server-hwe-16.04-1.19.3/Xi/xiquerypointer.c --- xorg-server-hwe-16.04-1.18.4/Xi/xiquerypointer.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/Xi/xiquerypointer.c 2017-03-15 18:05:25.000000000 +0000 @@ -110,8 +110,8 @@ rc = dixLookupWindow(&pWin, stuff->win, client, DixGetAttrAccess); if (rc != Success) { - SendErrorToClient(client, IReqCode, X_XIQueryPointer, stuff->win, rc); - return Success; + client->errorValue = stuff->win; + return rc; } if (pDev->valuator->motionHintWindow) diff -Nru xorg-server-hwe-16.04-1.18.4/xkb/Makefile.in xorg-server-hwe-16.04-1.19.3/xkb/Makefile.in --- xorg-server-hwe-16.04-1.18.4/xkb/Makefile.in 2016-07-19 17:27:31.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xkb/Makefile.in 2017-03-15 18:05:46.000000000 +0000 @@ -92,9 +92,10 @@ subdir = xkb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_xkbcompiled_DATA) \ @@ -394,6 +395,9 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -424,7 +428,10 @@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -519,6 +526,7 @@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru xorg-server-hwe-16.04-1.18.4/xkb/maprules.c xorg-server-hwe-16.04-1.19.3/xkb/maprules.c --- xorg-server-hwe-16.04-1.18.4/xkb/maprules.c 2016-07-15 16:18:11.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xkb/maprules.c 2017-03-15 18:05:25.000000000 +0000 @@ -578,7 +578,7 @@ Apply(const char *src, char **dst) { if (src) { - if (*src == '+' || *src == '!') { + if (*src == '+' || *src == '|') { *dst = _Concat(*dst, src); } else { diff -Nru xorg-server-hwe-16.04-1.18.4/xkb/xkbAccessX.c xorg-server-hwe-16.04-1.19.3/xkb/xkbAccessX.c --- xorg-server-hwe-16.04-1.18.4/xkb/xkbAccessX.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xkb/xkbAccessX.c 2017-03-15 18:05:25.000000000 +0000 @@ -89,6 +89,7 @@ xkbi->repeatKeyTimer = NULL; xkbi->krgTimer = NULL; xkbi->beepTimer = NULL; + xkbi->checkRepeat = NULL; ctrls->repeat_delay = XkbDfltRepeatDelay; ctrls->repeat_interval = XkbDfltRepeatInterval; ctrls->debounce_delay = 300; @@ -126,7 +127,7 @@ { DeviceEvent event; - init_device_event(&event, keybd, GetTimeInMillis()); + init_device_event(&event, keybd, GetTimeInMillis(), EVENT_SOURCE_NORMAL); event.type = type; event.detail.key = keyCode; event.key_repeat = isRepeat; @@ -317,7 +318,8 @@ if (xkbi->repeatKey == 0) return 0; - AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE); + if (xkbi->checkRepeat == NULL || xkbi->checkRepeat (dev, xkbi, xkbi->repeatKey)) + AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE); return xkbi->desc->ctrls->repeat_interval; } @@ -618,6 +620,7 @@ if (ctrls->enabled_ctrls & XkbSlowKeysMask) { xkbAccessXNotify ev; unsigned beep_type; + unsigned mask; ev.keycode = key; ev.slowKeysDelay = ctrls->slow_keys_delay; @@ -625,14 +628,16 @@ if (BitIsOn(keybd->key->down, key) || (xkbi->mouseKey == key)) { ev.detail = XkbAXN_SKRelease; beep_type = _BEEP_SLOW_RELEASE; + mask = XkbAX_SKReleaseFBMask; } else { ev.detail = XkbAXN_SKReject; beep_type = _BEEP_SLOW_REJECT; + mask = XkbAX_SKRejectFBMask; ignoreKeyEvent = TRUE; } XkbSendAccessXNotify(keybd, &ev); - if (XkbAX_NeedFeedback(ctrls, XkbAX_SKRejectFBMask)) { + if (XkbAX_NeedFeedback(ctrls, mask)) { XkbDDXAccessXBeep(keybd, beep_type, XkbSlowKeysMask); } if (xkbi->slowKey == key) diff -Nru xorg-server-hwe-16.04-1.18.4/xkb/xkbActions.c xorg-server-hwe-16.04-1.19.3/xkb/xkbActions.c --- xorg-server-hwe-16.04-1.18.4/xkb/xkbActions.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xkb/xkbActions.c 2017-03-15 18:05:25.000000000 +0000 @@ -1199,6 +1199,106 @@ } } +static void +XkbActionGetFilter(DeviceIntPtr dev, DeviceEvent *event, KeyCode key, + XkbAction *act, int *sendEvent) +{ + XkbSrvInfoPtr xkbi = dev->key->xkbInfo; + XkbFilterPtr filter; + + /* For focus events, we only want to run actions which update our state to + * (hopefully vaguely kinda) match that of the host server, rather than + * actually execute anything. For example, if we enter our VT with + * Ctrl+Alt+Backspace held down, we don't want to terminate our server + * immediately, but we _do_ want Ctrl+Alt to be latched down, so if + * Backspace is released and then pressed again, the server will terminate. + * + * This is pretty flaky, and we should in fact inherit the complete state + * from the host server. There are some state combinations that we cannot + * express by running the state machine over every key, e.g. if AltGr+Shift + * generates a different state to Shift+AltGr. */ + if (event->source_type == EVENT_SOURCE_FOCUS) { + switch (act->type) { + case XkbSA_SetMods: + case XkbSA_SetGroup: + case XkbSA_LatchMods: + case XkbSA_LatchGroup: + case XkbSA_LockMods: + case XkbSA_LockGroup: + break; + default: + *sendEvent = 1; + return; + } + } + + switch (act->type) { + case XkbSA_SetMods: + case XkbSA_SetGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterSetState(xkbi, filter, key, act); + break; + case XkbSA_LatchMods: + case XkbSA_LatchGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterLatchState(xkbi, filter, key, act); + break; + case XkbSA_LockMods: + case XkbSA_LockGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterLockState(xkbi, filter, key, act); + break; + case XkbSA_ISOLock: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterISOLock(xkbi, filter, key, act); + break; + case XkbSA_MovePtr: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterPointerMove(xkbi, filter, key, act); + break; + case XkbSA_PtrBtn: + case XkbSA_LockPtrBtn: + case XkbSA_SetPtrDflt: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterPointerBtn(xkbi, filter, key, act); + break; + case XkbSA_Terminate: + *sendEvent = XkbDDXTerminateServer(dev, key, act); + break; + case XkbSA_SwitchScreen: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterSwitchScreen(xkbi, filter, key, act); + break; + case XkbSA_SetControls: + case XkbSA_LockControls: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterControls(xkbi, filter, key, act); + break; + case XkbSA_ActionMessage: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterActionMessage(xkbi, filter, key, act); + break; + case XkbSA_RedirectKey: + filter = _XkbNextFreeFilter(xkbi); + /* redirect actions must create a new DeviceEvent. The + * source device id for this event cannot be obtained from + * xkbi, so we pass it here explicitly. The field deviceid + * equals to xkbi->device->id. */ + filter->priv = event->sourceid; + *sendEvent = _XkbFilterRedirectKey(xkbi, filter, key, act); + break; + case XkbSA_DeviceBtn: + case XkbSA_LockDeviceBtn: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterDeviceBtn(xkbi, filter, key, act); + break; + case XkbSA_XFree86Private: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterXF86Private(xkbi, filter, key, act); + break; + } +} + void XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event) { @@ -1208,7 +1308,6 @@ int sendEvent; Bool genStateNotify; XkbAction act; - XkbFilterPtr filter; Bool keyEvent; Bool pressEvent; ProcessInputProc backupproc; @@ -1236,74 +1335,10 @@ act = XkbGetButtonAction(kbd, dev, key); key |= BTN_ACT_FLAG; } + sendEvent = _XkbApplyFilters(xkbi, key, &act); - if (sendEvent) { - switch (act.type) { - case XkbSA_SetMods: - case XkbSA_SetGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterSetState(xkbi, filter, key, &act); - break; - case XkbSA_LatchMods: - case XkbSA_LatchGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterLatchState(xkbi, filter, key, &act); - break; - case XkbSA_LockMods: - case XkbSA_LockGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterLockState(xkbi, filter, key, &act); - break; - case XkbSA_ISOLock: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterISOLock(xkbi, filter, key, &act); - break; - case XkbSA_MovePtr: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterPointerMove(xkbi, filter, key, &act); - break; - case XkbSA_PtrBtn: - case XkbSA_LockPtrBtn: - case XkbSA_SetPtrDflt: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterPointerBtn(xkbi, filter, key, &act); - break; - case XkbSA_Terminate: - sendEvent = XkbDDXTerminateServer(dev, key, &act); - break; - case XkbSA_SwitchScreen: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterSwitchScreen(xkbi, filter, key, &act); - break; - case XkbSA_SetControls: - case XkbSA_LockControls: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterControls(xkbi, filter, key, &act); - break; - case XkbSA_ActionMessage: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterActionMessage(xkbi, filter, key, &act); - break; - case XkbSA_RedirectKey: - filter = _XkbNextFreeFilter(xkbi); - /* redirect actions must create a new DeviceEvent. The - * source device id for this event cannot be obtained from - * xkbi, so we pass it here explicitly. The field deviceid - * equals to xkbi->device->id. */ - filter->priv = event->sourceid; - sendEvent = _XkbFilterRedirectKey(xkbi, filter, key, &act); - break; - case XkbSA_DeviceBtn: - case XkbSA_LockDeviceBtn: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterDeviceBtn(xkbi, filter, key, &act); - break; - case XkbSA_XFree86Private: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterXF86Private(xkbi, filter, key, &act); - break; - } - } + if (sendEvent) + XkbActionGetFilter(dev, event, key, &act, &sendEvent); } else { if (!keyEvent) @@ -1492,7 +1527,7 @@ return; events = InitEventList(GetMaximumEventsNum() + 1); - OsBlockSignals(); + input_lock(); pScreen = miPointerGetScreen(ptr); saveWait = miPointerSetWaitForUpdate(pScreen, FALSE); nevents = GetPointerEvents(events, ptr, type, button, flags, mask); @@ -1500,13 +1535,12 @@ UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents); miPointerSetWaitForUpdate(pScreen, saveWait); - OsReleaseSignals(); for (i = 0; i < nevents; i++) mieqProcessDeviceEvent(ptr, &events[i], NULL); + input_unlock(); FreeEventList(events, GetMaximumEventsNum()); - } static void diff -Nru xorg-server-hwe-16.04-1.18.4/xkb/xkbInit.c xorg-server-hwe-16.04-1.19.3/xkb/xkbInit.c --- xorg-server-hwe-16.04-1.18.4/xkb/xkbInit.c 2016-07-19 17:07:29.000000000 +0000 +++ xorg-server-hwe-16.04-1.19.3/xkb/xkbInit.c 2017-03-15 18:05:25.000000000 +0000 @@ -60,7 +60,7 @@ #define LED_NUM 5 #define PHYS_LEDS 0x1f #else -#ifdef sun +#ifdef __sun #define LED_NUM 1 #define LED_SCROLL 2 #define LED_COMPOSE 3