Skip to content

Commit 30aad89

Browse files
committed
Merge branch 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-fixes
Three changes for the Armada DRM driver: 1. Add back the flags which tell the DRM core that we can do vblank. This was removed in error during the recent restructuring, and came to light while trying textured Xv rendering. 2. Fixing a refcount leak with Xv overlay. 3. As per recent discussion, the drm_vblank_pre_modeset() calls can cause deadlock with other changes to generic code. This change prevents those deadlocks by switching to the drm_crtc_vblank_*() calls instead. * 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/armada: convert to use vblank_on/off calls drm/armada: fix page_flip refcounting leak drm/armada: add IRQ support back
2 parents f7e87a4 + 178e561 commit 30aad89

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎drivers/gpu/drm/armada/armada_crtc.c‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
260260
* Tell the DRM core that vblank IRQs aren't going to happen for
261261
* a while. This cleans up any pending vblank events for us.
262262
*/
263-
drm_vblank_off(dev, dcrtc->num);
263+
drm_crtc_vblank_off(&dcrtc->crtc);
264264

265265
/* Handle any pending flip event. */
266266
spin_lock_irq(&dev->event_lock);
@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms)
289289
armada_drm_crtc_update(dcrtc);
290290
if (dpms_blanked(dpms))
291291
armada_drm_vblank_off(dcrtc);
292+
else
293+
drm_crtc_vblank_on(&dcrtc->crtc);
292294
}
293295
}
294296

@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
526528
/* Wait for pending flips to complete */
527529
wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
528530

529-
drm_vblank_pre_modeset(crtc->dev, dcrtc->num);
531+
drm_crtc_vblank_off(crtc);
530532

531533
crtc->mode = *adj;
532534

@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
617619

618620
armada_drm_crtc_update(dcrtc);
619621

620-
drm_vblank_post_modeset(crtc->dev, dcrtc->num);
622+
drm_crtc_vblank_on(crtc);
621623
armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
622624

623625
return 0;
@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
945947
armada_reg_queue_end(work->regs, i);
946948

947949
/*
948-
* Hold the old framebuffer for the work - DRM appears to drop our
949-
* reference to the old framebuffer in drm_mode_page_flip_ioctl().
950+
* Ensure that we hold a reference on the new framebuffer.
951+
* This has to match the behaviour in mode_set.
950952
*/
951-
drm_framebuffer_reference(work->old_fb);
953+
drm_framebuffer_reference(fb);
952954

953955
ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
954956
if (ret) {
955-
/*
956-
* Undo our reference above; DRM does not drop the reference
957-
* to this object on error, so that's okay.
958-
*/
959-
drm_framebuffer_unreference(work->old_fb);
957+
/* Undo our reference above */
958+
drm_framebuffer_unreference(fb);
960959
kfree(work);
961960
return ret;
962961
}

‎drivers/gpu/drm/armada/armada_drv.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
190190
if (ret)
191191
goto err_comp;
192192

193+
dev->irq_enabled = true;
193194
dev->vblank_disable_allowed = 1;
194195

195196
ret = armada_fbdev_init(dev);
@@ -331,7 +332,7 @@ static struct drm_driver armada_drm_driver = {
331332
.desc = "Armada SoC DRM",
332333
.date = "20120730",
333334
.driver_features = DRIVER_GEM | DRIVER_MODESET |
334-
DRIVER_PRIME,
335+
DRIVER_HAVE_IRQ | DRIVER_PRIME,
335336
.ioctls = armada_ioctls,
336337
.fops = &armada_drm_fops,
337338
};

0 commit comments

Comments
 (0)