diff options
| -rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index 946b71b6e608..2aeae7351621 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | |||
| @@ -103,8 +103,8 @@ static void crtc_flush_all(struct drm_crtc *crtc) | |||
| 103 | struct drm_plane *plane; | 103 | struct drm_plane *plane; |
| 104 | uint32_t flush_mask = 0; | 104 | uint32_t flush_mask = 0; |
| 105 | 105 | ||
| 106 | /* we could have already released CTL in the disable path: */ | 106 | /* this should not happen: */ |
| 107 | if (!mdp5_crtc->ctl) | 107 | if (WARN_ON(!mdp5_crtc->ctl)) |
| 108 | return; | 108 | return; |
| 109 | 109 | ||
| 110 | drm_atomic_crtc_for_each_plane(plane, crtc) { | 110 | drm_atomic_crtc_for_each_plane(plane, crtc) { |
| @@ -143,6 +143,11 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) | |||
| 143 | drm_atomic_crtc_for_each_plane(plane, crtc) { | 143 | drm_atomic_crtc_for_each_plane(plane, crtc) { |
| 144 | mdp5_plane_complete_flip(plane); | 144 | mdp5_plane_complete_flip(plane); |
| 145 | } | 145 | } |
| 146 | |||
| 147 | if (mdp5_crtc->ctl && !crtc->state->enable) { | ||
| 148 | mdp5_ctl_release(mdp5_crtc->ctl); | ||
| 149 | mdp5_crtc->ctl = NULL; | ||
| 150 | } | ||
| 146 | } | 151 | } |
| 147 | 152 | ||
| 148 | static void unref_cursor_worker(struct drm_flip_work *work, void *val) | 153 | static void unref_cursor_worker(struct drm_flip_work *work, void *val) |
| @@ -386,14 +391,17 @@ static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc) | |||
| 386 | mdp5_crtc->event = crtc->state->event; | 391 | mdp5_crtc->event = crtc->state->event; |
| 387 | spin_unlock_irqrestore(&dev->event_lock, flags); | 392 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 388 | 393 | ||
| 394 | /* | ||
| 395 | * If no CTL has been allocated in mdp5_crtc_atomic_check(), | ||
| 396 | * it means we are trying to flush a CRTC whose state is disabled: | ||
| 397 | * nothing else needs to be done. | ||
| 398 | */ | ||
| 399 | if (unlikely(!mdp5_crtc->ctl)) | ||
| 400 | return; | ||
| 401 | |||
| 389 | blend_setup(crtc); | 402 | blend_setup(crtc); |
| 390 | crtc_flush_all(crtc); | 403 | crtc_flush_all(crtc); |
| 391 | request_pending(crtc, PENDING_FLIP); | 404 | request_pending(crtc, PENDING_FLIP); |
| 392 | |||
| 393 | if (mdp5_crtc->ctl && !crtc->state->enable) { | ||
| 394 | mdp5_ctl_release(mdp5_crtc->ctl); | ||
| 395 | mdp5_crtc->ctl = NULL; | ||
| 396 | } | ||
| 397 | } | 405 | } |
| 398 | 406 | ||
| 399 | static int mdp5_crtc_set_property(struct drm_crtc *crtc, | 407 | static int mdp5_crtc_set_property(struct drm_crtc *crtc, |
| @@ -495,6 +503,10 @@ static int mdp5_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
| 495 | uint32_t roi_h; | 503 | uint32_t roi_h; |
| 496 | unsigned long flags; | 504 | unsigned long flags; |
| 497 | 505 | ||
| 506 | /* In case the CRTC is disabled, just drop the cursor update */ | ||
| 507 | if (unlikely(!crtc->state->enable)) | ||
| 508 | return 0; | ||
| 509 | |||
| 498 | x = (x > 0) ? x : 0; | 510 | x = (x > 0) ? x : 0; |
| 499 | y = (y > 0) ? y : 0; | 511 | y = (y > 0) ? y : 0; |
| 500 | 512 | ||
