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

Commit 37a0c337 authored by Aman Mehta's avatar Aman Mehta Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Sending KGSL events to msm perf module



Add msm performance module function calls to send
kgsl queue, submit and retired events. These events
will be accessed by userspace through msm performance
module to apply dynamic performance boosts.

Change-Id: I6d93831e5fe821032b8e32c52e88b72ab102f6a2
Signed-off-by: default avatarAman Mehta <amanmeht@codeaurora.org>
parent 0cfcff8f
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 */

#include <linux/slab.h>

#include <soc/qcom/msm_performance.h>
#include "adreno.h"
#include "adreno_trace.h"
#include "kgsl_gmu_core.h"
@@ -294,6 +294,10 @@ static void _retire_timestamp(struct kgsl_drawobj *drawobj)
	info.wptr = rb->wptr;
	info.timestamp = drawobj->timestamp;

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_RETIRED,
				context->proc_priv->pid,
				context->id, drawobj->timestamp);

	/*
	 * For A3xx we still get the rptr from the CP_RB_RPTR instead of
	 * rptr scratch out address. At this point GPU clocks turned off.
@@ -546,6 +550,7 @@ static int sendcmd(struct adreno_device *adreno_dev,
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	struct adreno_dispatcher *dispatcher = &adreno_dev->dispatcher;
	struct adreno_context *drawctxt = ADRENO_CONTEXT(drawobj->context);
	struct kgsl_context *context = drawobj->context;
	struct adreno_dispatcher_drawqueue *dispatch_q =
				ADRENO_DRAWOBJ_DISPATCH_DRAWQUEUE(drawobj);
	struct adreno_submit_time time;
@@ -667,6 +672,10 @@ static int sendcmd(struct adreno_device *adreno_dev,
	info.wptr = drawctxt->rb->wptr;
	info.gmu_dispatch_queue = -1;

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_SUBMIT,
			       context->proc_priv->pid,
			       context->id, drawobj->timestamp);

	trace_adreno_cmdbatch_submitted(drawobj, &info,
			time.ticks, (unsigned long) secs, nsecs / 1000,
			dispatch_q->inflight);
@@ -1242,11 +1251,16 @@ static unsigned int _check_context_state_to_queue_cmds(
static void _queue_drawobj(struct adreno_context *drawctxt,
	struct kgsl_drawobj *drawobj)
{
	struct kgsl_context *context = drawobj->context;

	/* Put the command into the queue */
	drawctxt->drawqueue[drawctxt->drawqueue_tail] = drawobj;
	drawctxt->drawqueue_tail = (drawctxt->drawqueue_tail + 1) %
			ADRENO_CONTEXT_DRAWQUEUE_SIZE;
	drawctxt->queued++;
	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_QUEUE,
				context->proc_priv->pid,
				context->id, drawobj->timestamp);
	trace_adreno_cmdbatch_queued(drawobj, drawctxt->queued);
}

@@ -2347,6 +2361,7 @@ static void retire_cmdobj(struct adreno_device *adreno_dev,
	struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);
	struct adreno_context *drawctxt = ADRENO_CONTEXT(drawobj->context);
	struct adreno_ringbuffer *rb = drawctxt->rb;
	struct kgsl_context *context = drawobj->context;
	uint64_t start = 0, end = 0;
	struct retire_info info = {0};

@@ -2365,6 +2380,10 @@ static void retire_cmdobj(struct adreno_device *adreno_dev,
	info.sop = start;
	info.eop = end;

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_RETIRED,
			       context->proc_priv->pid,
			       context->id, drawobj->timestamp);

	/*
	 * For A3xx we still get the rptr from the CP_RB_RPTR instead of
	 * rptr scratch out address. At this point GPU clocks turned off.