summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlija Hadzic <ilijahadzic@gmail.com>2013-05-08 22:39:43 -0400
committerMichel Dänzer <michel@daenzer.net>2013-05-29 15:27:13 +0200
commite40d5390b3efdea3e02267413350410d8e6a2970 (patch)
treeef8f4ade9f3bf5584814ffc34699b86175546000
parentffaa5abf207415159cdb28e90da49b95f497ef61 (diff)
DRI2: hook up vblank extrapolation to schedule_swap
This patch hooks up swap-scheduling function with vblank-extrapolation function. Rather than waiting for fixed time, we calculate exactly how much we should wait and what we should update target_msc to using radeon_dri2_extrapolate_msc_delay helper function and schedule the swap completion using DIX's timer facility. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_dri2.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index d113486a..c6f271e3 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -1258,14 +1258,16 @@ static int radeon_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
}
/*
- * CRTC is in DPMS off state, fallback to blit, but pace the
- * application at the rate that roughly approximates the
- * nominal frame rate of the relevant CRTC
+ * CRTC is in DPMS off state, fallback to blit, but calculate
+ * wait time from current time, target_msc and last vblank
+ * time/sequence when CRTC was turned off
*/
if (!radeon_crtc_is_enabled(crtc)) {
- TimerSet(NULL, 0, FALLBACK_SWAP_DELAY, radeon_dri2_deferred_swap,
- swap_info);
- *target_msc = 0;
+ CARD32 delay;
+ delay = radeon_dri2_extrapolate_msc_delay(crtc, target_msc,
+ divisor, remainder);
+ swap_info->frame = *target_msc;
+ TimerSet(NULL, 0, delay, radeon_dri2_deferred_swap, swap_info);
return TRUE;
}