3 * (C) COPYRIGHT 2012-2015 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 * "Coarse Demand" power management policy
24 #include <mali_kbase.h>
25 #include <mali_kbase_pm.h>
27 static u64 coarse_demand_get_core_mask(struct kbase_device *kbdev)
29 if (kbdev->pm.active_count == 0)
32 return kbdev->gpu_props.props.raw_props.shader_present;
35 static bool coarse_demand_get_core_active(struct kbase_device *kbdev)
37 if (0 == kbdev->pm.active_count && !(kbdev->shader_needed_bitmap |
38 kbdev->shader_inuse_bitmap))
44 static void coarse_demand_init(struct kbase_device *kbdev)
49 static void coarse_demand_term(struct kbase_device *kbdev)
54 /* The struct kbase_pm_policy structure for the demand power policy.
56 * This is the static structure that defines the demand power policy's callback
59 const struct kbase_pm_policy kbase_pm_coarse_demand_policy_ops = {
60 "coarse_demand", /* name */
61 coarse_demand_init, /* init */
62 coarse_demand_term, /* term */
63 coarse_demand_get_core_mask, /* get_core_mask */
64 coarse_demand_get_core_active, /* get_core_active */
66 KBASE_PM_POLICY_ID_COARSE_DEMAND, /* id */
69 KBASE_EXPORT_TEST_API(kbase_pm_coarse_demand_policy_ops);