stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks
@ 2017-11-10 11:34 Maarten Lankhorst
  2017-11-10 15:28 ` [Intel-gfx] " Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2017-11-10 11:34 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maarten Lankhorst, stable

We no longer use intel_crtc->wm.active for watermarks any more,
which was incorrect. But this uncovered a bug in sanitize_watermarks(),
which meant that we wrote the correct watermarks, but the next
update would still use the wrong hw watermarks for calculating.
This caused all further updates to fail with -EINVAL and the
log would reveal an error like the one below:

[   10.043902] [drm:ilk_validate_wm_level.part.8 [i915]] Sprite WM0 too large 56 (max 0)
[   10.043960] [drm:ilk_validate_pipe_wm [i915]] LP0 watermark invalid
[   10.044030] [drm:intel_crtc_atomic_check [i915]] No valid intermediate pipe watermarks are possible

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: b6b178a77210 ("drm/i915: Calculate ironlake intermediate watermarks correctly, v2.")
Cc: stable@vger.kernel.org #v4.8+
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 84817ccc5305..17665ee06c9a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14442,6 +14442,8 @@ static void sanitize_watermarks(struct drm_device *dev)
 
 		cs->wm.need_postvbl_update = true;
 		dev_priv->display.optimize_watermarks(intel_state, cs);
+
+		to_intel_crtc_state(crtc->state)->wm = cs->wm;
 	}
 
 put_state:
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks
  2017-11-10 11:34 [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks Maarten Lankhorst
@ 2017-11-10 15:28 ` Ville Syrjälä
  2017-11-11 14:14   ` Maarten Lankhorst
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2017-11-10 15:28 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx, stable

On Fri, Nov 10, 2017 at 12:34:53PM +0100, Maarten Lankhorst wrote:
> We no longer use intel_crtc->wm.active for watermarks any more,
> which was incorrect. But this uncovered a bug in sanitize_watermarks(),
> which meant that we wrote the correct watermarks, but the next
> update would still use the wrong hw watermarks for calculating.
> This caused all further updates to fail with -EINVAL and the
> log would reveal an error like the one below:
> 
> [   10.043902] [drm:ilk_validate_wm_level.part.8 [i915]] Sprite WM0 too large 56 (max 0)
> [   10.043960] [drm:ilk_validate_pipe_wm [i915]] LP0 watermark invalid
> [   10.044030] [drm:intel_crtc_atomic_check [i915]] No valid intermediate pipe watermarks are possible
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Fixes: b6b178a77210 ("drm/i915: Calculate ironlake intermediate watermarks correctly, v2.")
> Cc: stable@vger.kernel.org #v4.8+
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 84817ccc5305..17665ee06c9a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14442,6 +14442,8 @@ static void sanitize_watermarks(struct drm_device *dev)
>  
>  		cs->wm.need_postvbl_update = true;
>  		dev_priv->display.optimize_watermarks(intel_state, cs);
> +
> +		to_intel_crtc_state(crtc->state)->wm = cs->wm;

Hmm. Oh we don't swap the state here. Looks like we shouldn't be using
anything else from the crtc state, so this should work AFAICS.

Reviewed-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>

>  	}
>  
>  put_state:
> -- 
> 2.15.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrj�l�
Intel OTC

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks
  2017-11-10 15:28 ` [Intel-gfx] " Ville Syrjälä
@ 2017-11-11 14:14   ` Maarten Lankhorst
  0 siblings, 0 replies; 3+ messages in thread
From: Maarten Lankhorst @ 2017-11-11 14:14 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, stable

Op 10-11-17 om 16:28 schreef Ville Syrjälä:
> On Fri, Nov 10, 2017 at 12:34:53PM +0100, Maarten Lankhorst wrote:
>> We no longer use intel_crtc->wm.active for watermarks any more,
>> which was incorrect. But this uncovered a bug in sanitize_watermarks(),
>> which meant that we wrote the correct watermarks, but the next
>> update would still use the wrong hw watermarks for calculating.
>> This caused all further updates to fail with -EINVAL and the
>> log would reveal an error like the one below:
>>
>> [   10.043902] [drm:ilk_validate_wm_level.part.8 [i915]] Sprite WM0 too large 56 (max 0)
>> [   10.043960] [drm:ilk_validate_pipe_wm [i915]] LP0 watermark invalid
>> [   10.044030] [drm:intel_crtc_atomic_check [i915]] No valid intermediate pipe watermarks are possible
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Fixes: b6b178a77210 ("drm/i915: Calculate ironlake intermediate watermarks correctly, v2.")
>> Cc: stable@vger.kernel.org #v4.8+
>> ---
>>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 84817ccc5305..17665ee06c9a 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -14442,6 +14442,8 @@ static void sanitize_watermarks(struct drm_device *dev)
>>  
>>  		cs->wm.need_postvbl_update = true;
>>  		dev_priv->display.optimize_watermarks(intel_state, cs);
>> +
>> +		to_intel_crtc_state(crtc->state)->wm = cs->wm;
> Hmm. Oh we don't swap the state here. Looks like we shouldn't be using
> anything else from the crtc state, so this should work AFAICS.
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
We should, but I don't trust that we keep the swapped state completely identical to the original.
For  this reason I felt it was safer to only copy the wm part of the state. Thanks, pushed. :)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-11 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-10 11:34 [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks Maarten Lankhorst
2017-11-10 15:28 ` [Intel-gfx] " Ville Syrjälä
2017-11-11 14:14   ` Maarten Lankhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).