commit d88937ba8354d6a4e0be2a398037443146701ddc
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 15 13:44:05 2017 -0400

    xserver 1.19.3
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit b258ed457d8f22cfba8a45b35a9be9b53fd37e1e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 17 08:18:52 2017 +0000

    os: Fix iteration over busfaults
    
    Fixes a regression from
    
    commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a
    Author: Keith Packard <keithp@keithp.com>
    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 <chris@chris-wilson.co.uk>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit acdb5bf2de57c0080d2a6e730c788a0a428e13dc)

commit 7c4fab2f1f411b6f7d7adc76271fca7c29365ac4
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
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 <ajax@redhat.com>
    (cherry picked from commit ac15d4cecca377c5c31ab852c39bbd554ca48fe2)

commit fbb46e0be897ffe78b731a2456673b4cbb73b2be
Author: Dr.-Ing. Dieter Jurzitza <dieter.jurzitza@t-online.de>
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 <sndirsch@suse.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit d8161aeb50891ae10c5656487ce8f982deed5f9f)
    (cherry picked from commit 0c1574d9882a91b2c1a046bf4ac5a9b138a37965)

commit 18fcb66688057f5676952e2535d4bb9942371199
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <mark.blakeney@bullet-systems.net>
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 937527f9798d573ec82c2c508821899c229c018f)

commit d402b86b4561eb2580421de91d977a35abe88190
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
    Reviewed-by: Rui Matos <tiagomatos@gmail.com>
    (cherry picked from commit d4b7e0eaa4b2e97ce1dec653a2ae7d9621fe1431)

commit db1326cd6625747e4036e6cdc75bc7a0e1b0426b
Author: Qiang Yu <Qiang.Yu@amd.com>
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 <Qiang.Yu@amd.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5)

commit 1097bc9c184db4c722d5a8d2c5a4c0da9cdc70f5
Author: Chris Wilson <chris@chris-wilson.co.uk>
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 <ajax@redhat.com>

commit 0ec92f06d4b3bad2e62da24ee7fb64fc88a75820
Author: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>

commit f23e65f96365706c69fa781b2c6cbf3203619c9f
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Mar 2 17:53:04 2017 -0500

    xserver 1.19.2, no, really
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit 96d4df934bb4397a251d7d1f2dc0e1296c2e9bb3
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Mar 2 15:07:00 2017 -0500

    xserver 1.19.2
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit f4ff7b6b559c3ebf7ec1156d170b3daa0618eec2
Author: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>
    (cherry picked from commit 5c44169caed811e59a65ba346de1cadb46d266ec)

commit 1aa40b96e2f099eabfeef66e77fff36dbd377aa0
Author: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>
Date:   Thu Mar 2 15:07:00 2017 -0500

    xserver 1.19.2
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit e4dd73b242522942d9a5f1c9cada92321710a682
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit fe5c340046c8cf755b92763a49b2dc475e856a76)

commit c84f5c3dd19ae114da4eb3441b3e4e3a29f195df
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 8c9909a99292b2fb4a86de694bb0029f61e35662)

commit 94c3454d9fdbcefb01042c5c9d88468d86dd4725
Author: Matthieu Herrb <matthieu@herrb.eu>
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 <ajax@redhat.com>
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    (cherry picked from commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e)

commit b0298c02f0383760be899448fa666d0ea56f5d79
Author: Matthieu Herrb <matthieu@herrb.eu>
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 <matthieu@herrb.eu>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit 2855f759b1e7bf7f5e57cac36c1f0d0e5ac1a683)

commit ab15f65fe5d6d50e705c1064a6a5c1a0c2a8e045
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Tue Feb 28 19:18:43 2017 +0100

    Use arc4random_buf(3) if available to generate cookies.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    (cherry picked from commit 957e8db38f27932d353e86e9aa69cf16778b18f1)

commit 3f61c7a09b220805ee6778f4bf2f429e3df8e37a
Author: Matthieu Herrb <matthieu@herrb.eu>
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 <matthieu@herrb.eu>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c)

commit b5c98aa6779b97882246b03c5dea646bd1355991
Author: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
    Tested-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit 1b12249fd6d4d3b566043d556503f3f625b9b4ba)

commit 04c72d3c30623e360fd0bd37ed559915b93467f4
Author: Michel Dänzer <michel.daenzer@amd.com>
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 <michel.daenzer@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 38696ea56854e055c31bd2730adfc7c39aa115b0)

commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Feb 1 18:35:57 2017 +0900

    present: Allow flipping with PRIME slave outputs
    
    Works fine now.
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 542d9f6807ac06b70f564ccab10af69fa21a1221)

commit 10f8cf3572297764c6b50ac1f01b3ee195b1a453
Author: Michel Dänzer <michel.daenzer@amd.com>
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 <alexander.deucher@amd.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit b5b292896f647c85f03f53b20b2f03c0e94de428)
    (cherry picked from commit a6566f9e4dbf9ea9568a14e22cb5d004e10dbd4d)

commit e2243e5b805df387cb3881b2298bffaac4f02942
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 86463981361064dd0352ec215abf1696ce7fc5ea)

commit ada5328290f444e3fc0e6a05557d5963dec626e5
Author: Svitozar Cherepii <razotivs@gmail.com>
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 <razotivs@gmail.com>
    Tested-by: Svitozar Cherepii <razotivs@gmail.com>
    Acked-by: Olivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit 1c78bec9ca3cd1975a38bf5ebdba7dea65b309ab)

