Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 731efad8 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: use the wall clock for the user profiling buffer



Use getnstimeofday() to get the current wall clock value to return
to the user in the cmdbatch profiling buffer.  This lets them match
up the submit time with gettimeofday() on the user side.

CRs-fixed: 731844
Change-Id: Ic0dedbadac053cc5c97806465760e2fc0ec69d34
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 52b472e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -523,7 +523,7 @@ static int sendcmd(struct adreno_device *adreno_dev,
		return ret;
	}

	secs = time.clock;
	secs = time.ktime;
	nsecs = do_div(secs, 1000000000);

	trace_adreno_cmdbatch_submitted(cmdbatch, (int) dispatcher->inflight,
+7 −7
Original line number Diff line number Diff line
@@ -100,7 +100,11 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb,
		else
			time->ticks = 0;

		time->clock = local_clock();
		/* Get the kernel clock for time since boot */
		time->ktime = local_clock();

		/* Get the timeofday for the wall time (for the user) */
		getnstimeofday(&time->utime);

		local_irq_restore(flags);
	}
@@ -1506,12 +1510,8 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,

	/* Put the timevalues in the profiling buffer */
	if (cmdbatch_user_profiling) {
		uint64_t secs;
		unsigned long nsecs;
		secs = time->clock;
		nsecs = do_div(secs, 1000000000);
		profile_buffer->wall_clock_s = secs;
		profile_buffer->wall_clock_ns = nsecs;
		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;
	}

+4 −2
Original line number Diff line number Diff line
@@ -43,11 +43,13 @@ union adreno_ttbr0 {
 * struct adreno_submit_time - utility structure to store the wall clock / GPU
 * ticks at command submit time
 * @ticks: GPU ticks at submit time (from the 19.2Mhz timer)
 * @clock: local clock time (in nanoseconds)
 * @ktime: local clock time (in nanoseconds)
 * @utime: Wall clock time
 */
struct adreno_submit_time {
	uint64_t ticks;
	u64 clock;
	u64 ktime;
	struct timespec utime;
};

/**