aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tilcdc/tilcdc_drv.c
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2016-09-06 09:19:54 -0400
committerJyri Sarha <jsarha@ti.com>2016-09-07 08:54:40 -0400
commit642e51677d29c9f21891b571be4473ec482acaf0 (patch)
treec5ffe3c2821e677d1a8e24d446a8b9d9d97e37de /drivers/gpu/drm/tilcdc/tilcdc_drv.c
parenta6b7ebaadb5c8d869908e803e5616922a5096253 (diff)
drm/tilcdc: Clean up LCDC functional clock rate setting code
Clean up LCDC functional clock rate setting code. The LCDC functional clock is set by two functions: mode_set_nofb() and cpufreq_transition(). When tilcdc_crtc_mode_set_nofb() is called in atomic commit phase the drm atomic helpers have taken all the necessary drm locks and turned off the crtc, while tilcdc_commit() is keeping LCDC powered on. For mode_set_nofb() just a simple clock setting function without any locking or power management code is enough. The new tilcdc_crtc_set_clk() is implemented for that purpose. cpufreq_transition() on the other hand is called from outside DRM and it needs to take the necessary locks and turn off the CRTC while keeping the LCDC powered. The reimplemented tilcdc_crtc_update_clk() is for that purpose and it uses the new tilcdc_crtc_set_clk() to actually set the clock. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_drv.c')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_drv.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index b1ac61eac056..52ff3e120bb9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -185,14 +185,8 @@ static int cpufreq_transition(struct notifier_block *nb,
185 struct tilcdc_drm_private *priv = container_of(nb, 185 struct tilcdc_drm_private *priv = container_of(nb,
186 struct tilcdc_drm_private, freq_transition); 186 struct tilcdc_drm_private, freq_transition);
187 187
188 if (val == CPUFREQ_POSTCHANGE) { 188 if (val == CPUFREQ_POSTCHANGE)
189 if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) { 189 tilcdc_crtc_update_clk(priv->crtc);
190 drm_modeset_lock_crtc(priv->crtc, NULL);
191 priv->lcd_fck_rate = clk_get_rate(priv->clk);
192 tilcdc_crtc_update_clk(priv->crtc);
193 drm_modeset_unlock_crtc(priv->crtc);
194 }
195 }
196 190
197 return 0; 191 return 0;
198} 192}
@@ -286,7 +280,6 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
286 } 280 }
287 281
288#ifdef CONFIG_CPU_FREQ 282#ifdef CONFIG_CPU_FREQ
289 priv->lcd_fck_rate = clk_get_rate(priv->clk);
290 priv->freq_transition.notifier_call = cpufreq_transition; 283 priv->freq_transition.notifier_call = cpufreq_transition;
291 ret = cpufreq_register_notifier(&priv->freq_transition, 284 ret = cpufreq_register_notifier(&priv->freq_transition,
292 CPUFREQ_TRANSITION_NOTIFIER); 285 CPUFREQ_TRANSITION_NOTIFIER);