summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-15 16:50:24 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-09-15 16:50:24 +0900
commitb95ddb39c1154b3231cefd4e99046e7fb89f1e99 (patch)
treef5e4a46e4cceeb81534ea61718a975ff2798eac9
parent6cca7d529c3bb07bc78a49ae5085028ac743fe1d (diff)
DRI2: Add interpolated_vblanks in radeon_dri2_get_crtc_msc
We need that in radeon_dri2_drawable_crtc as well for priv->vblank_delta to work as intended. radeon_dri2_get_msc was already doing this. Fixes hangs in some cases when using VDPAU via DRI2 and moving the window between CRTCs. (Ported from amdgpu commit abd1a7901c95e4bc78415cf1b7923623b9177152) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit 11cc6843aa3b745aa1361f1a65e465e16696b914)
-rw-r--r--src/radeon_dri2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index bb8d1f8e..19c3d6a3 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -516,10 +516,11 @@ static uint32_t radeon_get_msc_delta(DrawablePtr pDraw, xf86CrtcPtr crtc)
*/
static Bool radeon_dri2_get_crtc_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc)
{
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
if (!radeon_crtc_is_enabled(crtc) ||
drmmode_crtc_get_ust_msc(crtc, ust, msc) != Success) {
/* CRTC is not running, extrapolate MSC and timestamp */
- drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
ScrnInfoPtr scrn = crtc->scrn;
RADEONInfoPtr info = RADEONPTR(scrn);
CARD64 now, delta_t, delta_seq;
@@ -544,6 +545,8 @@ static Bool radeon_dri2_get_crtc_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc)
*msc += delta_seq;
}
+ *msc += drmmode_crtc->interpolated_vblanks;
+
return TRUE;
}
@@ -991,7 +994,8 @@ static int radeon_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
if (!radeon_dri2_get_crtc_msc(crtc, ust, msc))
return FALSE;
- *msc += radeon_get_msc_delta(draw, crtc);
+ if (draw && draw->type == DRAWABLE_WINDOW)
+ *msc += get_dri2_window_priv((WindowPtr)draw)->vblank_delta;
*msc &= 0xffffffff;
return TRUE;
}