diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-30 08:49:14 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-30 08:49:14 +0800 |
commit | 8b93abfaba1141446f8749a52d2a2b4c2eaa4ffb (patch) | |
tree | 4b36c15a18fbb38328e23a07894ef10732fac74d | |
parent | 7dbb7ca40ca81ebd33d74cac447376f7aec9bcaf (diff) | |
download | stable-queue-8b93abfaba1141446f8749a52d2a2b4c2eaa4ffb.tar.gz |
.38 patches
-rw-r--r-- | queue-2.6.38/drm-send-pending-vblank-events-before-disabling-vblank.patch | 61 | ||||
-rw-r--r-- | queue-2.6.38/series | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/queue-2.6.38/drm-send-pending-vblank-events-before-disabling-vblank.patch b/queue-2.6.38/drm-send-pending-vblank-events-before-disabling-vblank.patch new file mode 100644 index 0000000000..bcea35ac18 --- /dev/null +++ b/queue-2.6.38/drm-send-pending-vblank-events-before-disabling-vblank.patch @@ -0,0 +1,61 @@ +From 498548ec69c6897fe4376b2ca90758762fa0b817 Mon Sep 17 00:00:00 2001 +From: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> +Date: Wed, 27 Apr 2011 16:10:57 +1000 +Subject: drm: Send pending vblank events before disabling vblank. + +From: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> + +commit 498548ec69c6897fe4376b2ca90758762fa0b817 upstream. + +This is the least-bad behaviour. It means that we signal the +vblank event before it actually happens, but since we're disabling +vblanks there's no guarantee that it will *ever* happen otherwise. + +This prevents GL applications which use WaitMSC from hanging +indefinitely. + +Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> +Signed-off-by: Dave Airlie <airlied@redhat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/gpu/drm/drm_irq.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/drivers/gpu/drm/drm_irq.c ++++ b/drivers/gpu/drm/drm_irq.c +@@ -942,11 +942,34 @@ EXPORT_SYMBOL(drm_vblank_put); + + void drm_vblank_off(struct drm_device *dev, int crtc) + { ++ struct drm_pending_vblank_event *e, *t; ++ struct timeval now; + unsigned long irqflags; ++ unsigned int seq; + + spin_lock_irqsave(&dev->vbl_lock, irqflags); + vblank_disable_and_save(dev, crtc); + DRM_WAKEUP(&dev->vbl_queue[crtc]); ++ ++ /* Send any queued vblank events, lest the natives grow disquiet */ ++ seq = drm_vblank_count_and_time(dev, crtc, &now); ++ list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { ++ if (e->pipe != crtc) ++ continue; ++ DRM_DEBUG("Sending premature vblank event on disable: \ ++ wanted %d, current %d\n", ++ e->event.sequence, seq); ++ ++ e->event.sequence = seq; ++ e->event.tv_sec = now.tv_sec; ++ e->event.tv_usec = now.tv_usec; ++ drm_vblank_put(dev, e->pipe); ++ list_move_tail(&e->base.link, &e->base.file_priv->event_list); ++ wake_up_interruptible(&e->base.file_priv->event_wait); ++ trace_drm_vblank_event_delivered(e->base.pid, e->pipe, ++ e->event.sequence); ++ } ++ + spin_unlock_irqrestore(&dev->vbl_lock, irqflags); + } + EXPORT_SYMBOL(drm_vblank_off); diff --git a/queue-2.6.38/series b/queue-2.6.38/series index 2e495eb5ce..5f2a3b7679 100644 --- a/queue-2.6.38/series +++ b/queue-2.6.38/series @@ -38,3 +38,4 @@ wire-up-fanotify-syscalls.patch wire-up-clock_adjtime-syscall.patch wire-up-the-fhandle-syscalls.patch wire-up-syncfs-syscall.patch +drm-send-pending-vblank-events-before-disabling-vblank.patch |