commit abf3bc68db579eb524c2eb5786daa5a00957a2f8
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit afeace27d3818274b75d59375771dc964d2f56bb)

commit fd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 058809c43ec578a407cf40d4c3e54a42503e3562)

commit 9a9c6af22e0f0136b11d7c19ce06c48e720a9ca4
Author: Chris Wilson <chris@chris-wilson.co.uk>
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 <chris@chris-wilson.co.uk>
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 <chris@chris-wilson.co.uk>
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 <ajax@redhat.com>
Date:   Wed Jan 11 16:15:57 2017 -0500

    xserver 1.19.1
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit 82dcb68a8782d0cce6e6ce1a375cda05c91fe8c3
Author: Keith Packard <keithp@keithp.com>
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 <ajax@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 785053d033e73d2deb0ded4b97eabfd881991978)

commit 14516988e095ed748e738c14a87c3656006846f7
Author: Qiang Yu <Qiang.Yu@amd.com>
Date:   Tue Jan 10 18:51:55 2017 +0800

    randr: fix xserver crash when xrandr setprovideroutputsource
    
    xrandr --setprovideroutputsource <screen> <gpu screen>
    Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU:
    Assertion `new->isGPU' failed.
    
    GPUScreen is not allowed to be sink output.
    
    Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6)

commit 3381e2c26b2ac40b1dd909439bf72559b80d0d86
Author: Qiang Yu <Qiang.Yu@amd.com>
Date:   Tue Jan 10 18:51:54 2017 +0800

    xfree86: fix wrong usage of xf86optionListMerge
    
    Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 1012510620de7dadd0ab18b19a8e11facd884601)

commit 27a2772cf3a1bcd656efdf653a7504597911dbc4
Author: Michel Dänzer <michel.daenzer@amd.com>
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 <alexander.deucher@amd.com>
    (cherry picked from commit e473b2bc016adacfe3fa47fdf6a8ce9f8cddff62)

commit 943e3cbeb0139d719589fc07c4f471195e4efe0a
Author: Kai-Heng Feng <kai.heng.feng@canonical.com>
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 <kai.heng.feng@canonical.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 9874f73e88678c9eacbcba05e52336fc63a32712)

commit cb3057da2254f9b6434a9c40486c72865cd1ab5e
Author: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>

commit db03742cd33d6d54834bb138886a4f84bc452a85
Author: Michal Srb <msrb@suse.com>
Date:   Mon Dec 12 17:45:22 2016 +0200

    xinerama: Swap the response in RRXineramaWriteMonitor
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>

commit 862c1c43c10eda955db1440cc72ff0387e24a35f
Author: Hans De Goede <hdegoede@redhat.com>
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 <eric@anholt.net>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 05e19644250698aa126a60bc671e85425df784d1)

commit 8790bd993ac2f8f8dd54a1946312e6b6dc929e00
Author: Mihail Konev <k.mvc@ya.ru>
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 <ajax@redhat.com>
    Signed-off-by: Mihail Konev <k.mvc@ya.ru>
    (cherry picked from commit 5b74e260e009d8bdf26433724495802b85cce7c3)

commit 8cf47472bff1d5ca3de6ff83a80f0d2820c3fb93
Author: Ben Crocker <bcrocker@redhat.com>
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 <ajax@redhat.com>
    Signed-off-by: Ben Crocker <bcrocker@redhat.com>
    (cherry picked from commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5)

commit 06a3e7ef3bf9a907f1fba84a3601870a5697f657
Author: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
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 <ajax@redhat.com>
    Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
    (cherry picked from commit b365c5d16894a259dbf29db4ca2640d8ed768063)

commit 543287e60af5e9d91b5fc7e4a42e51eafa63db21
Author: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit f31875510d818ba517f082e124adb294db906e51)

commit c24c9cc956038a61922f8b11ee68b8b0fc6b9f83
Author: Hans de Goede <hdegoede@redhat.com>
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 <nmahale@nvidia.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c)

commit 26132f57ee6fae9376955e7990ac2fbad5b49fac
Author: Hans de Goede <hdegoede@redhat.com>
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 <nmahale@nvidia.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1)

commit 6c51845e6b0f313a90e4375f2821f1da9cc53014
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Tested-by: Vít Ondruch <vondruch@redhat.com>
    Tested-by: Satish Balay <balay@fastmail.fm>
    Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
    (cherry picked from commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b)

commit b711efb05714bf3d0a102c717a05cde4fefdae3f
Author: Olivier Fourdan <ofourdan@redhat.com>
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 <ofourdan@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit f43207c1c4a8487600cf3ea116c10437417c861b)

commit 201ff45c2d7e6c7d73fd29d28871bb8b944074be
Author: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
    Reviewed-by: Daniel Stone <daniels@collabora.com>
    (cherry picked from commit d6a6e1d6abb110ff00ad31b94cd29d92ca7c71a5)

commit 738c17b7ef4c70ad00c7bc01cf64edb770dda840
Author: Rui Matos <tiagomatos@gmail.com>
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 <tiagomatos@gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 5611585b87ce48428a66f98ece319a083f55d205)

commit cd8f43e1b06aee8500548a94e3743cf153591683
Author: Rhys Kidd <rhyskidd@gmail.com>
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 <keithp@keithp.com>
    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 <keithp@keithp.com>
        Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    
    Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit cf8860786c3e301486cd2853bc82977ba75e6b17)

commit d6da2086951693e047fdd22b0d21c539ea1bb1e1
Author: Adam Jackson <ajax@redhat.com>
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.
