[RAMEN9610-10373] gpu: b_r16p0: Bug fix cal_dfs_get_clock by access_lock mutex
authorSeonghun, Kim <sh_ko.kim@samsung.com>
Thu, 3 Jan 2019 03:43:39 +0000 (12:43 +0900)
committerhskang <hs1218.kang@samsung.com>
Sat, 5 Jan 2019 03:51:20 +0000 (12:51 +0900)
Change-Id: I96b84d6128e2772c594c0345d4831933c761203b
Signed-off-by: Seonghun, Kim <sh_ko.kim@samsung.com>
drivers/gpu/arm/b_r16p0/platform/exynos/gpu_dvfs_api.c

index 6ba638c947878b1dcdd7cbe7f716a8476c042a1b..8a5499bff6ffa6b6e3aef5f88a9a93e5aeaa8e5f 100644 (file)
@@ -589,7 +589,14 @@ int gpu_dvfs_get_cur_clock(void)
        int clock = 0;
 
        DVFS_ASSERT(platform);
-
+#ifdef CONFIG_MALI_RT_PM
+       if (platform->exynos_pm_domain) {
+               mutex_lock(&platform->exynos_pm_domain->access_lock);
+               if (!platform->dvs_is_enabled && gpu_is_power_on())
+                       clock = gpu_get_cur_clock(platform);
+               mutex_unlock(&platform->exynos_pm_domain->access_lock);
+       }
+#else
        if (gpu_control_is_power_on(pkbdev) == 1) {
                mutex_lock(&platform->gpu_clock_lock);
 
@@ -602,6 +609,7 @@ int gpu_dvfs_get_cur_clock(void)
                clock = gpu_get_cur_clock(platform);
                mutex_unlock(&platform->gpu_clock_lock);
        }
+#endif
 
        return clock;
 }