lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] drm/panfrost: Register to the Energy Model with devfreq device
Date
From: Lukasz Luba <lukasz.luba@arm.com>

Let Panfrost devfreq device use the Energy Model (EM). The EM can be used
in thermal subsystem (devfreq_cooling) for calculating the used power.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
index 413987038fbf..8771782f67c6 100644
--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
@@ -105,6 +105,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
}
pfdev->devfreq.devfreq = devfreq;

+ dev_pm_opp_of_register_em(dev);
+
cooling = of_devfreq_cooling_register(dev->of_node, devfreq);
if (IS_ERR(cooling))
DRM_DEV_INFO(dev, "Failed to register cooling device\n");
@@ -118,6 +120,7 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev)
{
if (pfdev->devfreq.cooling)
devfreq_cooling_unregister(pfdev->devfreq.cooling);
+ dev_pm_opp_of_unregister_em(&pfdev->pdev->dev);
dev_pm_opp_of_remove_table(&pfdev->pdev->dev);
}

--
2.17.1
\
 
 \ /
  Last update: 2020-01-16 16:22    [W:0.119 / U:1.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site