Skip to content

Commit

Permalink
drm/sun4i: crtc: Call drm_crtc_vblank_on / drm_crtc_vblank_off
Browse files Browse the repository at this point in the history
Make sure that the CRTC code will call the enable/disable_vblank hooks.

Otherwise, since the refcounting will be off, we might end up in a
situation where the vblank management functions are called while the CRTC
is off.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180221125703.4595-3-maxime.ripard@bootlin.com
  • Loading branch information
Maxime Ripard committed Mar 6, 2018
1 parent 5af894b commit fd00c4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/sun4i/sun4i_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ static void sun4i_crtc_atomic_disable(struct drm_crtc *crtc,

DRM_DEBUG_DRIVER("Disabling the CRTC\n");

drm_crtc_vblank_off(crtc);

sun4i_tcon_set_status(scrtc->tcon, encoder, false);

if (crtc->state->event && !crtc->state->active) {
Expand All @@ -113,6 +115,8 @@ static void sun4i_crtc_atomic_enable(struct drm_crtc *crtc,
DRM_DEBUG_DRIVER("Enabling the CRTC\n");

sun4i_tcon_set_status(scrtc->tcon, encoder, true);

drm_crtc_vblank_on(crtc);
}

static void sun4i_crtc_mode_set_nofb(struct drm_crtc *crtc)
Expand Down

0 comments on commit fd00c4e

Please sign in to comment.