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

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

Merge "devfreq: Restrict gpu governors to gpu devfreq devices"

parents f74668f9 1f6bfc5a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ static int devfreq_vbif_ev_handler(struct devfreq *devfreq,

static struct devfreq_governor devfreq_vbif = {
	.name = "bw_vbif",
	/* Restrict this governor to only gpu devfreq devices */
	.immutable = 1,
	.get_target_freq = devfreq_vbif_get_freq,
	.event_handler = devfreq_vbif_ev_handler,
};
+9 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <linux/devfreq.h>
#include <linux/module.h>
#include <linux/msm_adreno_devfreq.h>
#include <linux/of_platform.h>
#include <linux/slab.h>

#include "devfreq_trace.h"
@@ -208,6 +209,14 @@ static int devfreq_gpubw_event_handler(struct devfreq *devfreq,
{
	int result = 0;
	unsigned long freq;
	struct device_node *node = devfreq->dev.parent->of_node;

	/*
	 * We want to restrict this governor be set only for
	 * gpu devfreq devices.
	 */
	if (!of_device_is_compatible(node, "qcom,kgsl-busmon"))
		return -EINVAL;

	mutex_lock(&devfreq->lock);
	freq = devfreq->previous_freq;
+12 −4
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <asm/cacheflush.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/qtee_shmbridge.h>
#include <linux/of_platform.h>
#include "governor.h"

static DEFINE_SPINLOCK(tz_lock);
@@ -552,11 +553,18 @@ static int tz_suspend(struct devfreq *devfreq)
static int tz_handler(struct devfreq *devfreq, unsigned int event, void *data)
{
	int result;
	struct msm_adreno_extended_profile *gpu_profile;
	struct device_node *node = devfreq->dev.parent->of_node;

	struct msm_adreno_extended_profile *gpu_profile = container_of(
					(devfreq->profile),
					struct msm_adreno_extended_profile,
					profile);
	/*
	 * We want to restrict this governor be set only for
	 * gpu devfreq devices.
	 */
	if (!of_device_is_compatible(node, "qcom,kgsl-3d0"))
		return -EINVAL;

	gpu_profile = container_of((devfreq->profile),
		struct msm_adreno_extended_profile, profile);

	switch (event) {
	case DEVFREQ_GOV_START: