Browse Source

drm/msm/mdp5: fix unclocked register access in _cursor_set()

Fixes an insta-reboot when screen-blanking kicks in, due to cursor
updates without clocks enabled.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark 8 years ago
parent
commit
af1f5f12c2
1 changed files with 8 additions and 0 deletions
  1. 8 0
      drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c

+ 8 - 0
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c

@@ -753,6 +753,7 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
 	if (!handle) {
 	if (!handle) {
 		DBG("Cursor off");
 		DBG("Cursor off");
 		cursor_enable = false;
 		cursor_enable = false;
+		mdp5_enable(mdp5_kms);
 		goto set_cursor;
 		goto set_cursor;
 	}
 	}
 
 
@@ -776,6 +777,8 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
 
 
 	get_roi(crtc, &roi_w, &roi_h);
 	get_roi(crtc, &roi_w, &roi_h);
 
 
+	mdp5_enable(mdp5_kms);
+
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_STRIDE(lm), stride);
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_STRIDE(lm), stride);
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_FORMAT(lm),
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_FORMAT(lm),
 			MDP5_LM_CURSOR_FORMAT_FORMAT(CURSOR_FMT_ARGB8888));
 			MDP5_LM_CURSOR_FORMAT_FORMAT(CURSOR_FMT_ARGB8888));
@@ -804,6 +807,7 @@ set_cursor:
 	crtc_flush(crtc, flush_mask);
 	crtc_flush(crtc, flush_mask);
 
 
 end:
 end:
+	mdp5_disable(mdp5_kms);
 	if (old_bo) {
 	if (old_bo) {
 		drm_flip_work_queue(&mdp5_crtc->unref_cursor_work, old_bo);
 		drm_flip_work_queue(&mdp5_crtc->unref_cursor_work, old_bo);
 		/* enable vblank to complete cursor work: */
 		/* enable vblank to complete cursor work: */
@@ -836,6 +840,8 @@ static int mdp5_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
 
 
 	get_roi(crtc, &roi_w, &roi_h);
 	get_roi(crtc, &roi_w, &roi_h);
 
 
+	mdp5_enable(mdp5_kms);
+
 	spin_lock_irqsave(&mdp5_crtc->cursor.lock, flags);
 	spin_lock_irqsave(&mdp5_crtc->cursor.lock, flags);
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_SIZE(lm),
 	mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_SIZE(lm),
 			MDP5_LM_CURSOR_SIZE_ROI_H(roi_h) |
 			MDP5_LM_CURSOR_SIZE_ROI_H(roi_h) |
@@ -847,6 +853,8 @@ static int mdp5_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
 
 
 	crtc_flush(crtc, flush_mask);
 	crtc_flush(crtc, flush_mask);
 
 
+	mdp5_disable(mdp5_kms);
+
 	return 0;
 	return 0;
 }
 }