drm/i915: Fix sync to vblank when VGA output is turned off
commite8d9252227536dc8bd4e2d254d16b5feef542496
authorLi Peng <peng.li@linux.intel.com>
Wed, 16 Dec 2009 15:33:25 +0000 (16 16:33 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:05:26 +0000 (18 14:05 -0800)
tree3a5aefe020a1554dec61b35c1ed6c52de2495ecd
parent58cd74bafb36b884abe67998cdef4203ae01769f
drm/i915: Fix sync to vblank when VGA output is turned off

commit 778c902640530371a169ad1c03566e7c51b09874 upstream

In current vblank-wait implementation, if we turn off VGA output,
drm_wait_vblank will still wait on the disabled pipe until timeout,
because vblank on the pipe is assumed be enabled. This would cause
slow system response on some system such as moblin.

This patch resolve the issue by adding a drm helper function
drm_vblank_off which explicitly clear vblank_enabled[crtc], wake up
any waiting queue and save last vblank counter before turning off
crtc. It also slightly change drm_vblank_get to ensure that we will
will return immediately if trying to wait on a disabled pipe.

Signed-off-by: Li Peng <peng.li@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[anholt: hand-applied for conflicts with overlay changes]
Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/i915/intel_display.c
include/drm/drmP.h