diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-10-28 10:31:41 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-01-20 04:06:34 -0500 |
commit | d31faf65b8300fa120f4b31d90270fbac36fc779 (patch) | |
tree | a3012f657c36ee8f8dd730fd8b2f78beeafee1a8 /drivers/gpu/drm/i915/i915_irq.c | |
parent | 3c184f69917d16e295934fcbe0803355b544df64 (diff) |
drm/i915: Fix scanoutpos calculations for interlaced modes
The scanline counter counts lines in the current field, not the entire
frame. But the crtc_ timings are the values for the entire frame. Divide
the vertical timings by 2 to make them match the scanline counter.
The rounding was carefully chosen to make it do the right thing wrt. the
observed scanline counter and ISR vblank bit behaviour.
Reviewed-by: mario.kleiner.de@gmail.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index b6e4a762806b..eacbb2f9e091 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -698,6 +698,12 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | |||
698 | vbl_start = mode->crtc_vblank_start; | 698 | vbl_start = mode->crtc_vblank_start; |
699 | vbl_end = mode->crtc_vblank_end; | 699 | vbl_end = mode->crtc_vblank_end; |
700 | 700 | ||
701 | if (mode->flags & DRM_MODE_FLAG_INTERLACE) { | ||
702 | vbl_start = DIV_ROUND_UP(vbl_start, 2); | ||
703 | vbl_end /= 2; | ||
704 | vtotal /= 2; | ||
705 | } | ||
706 | |||
701 | ret |= DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_ACCURATE; | 707 | ret |= DRM_SCANOUTPOS_VALID | DRM_SCANOUTPOS_ACCURATE; |
702 | 708 | ||
703 | /* | 709 | /* |