drm/i915: fix assert_cursor on BDW
Subsystems (2)
PATCH 1/1 drm/i915: fix assert_cursor on BDW
From: Paulo Zanoni <[email protected]>
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.
--- drivers/gpu/drm/i915/intel_display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
This patch is untested, but the "Uncalimed register" message is real, as long as we have the patch to print them.
drivers/gpu/drm/i915/intel_display.c +5 -4
@@ -1095,12 +1095,13 @@ 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",
Signature · 1 line
1.8.5.3
Quoted 9 lines · Paulo Zanoni
From: Paulo Zanoni <[email protected]>
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 Paulo Zanoni <[email protected]>
I was thinking you might want to rearrange intel_crtc_update_cursor() the same way, but maybe it's not worth the effort. We may soon have to take a look at using the pipe_offsets[] stuff for cursors anyway.
Quoted 36 lines
--- drivers/gpu/drm/i915/intel_display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)This patch is untested, but the "Uncalimed register" message is real, as long as we have the patch to print them.
drivers/gpu/drm/i915/intel_display.c +5
-4@@ -1095,12 +1095,13 @@ 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",Signature · 6 lines
1.8.5.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 6 lines · Ville Syrjälä
Quoted 5 lines · Paulo Zanoni
From: Paulo Zanoni <[email protected]>
We need to read the correct register, not a register that doesn't exist and will trigger "Unclaimed register" messages when we touch it.
Quoted 6 lines
Quoted 4 lines
Also rearrange the checks in an attempt to prevent this error from happening again.
Signed-off-by Paulo Zanoni <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>
Pushed to -fixes, thanks for the patch and review.
BR,
Jani.
Quoted 49 lines
I was thinking you might want to rearrange
intel_crtc_update_cursor()the same way, but maybe it's not worth the effort. We may soon have to take a look at using the pipe_offsets[] stuff for cursors anyway.Quoted 36 lines
--- drivers/gpu/drm/i915/intel_display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)This patch is untested, but the "Uncalimed register" message is real, as long as we have the patch to print them.
drivers/gpu/drm/i915/intel_display.c +5
-4@@ -1095,12 +1095,13 @@ 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",Signature · 6 lines
1.8.5.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx