xserver-multidpi/present
Michel Dänzer ff562c9f98 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 <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 25eca80265)
2016-01-27 09:55:07 -05:00
..
Makefile.am present: Add Present extension 2013-10-31 16:59:18 -07:00
present.c present: Handle wraparound when comparing MSC values 2016-01-27 09:55:07 -05:00
present.h glx/present: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap 2014-09-11 18:19:41 -07:00
present_event.c present: static cleanup 2015-07-08 16:40:57 -04:00
present_fake.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
present_fence.c present: Block for wait_fence in present_execute 2013-11-20 13:12:30 -08:00
present_notify.c present: Add Present extension 2013-10-31 16:59:18 -07:00
present_priv.h present: When cancelling a pending synchronous flip, requeue it 2015-12-09 10:45:49 -05:00
present_request.c present: static cleanup 2015-07-08 16:40:57 -04:00
present_screen.c present: Make window MSC offset 0 initially 2014-07-31 00:03:53 -07:00
presentext.h present: Add Present extension 2013-10-31 16:59:18 -07:00