summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-03-01 12:42:20 +0100
committerChristian König <[email protected]>2012-03-05 16:51:25 +0100
commit1d0c357a9733238985cbe029b174173ef927ac70 (patch)
tree02b715262d8db5e428db453986d6827476afcd8f /src/gallium/state_trackers/vdpau
parent4f5469f8d65fdeafe5b8410bbe20292b476b1ac9 (diff)
st/vdpau: implement support for high-precision output timing
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c13
1 files changed, 3 insertions, 10 deletions
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 <stdio.h>
-#include <time.h>
-#include <sys/timeb.h>
-
#include <vdpau/vdpau.h>
#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);
}
/**