From 1d0c357a9733238985cbe029b174173ef927ac70 Mon Sep 17 00:00:00 2001 From: Christian König Date: Thu, 1 Mar 2012 12:42:20 +0100 Subject: st/vdpau: implement support for high-precision output timing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/presentation.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/gallium/state_trackers/vdpau/presentation.c') diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index 397bd372577..cd00e54a988 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -26,9 +26,6 @@ **************************************************************************/ #include -#include -#include - #include #include "util/u_debug.h" @@ -169,7 +166,6 @@ vlVdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue, VdpTime *current_time) { vlVdpPresentationQueue *pq; - struct timespec ts; if (!current_time) return VDP_STATUS_INVALID_POINTER; @@ -178,8 +174,7 @@ vlVdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue, if (!pq) return VDP_STATUS_INVALID_HANDLE; - clock_gettime(CLOCK_REALTIME, &ts); - *current_time = (uint64_t)ts.tv_sec * 1000000000LL + (uint64_t)ts.tv_nsec; + *current_time = vl_screen_get_timestamp(pq->device->vscreen, pq->drawable); return VDP_STATUS_OK; } @@ -260,6 +255,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, vl_compositor_render(cstate, compositor, surf_draw, dirty_area); } + vl_screen_set_next_timestamp(pq->device->vscreen, earliest_presentation_time); pipe->screen->flush_frontbuffer ( pipe->screen, tex, 0, 0, @@ -316,10 +312,7 @@ vlVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_qu screen->fence_finish(screen, surf->fence, 0); } - // We actually need to query the timestamp of the last VSYNC event from the hardware - vlVdpPresentationQueueGetTime(presentation_queue, first_presentation_time); - - return VDP_STATUS_OK; + return vlVdpPresentationQueueGetTime(presentation_queue, first_presentation_time); } /** -- cgit v1.2.3