aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/armada/armada_crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/armada/armada_crtc.c')
-rw-r--r--drivers/gpu/drm/armada/armada_crtc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index 9a0cc09e6653..e4a1490b42c2 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
260 * Tell the DRM core that vblank IRQs aren't going to happen for 260 * Tell the DRM core that vblank IRQs aren't going to happen for
261 * a while. This cleans up any pending vblank events for us. 261 * a while. This cleans up any pending vblank events for us.
262 */ 262 */
263 drm_vblank_off(dev, dcrtc->num); 263 drm_crtc_vblank_off(&dcrtc->crtc);
264 264
265 /* Handle any pending flip event. */ 265 /* Handle any pending flip event. */
266 spin_lock_irq(&dev->event_lock); 266 spin_lock_irq(&dev->event_lock);
@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms)
289 armada_drm_crtc_update(dcrtc); 289 armada_drm_crtc_update(dcrtc);
290 if (dpms_blanked(dpms)) 290 if (dpms_blanked(dpms))
291 armada_drm_vblank_off(dcrtc); 291 armada_drm_vblank_off(dcrtc);
292 else
293 drm_crtc_vblank_on(&dcrtc->crtc);
292 } 294 }
293} 295}
294 296
@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
526 /* Wait for pending flips to complete */ 528 /* Wait for pending flips to complete */
527 wait_event(dcrtc->frame_wait, !dcrtc->frame_work); 529 wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
528 530
529 drm_vblank_pre_modeset(crtc->dev, dcrtc->num); 531 drm_crtc_vblank_off(crtc);
530 532
531 crtc->mode = *adj; 533 crtc->mode = *adj;
532 534
@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
617 619
618 armada_drm_crtc_update(dcrtc); 620 armada_drm_crtc_update(dcrtc);
619 621
620 drm_vblank_post_modeset(crtc->dev, dcrtc->num); 622 drm_crtc_vblank_on(crtc);
621 armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms)); 623 armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
622 624
623 return 0; 625 return 0;
@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
945 armada_reg_queue_end(work->regs, i); 947 armada_reg_queue_end(work->regs, i);
946 948
947 /* 949 /*
948 * Hold the old framebuffer for the work - DRM appears to drop our 950 * Ensure that we hold a reference on the new framebuffer.
949 * reference to the old framebuffer in drm_mode_page_flip_ioctl(). 951 * This has to match the behaviour in mode_set.
950 */ 952 */
951 drm_framebuffer_reference(work->old_fb); 953 drm_framebuffer_reference(fb);
952 954
953 ret = armada_drm_crtc_queue_frame_work(dcrtc, work); 955 ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
954 if (ret) { 956 if (ret) {
955 /* 957 /* Undo our reference above */
956 * Undo our reference above; DRM does not drop the reference 958 drm_framebuffer_unreference(fb);
957 * to this object on error, so that's okay.
958 */
959 drm_framebuffer_unreference(work->old_fb);
960 kfree(work); 959 kfree(work);
961 return ret; 960 return ret;
962 } 961 }