From d36974373f5f751bd536c6b3615d68ebd1dc6a69 Mon Sep 17 00:00:00 2001 From: Huan Biao Date: Fri, 23 Mar 2018 19:24:13 +0800 Subject: [PATCH] PD#161216: cooldev: fix k49 and k314 config change. Change-Id: I58fddf3ea8c12b8e4589b2bd95eef2d26d9ca348 Signed-off-by: Huan Biao --- gpu-v2.mk | 2 +- gpu.mk | 2 +- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- .../midgard/platform/devicetree/platform_gx.c | 13 +++++++++---- utgard/platform/meson_bu/platform_gx.c | 16 ++++++++++++---- utgard/platform/meson_m450/platform_m8.c | 12 ++++++++---- utgard/platform/meson_m450/platform_m8b.c | 9 ++++++++- 12 files changed, 93 insertions(+), 39 deletions(-) diff --git a/gpu-v2.mk b/gpu-v2.mk index d295ece..4a51f56 100644 --- a/gpu-v2.mk +++ b/gpu-v2.mk @@ -40,7 +40,7 @@ define utgard-modules $(MAKE) -C $(shell pwd)/$(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(shell pwd)/$(PRODUCT_OUT)/obj/mali \ ARCH=$(3) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) CONFIG_MALI400=m CONFIG_MALI450=m \ EXTRA_CFLAGS="-DCONFIG_MALI400=m -DCONFIG_MALI450=m" \ - CONFIG_GPU_THERMAL=y CONFIG_AM_VDEC_H264_4K2K=y modules + CONFIG_AM_VDEC_H264_4K2K=y modules @echo "GPU_MODS_OUT is $(GPU_MODS_OUT)" mkdir -p $(PRODUCT_OUT)/$(GPU_MODS_OUT) diff --git a/gpu.mk b/gpu.mk index 151b3d0..d6d0436 100644 --- a/gpu.mk +++ b/gpu.mk @@ -64,7 +64,7 @@ $(MALI_KO): $(MAKE) -C $(shell pwd)/$(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(shell pwd)/$(MALI_OUT)/ \ ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) CONFIG_MALI400=m CONFIG_MALI450=m \ EXTRA_CFLAGS="-DCONFIG_MALI400=m -DCONFIG_MALI450=m" \ - CONFIG_GPU_THERMAL=y CONFIG_AM_VDEC_H264_4K2K=y modules + CONFIG_AM_VDEC_H264_4K2K=y modules @echo "GPU_MODS_OUT is $(GPU_MODS_OUT)" mkdir -p $(PRODUCT_OUT)/$(GPU_MODS_OUT) diff --git a/midgard/r11p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r11p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index d16675e..b951906 100644 --- a/midgard/r11p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r11p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -101,7 +106,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -133,7 +138,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -196,7 +201,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/midgard/r12p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r12p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index d16675e..30b978b 100644 --- a/midgard/r12p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r12p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined (CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined (CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -101,7 +106,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -133,7 +138,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -196,7 +201,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/midgard/r13p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r13p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index d16675e..78380a2 100644 --- a/midgard/r13p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r13p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -101,7 +106,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -133,7 +138,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -196,7 +201,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/midgard/r14p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r14p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index d16675e..78380a2 100644 --- a/midgard/r14p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r14p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -101,7 +106,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -133,7 +138,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -196,7 +201,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/midgard/r15p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r15p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index d16675e..b951906 100644 --- a/midgard/r15p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r15p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -101,7 +106,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -133,7 +138,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -196,7 +201,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/midgard/r16p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/midgard/r16p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index 26a56f6..d057897 100644 --- a/midgard/r16p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/midgard/r16p0/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,7 +20,12 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) +#include +#include +#include +#endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) #include #include #include @@ -100,7 +105,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -132,7 +137,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -195,7 +200,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c index 26a56f6..4ffbfb0 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/platform_gx.c @@ -20,11 +20,16 @@ #include #endif #include -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) #include #include #include #endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#include +#endif #include "mali_scaling.h" #include "mali_clock.h" @@ -100,7 +105,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -132,7 +137,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -195,7 +200,7 @@ int mali_meson_uninit(struct platform_device* ptr_plt_dev) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_GPU_THERMAL) || defined(CONFIG_AMLOGIC_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/utgard/platform/meson_bu/platform_gx.c b/utgard/platform/meson_bu/platform_gx.c index 79f513c..2842254 100644 --- a/utgard/platform/meson_bu/platform_gx.c +++ b/utgard/platform/meson_bu/platform_gx.c @@ -29,6 +29,14 @@ #include #endif #endif +#ifdef CONFIG_AMLOGIC_GPU_THERMAL +#include +#include +#ifdef CONFIG_DEVFREQ_THERMAL +#include +#include +#endif +#endif #include #include #include @@ -109,7 +117,7 @@ int get_gpu_max_clk_level(void) return mali_plat_data.cfg_clock; } -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -137,7 +145,7 @@ static u32 get_mali_utilization(void) #endif #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -341,7 +349,7 @@ int mali_deep_resume(struct device *device) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; @@ -363,7 +371,7 @@ void mali_post_init(void) gcdev->get_online_pp = mali_get_online_pp; #endif err = gpufreq_cooling_register(gcdev); -#ifdef CONFIG_DEVFREQ_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) aml_thermal_min_update(gcdev->cool_dev); #endif if (err < 0) diff --git a/utgard/platform/meson_m450/platform_m8.c b/utgard/platform/meson_m450/platform_m8.c index 66a4e25..9eaad3e 100644 --- a/utgard/platform/meson_m450/platform_m8.c +++ b/utgard/platform/meson_m450/platform_m8.c @@ -21,10 +21,14 @@ #endif #include #include -#ifdef CONFIG_GPU_THERMAL +#if defined (CONFIG_GPU_THERMAL) #include #include #endif +#if defined (CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#endif #include #include #include @@ -184,7 +188,7 @@ static struct resource mali_gpu_resources[] = INT_MALI_PP) }; -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static void set_limit_mali_freq(u32 idx) { if (mali_plat_data.limit_on == 0) @@ -201,7 +205,7 @@ static u32 get_limit_mali_freq(void) } #endif -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -450,7 +454,7 @@ int mali_deep_resume(struct device *device) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; diff --git a/utgard/platform/meson_m450/platform_m8b.c b/utgard/platform/meson_m450/platform_m8b.c index 692aafe..99d86b8 100644 --- a/utgard/platform/meson_m450/platform_m8b.c +++ b/utgard/platform/meson_m450/platform_m8b.c @@ -19,8 +19,15 @@ #include #include #include +#if defined(CONFIG_GPU_THERMAL) #include #include +#endif +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) +#include +#include +#endif + #include #include #include @@ -433,7 +440,7 @@ int mali_deep_resume(struct device *device) void mali_post_init(void) { -#ifdef CONFIG_GPU_THERMAL +#if defined(CONFIG_AMLOGIC_GPU_THERMAL) || defined(CONFIG_GPU_THERMAL) int err; struct gpufreq_cooling_device *gcdev = NULL; struct gpucore_cooling_device *gccdev = NULL; -- 2.20.1