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

Commit 88cb36d3 authored by Sushmita Susheelendra's avatar Sushmita Susheelendra
Browse files

msm: kgsl: Add a sync event to map GMU events to ftrace timeline



GMU events will be streamed to the host if GMU log streaming is
enabled. Being able to view GMU events on the same timeline
as GPU and host events is helpful for profiling. Add a sync event
to map GMU AO counter ticks to the ftrace timeline just before
bringing the GMU out of reset.

Change-Id: I7e2696f4d0d8666a2fcdfccb358619277e5949b8
Signed-off-by: default avatarSushmita Susheelendra <ssusheel@codeaurora.org>
parent 76a04e42
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "adreno.h"
#include "adreno_a6xx.h"
#include "adreno_hwsched.h"
#include "adreno_trace.h"
#include "kgsl_bus.h"
#include "kgsl_device.h"
#include "kgsl_trace.h"
@@ -415,6 +416,22 @@ static void a6xx_gmu_power_config(struct adreno_device *adreno_dev)
				RPMH_ENABLE_MASK);
}

static void gmu_ao_sync_event(struct adreno_device *adreno_dev)
{
	unsigned long flags;
	u64 ticks;

	local_irq_save(flags);

	/* Read GMU always on register */
	ticks = a6xx_read_alwayson(adreno_dev);

	/* Trace the GMU time to create a mapping to ftrace time */
	trace_gmu_ao_sync(ticks);

	local_irq_restore(flags);
}

int a6xx_gmu_device_start(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
@@ -422,6 +439,8 @@ int a6xx_gmu_device_start(struct adreno_device *adreno_dev)
	u32 val = 0x00000100;
	u32 mask = 0x000001FF;

	gmu_ao_sync_event(adreno_dev);

	/* Check for 0xBABEFACE on legacy targets */
	if (gmu->ver.core <= 0x20010004) {
		val = 0xBABEFACE;
+14 −0
Original line number Diff line number Diff line
@@ -159,6 +159,20 @@ TRACE_EVENT(adreno_cmdbatch_retired,
	 )
);

TRACE_EVENT(gmu_ao_sync,
	TP_PROTO(u64 ticks),
	TP_ARGS(ticks),
	TP_STRUCT__entry(
		__field(u64, ticks)
	),
	TP_fast_assign(
		__entry->ticks = ticks;
	),
	TP_printk(
		"ticks=%llu", __entry->ticks
	)
);

TRACE_EVENT(adreno_cmdbatch_sync,
	TP_PROTO(unsigned int ctx_id, unsigned int ctx_prio,
		unsigned int timestamp,	uint64_t ticks),