diff options
author | Marek Olšák <[email protected]> | 2017-02-11 20:51:41 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-14 21:47:51 +0100 |
commit | 626e4ef18f1ffc521ab3e6faef3173abedd52dbf (patch) | |
tree | 1e337ce4a96f6c073864d7c7e85249c2808b8830 /src/gallium/auxiliary/util/u_queue.c | |
parent | 6c61a8bfc6cb30e30b806a30f30c0e9b01b0d673 (diff) |
gallium/u_queue: add util_queue_get_thread_time_nano
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_queue.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c index 838464fb9a6..4da5d8e9f8c 100644 --- a/src/gallium/auxiliary/util/u_queue.c +++ b/src/gallium/auxiliary/util/u_queue.c @@ -242,3 +242,13 @@ util_queue_add_job(struct util_queue *queue, pipe_condvar_signal(queue->has_queued_cond); pipe_mutex_unlock(queue->lock); } + +int64_t +util_queue_get_thread_time_nano(struct util_queue *queue, unsigned thread_index) +{ + /* Allow some flexibility by not raising an error. */ + if (thread_index >= queue->num_threads) + return 0; + + return pipe_thread_get_time_nano(queue->threads[thread_index]); +} |