aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2016-09-05 13:39:32 -0400
committerJyri Sarha <jsarha@ti.com>2016-09-07 08:54:40 -0400
commita6b7ebaadb5c8d869908e803e5616922a5096253 (patch)
tree7783e40634979d49117e430435a089c0c00019b1 /drivers/gpu
parentc56653855250ca6072d6e0ad7fe537c1a6628c70 (diff)
drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate
Take crtc modeset lock while updating the crtc clock rate. To avoid a race in tilcdc_crtc_update_clk(), we do not want crtc mode to change while we update crtc clock. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index f8892e9ad169..b1ac61eac056 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -184,10 +184,13 @@ static int cpufreq_transition(struct notifier_block *nb,
184{ 184{
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 if (val == CPUFREQ_POSTCHANGE) { 188 if (val == CPUFREQ_POSTCHANGE) {
188 if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) { 189 if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) {
190 drm_modeset_lock_crtc(priv->crtc, NULL);
189 priv->lcd_fck_rate = clk_get_rate(priv->clk); 191 priv->lcd_fck_rate = clk_get_rate(priv->clk);
190 tilcdc_crtc_update_clk(priv->crtc); 192 tilcdc_crtc_update_clk(priv->crtc);
193 drm_modeset_unlock_crtc(priv->crtc);
191 } 194 }
192 } 195 }
193 196