From: Kasin Lee Date: Fri, 19 Dec 2014 07:45:18 +0000 (+0800) Subject: PD #96512: hibernate suported X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=770ab4183e346cc7a48c196634a2a0144e22a92c;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_mali-driver.git PD #96512: hibernate suported Change-Id: Ic6c846a9eef70fcf7dfc437a1290f6d5b0f75a14 --- diff --git a/mali/platform/mali_pm_device.c b/mali/platform/mali_pm_device.c old mode 100644 new mode 100755 index 0c33f66..52bec46 --- a/mali/platform/mali_pm_device.c +++ b/mali/platform/mali_pm_device.c @@ -12,6 +12,7 @@ #include #include #include +#include static int mali_os_suspend(struct device *device) { @@ -28,6 +29,7 @@ static int mali_os_resume(struct device *device) int ret = 0; MALI_DEBUG_PRINT(4, ("mali_os_resume() called\n")); + ret = mali_deep_resume(device); return ret; @@ -55,6 +57,8 @@ static int mali_os_thaw(struct device *device) int ret = 0; MALI_DEBUG_PRINT(4, ("mali_os_thaw() called\n")); + enable_clock(); + mali_pmu_powerup(); if (NULL != device->driver && NULL != device->driver->pm && @@ -67,6 +71,13 @@ static int mali_os_thaw(struct device *device) return ret; } +static int mali_os_restore(struct device *device) +{ + MALI_DEBUG_PRINT(4, ("mali_os_thaw() called\n")); + mali_dev_restore(); + return mali_os_resume(device); +} + #ifdef CONFIG_PM_RUNTIME static int mali_runtime_suspend(struct device *device) { @@ -116,6 +127,7 @@ static struct dev_pm_ops mali_gpu_device_type_pm_ops = .resume = mali_os_resume, .freeze = mali_os_freeze, .thaw = mali_os_thaw, + .restore = mali_os_restore, #ifdef CONFIG_PM_RUNTIME .runtime_suspend = mali_runtime_suspend, .runtime_resume = mali_runtime_resume, diff --git a/mali/platform/mali_scaling.h b/mali/platform/mali_scaling.h index fbf759d..4ca5da5 100755 --- a/mali/platform/mali_scaling.h +++ b/mali/platform/mali_scaling.h @@ -106,6 +106,7 @@ void set_mali_schel_mode(u32 mode); /* for frequency reporter in DS-5 streamline. */ u32 get_current_frequency(void); +void mali_dev_restore(void); extern int mali_pm_statue; #endif /* __ARM_CORE_SCALING_H__ */ diff --git a/mali/platform/meson_m450/platform_g9tv.c b/mali/platform/meson_m450/platform_g9tv.c index 6129d18..c0ff86e 100755 --- a/mali/platform/meson_m450/platform_g9tv.c +++ b/mali/platform/meson_m450/platform_g9tv.c @@ -165,6 +165,7 @@ static void set_limit_mali_freq(u32 idx) return; if (idx > mali_plat_data.turbo_clock || idx < mali_plat_data.scale_info.minclk) return; + mali_plat_data.scale_info.maxclk= idx; revise_mali_rt(); } diff --git a/mali/platform/meson_m450/platform_m8.c b/mali/platform/meson_m450/platform_m8.c index cc7bc88..96ecf9f 100755 --- a/mali/platform/meson_m450/platform_m8.c +++ b/mali/platform/meson_m450/platform_m8.c @@ -253,7 +253,7 @@ static int mali_cri_light_suspend(size_t param) struct mali_pmu_core *pmu; ret = 0; - mali_pm_statue = 0; + mali_pm_statue = 1; device = (struct device *)param; pmu = mali_pmu_get_global_pmu_core(); @@ -286,7 +286,7 @@ static int mali_cri_light_resume(size_t param) /* Need to notify Mali driver about this event */ ret = device->driver->pm->runtime_resume(device); } - mali_pm_statue = 1; + mali_pm_statue = 0; return ret; } diff --git a/mali/platform/meson_m450/platform_m8b.c b/mali/platform/meson_m450/platform_m8b.c index 23779db..4382f8f 100755 --- a/mali/platform/meson_m450/platform_m8b.c +++ b/mali/platform/meson_m450/platform_m8b.c @@ -163,6 +163,7 @@ static void set_limit_mali_freq(u32 idx) if (idx > mali_plat_data.turbo_clock || idx < mali_plat_data.scale_info.minclk) return; mali_plat_data.scale_info.maxclk= idx; + revise_mali_rt(); } @@ -220,7 +221,7 @@ static int mali_cri_light_suspend(size_t param) struct mali_pmu_core *pmu; ret = 0; - mali_pm_statue = 0; + mali_pm_statue = 1; device = (struct device *)param; pmu = mali_pmu_get_global_pmu_core(); @@ -253,7 +254,7 @@ static int mali_cri_light_resume(size_t param) /* Need to notify Mali driver about this event */ ret = device->driver->pm->runtime_resume(device); } - mali_pm_statue = 1; + mali_pm_statue = 0; return ret; } diff --git a/mali/platform/meson_m450/scaling.c b/mali/platform/meson_m450/scaling.c index b6fb411..3d5fab2 100755 --- a/mali/platform/meson_m450/scaling.c +++ b/mali/platform/meson_m450/scaling.c @@ -394,3 +394,11 @@ void mali_gpu_utilization_callback(struct mali_gpu_utilization_data *data) break; } } + +void mali_dev_restore(void) +{ + mali_dvfs_threshold_table * pdvfs = pmali_plat->dvfs_table; + + //mali_perf_set_num_pp_cores(num_cores_enabled); + mali_clock_set(pdvfs[currentStep].freq_index); +}