summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_pm.c
diff options
context:
space:
mode:
authorSiddharth Kapoor <ksiddharth@google.com>2022-01-07 19:09:01 +0800
committerSiddharth Kapoor <ksiddharth@google.com>2022-01-07 19:09:01 +0800
commit0207d6c3b7a2002f15c60d08617e956faf5ba90c (patch)
treeeae0afe608a70b25f64e959db2b782fb33f89160 /mali_kbase/mali_kbase_pm.c
parent0c596dc70431fa2c70021fa1685e3efc969a852d (diff)
downloadgpu-0207d6c3b7a2002f15c60d08617e956faf5ba90c.tar.gz
Mali Valhall Android DDK r35p0 KMD
Provenance: 3e260085ac (collaborate/EAC/v_r35p0) VX504X08X-BU-00000-r35p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r35p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r35p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r35p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Siddharth Kapoor <ksiddharth@google.com> Change-Id: Id9ef73da49680e2935a827c40d54169545f7162e
Diffstat (limited to 'mali_kbase/mali_kbase_pm.c')
-rw-r--r--mali_kbase/mali_kbase_pm.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/mali_kbase/mali_kbase_pm.c b/mali_kbase/mali_kbase_pm.c
index 4078da1..af154d5 100644
--- a/mali_kbase/mali_kbase_pm.c
+++ b/mali_kbase/mali_kbase_pm.c
@@ -144,7 +144,7 @@ void kbase_pm_context_idle(struct kbase_device *kbdev)
KBASE_EXPORT_TEST_API(kbase_pm_context_idle);
-void kbase_pm_driver_suspend(struct kbase_device *kbdev)
+int kbase_pm_driver_suspend(struct kbase_device *kbdev)
{
KBASE_DEBUG_ASSERT(kbdev);
@@ -162,7 +162,7 @@ void kbase_pm_driver_suspend(struct kbase_device *kbdev)
mutex_lock(&kbdev->pm.lock);
if (WARN_ON(kbase_pm_is_suspending(kbdev))) {
mutex_unlock(&kbdev->pm.lock);
- return;
+ return 0;
}
kbdev->pm.suspending = true;
mutex_unlock(&kbdev->pm.lock);
@@ -193,7 +193,12 @@ void kbase_pm_driver_suspend(struct kbase_device *kbdev)
*/
kbasep_js_suspend(kbdev);
#else
- kbase_csf_scheduler_pm_suspend(kbdev);
+ if (kbase_csf_scheduler_pm_suspend(kbdev)) {
+ mutex_lock(&kbdev->pm.lock);
+ kbdev->pm.suspending = false;
+ mutex_unlock(&kbdev->pm.lock);
+ return -1;
+ }
#endif
/* Wait for the active count to reach zero. This is not the same as
@@ -209,7 +214,12 @@ void kbase_pm_driver_suspend(struct kbase_device *kbdev)
/* NOTE: We synchronize with anything that was just finishing a
* kbase_pm_context_idle() call by locking the pm.lock below
*/
- kbase_hwaccess_pm_suspend(kbdev);
+ if (kbase_hwaccess_pm_suspend(kbdev)) {
+ mutex_lock(&kbdev->pm.lock);
+ kbdev->pm.suspending = false;
+ mutex_unlock(&kbdev->pm.lock);
+ return -1;
+ }
#ifdef CONFIG_MALI_ARBITER_SUPPORT
if (kbdev->arb.arb_if) {
@@ -218,6 +228,8 @@ void kbase_pm_driver_suspend(struct kbase_device *kbdev)
mutex_unlock(&kbdev->pm.arb_vm_state->vm_state_lock);
}
#endif /* CONFIG_MALI_ARBITER_SUPPORT */
+
+ return 0;
}
void kbase_pm_driver_resume(struct kbase_device *kbdev, bool arb_gpu_start)
@@ -273,16 +285,19 @@ void kbase_pm_driver_resume(struct kbase_device *kbdev, bool arb_gpu_start)
kbase_kinstr_prfcnt_resume(kbdev->kinstr_prfcnt_ctx);
}
-void kbase_pm_suspend(struct kbase_device *kbdev)
+int kbase_pm_suspend(struct kbase_device *kbdev)
{
+ int result = 0;
#ifdef CONFIG_MALI_ARBITER_SUPPORT
if (kbdev->arb.arb_if)
kbase_arbiter_pm_vm_event(kbdev, KBASE_VM_OS_SUSPEND_EVENT);
else
- kbase_pm_driver_suspend(kbdev);
+ result = kbase_pm_driver_suspend(kbdev);
#else
- kbase_pm_driver_suspend(kbdev);
+ result = kbase_pm_driver_suspend(kbdev);
#endif /* CONFIG_MALI_ARBITER_SUPPORT */
+
+ return result;
}
void kbase_pm_resume(struct kbase_device *kbdev)