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

Commit 218cb38d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add a cmdbatch profiling flag to get time since boot"

parents 017c4708 22f06755
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -1153,8 +1153,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;
		}
	}
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2008-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -625,7 +625,8 @@ struct kgsl_cmdbatch *kgsl_cmdbatch_create(struct kgsl_device *device,
				| KGSL_CMDBATCH_SYNC
				| KGSL_CMDBATCH_PWR_CONSTRAINT
				| KGSL_CMDBATCH_MEMLIST
				| KGSL_CMDBATCH_PROFILING);
				| KGSL_CMDBATCH_PROFILING
				| KGSL_CMDBATCH_PROFILING_KTIME);

	/* Add a timer to help debug sync deadlocks */
	setup_timer(&cmdbatch->timer, _kgsl_cmdbatch_timer,
+7 −2
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@
#define KGSL_CMDBATCH_SUBMIT_IB_LIST	KGSL_CONTEXT_SUBMIT_IB_LIST /* 0x004 */
#define KGSL_CMDBATCH_CTX_SWITCH	KGSL_CONTEXT_CTX_SWITCH     /* 0x008 */
#define KGSL_CMDBATCH_PROFILING		0x00000010
#define KGSL_CMDBATCH_PROFILING_KTIME	0x00000020
#define KGSL_CMDBATCH_END_OF_FRAME	KGSL_CONTEXT_END_OF_FRAME   /* 0x100 */
#define KGSL_CMDBATCH_SYNC		KGSL_CONTEXT_SYNC           /* 0x400 */
#define KGSL_CMDBATCH_PWR_CONSTRAINT	KGSL_CONTEXT_PWR_CONSTRAINT /* 0x800 */
@@ -384,8 +385,12 @@ struct kgsl_ibdesc {

/**
 * struct kgsl_cmdbatch_profiling_buffer
 * @wall_clock_s: Wall clock at ringbuffer submission time (seconds)
 * @wall_clock_ns: Wall clock at ringbuffer submission time (nanoseconds)
 * @wall_clock_s: Ringbuffer submission time (seconds).
 *                If KGSL_CMDBATCH_PROFILING_KTIME is set, time is provided
 *                in kernel clocks, otherwise wall clock time is used.
 * @wall_clock_ns: Ringbuffer submission time (nanoseconds).
 *                 If KGSL_CMDBATCH_PROFILING_KTIME is set time is provided
 *                 in kernel clocks, otherwise wall clock time is used.
 * @gpu_ticks_queued: GPU ticks at ringbuffer submission
 * @gpu_ticks_submitted: GPU ticks when starting cmdbatch execution
 * @gpu_ticks_retired: GPU ticks when finishing cmdbatch execution