summaryrefslogtreecommitdiff
path: root/mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c')
-rw-r--r--mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c b/mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c
index 3881d28..a019229 100644
--- a/mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c
+++ b/mali_kbase/platform/devicetree/mali_kbase_runtime_pm.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
*
- * (C) COPYRIGHT 2015-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2015-2022 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -50,7 +50,6 @@ static void enable_gpu_power_control(struct kbase_device *kbdev)
}
}
-
static void disable_gpu_power_control(struct kbase_device *kbdev)
{
unsigned int i;
@@ -82,8 +81,7 @@ static int pm_callback_power_on(struct kbase_device *kbdev)
int error;
unsigned long flags;
- dev_dbg(kbdev->dev, "%s %p\n", __func__,
- (void *)kbdev->dev->pm_domain);
+ dev_dbg(kbdev->dev, "%s %pK\n", __func__, (void *)kbdev->dev->pm_domain);
spin_lock_irqsave(&kbdev->hwaccess_lock, flags);
WARN_ON(kbdev->pm.backend.gpu_powered);
@@ -99,9 +97,8 @@ static int pm_callback_power_on(struct kbase_device *kbdev)
#else
spin_unlock_irqrestore(&kbdev->hwaccess_lock, flags);
+#ifdef KBASE_PM_RUNTIME
error = pm_runtime_get_sync(kbdev->dev);
- enable_gpu_power_control(kbdev);
-
if (error == 1) {
/*
* Let core know that the chip has not been
@@ -109,8 +106,11 @@ static int pm_callback_power_on(struct kbase_device *kbdev)
*/
ret = 0;
}
-
dev_dbg(kbdev->dev, "pm_runtime_get_sync returned %d\n", error);
+#else
+ enable_gpu_power_control(kbdev);
+#endif /* KBASE_PM_RUNTIME */
+
#endif /* MALI_USE_CSF */
return ret;
@@ -126,7 +126,9 @@ static void pm_callback_power_off(struct kbase_device *kbdev)
WARN_ON(kbdev->pm.backend.gpu_powered);
#if MALI_USE_CSF
if (likely(kbdev->csf.firmware_inited)) {
+#ifdef CONFIG_MALI_DEBUG
WARN_ON(kbase_csf_scheduler_get_nr_active_csgs(kbdev));
+#endif
WARN_ON(kbdev->pm.backend.mcu_state != KBASE_MCU_OFF);
}
spin_unlock_irqrestore(&kbdev->hwaccess_lock, flags);
@@ -241,7 +243,9 @@ static int pm_callback_runtime_on(struct kbase_device *kbdev)
{
dev_dbg(kbdev->dev, "%s\n", __func__);
+#if !MALI_USE_CSF
enable_gpu_power_control(kbdev);
+#endif
return 0;
}
@@ -249,7 +253,9 @@ static void pm_callback_runtime_off(struct kbase_device *kbdev)
{
dev_dbg(kbdev->dev, "%s\n", __func__);
+#if !MALI_USE_CSF
disable_gpu_power_control(kbdev);
+#endif
}
static void pm_callback_resume(struct kbase_device *kbdev)
@@ -264,6 +270,17 @@ static void pm_callback_suspend(struct kbase_device *kbdev)
pm_callback_runtime_off(kbdev);
}
+#ifdef CONFIG_MALI_HOST_CONTROLS_SC_RAILS
+static void pm_callback_sc_rails_on(struct kbase_device *kbdev)
+{
+ dev_dbg(kbdev->dev, "SC rails are on");
+}
+
+static void pm_callback_sc_rails_off(struct kbase_device *kbdev)
+{
+ dev_dbg(kbdev->dev, "SC rails are off");
+}
+#endif
struct kbase_pm_callback_conf pm_callbacks = {
.power_on_callback = pm_callback_power_on,
@@ -289,6 +306,9 @@ struct kbase_pm_callback_conf pm_callbacks = {
.power_runtime_gpu_idle_callback = NULL,
.power_runtime_gpu_active_callback = NULL,
#endif
-};
-
+#ifdef CONFIG_MALI_HOST_CONTROLS_SC_RAILS
+ .power_on_sc_rails_callback = pm_callback_sc_rails_on,
+ .power_off_sc_rails_callback = pm_callback_sc_rails_off,
+#endif
+};