summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c14
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3.c16
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.c8
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.h2
4 files changed, 28 insertions, 12 deletions
diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c
index 8d1f4041dde..3ec90a7f40e 100644
--- a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c
+++ b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c
@@ -548,6 +548,9 @@ static int mali_probe(struct platform_device *pdev)
_mali_osk_wq_term();
}
+#ifdef CONFIG_MALI_DT
+ mali_platform_device_deinit(mali_platform_device);
+#endif
mali_platform_device = NULL;
return -EFAULT;
}
@@ -592,7 +595,8 @@ static int mali_driver_suspend_scheduler(struct device *dev)
{
mali_pm_os_suspend(MALI_TRUE);
- mali_platform_power_mode_change(2);
+ if (pm_runtime_active(dev))
+ mali_platform_power_mode_change(2); /*(MALI_POWER_MODE_DEEP_SLEEP)*/
/* Tracing the frequency and voltage after mali is suspended */
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
@@ -621,7 +625,8 @@ static int mali_driver_resume_scheduler(struct device *dev)
0, 0, 0);
#endif
- mali_platform_power_mode_change(0);
+ if (pm_runtime_active(dev))
+ mali_platform_power_mode_change(0); /* (MALI_POWER_MODE_ON) */
mali_pm_os_resume();
return 0;
@@ -632,7 +637,7 @@ static int mali_driver_resume_scheduler(struct device *dev)
static int mali_driver_runtime_suspend(struct device *dev)
{
if (MALI_TRUE == mali_pm_runtime_suspend()) {
- mali_platform_power_mode_change(1);
+ mali_platform_power_mode_change(1); /* (MALI_POWER_MODE_LIGHT_SLEEP) */
/* Tracing the frequency and voltage after mali is suspended */
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
@@ -641,7 +646,6 @@ static int mali_driver_runtime_suspend(struct device *dev)
0,
0,
0, 0, 0);
-
return 0;
} else {
return -EBUSY;
@@ -664,7 +668,7 @@ static int mali_driver_runtime_resume(struct device *dev)
mali_gpu_clk[1].vol / 1000,
0, 0, 0);
#endif
- mali_platform_power_mode_change(0);
+ mali_platform_power_mode_change(0); /* (MALI_POWER_MODE_ON) */
mali_pm_runtime_resume();
return 0;
diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3.c b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3.c
index 4ad3f4e0264..dcd6dee6e86 100644
--- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3.c
+++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3.c
@@ -27,6 +27,7 @@
#include "mali_kernel_common.h"
#include "exynos3_pmm.h"
+#if !defined(CONFIG_MALI_DT)
#define MALI_GP_IRQ EXYNOS3_IRQ_GP_3D
#define MALI_PP0_IRQ EXYNOS3_IRQ_PP0_3D
#define MALI_PP1_IRQ EXYNOS3_IRQ_PP1_3D
@@ -45,6 +46,7 @@ static struct resource mali_gpu_resources[] =
MALI_PP0_IRQ, MALI_PP0_MMU_IRQ,
MALI_PP1_IRQ, MALI_PP1_MMU_IRQ)
};
+#endif
//extern struct platform_device mali_gpu_device;
@@ -53,18 +55,18 @@ static struct mali_gpu_device_data mali_gpu_data =
.shared_mem_size = 256 * 1024 * 1024, /* 256MB */
.fb_start = 0x40000000,
.fb_size = 0xb1000000,
- .utilization_interval = 1000, /* 1000ms */
+ .control_interval = 1000, /* 1000ms */
.utilization_callback = mali_gpu_utilization_handler,
};
-int mali_platform_device_register(struct platform_device *exynos4_device_g3d)
+int mali_platform_device_init(struct platform_device *exynos4_device_g3d)
{
- int err;
-
- MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
+ int err = 0;
/* Connect resources to the device */
+#if !defined(CONFIG_MALI_DT)
err = platform_device_add_resources(exynos4_device_g3d, mali_gpu_resources, sizeof(mali_gpu_resources) / sizeof(mali_gpu_resources[0]));
+#endif
if (0 == err)
{
err = platform_device_add_data(exynos4_device_g3d, &mali_gpu_data, sizeof(mali_gpu_data));
@@ -88,9 +90,9 @@ int mali_platform_device_register(struct platform_device *exynos4_device_g3d)
return err;
}
-void mali_platform_device_unregister(struct platform_device *exynos4_device_g3d)
+void mali_platform_device_deinit(struct platform_device *exynos4_device_g3d)
{
- MALI_DEBUG_PRINT(4, ("mali_platform_device_unregister() called\n"));
+ MALI_DEBUG_PRINT(4, ("mali_platform_device_deinit() called\n"));
mali_platform_deinit(exynos4_device_g3d);
#ifdef CONFIG_MALI400_DEBUG_SYS
diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.c b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.c
index e763b3cf032..852653e6f25 100644
--- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.c
+++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.c
@@ -859,6 +859,14 @@ _mali_osk_errcode_t mali_platform_power_mode_change(struct device *dev, mali_pow
MALI_SUCCESS;
}
+bool mali_is_on(void)
+{
+ if (nPowermode == MALI_POWER_MODE_ON)
+ return true;
+ else
+ return false;
+}
+
void mali_gpu_utilization_handler(struct mali_gpu_utilization_data *data)
{
if (nPowermode == MALI_POWER_MODE_ON)
diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.h b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.h
index eef9c14a57c..c0689508314 100644
--- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.h
+++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos3250/exynos3_pmm.h
@@ -101,6 +101,8 @@ _mali_osk_errcode_t mali_platform_deinit(struct platform_device *pdev);
*/
_mali_osk_errcode_t mali_platform_power_mode_change(struct device *dev, mali_power_mode power_mode);
+bool mali_is_on(void);
+
#ifdef __cplusplus
}
#endif