* [PATCH] drm/i915: fix assert_cursor on BDW
@ 2014-02-27 19:30 Paulo Zanoni
2014-02-27 19:47 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Paulo Zanoni @ 2014-02-27 19:30 UTC (permalink / raw)
To: intel-gfx; +Cc: Paulo Zanoni
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
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 <paulo.r.zanoni@intel.com>
---
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.
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f19e6ea..2e05d1e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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",
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: fix assert_cursor on BDW
2014-02-27 19:30 [PATCH] drm/i915: fix assert_cursor on BDW Paulo Zanoni
@ 2014-02-27 19:47 ` Ville Syrjälä
2014-02-28 14:10 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2014-02-27 19:47 UTC (permalink / raw)
To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni
On Thu, Feb 27, 2014 at 04:30:56PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> 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 <paulo.r.zanoni@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
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.
> ---
> 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.
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f19e6ea..2e05d1e 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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",
> --
> 1.8.5.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: fix assert_cursor on BDW
2014-02-27 19:47 ` Ville Syrjälä
@ 2014-02-28 14:10 ` Jani Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2014-02-28 14:10 UTC (permalink / raw)
To: Ville Syrjälä, Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni
On Thu, 27 Feb 2014, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Feb 27, 2014 at 04:30:56PM -0300, Paulo Zanoni wrote:
>> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>>
>> 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 <paulo.r.zanoni@intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Pushed to -fixes, thanks for the patch and review.
BR,
Jani.
>
> 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.
>
>> ---
>> 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.
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index f19e6ea..2e05d1e 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -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",
>> --
>> 1.8.5.3
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-28 14:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 19:30 [PATCH] drm/i915: fix assert_cursor on BDW Paulo Zanoni
2014-02-27 19:47 ` Ville Syrjälä
2014-02-28 14:10 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox