|
21 | 21 | * Base kernel Power Management hardware control |
22 | 22 | */ |
23 | 23 |
|
| 24 | +// #define ENABLE_DEBUG_LOG |
| 25 | +#include "../../platform/rk/custom_log.h" |
| 26 | + |
24 | 27 | #include <mali_kbase.h> |
25 | 28 | #include <mali_kbase_config_defaults.h> |
26 | 29 | #include <mali_midg_regmap.h> |
@@ -71,6 +74,26 @@ enum kbasep_pm_action { |
71 | 74 | ACTION_PWRACTIVE = (SHADER_PWRACTIVE_LO - SHADER_PRESENT_LO) |
72 | 75 | }; |
73 | 76 |
|
| 77 | +/*---------------------------------------------------------------------------*/ |
| 78 | + |
| 79 | +static bool is_action_of_powering_off_l2(enum kbase_pm_core_type core_type, |
| 80 | + enum kbasep_pm_action active) |
| 81 | +{ |
| 82 | + return (KBASE_PM_CORE_L2 == core_type) && (ACTION_PWROFF == active); |
| 83 | +} |
| 84 | + |
| 85 | +static bool is_action_of_powering_off_shader(enum kbase_pm_core_type core_type, |
| 86 | + enum kbasep_pm_action active) |
| 87 | +{ |
| 88 | + return (KBASE_PM_CORE_SHADER == core_type) && (ACTION_PWROFF == active); |
| 89 | +} |
| 90 | + |
| 91 | +static bool is_action_of_powering_off_tiler(enum kbase_pm_core_type core_type, |
| 92 | + enum kbasep_pm_action active) |
| 93 | +{ |
| 94 | + return (KBASE_PM_CORE_TILER == core_type) && (ACTION_PWROFF == active); |
| 95 | +} |
| 96 | + |
74 | 97 | static u64 kbase_pm_get_state( |
75 | 98 | struct kbase_device *kbdev, |
76 | 99 | enum kbase_pm_core_type core_type, |
@@ -153,6 +176,25 @@ static void kbase_pm_invoke(struct kbase_device *kbdev, |
153 | 176 |
|
154 | 177 | lockdep_assert_held(&kbdev->pm.power_change_lock); |
155 | 178 |
|
| 179 | + /*-------------------------------------------------------*/ |
| 180 | + |
| 181 | + if ( is_action_of_powering_off_l2(core_type, action) ) { |
| 182 | + D("not to power off l2 actually."); |
| 183 | + return; |
| 184 | + } |
| 185 | + if ( is_action_of_powering_off_shader(core_type, action) ) { |
| 186 | + D("not to power off shader actually. cores_lo : 0x%x, hi : 0x%x.", |
| 187 | + lo, |
| 188 | + hi); |
| 189 | + return; |
| 190 | + } |
| 191 | + if ( is_action_of_powering_off_tiler(core_type, action) ) { |
| 192 | + D("not to power off tiler actually."); |
| 193 | + return; |
| 194 | + } |
| 195 | + |
| 196 | + /*-------------------------------------------------------*/ |
| 197 | + |
156 | 198 | reg = core_type_to_reg(core_type, action); |
157 | 199 |
|
158 | 200 | KBASE_DEBUG_ASSERT(reg); |
|
0 commit comments