diff options
author | Sidath Senanayake <sidaths@google.com> | 2018-03-19 13:26:23 +0100 |
---|---|---|
committer | Sidath Senanayake <sidaths@google.com> | 2018-03-19 13:26:23 +0100 |
commit | 8946bcdee4c36dbc82b8c2a2abcf9c2f5eab5ae0 (patch) | |
tree | adf890cf7a6af02a05c8eb94c177bd83ca21fd8b /mali_kbase/mali_kbase_pm.c | |
parent | e42736e67f7d84d329d9595b7393e6784c5b887f (diff) | |
download | gpu-8946bcdee4c36dbc82b8c2a2abcf9c2f5eab5ae0.tar.gz |
Mali Bifrost DDK r11p0 KMD
Provenance:
b1581ebda (collaborate/EAC/b_r11p0)
BX304L01B-BU-00000-r11p0-01rel0
BX304L06A-BU-00000-r11p0-01rel0
BX304X07X-BU-00000-r11p0-01rel0
Signed-off-by: Sidath Senanayake <sidaths@google.com>
Change-Id: Ia590e1eb21778d33cacbefba83598ee56790ca85
Diffstat (limited to 'mali_kbase/mali_kbase_pm.c')
-rw-r--r-- | mali_kbase/mali_kbase_pm.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/mali_kbase/mali_kbase_pm.c b/mali_kbase/mali_kbase_pm.c index da56f0a..e3cb0b1 100644 --- a/mali_kbase/mali_kbase_pm.c +++ b/mali_kbase/mali_kbase_pm.c @@ -1,6 +1,6 @@ /* * - * (C) COPYRIGHT 2010-2016 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2010-2018 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 @@ -94,10 +94,15 @@ int kbase_pm_context_active_handle_suspend(struct kbase_device *kbdev, enum kbas if (old_count == 0) kbase_timeline_pm_handle_event(kbdev, KBASE_TIMELINE_PM_EVENT_GPU_ACTIVE); - if (c == 1) + if (c == 1) { /* First context active: Power on the GPU and any cores requested by * the policy */ kbase_hwaccess_pm_gpu_active(kbdev); + } +#if defined(CONFIG_DEVFREQ_THERMAL) && defined(CONFIG_MALI_DEVFREQ) + if (kbdev->ipa.gpu_active_callback) + kbdev->ipa.gpu_active_callback(kbdev->ipa.model_data); +#endif mutex_unlock(&kbdev->pm.lock); mutex_unlock(&js_devdata->runpool_mutex); @@ -146,6 +151,21 @@ void kbase_pm_context_idle(struct kbase_device *kbdev) wake_up(&kbdev->pm.zero_active_count_wait); } +#if defined(CONFIG_DEVFREQ_THERMAL) && defined(CONFIG_MALI_DEVFREQ) + /* IPA may be using vinstr, in which case there may be one PM reference + * still held when all other contexts have left the GPU. Inform IPA that + * the GPU is now idle so that vinstr can drop it's reference. + * + * If the GPU was only briefly active then it might have gone idle + * before vinstr has taken a PM reference, meaning that active_count is + * zero. We still need to inform IPA in this case, so that vinstr can + * drop the PM reference and avoid keeping the GPU powered + * unnecessarily. + */ + if (c <= 1 && kbdev->ipa.gpu_idle_callback) + kbdev->ipa.gpu_idle_callback(kbdev->ipa.model_data); +#endif + mutex_unlock(&kbdev->pm.lock); mutex_unlock(&js_devdata->runpool_mutex); } |