PD #96512: hibernate suported
authorKasin Lee <kasin.li@amlogic.com>
Fri, 19 Dec 2014 07:45:18 +0000 (15:45 +0800)
committerKasin Lee <kasin.li@amlogic.com>
Fri, 19 Dec 2014 07:45:18 +0000 (15:45 +0800)
Change-Id: Ic6c846a9eef70fcf7dfc437a1290f6d5b0f75a14

mali/platform/mali_pm_device.c [changed mode: 0644->0755]
mali/platform/mali_scaling.h
mali/platform/meson_m450/platform_g9tv.c
mali/platform/meson_m450/platform_m8.c
mali/platform/meson_m450/platform_m8b.c
mali/platform/meson_m450/scaling.c

old mode 100644 (file)
new mode 100755 (executable)
index 0c33f66..52bec46
@@ -12,6 +12,7 @@
 #include <common/mali_kernel_common.h>
 #include <common/mali_osk_profiling.h>
 #include <common/mali_pmu.h>
+#include <linux/mali/mali_utgard.h>
 
 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,
index fbf759da97f227c974e2fbeb0d092452d968c4d9..4ca5da5a6564b4db59a275a3e76cf9316db1987c 100755 (executable)
@@ -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__ */
index 6129d18283c88d6226e19a7b1b8b802f9c1e3f5f..c0ff86ef77aee9d43305efa30edfccb961ea9082 100755 (executable)
@@ -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();
 }
index cc7bc88c95346dd64613d0e4481ecf2b48ea1a07..96ecf9fb7f2074dc1a486eee2ca25a0d122c9db4 100755 (executable)
@@ -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;
 }
 
index 23779db8489382fc5f9fea7876e0a17f9d477a43..4382f8fa686b97ea6ff33cfeb8f8218de1d95859 100755 (executable)
@@ -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;
 }
 
index b6fb41142399c56fe9332228c0ed84f234f2f686..3d5fab2e1ede84e6867af769a72340f6225372e2 100755 (executable)
@@ -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);
+}