From: Jiyu Yang Date: Fri, 11 Mar 2016 06:34:02 +0000 (+0800) Subject: PD#119939 add array check for dvfs table for mali450 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5154c8d437b5d7c9e88e9656d62db1e2f6aaa6b8;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_mali-driver.git PD#119939 add array check for dvfs table for mali450 Change-Id: I9f6b40f28f6ad779c65fffae70d41987a01ab10e --- diff --git a/mali/platform/meson_bu/scaling.c b/mali/platform/meson_bu/scaling.c index 1a725a1..54a6d66 100644 --- a/mali/platform/meson_bu/scaling.c +++ b/mali/platform/meson_bu/scaling.c @@ -405,6 +405,16 @@ static void mali_decide_next_status(struct mali_gpu_utilization_data *data, int* *pp_change_flag = -1; } } + + if (decided_fs_idx < 0 ) { + printk("gpu debug, next index below 0\n"); + decided_fs_idx = 0; + } + if (decided_fs_idx > pmali_plat->scale_info.maxclk) { + decided_fs_idx = pmali_plat->scale_info.maxclk; + printk("gpu debug, next index above max, set to %d\n", decided_fs_idx); + } + if (change_mode) mali_stay_count = pmali_plat->dvfs_table[decided_fs_idx].keep_count; *next_fs_idx = decided_fs_idx;