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

Commit 70ed685e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add gpu_frequency trace during SLUMBER entry and exit"

parents 0e27edd4 120f1814
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/msm-bus.h>
#include <linux/msm-bus.h>
@@ -15,6 +15,7 @@
#include "kgsl_device.h"
#include "kgsl_device.h"
#include "kgsl_pwrscale.h"
#include "kgsl_pwrscale.h"
#include "kgsl_trace.h"
#include "kgsl_trace.h"
#include "kgsl_trace_power.h"


#define KGSL_PWRFLAGS_POWER_ON 0
#define KGSL_PWRFLAGS_POWER_ON 0
#define KGSL_PWRFLAGS_CLK_ON   1
#define KGSL_PWRFLAGS_CLK_ON   1
@@ -616,6 +617,8 @@ void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device,
			pwr->previous_pwrlevel,
			pwr->previous_pwrlevel,
			pwr->pwrlevels[old_level].gpu_freq);
			pwr->pwrlevels[old_level].gpu_freq);


	trace_gpu_frequency(pwrlevel->gpu_freq/1000, 0);

	/*
	/*
	 * Some targets do not support the bandwidth requirement of
	 * Some targets do not support the bandwidth requirement of
	 * GPU at TURBO, for such targets we need to set GPU-BIMC
	 * GPU at TURBO, for such targets we need to set GPU-BIMC
@@ -2664,6 +2667,7 @@ static int _wake(struct kgsl_device *device)
{
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	int status = 0;
	int status = 0;
	unsigned int state = device->state;


	switch (device->state) {
	switch (device->state) {
	case KGSL_STATE_SUSPEND:
	case KGSL_STATE_SUSPEND:
@@ -2690,6 +2694,9 @@ static int _wake(struct kgsl_device *device)
		/* Turn on the core clocks */
		/* Turn on the core clocks */
		kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_ON, KGSL_STATE_ACTIVE);
		kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_ON, KGSL_STATE_ACTIVE);


		if (state == KGSL_STATE_SLUMBER || state == KGSL_STATE_SUSPEND)
			trace_gpu_frequency(
			pwr->pwrlevels[pwr->active_pwrlevel].gpu_freq/1000, 0);
		/*
		/*
		 * No need to turn on/off irq here as it no longer affects
		 * No need to turn on/off irq here as it no longer affects
		 * power collapse
		 * power collapse
@@ -2895,6 +2902,7 @@ _slumber(struct kgsl_device *device)
		kgsl_pwrctrl_clk_set_options(device, false);
		kgsl_pwrctrl_clk_set_options(device, false);
		kgsl_pwrctrl_disable(device);
		kgsl_pwrctrl_disable(device);
		kgsl_pwrscale_sleep(device);
		kgsl_pwrscale_sleep(device);
		trace_gpu_frequency(0, 0);
		kgsl_pwrctrl_set_state(device, KGSL_STATE_SLUMBER);
		kgsl_pwrctrl_set_state(device, KGSL_STATE_SLUMBER);
		pm_qos_update_request(&device->pwrctrl.pm_qos_req_dma,
		pm_qos_update_request(&device->pwrctrl.pm_qos_req_dma,
						PM_QOS_DEFAULT_VALUE);
						PM_QOS_DEFAULT_VALUE);
@@ -2910,6 +2918,7 @@ _slumber(struct kgsl_device *device)
		break;
		break;
	case KGSL_STATE_AWARE:
	case KGSL_STATE_AWARE:
		kgsl_pwrctrl_disable(device);
		kgsl_pwrctrl_disable(device);
		trace_gpu_frequency(0, 0);
		kgsl_pwrctrl_set_state(device, KGSL_STATE_SLUMBER);
		kgsl_pwrctrl_set_state(device, KGSL_STATE_SLUMBER);
		break;
		break;
	default:
	default:
+4 −1
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2011,2013,2015,2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2011,2013,2015,2019-2020 The Linux Foundation. All rights reserved.
 */
 */


#include <linux/module.h>
#include <linux/module.h>
@@ -10,8 +10,11 @@
/* Instantiate tracepoints */
/* Instantiate tracepoints */
#define CREATE_TRACE_POINTS
#define CREATE_TRACE_POINTS
#include "kgsl_trace.h"
#include "kgsl_trace.h"
#include "kgsl_trace_power.h"


EXPORT_TRACEPOINT_SYMBOL(kgsl_regwrite);
EXPORT_TRACEPOINT_SYMBOL(kgsl_regwrite);
EXPORT_TRACEPOINT_SYMBOL(kgsl_issueibcmds);
EXPORT_TRACEPOINT_SYMBOL(kgsl_issueibcmds);
EXPORT_TRACEPOINT_SYMBOL(kgsl_user_pwrlevel_constraint);
EXPORT_TRACEPOINT_SYMBOL(kgsl_user_pwrlevel_constraint);
EXPORT_TRACEPOINT_SYMBOL(kgsl_constraint);
EXPORT_TRACEPOINT_SYMBOL(kgsl_constraint);

EXPORT_TRACEPOINT_SYMBOL(gpu_frequency);
+41 −0
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */

#if !defined(_KGSL_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
#define _KGSL_TRACE_POWER_H

#undef TRACE_SYSTEM
#define TRACE_SYSTEM power
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE kgsl_trace_power

#include <linux/tracepoint.h>

/**
 * gpu_frequency - Reports frequency changes in GPU clock domains
 * @state:  New frequency (in KHz)
 * @gpu_id: GPU clock domain
 */
TRACE_EVENT(gpu_frequency,
	TP_PROTO(unsigned int state, unsigned int gpu_id),
	TP_ARGS(state, gpu_id),
	TP_STRUCT__entry(
		__field(unsigned int, state)
		__field(unsigned int, gpu_id)
	),
	TP_fast_assign(
		__entry->state = state;
		__entry->gpu_id = gpu_id;
	),

	TP_printk("state=%lu gpu_id=%lu",
		(unsigned long)__entry->state,
		(unsigned long)__entry->gpu_id)
);

#endif /* _KGSL_TRACE_POWER_H */

/* This part must be outside protection */
#include <trace/define_trace.h>