From f3576a9924a79e31b9376ecd1002279593ca629f Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Mon, 23 May 2016 16:51:52 +0900 Subject: [PATCH] ARM: mali400: r5p2_rel0: fix for exynos MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The exynos platform codes have to be modified a bit to apply r5p2_rel0. If not, will occurs build errors. CC drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.o drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c:190:13: error: conflicting types for ‘mali_platform_power_mode_change’ extern void mali_platform_power_mode_change(int power_mode); ... drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.c:246:2: error: unknown field ‘utilization_interval’ specified in initializer .utilization_interval = 100, /* 100ms in Tizen */ ^ ... drivers/built-in.o: In function `mali_remove': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c:561: undefined reference to `mali_platform_device_deinit' drivers/built-in.o: In function `mali_probe': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c:515: undefined reference to `mali_platform_device_init' drivers/built-in.o: In function `mali_hw_core_register_read': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:52: undefined reference to `mali_is_on' drivers/built-in.o: In function `mali_hw_core_register_write': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:98: undefined reference to `mali_is_on' drivers/built-in.o: In function `mali_hw_core_register_read': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:52: undefined reference to `mali_is_on' /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:52: undefined reference to `mali_is_on' drivers/built-in.o: In function `mali_hw_core_register_write': /home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:98: undefined reference to `mali_is_on' drivers/built-in.o:/home/pub/git/spin/linux-exynos/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_hw_core.h:52: more undefined references to `mali_is_on' follow Signed-off-by: Joonyoung Shim --- .../r5p2_rel0/platform/exynos/exynos.c | 21 +++++---- .../r5p2_rel0/platform/exynos/exynos.h | 45 ------------------- 2 files changed, 12 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.c b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.c index d4fe53bc511d..cf3d03e9d895 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.c +++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.c @@ -206,10 +206,10 @@ static void exynos_update_dvfs(struct mali_gpu_utilization_data *data) * Power management */ -_mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode) +void mali_platform_power_mode_change(int power_mode) { if (WARN_ON(mali->power_mode == power_mode)) - MALI_SUCCESS; + return; switch (power_mode) { case MALI_POWER_MODE_ON: @@ -231,8 +231,14 @@ _mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode) } mali->power_mode = power_mode; +} - MALI_SUCCESS; +bool mali_is_on(void) +{ + if (mali->power_mode == MALI_POWER_MODE_ON) + return true; + else + return false; } /* @@ -243,13 +249,12 @@ static struct mali_gpu_device_data mali_exynos_gpu_data = { .shared_mem_size = SZ_256M, .fb_start = 0x40000000, .fb_size = 0xb1000000, - .utilization_interval = 100, /* 100ms in Tizen */ + .control_interval = 100, /* 100ms in Tizen */ .utilization_callback = exynos_update_dvfs, }; -_mali_osk_errcode_t mali_platform_init(void) +int mali_platform_device_init(struct platform_device *pdev) { - struct platform_device *pdev = mali_platform_device; const struct mali_exynos_variant *variant; const struct of_device_id *match; struct resource *old_res, *new_res; @@ -359,10 +364,8 @@ _mali_osk_errcode_t mali_platform_init(void) MALI_SUCCESS; } -_mali_osk_errcode_t mali_platform_deinit(void) +int mali_platform_device_deinit(struct platform_device *pdev) { - struct platform_device *pdev = mali_platform_device; - pm_runtime_disable(&pdev->dev); regulator_disable(mali->vdd_g3d); diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.h b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.h index dd03d6c1b166..8bc4fd80032a 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.h +++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/exynos/exynos.h @@ -12,10 +12,6 @@ #ifndef __EXYNOS_H__ #define __EXYNOS_H__ -#include - -#include "mali_osk.h" - /** @brief description of power change reasons */ typedef enum mali_power_mode_tag @@ -25,45 +21,4 @@ typedef enum mali_power_mode_tag MALI_POWER_MODE_DEEP_SLEEP, } mali_power_mode; -/** @brief Platform specific setup and initialisation of MALI - * - * This is called from the entrypoint of the driver to initialize the platform - * - * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error. - */ -_mali_osk_errcode_t mali_platform_init(void); - -/** @brief Platform specific deinitialisation of MALI - * - * This is called on the exit of the driver to terminate the platform - * - * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error. - */ -_mali_osk_errcode_t mali_platform_deinit(void); - -/** @brief Platform specific powerdown sequence of MALI - * - * Call as part of platform init if there is no PMM support, else the - * PMM will call it. - * There are three power modes defined: - * 1) MALI_POWER_MODE_ON - * 2) MALI_POWER_MODE_LIGHT_SLEEP - * 3) MALI_POWER_MODE_DEEP_SLEEP - * MALI power management module transitions to MALI_POWER_MODE_LIGHT_SLEEP mode when MALI is idle - * for idle timer (software timer defined in mali_pmm_policy_jobcontrol.h) duration, MALI transitions - * to MALI_POWER_MODE_LIGHT_SLEEP mode during timeout if there are no more jobs queued. - * MALI power management module transitions to MALI_POWER_MODE_DEEP_SLEEP mode when OS does system power - * off. - * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP - * mode. - * MALI_POWER_MODE_ON mode is entered when the MALI is to powered up. Some customers want to control voltage regulators during - * the whole system powers on/off. Customer can track in this function whether the MALI is powered up from - * MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP mode and manage the voltage regulators as well. - * @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); - -extern const struct of_device_id mali_of_matches[]; - #endif -- 2.34.1