3 * (C) COPYRIGHT ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
21 * @file mali_kbase_pm_demand.c
22 * A simple demand based power management policy
25 #include <kbase/src/common/mali_kbase.h>
26 #include <kbase/src/common/mali_kbase_pm.h>
28 static u64 demand_get_core_mask(struct kbase_device *kbdev)
30 u64 desired = kbdev->shader_needed_bitmap | kbdev->shader_inuse_bitmap;
32 if (0 == kbdev->pm.active_count)
38 static mali_bool demand_get_core_active (struct kbase_device *kbdev)
40 if (0 == kbdev->pm.active_count)
46 static void demand_init(struct kbase_device *kbdev)
51 static void demand_term(struct kbase_device *kbdev)
56 /** The @ref kbase_pm_policy structure for the demand power policy.
58 * This is the static structure that defines the demand power policy's callback and name.
60 const kbase_pm_policy kbase_pm_demand_policy_ops = {
62 demand_init, /* init */
63 demand_term, /* term */
64 demand_get_core_mask, /* get_core_mask */
65 demand_get_core_active, /* get_core_active */
67 KBASE_PM_POLICY_ID_DEMAND, /* id */
70 KBASE_EXPORT_TEST_API(kbase_pm_demand_policy_ops)