Skip to content

Commit

Permalink
drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
Jyri Sarha committed Sep 7, 2016
1 parent 46a897f commit 10ca4f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/tilcdc/tilcdc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ static int cpufreq_transition(struct notifier_block *nb,
{
struct tilcdc_drm_private *priv = container_of(nb,
struct tilcdc_drm_private, freq_transition);

if (val == CPUFREQ_POSTCHANGE) {
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);
tilcdc_crtc_update_clk(priv->crtc);
drm_modeset_unlock_crtc(priv->crtc);
}
}

Expand Down

0 comments on commit 10ca4f3

Please sign in to comment.