Skip to content

Commit ef0f932

Browse files
chenzhenrkhuangtao
authored andcommitted
MALI: midgard: RK: not to power off all the pm cores
This is a workaround for the issue that "400M, 500M and 600M of clk_gpu needs high vdd_gpu", according to "6.1" of Mali Application Note "Potential glitches on Power Domain interfaces". Change-Id: I58daa3cf796802f073f67bacb62734516be76205 Signed-off-by: chenzhen <chenzhen@rock-chips.com>
1 parent 7be137a commit ef0f932

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_pm_driver.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
* Base kernel Power Management hardware control
2222
*/
2323

24+
// #define ENABLE_DEBUG_LOG
25+
#include "../../platform/rk/custom_log.h"
26+
2427
#include <mali_kbase.h>
2528
#include <mali_kbase_config_defaults.h>
2629
#include <mali_midg_regmap.h>
@@ -71,6 +74,26 @@ enum kbasep_pm_action {
7174
ACTION_PWRACTIVE = (SHADER_PWRACTIVE_LO - SHADER_PRESENT_LO)
7275
};
7376

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+
7497
static u64 kbase_pm_get_state(
7598
struct kbase_device *kbdev,
7699
enum kbase_pm_core_type core_type,
@@ -153,6 +176,25 @@ static void kbase_pm_invoke(struct kbase_device *kbdev,
153176

154177
lockdep_assert_held(&kbdev->pm.power_change_lock);
155178

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+
156198
reg = core_type_to_reg(core_type, action);
157199

158200
KBASE_DEBUG_ASSERT(reg);

0 commit comments

Comments
 (0)