From 29295b26180ec5879e4225a54d5f78b2dd456d8d Mon Sep 17 00:00:00 2001 From: chenzhen Date: Wed, 23 Sep 2015 11:40:15 +0800 Subject: [PATCH] rk312x, mali_400: correct coding style in platform_dependent_part. Change-Id: I312b59f8875fd5d115a3a1c1e925a38afe8e7fa6 Signed-off-by: chenzhen --- .../mali/platform/rk30/arm_core_scaling.c | 32 +- .../mali400/mali/platform/rk30/custom_log.h | 472 ++++++++++-------- .../mali400/mali/platform/rk30/mali_dvfs.c | 391 ++++++++------- .../mali400/mali/platform/rk30/mali_dvfs.h | 60 +-- .../mali/platform/rk30/mali_platform.c | 88 ++-- .../mali/platform/rk30/mali_platform.h | 12 +- .../arm/mali400/mali/platform/rk30/rk3066.c | 26 +- .../arm/mali400/mali/platform/rk30/rk_ext.h | 97 ++-- 8 files changed, 605 insertions(+), 573 deletions(-) diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/arm_core_scaling.c b/drivers/gpu/arm/mali400/mali/platform/rk30/arm_core_scaling.c index 6c50e894136e..8cb95dcaaf7d 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/arm_core_scaling.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/arm_core_scaling.c @@ -28,6 +28,7 @@ static struct work_struct wq_work; static void set_num_cores(struct work_struct *work) { int err = mali_perf_set_num_pp_cores(num_cores_enabled); + MALI_DEBUG_ASSERT(0 == err); MALI_IGNORE(err); } @@ -61,7 +62,8 @@ static void enable_max_num_cores(void) if (num_cores_enabled < num_cores_total) { num_cores_enabled = num_cores_total; schedule_work(&wq_work); - MALI_DEBUG_PRINT(3, ("Core scaling: Enabling maximum number of cores\n")); + MALI_DEBUG_PRINT(3, + ("Core scaling: Enabling max num of cores\n")); } MALI_DEBUG_ASSERT(num_cores_total == num_cores_enabled); @@ -103,20 +105,26 @@ void mali_core_scaling_update(struct mali_gpu_utilization_data *data) * in order to make a good core scaling algorithm. */ - MALI_DEBUG_PRINT(3, ("Utilization: (%3d, %3d, %3d), cores enabled: %d/%d\n", data->utilization_gpu, data->utilization_gp, data->utilization_pp, num_cores_enabled, num_cores_total)); + MALI_DEBUG_PRINT(3, + ("Utilization:(%3d, %3d, %3d), cores enabled: %d/%d\n", + data->utilization_gpu, + data->utilization_gp, + data->utilization_pp, + num_cores_enabled, + num_cores_total)); - /* NOTE: this function is normally called directly from the utilization callback which is in - * timer context. */ + /* NOTE: + * 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) enable_max_num_cores(); - } else if (PERCENT_OF(50, 256) < data->utilization_pp) { + else if (PERCENT_OF(50, 256) < data->utilization_pp) enable_one_core(); - } else if (PERCENT_OF(40, 256) < data->utilization_pp) { - /* do nothing */ - } else if (PERCENT_OF(0, 256) < data->utilization_pp) { + 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 { - /* do nothing */ - } + else + MALI_DEBUG_PRINT(6, ("do nothing")); } diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/custom_log.h b/drivers/gpu/arm/mali400/mali/platform/rk30/custom_log.h index 3e3de1bafd44..f3a801804a20 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/custom_log.h +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/custom_log.h @@ -1,222 +1,250 @@ -/* -------------------------------------------------------------------------------------------------------- - * File: custom_log.h - * - * Desc: ChenZhen Æ«ºÃµÄ log Êä³öµÄ¶¨ÖÆÊµÏÖ. - * - * ----------------------------------------------------------------------------------- - * < ϰÓï ºÍ ËõÂÔÓï > : - * - * ----------------------------------------------------------------------------------- - * Usage: - * - * Note: - * - * Author: ChenZhen - * - * -------------------------------------------------------------------------------------------------------- - * Version: - * v1.0 - * -------------------------------------------------------------------------------------------------------- - * Log: - ----Fri Nov 19 15:20:28 2010 v1.0 - * - * -------------------------------------------------------------------------------------------------------- - */ - - -#ifndef __CUSTOM_LOG_H__ -#define __CUSTOM_LOG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* --------------------------------------------------------------------------------------------------------- - * Include Files - * --------------------------------------------------------------------------------------------------------- - */ -#include - - -/* --------------------------------------------------------------------------------------------------------- - * Macros Definition - * --------------------------------------------------------------------------------------------------------- - */ - -/** ÈôÏÂÁÐ macro Óб»¶¨Òå, ²Å ʹÄÜ log Êä³ö. */ -#define ENABLE_DEBUG_LOG - -/** .! : ÈôÐèҪȫ¾ÖµØ¹Ø±Õ D log, ¿ÉÒÔʹÄÜÏÂÃæµÄ´úÂë. */ -/* -#undef ENABLE_DEBUG_LOG -#warning "custom debug log is disabled globally!" -*/ - -#define LOGD(fmt, args...) \ - printk(KERN_DEBUG fmt "\n", ## args) - -/*---------------------------------------------------------------------------*/ - -#ifdef ENABLE_VERBOSE_LOG -/** Verbose log. */ -#define V(fmt, args...) \ - { printk(KERN_DEBUG "V : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); } -#else -#define V(...) ((void)0) -#endif - - -#ifdef ENABLE_DEBUG_LOG -/** Debug log. */ -#define D(fmt, args...) \ - { printk(KERN_DEBUG "D : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); } -#else -#define D(...) ((void)0) -#endif - -#define I(fmt, args...) \ - { printk(KERN_INFO "I : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); } - -#define W(fmt, args...) \ - { printk(KERN_WARNING "W : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); } - -#define E(fmt, args...) \ - { printk(KERN_ERR "E : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); } - -/*-------------------------------------------------------*/ - -/** ʹÓà D(), ÒÔÊ®½øÖƵÄÐÎʽ´òÓ¡±äÁ¿ 'var' µÄ value. */ -#define D_DEC(var) D(#var " = %d.", var); - -#define E_DEC(var) E(#var " = %d.", var); - -/** ʹÓà D(), ÒÔÊ®Áù½øÖƵÄÐÎʽ´òÓ¡±äÁ¿ 'var' µÄ value. */ -#define D_HEX(var) D(#var " = 0x%x.", var); - -#define E_HEX(var) E(#var " = 0x%x.", var); - -/** ʹÓà D(), ÒÔÊ®Áù½øÖƵÄÐÎʽ ´òÓ¡Ö¸ÕëÀàÐͱäÁ¿ 'ptr' µÄ value. */ -#define D_PTR(ptr) D(#ptr " = %p.", ptr); - -#define E_PTR(ptr) E(#ptr " = %p.", ptr); - -/** ʹÓà D(), ´òÓ¡ char ×Ö´®. */ -#define D_STR(pStr) \ -{\ - if ( NULL == pStr )\ - {\ - D(#pStr" = NULL.");\ - }\ - else\ - {\ - D(#pStr" = '%s'.", pStr);\ - }\ -} - -#define E_STR(pStr) \ -{\ - if ( NULL == pStr )\ - {\ - E(#pStr" = NULL.");\ - }\ - else\ - {\ - E(#pStr" = '%s'.", pStr);\ - }\ -} - -#ifdef ENABLE_DEBUG_LOG -/** - * log ´Ó 'pStart' µØÖ·¿ªÊ¼µÄ 'len' ¸ö×Ö½ÚµÄÊý¾Ý. - */ -#define D_MEM(pStart, len) \ - {\ - int i = 0;\ - char* p = (char*)pStart;\ - D("dump memory from addr of '" #pStart "', from %p, length %d' : ", pStart, len); \ - printk("\t\t");\ - for ( i = 0; i < len ; i++ )\ - {\ - printk("0x%02x, ", p[i] );\ - }\ - printk("\n");\ - } -#else -#define D_MEM(...) ((void)0) -#endif - -/*-------------------------------------------------------*/ - -#define EXIT_FOR_DEBUG \ -{\ - E("To exit for debug.");\ - return 1;\ -} - -/*-------------------------------------------------------*/ - -/** - * µ÷Óú¯Êý, ²¢¼ì²é·µ»ØÖµ, ¸ù¾Ý·µ»ØÖµ¾ö¶¨ÊÇ·ñÌø×ªµ½Ö¸¶¨µÄ´íÎó´¦Àí´úÂë. - * @param functionCall - * ¶ÔÌØ¶¨º¯ÊýµÄµ÷ÓÃ, ¸Ãº¯ÊýµÄ·µ»ØÖµ±ØÐëÊÇ ±íÕ÷ ³É¹¦ or err µÄ ÕûÐÍÊý. - * ÕâÀï, ±»µ÷Óú¯Êý "±ØÐë" ÊDZ»¶¨ÒåΪ "·µ»Ø 0 ±íʾ²Ù×÷³É¹¦". - * @param result - * ÓÃÓڼǼº¯Êý·µ»ØµÄ error code µÄ ÕûÐͱäÁ¿, ͨ³£ÊÇ "ret" or "result" µÈ. - * @param label - * Èôº¯Êý·µ»Ø´íÎó, ³ÌÐò½«ÒªÌø×ªµ½µÄ ´íÎó´¦Àí´¦µÄ ±êºÅ, ͨ³£¾ÍÊÇ "EXIT". - */ -#define CHECK_FUNC_CALL(functionCall, result, label) \ -{\ - if ( 0 != ( (result) = (functionCall) ) )\ - {\ - E("Function call returned error : " #result " = %d.", result);\ - goto label;\ - }\ -} - -/** - * ÔÚÌØ¶¨Ìõ¼þÏÂ, Åж¨ error ·¢Éú, ¶Ô±äÁ¿ 'retVar' ÉèÖà 'errCode', - * Log Êä³ö¶ÔÓ¦µÄ Error Caution, È»ºóÌø×ª 'label' Ö¸¶¨µÄ´úÂë´¦Ö´ÐÐ. - * @param msg - * ´¿×Ö´®ÐÎʽµÄÌáʾÐÅÏ¢. - * @param retVar - * ±êʶº¯ÊýÖ´ÐÐ״̬»òÕß½á¹ûµÄ±äÁ¿, ½«±»ÉèÖþßÌåµÄ Error Code. - * ͨ³£ÊÇ 'ret' or 'result'. - * @param errCode - * ±íÕ÷ÌØ¶¨ error µÄ³£Êý±êʶ, ͨ³£ÊÇ ºêµÄÐÎ̬. - * @param label - * ³ÌÐò½«ÒªÌø×ªµ½µÄ´íÎó´¦Àí´úÂëµÄ±êºÅ, ͨ³£¾ÍÊÇ 'EXIT'. - * @param args... - * ¶ÔÓ¦ 'msgFmt' ʵ²ÎÖÐ '%s', '%d', ... µÈ ת»»ËµÃ÷·û µÄ¾ßÌå¿É±ä³¤Êµ²Î. - */ -#define SET_ERROR_AND_JUMP(msgFmt, retVar, errCode, label, args...) \ -{\ - E("To set '" #retVar "' to %d('" #errCode "'), because : " msgFmt, (errCode), ## args);\ - (retVar) = (errCode);\ - goto label;\ -} - - -/* --------------------------------------------------------------------------------------------------------- - * Types and Structures Definition - * --------------------------------------------------------------------------------------------------------- - */ - - -/* --------------------------------------------------------------------------------------------------------- - * Global Functions' Prototype - * --------------------------------------------------------------------------------------------------------- - */ - - -/* --------------------------------------------------------------------------------------------------------- - * Inline Functions Implementation - * --------------------------------------------------------------------------------------------------------- - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CUSTOM_LOG_H__ */ - +/* ---------------------------------------------------------------------------- + * File: custom_log.h + * + * Desc: ChenZhen 偏好的 log 输出的定制实现. + * + * -------------------------------------------------------------------- + * < 习语 和 缩略语 > : + * + * -------------------------------------------------------------------- + * Usage: + * + * Note: + * + * Author: ChenZhen + * + * ---------------------------------------------------------------------------- + * Version: + * v1.0 + * ---------------------------------------------------------------------------- + * Log: + ----Fri Nov 19 15:20:28 2010 v1.0 + * + * ---------------------------------------------------------------------------- + */ + + +#ifndef __CUSTOM_LOG_H__ +#define __CUSTOM_LOG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------------------------------------------------------- + * Include Files + * ----------------------------------------------------------------------------- + */ +#include +#include + + +/* ----------------------------------------------------------------------------- + * Macros Definition + * ----------------------------------------------------------------------------- + */ + +/** 若下列 macro 有被定义, 才 使能 log 输出. */ +/* #define ENABLE_DEBUG_LOG */ + +/** .! : 若需要全局地关闭 D log, 可以使能下面的代码. */ +/* +#undef ENABLE_DEBUG_LOG +#warning "custom debug log is disabled globally!" +*/ + +/*----------------------------------------------------------------------------*/ + +#ifdef ENABLE_VERBOSE_LOG +/** Verbose log. */ +#define V(fmt, args...) \ + pr_debug("V : [File] : %s; [Line] : %d; [Func] : %s(); " fmt \ + "\n", \ + __FILE__, \ + __LINE__, \ + __func__, \ + ## args) +#else +#define V(...) ((void)0) +#endif + + +#ifdef ENABLE_DEBUG_LOG +/** Debug log. */ +#define D(fmt, args...) \ + pr_debug("D : [File] : %s; [Line] : %d; [Func] : %s(); " fmt \ + "\n", \ + __FILE__, \ + __LINE__, \ + __func__, \ + ## args) +#else +#define D(...) ((void)0) +#endif + +#define I(fmt, args...) \ + pr_info("I : [File] : %s; [Line] : %d; [Func] : %s(); " fmt \ + "\n", \ + __FILE__, \ + __LINE__, \ + __func__, \ + ## args) + +#define W(fmt, args...) \ + pr_warn("W : [File] : %s; [Line] : %d; [Func] : %s(); " \ + fmt "\n", \ + __FILE__, \ + __LINE__, \ + __func__, \ + ## args) + +#define E(fmt, args...) \ + pr_err("E : [File] : %s; [Line] : %d; [Func] : %s(); " fmt \ + "\n", \ + __FILE__, \ + __LINE__, \ + __func__, \ + ## args) + +/*-------------------------------------------------------*/ + +/** 使用 D(), 以十进制的形式打印变量 'var' 的 value. */ +#define D_DEC(var) D(#var " = %d.", var) + +#define E_DEC(var) E(#var " = %d.", var) + +/** 使用 D(), 以十六进制的形式打印变量 'var' 的 value. */ +#define D_HEX(var) D(#var " = 0x%x.", var) + +#define E_HEX(var) E(#var " = 0x%x.", var) + +/** + * 使用 D(), 以十六进制的形式, + * 打印指针类型变量 'ptr' 的 value. + */ +#define D_PTR(ptr) D(#ptr " = %p.", ptr) + +#define E_PTR(ptr) E(#ptr " = %p.", ptr) + +/** 使用 D(), 打印 char 字串. */ +#define D_STR(p_str) \ +do { \ + if (NULL == p_str) { \ + D(#p_str" = NULL."); \ + else \ + D(#p_str" = '%s'.", p_str); \ +} while (0) + +#define E_STR(p_str) \ +do { \ + if (NULL == p_str) \ + E(#p_str" = NULL."); \ + else \ + E(#p_str" = '%s'.", p_str); \ +} while (0) + +#ifdef ENABLE_DEBUG_LOG +/** + * log 从 'p_start' 地址开始的 'len' 个字节的数据. + */ +#define D_MEM(p_start, len) \ +do { \ + int i = 0; \ + char *p = (char *)(p_start); \ + D("dump memory from addr of '" #p_start "', from %p, length %d' : ", \ + (p_start), \ + (len)); \ + pr_debug("\t\t"); \ + for (i = 0; i < (len); i++) \ + pr_debug("0x%02x, ", p[i]); \ + pr_debug("\n"); \ +} while (0) +#else +#define D_MEM(...) ((void)0) +#endif + +/*-------------------------------------------------------*/ + +#define EXIT_FOR_DEBUG \ +do { \ + E("To exit for debug."); \ + return 1; \ +} while (0) + +/*-------------------------------------------------------*/ + +/** + * 调用函数, 并检查返回值, 根据返回值决定是否跳转到指定的错误处理代码. + * @param func_call + * 对特定函数的调用, + * 该函数的返回值必须是 表征 成功 or err 的 整型数. + * 且被 "必须" 被定义为 "返回 0 表示操作成功". + * @param result + * 用于记录函数返回的 error code 的 整型变量, + * 通常是 "ret" or "result" 等. + * @param label + * 若函数返回错误, + * 程序将要跳转到的 错误处理处的 标号, + * 通常就是 "EXIT". + */ +#define CHECK_FUNC_CALL(func_call, result, label) \ +do { \ + (result) = (func_call) \ + if (0 != (result)) { \ + E("Function call returned error : " #result " = %d.", result); \ + goto label;\ + } \ +} while (0) + +/** + * 在特定条件下, 判定 error 发生, 对变量 'ret_var' 设置 'err_code', + * Log 输出对应的 Error Caution, + * 然后跳转 'label' 指定的代码处执行. + * @param msg + * 纯字串形式的提示信息. + * @param ret_var + * 标识函数执行状态或者结果的变量, + * 将被设置具体的 Error Code. + * 通常是 'ret' or 'result'. + * @param err_code + * 表征特定 error 的常数标识, + * 通常是 宏的形态. + * @param label + * 程序将要跳转到的错误处理代码的标号, + * 通常就是 'EXIT'. + * @param args... + * 对应 'msg_fmt' 实参中, + * '%s', '%d', ... 等转换说明符的具体可变长实参. + */ +#define SET_ERROR_AND_JUMP(msg_fmt, ret_var, err_code, label, args...) \ +do { \ + E("To set '" #ret_var "' to %d('" #err_code "'), because : " msg_fmt, \ + (err_code), \ + ## args); \ + (ret_var) = (err_code); \ + goto label; \ +} while (0) + + +/* ----------------------------------------------------------------------------- + * Types and Structures Definition + * ----------------------------------------------------------------------------- + */ + + +/* ----------------------------------------------------------------------------- + * Global Functions' Prototype + * ----------------------------------------------------------------------------- + */ + + +/* ----------------------------------------------------------------------------- + * Inline Functions Implementation + * ----------------------------------------------------------------------------- + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __CUSTOM_LOG_H__ */ diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.c b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.c index 0402e6dcc095..26ca41cba127 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.c @@ -1,190 +1,201 @@ -/* - * Rockchip SoC Mali-450 DVFS driver - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software FoundatIon. - */ - -#include "mali_platform.h" -#include "mali_dvfs.h" - -#define level0_min 0 -#define level0_max 70 -#define levelf_max 100 - -#define mali_dividend 7 -#define mali_fix_float(a) ((((a)*mali_dividend)%10)?((((a)*mali_dividend)/10)+1):(((a)*mali_dividend)/10)) - -#define work_to_dvfs(w) container_of(w, struct mali_dvfs, work) -#define dvfs_to_drv_data(dvfs) container_of(dvfs, struct mali_platform_drv_data, dvfs) - -static void mali_dvfs_event_proc(struct work_struct *w) -{ - struct mali_dvfs *dvfs = work_to_dvfs(w); - struct mali_platform_drv_data *drv_data = dvfs_to_drv_data(dvfs); - unsigned int utilisation = dvfs->utilisation; - unsigned int level = dvfs->current_level; - const struct mali_fv_info *threshold = &drv_data->fv_info[level]; - int ret; - - utilisation = utilisation * 100 / 256; - - // dev_dbg(drv_data->dev, "utilisation percent = %d\n", utilisation); - - if (utilisation > threshold->max && - level < drv_data->fv_info_length - 1 ) - level += 1; - else if (level > 0 && utilisation < threshold->min) - level -= 1; - else - return; - - dev_dbg(drv_data->dev, "Setting dvfs level %u: freq = %lu Hz\n", - level, drv_data->fv_info[level].freq); - - ret = mali_set_level(drv_data->dev, level); - if (ret) { - dev_err(drv_data->dev, "set freq error, %d", ret); - return; - } -} - -bool mali_dvfs_is_enabled(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - return dvfs->enabled; -} - -void mali_dvfs_enable(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - dvfs->enabled = true; -} - -void mali_dvfs_disable(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - dvfs->enabled = false; - cancel_work_sync(&dvfs->work); -} - -unsigned int mali_dvfs_utilisation(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - return dvfs->utilisation; -} - -int mali_dvfs_event(struct device *dev, u32 utilisation) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - dvfs->utilisation = utilisation; - - if (dvfs->enabled) - schedule_work(&dvfs->work); - - return MALI_TRUE; -} -static void mali_dvfs_threshold(u32 div, struct mali_platform_drv_data *drv_data) -{ - int length = drv_data->fv_info_length; - u32 pre_level; - u32 tmp; - int level; - - for (level = 0; level < length; level++) { - if (level == 0) { - drv_data->fv_info[level].min = level0_min; - if (length == 1) - drv_data->fv_info[level].max = levelf_max; - else - drv_data->fv_info[level].max = level0_max; - } else { - pre_level = level - 1; - if (level == length - 1) - drv_data->fv_info[level].max = levelf_max; - else - drv_data->fv_info[level].max = drv_data->fv_info[pre_level].max + div; - - drv_data->fv_info[level].min = drv_data->fv_info[pre_level].max * - drv_data->fv_info[pre_level].freq / drv_data->fv_info[level].freq; - - tmp = drv_data->fv_info[level].max - drv_data->fv_info[level].min; - drv_data->fv_info[level].min += mali_fix_float(tmp); - } - - dev_info(drv_data->dev, "freq: %lu, min_threshold: %d, max_threshold: %d\n", - drv_data->fv_info[level].freq, - drv_data->fv_info[level].min, - drv_data->fv_info[level].max); - } -} - -int mali_dvfs_init(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - struct cpufreq_frequency_table *freq_table; - int i = 0; - int div_dvfs; - int ret; - - freq_table = dvfs_get_freq_volt_table(drv_data->clk); - if (!freq_table) { - dev_err(dev, "Can't find dvfs table in dts\n"); - return -1; - } - - while (freq_table[i].frequency != CPUFREQ_TABLE_END) { - drv_data->fv_info_length++; - i++; - } - - drv_data->fv_info = devm_kcalloc(dev, drv_data->fv_info_length, - sizeof(*drv_data->fv_info), - GFP_KERNEL); - if (!drv_data->fv_info) - return -ENOMEM; - - for (i = 0; i < drv_data->fv_info_length; i++) - drv_data->fv_info[i].freq = freq_table[i].frequency * 1000; - - if(drv_data->fv_info_length > 1) - div_dvfs = round_up(((levelf_max - level0_max) / - (drv_data->fv_info_length-1)), 1); - - mali_dvfs_threshold(div_dvfs, drv_data); - - ret = dvfs_clk_set_rate(drv_data->clk, drv_data->fv_info[0].freq); - if (ret) - return ret; - - drv_data->dvfs.current_level = 0; - - dev_info(dev, "initial freq = %lu\n", - dvfs_clk_get_rate(drv_data->clk)); - - INIT_WORK(&dvfs->work, mali_dvfs_event_proc); - dvfs->enabled = true; - - return 0; -} - -void mali_dvfs_term(struct device *dev) -{ - struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - struct mali_dvfs *dvfs = &drv_data->dvfs; - - dvfs->enabled = false; - cancel_work_sync(&dvfs->work); -} +/* + * Rockchip SoC Mali-450 DVFS driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software FoundatIon. + */ + +#include "mali_platform.h" +#include "mali_dvfs.h" + +#define level0_min 0 +#define level0_max 70 +#define levelf_max 100 + +#define mali_dividend 7 +#define mali_fix_float(a) \ + ((((a) * mali_dividend) % 10) \ + ? ((((a) * mali_dividend) / 10) + 1) \ + : (((a) * mali_dividend) / 10)) + +#define work_to_dvfs(w) container_of(w, struct mali_dvfs, work) +#define dvfs_to_drv_data(dvfs) \ + container_of(dvfs, struct mali_platform_drv_data, dvfs) + +static void mali_dvfs_event_proc(struct work_struct *w) +{ + struct mali_dvfs *dvfs = work_to_dvfs(w); + struct mali_platform_drv_data *drv_data = dvfs_to_drv_data(dvfs); + unsigned int utilisation = dvfs->utilisation; + unsigned int level = dvfs->current_level; + const struct mali_fv_info *threshold = &drv_data->fv_info[level]; + int ret; + + utilisation = utilisation * 100 / 256; + + /* dev_dbg(drv_data->dev, "utilisation percent = %d\n", utilisation); */ + + if (utilisation > threshold->max && + level < drv_data->fv_info_length - 1) + level += 1; + else if (level > 0 && utilisation < threshold->min) + level -= 1; + else + return; + + dev_dbg(drv_data->dev, "Setting dvfs level %u: freq = %lu Hz\n", + level, drv_data->fv_info[level].freq); + + ret = mali_set_level(drv_data->dev, level); + if (ret) { + dev_err(drv_data->dev, "set freq error, %d", ret); + return; + } +} + +bool mali_dvfs_is_enabled(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + return dvfs->enabled; +} + +void mali_dvfs_enable(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + dvfs->enabled = true; +} + +void mali_dvfs_disable(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + dvfs->enabled = false; + cancel_work_sync(&dvfs->work); +} + +unsigned int mali_dvfs_utilisation(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + return dvfs->utilisation; +} + +int mali_dvfs_event(struct device *dev, u32 utilisation) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + dvfs->utilisation = utilisation; + + if (dvfs->enabled) + schedule_work(&dvfs->work); + + return MALI_TRUE; +} +static void mali_dvfs_threshold(u32 div, + struct mali_platform_drv_data *drv_data) +{ + int length = drv_data->fv_info_length; + u32 pre_level; + u32 tmp; + int level; + + for (level = 0; level < length; level++) { + if (level == 0) { + drv_data->fv_info[level].min = level0_min; + if (length == 1) + drv_data->fv_info[level].max = levelf_max; + else + drv_data->fv_info[level].max = level0_max; + } else { + pre_level = level - 1; + if (level == length - 1) + drv_data->fv_info[level].max = levelf_max; + else + drv_data->fv_info[level].max = + drv_data->fv_info[pre_level].max + + div; + + drv_data->fv_info[level].min = + drv_data->fv_info[pre_level].max + * drv_data->fv_info[pre_level].freq + / drv_data->fv_info[level].freq; + + tmp = + drv_data->fv_info[level].max + - drv_data->fv_info[level].min; + drv_data->fv_info[level].min += mali_fix_float(tmp); + } + + dev_info(drv_data->dev, + "freq: %lu, min_threshold: %d, max_threshold: %d\n", + drv_data->fv_info[level].freq, + drv_data->fv_info[level].min, + drv_data->fv_info[level].max); + } +} + +int mali_dvfs_init(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + struct cpufreq_frequency_table *freq_table; + int i = 0; + int div_dvfs; + int ret; + + freq_table = dvfs_get_freq_volt_table(drv_data->clk); + if (!freq_table) { + dev_err(dev, "Can't find dvfs table in dts\n"); + return -1; + } + + while (freq_table[i].frequency != CPUFREQ_TABLE_END) { + drv_data->fv_info_length++; + i++; + } + + drv_data->fv_info = devm_kcalloc(dev, drv_data->fv_info_length, + sizeof(*drv_data->fv_info), + GFP_KERNEL); + if (!drv_data->fv_info) + return -ENOMEM; + + for (i = 0; i < drv_data->fv_info_length; i++) + drv_data->fv_info[i].freq = freq_table[i].frequency * 1000; + + if (drv_data->fv_info_length > 1) + div_dvfs = round_up(((levelf_max - level0_max) / + (drv_data->fv_info_length-1)), 1); + + mali_dvfs_threshold(div_dvfs, drv_data); + + ret = dvfs_clk_set_rate(drv_data->clk, drv_data->fv_info[0].freq); + if (ret) + return ret; + + drv_data->dvfs.current_level = 0; + + dev_info(dev, "initial freq = %lu\n", dvfs_clk_get_rate(drv_data->clk)); + + INIT_WORK(&dvfs->work, mali_dvfs_event_proc); + dvfs->enabled = true; + + return 0; +} + +void mali_dvfs_term(struct device *dev) +{ + struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); + struct mali_dvfs *dvfs = &drv_data->dvfs; + + dvfs->enabled = false; + cancel_work_sync(&dvfs->work); +} diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.h b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.h index d204b854f020..ddb68d99ca35 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.h +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_dvfs.h @@ -1,30 +1,30 @@ -/* - * Rockchip SoC Mali-450 DVFS driver - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software FoundatIon. - */ -#include -#include -#include - -#ifndef _MALI_DVFS_H_ -#define _MALI_DVFS_H_ - -struct mali_dvfs { - struct work_struct work; - unsigned int utilisation; - unsigned int current_level; - bool enabled; -}; - -int mali_dvfs_init(struct device *dev); -void mali_dvfs_term(struct device *dev); -void mali_set_dvfs(struct device *dev, bool enable); -bool mali_dvfs_is_enabled(struct device *dev); -void mali_dvfs_enable(struct device *dev); -void mali_dvfs_disable(struct device *dev); -unsigned int mali_dvfs_utilisation(struct device *dev); -int mali_dvfs_event(struct device *dev, u32 utilisation); -#endif /*_MALI_DVFS_H_*/ +/* + * Rockchip SoC Mali-450 DVFS driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software FoundatIon. + */ +#include +#include +#include + +#ifndef _MALI_DVFS_H_ +#define _MALI_DVFS_H_ + +struct mali_dvfs { + struct work_struct work; + unsigned int utilisation; + unsigned int current_level; + bool enabled; +}; + +int mali_dvfs_init(struct device *dev); +void mali_dvfs_term(struct device *dev); +void mali_set_dvfs(struct device *dev, bool enable); +bool mali_dvfs_is_enabled(struct device *dev); +void mali_dvfs_enable(struct device *dev); +void mali_dvfs_disable(struct device *dev); +unsigned int mali_dvfs_utilisation(struct device *dev); +int mali_dvfs_event(struct device *dev, u32 utilisation); +#endif /*_MALI_DVFS_H_*/ diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.c b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.c index 121487de34bb..2e233e0ccea0 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -44,19 +44,19 @@ int mali_set_level(struct device *dev, int level) int ret; unsigned int current_level; - _mali_osk_mutex_wait(drv_data->clockSetlock); + _mali_osk_mutex_wait(drv_data->clock_set_lock); current_level = drv_data->dvfs.current_level; freq = drv_data->fv_info[level].freq; if (level == current_level) { - _mali_osk_mutex_signal(drv_data->clockSetlock); + _mali_osk_mutex_signal(drv_data->clock_set_lock); return 0; } ret = dvfs_clk_set_rate(drv_data->clk, freq); if (ret) { - _mali_osk_mutex_signal(drv_data->clockSetlock); + _mali_osk_mutex_signal(drv_data->clock_set_lock); return ret; } @@ -64,7 +64,7 @@ int mali_set_level(struct device *dev, int level) drv_data->dvfs.current_level = level; - _mali_osk_mutex_signal(drv_data->clockSetlock); + _mali_osk_mutex_signal(drv_data->clock_set_lock); return 0; } @@ -135,12 +135,15 @@ static ssize_t show_clock(struct device *dev, { struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%lu\n", dvfs_clk_get_rate(drv_data->clk)); + return scnprintf(buf, + PAGE_SIZE, + "%lu\n", + dvfs_clk_get_rate(drv_data->clk)); } static ssize_t set_clock(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -{ +{ struct mali_platform_drv_data *drv_data = dev_get_drvdata(dev); unsigned long freq; ssize_t ret; @@ -152,6 +155,7 @@ static ssize_t set_clock(struct device *dev, struct device_attribute *attr, for (level = drv_data->fv_info_length - 1; level > 0; level--) { unsigned long tmp = drv_data->fv_info[level].freq; + if (tmp <= freq) break; } @@ -166,14 +170,16 @@ static ssize_t set_clock(struct device *dev, struct device_attribute *attr, } static ssize_t show_dvfs_enable(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, + char *buf) { return scnprintf(buf, PAGE_SIZE, "%u\n", mali_dvfs_is_enabled(dev)); } static ssize_t set_dvfs_enable(struct device *dev, - struct device_attribute *attr, const char *buf, - size_t count) + struct device_attribute *attr, + const char *buf, + size_t count) { unsigned long enable; ssize_t ret; @@ -193,12 +199,15 @@ static ssize_t set_dvfs_enable(struct device *dev, } static ssize_t show_utilisation(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, + char *buf) { return scnprintf(buf, PAGE_SIZE, "%u\n", mali_dvfs_utilisation(dev)); } -static int error_count_show(struct device *dev,struct device_attribute *attr, char *buf) +static int error_count_show(struct device *dev, + struct device_attribute *attr, + char *buf) { return sprintf(buf, "%d\n", mali_group_error); } @@ -268,15 +277,16 @@ _mali_osk_errcode_t mali_platform_init(struct platform_device *pdev) if (ret) goto term_clk; - mali_drv_data->clockSetlock = _mali_osk_mutex_init(_MALI_OSK_LOCKFLAG_ORDERED, - _MALI_OSK_LOCK_ORDER_UTILIZATION); + mali_drv_data->clock_set_lock = + _mali_osk_mutex_init(_MALI_OSK_LOCKFLAG_ORDERED, + _MALI_OSK_LOCK_ORDER_UTILIZATION); mali_core_scaling_enable = 1; - return 0; + return 0; term_clk: mali_clock_term(dev); err_init: - return _MALI_OSK_ERR_FAULT; + return _MALI_OSK_ERR_FAULT; } _mali_osk_errcode_t mali_platform_deinit(struct platform_device *pdev) @@ -286,7 +296,7 @@ _mali_osk_errcode_t mali_platform_deinit(struct platform_device *pdev) mali_core_scaling_term(); mali_clock_term(dev); - _mali_osk_mutex_term(drv_data->clockSetlock); + _mali_osk_mutex_term(drv_data->clock_set_lock); return 0; } @@ -312,37 +322,39 @@ _mali_osk_errcode_t mali_power_domain_control(u32 bpower_off) return 0; } -_mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode) +_mali_osk_errcode_t mali_platform_power_mode_change( + enum mali_power_mode power_mode) { - switch(power_mode) { - case MALI_POWER_MODE_ON: - MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_ON\r\n")); - mali_power_domain_control(MALI_POWER_MODE_ON); - break; - case MALI_POWER_MODE_LIGHT_SLEEP: - MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_LIGHT_SLEEP\r\n")); - mali_power_domain_control(MALI_POWER_MODE_LIGHT_SLEEP); - break; - case MALI_POWER_MODE_DEEP_SLEEP: - MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_DEEP_SLEEP\r\n")); - mali_power_domain_control(MALI_POWER_MODE_DEEP_SLEEP); - break; - default: - MALI_DEBUG_PRINT(2, ("mali_platform_power_mode_change:power_mode(%d) not support \r\n", - power_mode)); + switch (power_mode) { + case MALI_POWER_MODE_ON: + MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_ON\r\n")); + mali_power_domain_control(MALI_POWER_MODE_ON); + break; + case MALI_POWER_MODE_LIGHT_SLEEP: + MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_LIGHT_SLEEP\r\n")); + mali_power_domain_control(MALI_POWER_MODE_LIGHT_SLEEP); + break; + case MALI_POWER_MODE_DEEP_SLEEP: + MALI_DEBUG_PRINT(2, ("MALI_POWER_MODE_DEEP_SLEEP\r\n")); + mali_power_domain_control(MALI_POWER_MODE_DEEP_SLEEP); + break; + default: + MALI_DEBUG_PRINT(2, + (":power_mode(%d) not support \r\n", + power_mode)); } - - return 0; + + return 0; } void mali_gpu_utilization_handler(struct mali_gpu_utilization_data *data) { - if(data->utilization_pp > 256) + if (data->utilization_pp > 256) return; if (mali_core_scaling_enable) mali_core_scaling_update(data); - // dev_dbg(mali_dev, "utilization:%d\r\n", data->utilization_pp); + /* dev_dbg(mali_dev, "utilization:%d\r\n", data->utilization_pp); */ mali_dvfs_event(mali_dev, data->utilization_pp); } diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.h b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.h index a493d70c37c1..6c97498444ae 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.h +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/mali_platform.h @@ -28,12 +28,11 @@ extern "C" { /** @brief description of power change reasons */ -typedef enum mali_power_mode_tag -{ +enum mali_power_mode { MALI_POWER_MODE_ON, /**< Power Mali on */ MALI_POWER_MODE_LIGHT_SLEEP, /**< Mali has been idle for a short time, or runtime PM suspend */ MALI_POWER_MODE_DEEP_SLEEP, /**< Mali has been idle for a long time, or OS suspend */ -} mali_power_mode; +}; struct mali_fv_info { unsigned long freq; @@ -48,8 +47,8 @@ struct mali_platform_drv_data { unsigned int fv_info_length; struct mali_dvfs dvfs; struct device *dev; - bool power_state; - _mali_osk_mutex_t *clockSetlock; + bool power_state; + _mali_osk_mutex_t *clock_set_lock; }; /** @brief Platform specific setup and initialisation of MALI @@ -75,7 +74,8 @@ _mali_osk_errcode_t mali_platform_deinit(struct platform_device *pdev); * @param power_mode defines the power modes * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error. */ -_mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode); +_mali_osk_errcode_t mali_platform_power_mode_change( + enum mali_power_mode power_mode); /** @brief Platform specific handling of GPU utilization data diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/rk3066.c b/drivers/gpu/arm/mali400/mali/platform/rk30/rk3066.c index 7581721c58c1..4aabe0d70f0f 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/rk3066.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/rk3066.c @@ -7,7 +7,7 @@ * copies and copies may only be made to the extent permitted * by a licensing agreement from ARM Limited. */ - + #include #include #include @@ -27,6 +27,7 @@ static int mali_runtime_suspend(struct device *device) { int ret = 0; + MALI_DEBUG_PRINT(4, ("mali_runtime_suspend() called\n")); if (NULL != device->driver && @@ -44,6 +45,7 @@ static int mali_runtime_suspend(struct device *device) static int mali_runtime_resume(struct device *device) { int ret = 0; + MALI_DEBUG_PRINT(4, ("mali_runtime_resume() called\n")); mali_platform_power_mode_change(MALI_POWER_MODE_ON); @@ -61,6 +63,7 @@ static int mali_runtime_resume(struct device *device) static int mali_runtime_idle(struct device *device) { int ret = 0; + MALI_DEBUG_PRINT(4, ("mali_runtime_idle() called\n")); if (NULL != device->driver && @@ -83,7 +86,7 @@ static int mali_os_suspend(struct device *device) int ret = 0; MALI_DEBUG_PRINT(4, ("mali_os_suspend() called\n")); - + if (NULL != device->driver && NULL != device->driver->pm && NULL != device->driver->pm->suspend) { @@ -146,8 +149,7 @@ static int mali_os_thaw(struct device *device) return ret; } -static struct dev_pm_ops mali_gpu_device_type_pm_ops = -{ +static const struct dev_pm_ops mali_gpu_device_type_pm_ops = { .suspend = mali_os_suspend, .resume = mali_os_resume, .freeze = mali_os_freeze, @@ -159,18 +161,16 @@ static struct dev_pm_ops mali_gpu_device_type_pm_ops = #endif }; -static struct device_type mali_gpu_device_device_type = -{ +static const struct device_type mali_gpu_device_device_type = { .pm = &mali_gpu_device_type_pm_ops, }; -static struct mali_gpu_device_data mali_gpu_data = -{ - .shared_mem_size = 1024* 1024 * 1024, /* 1GB */ +static const struct mali_gpu_device_data mali_gpu_data = { + .shared_mem_size = 1024 * 1024 * 1024, /* 1GB */ .fb_start = 0x40000000, .fb_size = 0xb1000000, .max_job_runtime = 60000, /* 60 seconds */ - //.utilization_interval = 0, /* 0ms */ + /* .utilization_interval = 0, */ /* 0ms */ .utilization_callback = mali_gpu_utilization_handler, }; @@ -187,7 +187,8 @@ int mali_platform_device_init(struct platform_device *pdev) { int err = 0; int num_pp_cores = 0; - MALI_DEBUG_PRINT(2,("mali_platform_device_register() called\n")); + + MALI_DEBUG_PRINT(2, ("mali_platform_device_register() called\n")); if (cpu_is_rk312x()) num_pp_cores = 2; @@ -203,12 +204,9 @@ int mali_platform_device_init(struct platform_device *pdev) if (err == 0) { err = mali_platform_init(pdev); if (err == 0) { - #ifdef CONFIG_PM_RUNTIME -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) pm_runtime_set_autosuspend_delay(&(pdev->dev), 1000); pm_runtime_use_autosuspend(&(pdev->dev)); -#endif pm_runtime_enable(&(pdev->dev)); #endif MALI_DEBUG_ASSERT(0 < num_pp_cores); diff --git a/drivers/gpu/arm/mali400/mali/platform/rk30/rk_ext.h b/drivers/gpu/arm/mali400/mali/platform/rk30/rk_ext.h index d04213ccc528..ae00e99d9e73 100755 --- a/drivers/gpu/arm/mali400/mali/platform/rk30/rk_ext.h +++ b/drivers/gpu/arm/mali400/mali/platform/rk30/rk_ext.h @@ -1,61 +1,36 @@ -/* -------------------------------------------------------------------------------------------------------- - * File: rk_ext.h - * - * Desc: rk_ext_on_mali_ko 中的 通行定义等. - * - * Usage: - * - * Note: - * - * Author: ChenZhen - * - * Log: - * - * -------------------------------------------------------------------------------------------------------- - */ - - -#ifndef __RK_EXT_H__ -#define __RK_EXT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* --------------------------------------------------------------------------------------------------------- - * Include Files - * --------------------------------------------------------------------------------------------------------- - */ - - -/* --------------------------------------------------------------------------------------------------------- - * Macros Definition - * --------------------------------------------------------------------------------------------------------- - */ - -/** version of rk_ext on mali_ko, aka. rk_ko_ver. */ -#define RK_KO_VER (4) - -/* --------------------------------------------------------------------------------------------------------- - * Types and Structures Definition - * --------------------------------------------------------------------------------------------------------- - */ - - -/* --------------------------------------------------------------------------------------------------------- - * Global Functions' Prototype - * --------------------------------------------------------------------------------------------------------- - */ - - -/* --------------------------------------------------------------------------------------------------------- - * Inline Functions Implementation - * --------------------------------------------------------------------------------------------------------- - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RK_EXT_H__ */ - +/* ---------------------------------------------------------------------------- + * File: rk_ext.h + * + * Desc: rk_ext_on_mali_ko 中的 通行定义等. + * + * Usage: + * + * Note: + * + * Author: ChenZhen + * + * Log: + * + * ---------------------------------------------------------------------------- + */ + +#ifndef __RK_EXT_H__ +#define __RK_EXT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------*/ + +/** version of rk_ext on mali_ko, aka. rk_ko_ver. */ +#define RK_KO_VER (4) + +/*---------------------------------------------------------------------------*/ + +#ifdef __cplusplus +} +#endif + +#endif /* __RK_EXT_H__ */ + -- 2.34.1