[Mesa-dev] [PATCH 1/4] softpipe: Use os_time_get_nano() everywhere.
Dave Airlie
airlied at gmail.com
Wed Dec 19 15:34:09 PST 2012
Looks fine to me,
Reviewed-by: Dave Airlie <airlied at redhat.com>
I'll let Marek look at the timer query stuff, he has a better idea how
the drivers use it.
On Thu, Dec 20, 2012 at 9:26 AM, <jfonseca at vmware.com> wrote:
> From: José Fonseca <jose.r.fonseca at gmail.com>
>
> ---
> src/gallium/drivers/softpipe/sp_query.c | 8 ++++----
> src/gallium/drivers/softpipe/sp_screen.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
> index c173736..3981325 100644
> --- a/src/gallium/drivers/softpipe/sp_query.c
> +++ b/src/gallium/drivers/softpipe/sp_query.c
> @@ -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_time_get_nano return nanoseconds */
> + td.frequency = UINT64_C(1000000000);
> td.disjoint = sq->end != sq->start;
> memcpy(vresult, &td,
> sizeof(struct pipe_query_data_timestamp_disjoint));
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
> index 909fa1c..f344814 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -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();
> }
>
> /**
> --
> 1.7.9.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list