#include "pipe/p_winsys.h"
#include "u_timed_winsys.h"
#include "util/u_memory.h"
-#include <sys/time.h>
-
+#include "util/u_time.h"
struct timed_winsys {
struct pipe_winsys base;
struct pipe_winsys *backend;
- unsigned long long last_dump;
+ uint64_t last_dump;
struct {
const char *name_key;
double total;
}
-static unsigned long long get_time( void )
-{
- struct timeval systime;
- gettimeofday( &systime, NULL );
- return (((unsigned long long) systime.tv_sec) * 1000000LL) + systime.tv_usec;
-}
-
-
-static unsigned long long time_start( void )
+static uint64_t time_start( void )
{
- return get_time();
+ return util_time_micros();
}
const char *name )
{
struct timed_winsys *tws = timed_winsys(winsys);
- unsigned long long endval = get_time();
+ uint64_t endval = util_time_micros();
double elapsed = (endval - startval)/1000.0;
if (endval - startval > 1000LL)
unsigned size )
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
struct pipe_buffer *buf = backend->buffer_create( backend, alignment, usage, size );
unsigned bytes)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes );
unsigned flags)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
void *map = backend->buffer_map( backend, buf, flags );
struct pipe_buffer *buf)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
backend->buffer_unmap( backend, buf );
struct pipe_buffer *buf)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
backend->buffer_destroy( backend, buf );
void *context_private)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
backend->flush_frontbuffer( backend, surf, context_private );
timed_surface_alloc(struct pipe_winsys *winsys)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
struct pipe_surface *surf = backend->surface_alloc( backend );
unsigned tex_usage)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
int ret = backend->surface_alloc_storage( backend, surf, width, height,
format, flags, tex_usage );
timed_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
backend->surface_release( backend, s );
timed_get_name( struct pipe_winsys *winsys )
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
const char *ret = backend->get_name( backend );
struct pipe_fence_handle *fence)
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
backend->fence_reference( backend, ptr, fence );
unsigned flag )
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
int ret = backend->fence_signalled( backend, fence, flag );
unsigned flag )
{
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- unsigned long long start = time_start();
+ uint64_t start = time_start();
int ret = backend->fence_finish( backend, fence, flag );