rk312x, mali_400: make it more 'difficult' to disable one core in low load.

Change-Id: I8f9aaa5d442a1d0f7a7685ba1885ad39b89ee097
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
This commit is contained in:
chenzhen
2015-10-21 08:59:41 +08:00
committed by Gerrit Code Review
parent d989b5b65c
commit 44f997ff54

View File

@@ -13,6 +13,9 @@
* Example core scaling policy.
*/
/* #define ENABLE_DEBUG_LOG */
#include "custom_log.h"
#include "arm_core_scaling.h"
#include <linux/mali/mali_utgard.h>
@@ -23,6 +26,16 @@
static int num_cores_total;
static int num_cores_enabled;
/**
* 对连续的 request_to_disable_on_core 的计数.
*/
static int count_of_requests_to_disable_one_core;
/**
* 在 count_of_requests_to_disable_one_core 等于本 value 的时候,
* 将执行确实的 disable_one_core 操作.
*/
#define NUM_OF_REQUESTS_TO_REALLY_DISABLE_ONE_CORE (10)
static struct work_struct wq_work;
static void set_num_cores(struct work_struct *work)
@@ -114,17 +127,30 @@ void mali_core_scaling_update(struct mali_gpu_utilization_data *data)
num_cores_total));
/* NOTE:
* this function is normally called directly
* from the utilization callback which is in timer context. */
* this function
* is normally called directly
* from the utilization callback
* which is in timer context. */
if (PERCENT_OF(90, 256) < data->utilization_pp)
if (PERCENT_OF(90, 256) < data->utilization_pp) {
V("to enable max num of pp_cores.");
enable_max_num_cores();
else if (PERCENT_OF(50, 256) < data->utilization_pp)
count_of_requests_to_disable_one_core = 0;
} else if (PERCENT_OF(50, 256) < data->utilization_pp) {
V("to enable more one pp_core.");
enable_one_core();
else if (PERCENT_OF(40, 256) < data->utilization_pp)
MALI_DEBUG_PRINT(6, ("do nothing"));
else if (PERCENT_OF(0, 256) < data->utilization_pp)
disable_one_core();
else
MALI_DEBUG_PRINT(6, ("do nothing"));
count_of_requests_to_disable_one_core = 0;
} else if (PERCENT_OF(40, 256) < data->utilization_pp) {
count_of_requests_to_disable_one_core = 0;
} else if (PERCENT_OF(0, 256) < data->utilization_pp) {
count_of_requests_to_disable_one_core++;
if (count_of_requests_to_disable_one_core
>= NUM_OF_REQUESTS_TO_REALLY_DISABLE_ONE_CORE) {
V("to disable a pp_core.");
disable_one_core();
count_of_requests_to_disable_one_core = 0;
}
} else {
count_of_requests_to_disable_one_core = 0;
}
}