Skip to content

Commit

Permalink
FROMGIT: drm/panfrost: add governor data with pre-defined thresholds
Browse files Browse the repository at this point in the history
The simple_ondemand devfreq governor uses two thresholds to decide about
the frequency change: upthreshold, downdifferential. These two tunable
change the behavior of the governor decision, e.g. how fast to increase
the frequency or how rapidly limit the frequency. This patch adds needed
governor data with thresholds values gathered experimentally in different
workloads.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
  • Loading branch information
lukaszluba-arm authored and chewitt committed Jan 24, 2021
1 parent 9eeeabb commit d3d3168
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/gpu/drm/panfrost/panfrost_devfreq.c
Expand Up @@ -129,8 +129,16 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
panfrost_devfreq_profile.initial_freq = cur_freq;
dev_pm_opp_put(opp);

/*
* Setup default thresholds for the simple_ondemand governor.
* The values are chosen based on experiments.
*/
pfdevfreq->gov_data.upthreshold = 45;
pfdevfreq->gov_data.downdifferential = 5;

devfreq = devm_devfreq_add_device(dev, &panfrost_devfreq_profile,
DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL);
DEVFREQ_GOV_SIMPLE_ONDEMAND,
&pfdevfreq->gov_data);
if (IS_ERR(devfreq)) {
DRM_DEV_ERROR(dev, "Couldn't initialize GPU devfreq\n");
ret = PTR_ERR(devfreq);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/panfrost/panfrost_devfreq.h
Expand Up @@ -4,6 +4,7 @@
#ifndef __PANFROST_DEVFREQ_H__
#define __PANFROST_DEVFREQ_H__

#include <linux/devfreq.h>
#include <linux/spinlock.h>
#include <linux/ktime.h>

Expand All @@ -17,6 +18,7 @@ struct panfrost_devfreq {
struct devfreq *devfreq;
struct opp_table *regulators_opp_table;
struct thermal_cooling_device *cooling;
struct devfreq_simple_ondemand_data gov_data;
bool opp_of_table_added;

ktime_t busy_time;
Expand Down

0 comments on commit d3d3168

Please sign in to comment.