Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9d82081 authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Jani Nikula
Browse files

drm/i915: fix assert_cursor on BDW



We need to read the correct register, not a register that doesn't exist
and will trigger "Unclaimed register" messages when we touch it.

Also rearrange the checks in an attempt to prevent this error from
happening again.

Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
[Jani: dropped an extra empty line introduced.]
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 17b0c1f7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1092,12 +1092,12 @@ static void assert_cursor(struct drm_i915_private *dev_priv,
	struct drm_device *dev = dev_priv->dev;
	bool cur_state;

	if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
		cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE;
	else if (IS_845G(dev) || IS_I865G(dev))
	if (IS_845G(dev) || IS_I865G(dev))
		cur_state = I915_READ(_CURACNTR) & CURSOR_ENABLE;
	else
	else if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev))
		cur_state = I915_READ(CURCNTR(pipe)) & CURSOR_MODE;
	else
		cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE;

	WARN(cur_state != state,
	     "cursor on pipe %c assertion failure (expected %s, current %s)\n",