diff options
author | Jonathan Wicks <jwicks@codeaurora.org> | 2016-01-21 15:45:18 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:19:46 -0700 |
commit | e80d2278fb81871b695b42c3fab03551b9174153 (patch) | |
tree | 05334b6ff59182871e85df99dc381298eb84c59a /drivers/gpu/msm/adreno_ringbuffer.c | |
parent | 60bca9adbcaaab05f6903b7d74d97ece527090ba (diff) |
msm: kgsl: Add a cmdbatch profiling flag to get time since boot
Add a new cmdbatch profiling flag that populates the seconds
and nanosecond fields of the cmdbatch structure with the time
since boot instead of the wall time.
CRs-Fixed: 968114
Change-Id: I4e752d5237a74192b3ea9cc125c11bae574c1b36
Signed-off-by: Jonathan Wicks <jwicks@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/adreno_ringbuffer.c')
-rw-r--r-- | drivers/gpu/msm/adreno_ringbuffer.c | 18 |
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; } } |