Skip to content

Commit

Permalink
drm/lima: add governor data with pre-defined thresholds
Browse files Browse the repository at this point in the history
This patch adapts the panfrost pre-defined thresholds change [0] to the
lima driver to improve real-world performance. The upthreshold value has
been set to ramp GPU frequency to max freq faster (compared to panfrost)
to compensate for the lower overall performance of utgard devices.

[0] https://patchwork.kernel.org/project/dri-devel/patch/20210121170445.19761-1-lukasz.luba@arm.com/

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210127194047.21462-1-christianshewitt@gmail.com
  • Loading branch information
Christian Hewitt authored and Qiang Yu committed Feb 7, 2021
1 parent 904beeb commit 1d048af
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/lima/lima_devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,16 @@ int lima_devfreq_init(struct lima_device *ldev)
lima_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.
*/
ldevfreq->gov_data.upthreshold = 30;
ldevfreq->gov_data.downdifferential = 5;

devfreq = devm_devfreq_add_device(dev, &lima_devfreq_profile,
DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL);
DEVFREQ_GOV_SIMPLE_ONDEMAND,
&ldevfreq->gov_data);
if (IS_ERR(devfreq)) {
dev_err(dev, "Couldn't initialize GPU devfreq\n");
ret = PTR_ERR(devfreq);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/lima/lima_devfreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#ifndef __LIMA_DEVFREQ_H__
#define __LIMA_DEVFREQ_H__

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

Expand All @@ -18,6 +19,7 @@ struct lima_devfreq {
struct opp_table *clkname_opp_table;
struct opp_table *regulators_opp_table;
struct thermal_cooling_device *cooling;
struct devfreq_simple_ondemand_data gov_data;

ktime_t busy_time;
ktime_t idle_time;
Expand Down

0 comments on commit 1d048af

Please sign in to comment.