]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/tilcdc: Take CRTC lock when calling tilcdc_crtc_disable()
authorJyri Sarha <jsarha@ti.com>
Wed, 7 Sep 2016 08:46:40 +0000 (11:46 +0300)
committerJyri Sarha <jsarha@ti.com>
Wed, 7 Sep 2016 12:54:42 +0000 (15:54 +0300)
Take CRTC lock when calling tilcdc_crtc_disable() in
tilcdc_crtc_destroy().

In theory there could still be some operation ongoing, which should
finish before destroying the CRTC. However, the main reason for
adding this is to be able to add WARNing in tilcdc_crtc_disable() if
CRTC is not locked.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/tilcdc/tilcdc_crtc.c

index 41ce411a64f90255c346cd638bf62e65b47767c5..c1cbabcfb9d4b1f0fc7cf1913f53000a391c5529 100644 (file)
@@ -230,7 +230,9 @@ static void tilcdc_crtc_destroy(struct drm_crtc *crtc)
        struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
        struct tilcdc_drm_private *priv = crtc->dev->dev_private;
 
+       drm_modeset_lock_crtc(crtc, NULL);
        tilcdc_crtc_disable(crtc);
+       drm_modeset_unlock_crtc(crtc);
 
        flush_workqueue(priv->wq);