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>
This commit is contained in:
parent
fcb818231f
commit
2430262493
|
@ -618,33 +618,25 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
|
||||||
|
|
||||||
/* raw reads, only for fast reads of display block, no need for forcewake etc. */
|
/* raw reads, only for fast reads of display block, no need for forcewake etc. */
|
||||||
#define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__))
|
#define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__))
|
||||||
#define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__))
|
|
||||||
|
|
||||||
static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
|
static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||||
uint32_t status;
|
uint32_t status;
|
||||||
|
int reg;
|
||||||
|
|
||||||
if (INTEL_INFO(dev)->gen < 7) {
|
if (INTEL_INFO(dev)->gen >= 8) {
|
||||||
status = pipe == PIPE_A ?
|
status = GEN8_PIPE_VBLANK;
|
||||||
DE_PIPEA_VBLANK :
|
reg = GEN8_DE_PIPE_ISR(pipe);
|
||||||
DE_PIPEB_VBLANK;
|
} else if (INTEL_INFO(dev)->gen >= 7) {
|
||||||
|
status = DE_PIPE_VBLANK_IVB(pipe);
|
||||||
|
reg = DEISR;
|
||||||
} else {
|
} else {
|
||||||
switch (pipe) {
|
status = DE_PIPE_VBLANK(pipe);
|
||||||
default:
|
reg = DEISR;
|
||||||
case PIPE_A:
|
|
||||||
status = DE_PIPEA_VBLANK_IVB;
|
|
||||||
break;
|
|
||||||
case PIPE_B:
|
|
||||||
status = DE_PIPEB_VBLANK_IVB;
|
|
||||||
break;
|
|
||||||
case PIPE_C:
|
|
||||||
status = DE_PIPEC_VBLANK_IVB;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return __raw_i915_read32(dev_priv, DEISR) & status;
|
return __raw_i915_read32(dev_priv, reg) & status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
|
static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
|
||||||
|
|
Loading…
Reference in New Issue