softpipe: Use os_time_get_nano() everywhere.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 8 Dec 2012 11:45:58 +0000 (11:45 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 11 Dec 2012 16:45:01 +0000 (16:45 +0000)
src/gallium/drivers/softpipe/sp_query.c
src/gallium/drivers/softpipe/sp_screen.c

index c173736d71484016d44cf4ebfb04540d096c8e31..2dd82c81d6fd76ebedb575c3b14cdc607e28c19f 100644 (file)
@@ -91,7 +91,7 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
-      sq->start = 1000*os_time_get();
+      sq->start = os_time_get_nano();
       break;
    case PIPE_QUERY_SO_STATISTICS:
       sq->so.primitives_storage_needed = 0;
@@ -131,7 +131,7 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
       /* fall through */
    case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
-      sq->end = 1000*os_time_get();
+      sq->end = os_time_get_nano();
       break;
    case PIPE_QUERY_SO_STATISTICS:
       sq->so.primitives_storage_needed =
@@ -172,8 +172,8 @@ softpipe_get_query_result(struct pipe_context *pipe,
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT: {
       struct pipe_query_data_timestamp_disjoint td;
-      /*os_get_time is in microseconds*/
-      td.frequency = 1000000;
+      /* os_get_time_nano return nanoseconds */
+      td.frequency = UINT64_C(1000000000);
       td.disjoint = sq->end != sq->start;
       memcpy(vresult, &td,
              sizeof(struct pipe_query_data_timestamp_disjoint));
index 909fa1c98b2c5f25deb3f1db5d80ed8154e32330..f3448142959305c5022648f7a9350577bdd10618 100644 (file)
@@ -366,7 +366,7 @@ softpipe_flush_frontbuffer(struct pipe_screen *_screen,
 static uint64_t
 softpipe_get_timestamp(struct pipe_screen *_screen)
 {
-   return os_time_get()*1000;
+   return os_time_get_nano();
 }
 
 /**