3 * (C) COPYRIGHT 2011-2012 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
8 * A copy of the licence is included with the program, and can also be obtained from Free Software
9 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * @file mali_kbase_pm_demand.h
17 * A simple demand based power management policy
20 #ifndef MALI_KBASE_PM_DEMAND_H
21 #define MALI_KBASE_PM_DEMAND_H
23 /** The states that the demand policy can enter.
25 * The diagram below should the states that the demand policy can enter and the transitions that can occur between the
29 * digraph demand_states {
33 * POWERING_UP [label="STATE_POWERING_UP"
34 * URL="\ref kbasep_pm_demand_state.KBASEP_PM_DEMAND_STATE_POWERING_UP"];
35 * POWERING_DOWN [label="STATE_POWERING_DOWN"
36 * URL="\ref kbasep_pm_demand_state.KBASEP_PM_DEMAND_STATE_POWERING_DOWN"];
37 * POWERED_UP [label="STATE_POWERED_UP"
38 * URL="\ref kbasep_pm_demand_state.KBASEP_PM_DEMAND_STATE_POWERED_UP"];
39 * POWERED_DOWN [label="STATE_POWERED_DOWN"
40 * URL="\ref kbasep_pm_demand_state.KBASEP_PM_DEMAND_STATE_POWERED_DOWN"];
41 * CHANGING_POLICY [label="STATE_CHANGING_POLICY"
42 * URL="\ref kbasep_pm_demand_state.KBASEP_PM_DEMAND_STATE_CHANGING_POLICY"];
44 * init [label="init" URL="\ref KBASE_PM_EVENT_INIT"];
45 * change_policy [label="change_policy" URL="\ref kbase_pm_change_policy"];
47 * init -> POWERING_UP [ label = "Policy init" ];
49 * POWERING_UP -> POWERED_UP [label = "Power state change" URL="\ref KBASE_PM_EVENT_STATE_CHANGED"];
50 * POWERING_DOWN -> POWERED_DOWN [label = "Power state change" URL="\ref KBASE_PM_EVENT_STATE_CHANGED"];
51 * CHANGING_POLICY -> change_policy [label = "Power state change" URL="\ref KBASE_PM_EVENT_STATE_CHANGED"];
53 * POWERED_UP -> POWERING_DOWN [label = "GPU Idle" URL="\ref KBASE_PM_EVENT_GPU_IDLE"];
54 * POWERING_UP -> POWERING_DOWN [label = "GPU Idle" URL="\ref KBASE_PM_EVENT_GPU_IDLE"];
56 * POWERED_DOWN -> POWERING_UP [label = "GPU Active" URL="\ref KBASE_PM_EVENT_GPU_ACTIVE"];
57 * POWERING_DOWN -> POWERING_UP [label = "GPU Active" URL="\ref KBASE_PM_EVENT_GPU_ACTIVE"];
59 * POWERING_UP -> CHANGING_POLICY [label = "Change policy" URL="\ref KBASE_PM_EVENT_CHANGE_POLICY"];
60 * POWERING_DOWN -> CHANGING_POLICY [label = "Change policy" URL="\ref KBASE_PM_EVENT_CHANGE_POLICY"];
61 * POWERED_UP -> change_policy [label = "Change policy" URL="\ref KBASE_PM_EVENT_CHANGE_POLICY"];
62 * POWERED_DOWN -> change_policy [label = "Change policy" URL="\ref KBASE_PM_EVENT_CHANGE_POLICY"];
66 typedef enum kbasep_pm_demand_state
68 KBASEP_PM_DEMAND_STATE_POWERING_UP, /**< The GPU is powering up */
69 KBASEP_PM_DEMAND_STATE_POWERED_UP, /**< The GPU is powered up and jobs can execute */
70 KBASEP_PM_DEMAND_STATE_POWERING_DOWN, /**< The GPU is powering down */
71 KBASEP_PM_DEMAND_STATE_POWERED_DOWN, /**< The GPU is powered down */
72 KBASEP_PM_DEMAND_STATE_CHANGING_POLICY /**< The power policy is about to change */
73 } kbasep_pm_demand_state;
75 /** Private structure for policy instance data.
77 * This contains data that is private to the particular power policy that is active.
79 typedef struct kbasep_pm_policy_demand
81 kbasep_pm_demand_state state; /**< The current state of the policy */
82 } kbasep_pm_policy_demand;