Commit a6b7ebaa authored by Jyri Sarha's avatar Jyri Sarha

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: default avatarJyri Sarha <jsarha@ti.com>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent c5665385
...@@ -184,10 +184,13 @@ static int cpufreq_transition(struct notifier_block *nb, ...@@ -184,10 +184,13 @@ static int cpufreq_transition(struct notifier_block *nb,
{ {
struct tilcdc_drm_private *priv = container_of(nb, struct tilcdc_drm_private *priv = container_of(nb,
struct tilcdc_drm_private, freq_transition); struct tilcdc_drm_private, freq_transition);
if (val == CPUFREQ_POSTCHANGE) { if (val == CPUFREQ_POSTCHANGE) {
if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) { if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) {
drm_modeset_lock_crtc(priv->crtc, NULL);
priv->lcd_fck_rate = clk_get_rate(priv->clk); priv->lcd_fck_rate = clk_get_rate(priv->clk);
tilcdc_crtc_update_clk(priv->crtc); tilcdc_crtc_update_clk(priv->crtc);
drm_modeset_unlock_crtc(priv->crtc);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment