summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm/adreno_ringbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/msm/adreno_ringbuffer.c')
-rw-r--r--drivers/gpu/msm/adreno_ringbuffer.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/msm/adreno_ringbuffer.c b/drivers/gpu/msm/adreno_ringbuffer.c
index 32bcfd4d8178..42fb4659c1f2 100644
--- a/drivers/gpu/msm/adreno_ringbuffer.c
+++ b/drivers/gpu/msm/adreno_ringbuffer.c
@@ -1142,8 +1142,22 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
/* Put the timevalues in the profiling buffer */
if (cmdbatch_user_profiling) {
- profile_buffer->wall_clock_s = time->utime.tv_sec;
- profile_buffer->wall_clock_ns = time->utime.tv_nsec;
+ /*
+ * Return kernel clock time to the the client
+ * if requested
+ */
+ if (cmdbatch->flags & KGSL_CMDBATCH_PROFILING_KTIME) {
+ uint64_t secs = time->ktime;
+
+ profile_buffer->wall_clock_ns =
+ do_div(secs, NSEC_PER_SEC);
+ profile_buffer->wall_clock_s = secs;
+ } else {
+ profile_buffer->wall_clock_s =
+ time->utime.tv_sec;
+ profile_buffer->wall_clock_ns =
+ time->utime.tv_nsec;
+ }
profile_buffer->gpu_ticks_queued = time->ticks;
}
}