Commit 30aad89a authored by Dave Airlie's avatar Dave Airlie

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
parents f7e87a44 178e561f
...@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc) ...@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
* Tell the DRM core that vblank IRQs aren't going to happen for * Tell the DRM core that vblank IRQs aren't going to happen for
* a while. This cleans up any pending vblank events for us. * a while. This cleans up any pending vblank events for us.
*/ */
drm_vblank_off(dev, dcrtc->num); drm_crtc_vblank_off(&dcrtc->crtc);
/* Handle any pending flip event. */ /* Handle any pending flip event. */
spin_lock_irq(&dev->event_lock); spin_lock_irq(&dev->event_lock);
...@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms) ...@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms)
armada_drm_crtc_update(dcrtc); armada_drm_crtc_update(dcrtc);
if (dpms_blanked(dpms)) if (dpms_blanked(dpms))
armada_drm_vblank_off(dcrtc); armada_drm_vblank_off(dcrtc);
else
drm_crtc_vblank_on(&dcrtc->crtc);
} }
} }
...@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, ...@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
/* Wait for pending flips to complete */ /* Wait for pending flips to complete */
wait_event(dcrtc->frame_wait, !dcrtc->frame_work); wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
drm_vblank_pre_modeset(crtc->dev, dcrtc->num); drm_crtc_vblank_off(crtc);
crtc->mode = *adj; crtc->mode = *adj;
...@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, ...@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
armada_drm_crtc_update(dcrtc); armada_drm_crtc_update(dcrtc);
drm_vblank_post_modeset(crtc->dev, dcrtc->num); drm_crtc_vblank_on(crtc);
armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms)); armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
return 0; return 0;
...@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc, ...@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
armada_reg_queue_end(work->regs, i); armada_reg_queue_end(work->regs, i);
/* /*
* Hold the old framebuffer for the work - DRM appears to drop our * Ensure that we hold a reference on the new framebuffer.
* reference to the old framebuffer in drm_mode_page_flip_ioctl(). * This has to match the behaviour in mode_set.
*/ */
drm_framebuffer_reference(work->old_fb); drm_framebuffer_reference(fb);
ret = armada_drm_crtc_queue_frame_work(dcrtc, work); ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
if (ret) { if (ret) {
/* /* Undo our reference above */
* Undo our reference above; DRM does not drop the reference drm_framebuffer_unreference(fb);
* to this object on error, so that's okay.
*/
drm_framebuffer_unreference(work->old_fb);
kfree(work); kfree(work);
return ret; return ret;
} }
......
...@@ -190,6 +190,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -190,6 +190,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
if (ret) if (ret)
goto err_comp; goto err_comp;
dev->irq_enabled = true;
dev->vblank_disable_allowed = 1; dev->vblank_disable_allowed = 1;
ret = armada_fbdev_init(dev); ret = armada_fbdev_init(dev);
...@@ -331,7 +332,7 @@ static struct drm_driver armada_drm_driver = { ...@@ -331,7 +332,7 @@ static struct drm_driver armada_drm_driver = {
.desc = "Armada SoC DRM", .desc = "Armada SoC DRM",
.date = "20120730", .date = "20120730",
.driver_features = DRIVER_GEM | DRIVER_MODESET | .driver_features = DRIVER_GEM | DRIVER_MODESET |
DRIVER_PRIME, DRIVER_HAVE_IRQ | DRIVER_PRIME,
.ioctls = armada_ioctls, .ioctls = armada_ioctls,
.fops = &armada_drm_fops, .fops = &armada_drm_fops,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment