diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-03-11 06:58:46 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-03-12 11:13:59 -0400 |
commit | 243026249324b2c958b67ab387fe6813a9836fe0 (patch) | |
tree | 45518d633bfc028f18a8eb8535fe329566138d00 /drivers | |
parent | fcb818231f81e22b2c3a76d7ef416237fa0c7609 (diff) |
drm/i915: Fix scanline counter fixup on BDW
The display interrupts changed on BDW, so the current ILK-HSW specific
code in ilk_pipe_in_vblank_locked() doesn't work there. Add the required
bits for BDW, and while at it, change the existing code to use nicer
looking vblank status bit macros.
Also remove the now stale __raw_i915_read16() definition which was
left over from the failed gen2 ISR experiment.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73962
Tested-by: Lu Hua <huax.lu@intel.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.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index d4c952d12f3b..ec9b8a4b04ed 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -618,33 +618,25 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) | |||
618 | 618 | ||
619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ | 619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ |
620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) | 620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) |
621 | #define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__)) | ||
622 | 621 | ||
623 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) | 622 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) |
624 | { | 623 | { |
625 | struct drm_i915_private *dev_priv = dev->dev_private; | 624 | struct drm_i915_private *dev_priv = dev->dev_private; |
626 | uint32_t status; | 625 | uint32_t status; |
627 | 626 | int reg; | |
628 | if (INTEL_INFO(dev)->gen < 7) { | 627 | |
629 | status = pipe == PIPE_A ? | 628 | if (INTEL_INFO(dev)->gen >= 8) { |
630 | DE_PIPEA_VBLANK : | 629 | status = GEN8_PIPE_VBLANK; |
631 | DE_PIPEB_VBLANK; | 630 | reg = GEN8_DE_PIPE_ISR(pipe); |
631 | } else if (INTEL_INFO(dev)->gen >= 7) { | ||
632 | status = DE_PIPE_VBLANK_IVB(pipe); | ||
633 | reg = DEISR; | ||
632 | } else { | 634 | } else { |
633 | switch (pipe) { | 635 | status = DE_PIPE_VBLANK(pipe); |
634 | default: | 636 | reg = DEISR; |
635 | case PIPE_A: | ||
636 | status = DE_PIPEA_VBLANK_IVB; | ||
637 | break; | ||
638 | case PIPE_B: | ||
639 | status = DE_PIPEB_VBLANK_IVB; | ||
640 | break; | ||
641 | case PIPE_C: | ||
642 | status = DE_PIPEC_VBLANK_IVB; | ||
643 | break; | ||
644 | } | ||
645 | } | 637 | } |
646 | 638 | ||
647 | return __raw_i915_read32(dev_priv, DEISR) & status; | 639 | return __raw_i915_read32(dev_priv, reg) & status; |
648 | } | 640 | } |
649 | 641 | ||
650 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | 642 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, |