Skip to content

Commit

Permalink
drm/tilcdc: WARN if CRTC is touched without CRTC lock
Browse files Browse the repository at this point in the history
WARN if CRTC is touched without CRTC lock. The crtc functions should
not be called simultaneously from multiple threads. Having the DRM
CRTC lock should take care of that.

Signed-off-by: Jyri Sarha <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
Jyri Sarha committed Sep 7, 2016
1 parent 9193168 commit 4dc7dca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/tilcdc/tilcdc_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ static void tilcdc_crtc_enable(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev;
struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);

WARN_ON(!drm_modeset_is_locked(&crtc->mutex));

if (tilcdc_crtc->enabled)
return;

Expand All @@ -177,6 +179,8 @@ void tilcdc_crtc_disable(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev;
struct tilcdc_drm_private *priv = dev->dev_private;

WARN_ON(!drm_modeset_is_locked(&crtc->mutex));

if (!tilcdc_crtc->enabled)
return;

Expand Down Expand Up @@ -249,6 +253,8 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc,
struct drm_device *dev = crtc->dev;
unsigned long flags;

WARN_ON(!drm_modeset_is_locked(&crtc->mutex));

if (tilcdc_crtc->event) {
dev_err(dev->dev, "already pending page flip!\n");
return -EBUSY;
Expand Down Expand Up @@ -353,6 +359,8 @@ static void tilcdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
struct drm_display_mode *mode = &crtc->state->adjusted_mode;
struct drm_framebuffer *fb = crtc->primary->state->fb;

WARN_ON(!drm_modeset_is_locked(&crtc->mutex));

if (WARN_ON(!info))
return;

Expand Down

0 comments on commit 4dc7dca

Please sign in to comment.