aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-03-11 06:58:45 -0400
committerJani Nikula <jani.nikula@intel.com>2014-03-12 11:13:13 -0400
commitfcb818231f81e22b2c3a76d7ef416237fa0c7609 (patch)
tree7a26cd6eead3abcf9e0b17bf2bddf8992ed64ae4 /drivers
parent24bd9bf54d45d28089251cdf62bf14323d1aa827 (diff)
drm/i915: Add a workaround for HSW scanline counter weirdness
On HSW the scanline counter seems to behave differently depending on the output type. eDP on port A does what you would expect an the normal +1 fixup is sufficient to cover it. But on HDMI outputs we seem to need a +2 fixup. Just assume we always need the +2 fixup and accept the slight inaccuracy on eDP. This fixes a regression introduced in: commit 8072bfa6045a264d3913102a35fab125b06603a2 Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Mon Oct 28 21:22:52 2013 +0200 drm/radeon: Move the early vblank IRQ fixup to radeon_get_crtc_scanoutpos() That commit removed the heuristic that tried to fix up the timestamps for vblank interrupts that fire a bit too early. Since then the vblank timestamp code would treat some vblank interrupts as spurious since the scanline counter would indicate that vblank_start wasn't reached yet. That in turn lead to incorrect vblank event sequence numbers being reported to userspace, which lead to unsteady framerate in applications such as XBMC which uses them for timing purposes. v2: Remember to call ilk_pipe_in_vblank_locked() on HSW too (Mika) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75725 Tested-by: bugzilla1@gmx.com Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 9fec71175571..d4c952d12f3b 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -702,7 +702,28 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
702 else 702 else
703 position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; 703 position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3;
704 704
705 if (HAS_PCH_SPLIT(dev)) { 705 if (HAS_DDI(dev)) {
706 /*
707 * On HSW HDMI outputs there seems to be a 2 line
708 * difference, whereas eDP has the normal 1 line
709 * difference that earlier platforms have. External
710 * DP is unknown. For now just check for the 2 line
711 * difference case on all output types on HSW+.
712 *
713 * This might misinterpret the scanline counter being
714 * one line too far along on eDP, but that's less
715 * dangerous than the alternative since that would lead
716 * the vblank timestamp code astray when it sees a
717 * scanline count before vblank_start during a vblank
718 * interrupt.
719 */
720 in_vbl = ilk_pipe_in_vblank_locked(dev, pipe);
721 if ((in_vbl && (position == vbl_start - 2 ||
722 position == vbl_start - 1)) ||
723 (!in_vbl && (position == vbl_end - 2 ||
724 position == vbl_end - 1)))
725 position = (position + 2) % vtotal;
726 } else if (HAS_PCH_SPLIT(dev)) {
706 /* 727 /*
707 * The scanline counter increments at the leading edge 728 * The scanline counter increments at the leading edge
708 * of hsync, ie. it completely misses the active portion 729 * of hsync, ie. it completely misses the active portion