static int pm_callback_runtime_on(kbase_device *kbdev) { kbase_platform_clock_on(kbdev); #ifdef CONFIG_MALI_T6XX_DVFS //if (kbase_platform_dvfs_enable(true, MALI_DVFS_START_FREQ)!= MALI_TRUE) // return -EPERM; #endif return 0; }
static int pm_callback_runtime_on(kbase_device *kbdev) { int ret; struct clk *mout_vpll = NULL, *aclk_g3d_sw = NULL, *aclk_g3d_dout = NULL; struct device *dev = kbdev->osdev.dev; struct exynos_context * platform = (struct exynos_context *) kbdev->platform_context; sec_debug_aux_log(SEC_DEBUG_AUXLOG_CPU_BUS_CLOCK_CHANGE, "g3d turn on++++"); kbase_platform_clock_on(kbdev); #ifdef CONFIG_MALI_T6XX_DVFS //if (kbase_platform_dvfs_enable(true, MALI_DVFS_START_FREQ) != MALI_TRUE) // return -EPERM; #endif mout_vpll = clk_get(dev, "mout_vpll"); if (IS_ERR(mout_vpll)) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_get [mout_vpll]\n"); return 0; } aclk_g3d_dout = clk_get(dev, "aclk_g3d_dout"); if (IS_ERR(aclk_g3d_dout)) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_get [aclk_g3d_dout]\n"); return 0; } aclk_g3d_sw = clk_get(dev, "aclk_g3d_sw"); if (IS_ERR(aclk_g3d_sw)) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_get [aclk_g3d_sw]\n"); return 0; } ret = clk_set_parent(platform->aclk_g3d, aclk_g3d_sw); if (ret < 0) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_set_parent [platform->aclk_g3d]\n"); return 0; } ret = clk_set_parent(aclk_g3d_sw, aclk_g3d_dout); if (ret < 0) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_set_parent [aclk_g3d_sw]\n"); return 0; } ret = clk_set_parent(aclk_g3d_dout, mout_vpll); if (ret < 0) { KBASE_DEBUG_PRINT_ERROR(KBASE_CORE, "failed to clk_set_parent [aclk_g3d_dout]\n"); return 0; } sec_debug_aux_log(SEC_DEBUG_AUXLOG_CPU_BUS_CLOCK_CHANGE, "g3d turn on---"); return 0; }
static int pm_callback_runtime_on(kbase_device *kbdev) { #ifdef CONFIG_MALI_T6XX_DVFS struct exynos_context *platform = (struct exynos_context *)kbdev->platform_context; #endif kbase_platform_clock_on(kbdev); #ifdef CONFIG_MALI_T6XX_DVFS if (platform->dvfs_enabled) { if (kbase_platform_dvfs_enable(true, MALI_DVFS_START_FREQ)!= MALI_TRUE) return -EPERM; } else { if (kbase_platform_dvfs_enable(false, MALI_DVFS_CURRENT_FREQ)!= MALI_TRUE) return -EPERM; } #endif return 0; }
void kbase_device_runtime_get_sync(struct device *dev) { int result; struct kbase_device *kbdev; struct exynos_context *platform; kbdev = dev_get_drvdata(dev); platform = (struct exynos_context *) kbdev->platform_context; if(!platform) return; /******************************************** * * This is workaround about occurred kernel panic when you turn off the system. * * System kernel will call the "__pm_runtime_disable" when you turn off the system. * After that function, System kernel do not run the runtimePM API more. * * So, this code is check the "dev->power.disable_depth" value is not zero. * ********************************************/ if(dev->power.disable_depth > 0) { if(platform->cmu_pmu_status == 0) kbase_platform_cmu_pmu_control(kbdev, 1); return; } if(delayed_work_pending(&kbdev->runtime_pm_workqueue)) { cancel_delayed_work_sync(&kbdev->runtime_pm_workqueue); } mutex_lock(&runtime_pm_lock); kbase_platform_clock_on(kbdev); pm_runtime_get_noresume(dev); result = pm_runtime_resume(dev); mutex_unlock(&runtime_pm_lock); #if MALI_GATOR_SUPPORT kbase_trace_mali_timeline_event(GATOR_MAKE_EVENT(ACTIVITY_RTPM_CHANGED, ACTIVITY_RTPM) | 1); #endif #if MALI_RTPM_DEBUG printk( "kbase_device_runtime_get_sync, usage_count=%d\n", atomic_read(&dev->power.usage_count)); #endif /******************************************** * * This check is re-confirm about maybe context switch by another cpu when turn off the system. * * runtimePM put_sync -------- runtimePM get_sync -------- runtimePM put_sync : CPU 0 * \ * \ ( context running by another core. ) * \ * - (turn off the system) runtimePM disable : CPU 1 * \ * \ * => do not success implement runtimePM API ********************************************/ if(result < 0 && result == -EAGAIN) kbase_platform_cmu_pmu_control(kbdev, 1); else if(result < 0) printk(KERN_ERR "pm_runtime_get_sync failed (%d)\n", result); }