[PATCH v5 4/6] drm/i915/skl: Ensure pipes with changed wms get added to the state

2016-08-02 Thread Lyude
If we're enabling a pipe, we'll need to modify the watermarks on all
other active pipes. Since those pipes won't be added to the state on
their own, we need to add them ourselves.

Signed-off-by: Lyude 
Cc: stable at vger.kernel.org
Cc: Ville Syrjälä 
Cc: Daniel Vetter 
Cc: Radhakrishna Sripada 
Cc: Hans de Goede 
Cc: Matt Roper 
---
 drivers/gpu/drm/i915/intel_pm.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 53adcbf..6b2452b 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4085,6 +4085,10 @@ skl_compute_ddb(struct drm_atomic_state *state)
ret = skl_allocate_pipe_ddb(cstate, ddb);
if (ret)
return ret;
+
+   ret = drm_atomic_add_affected_planes(state, _crtc->base);
+   if (ret)
+   return ret;
}

return 0;
-- 
2.7.4



[PATCH v5 4/6] drm/i915/skl: Ensure pipes with changed wms get added to the state

2016-08-02 Thread Matt Roper
On Tue, Aug 02, 2016 at 02:52:52PM -0400, Lyude wrote:
> If we're enabling a pipe, we'll need to modify the watermarks on all
> other active pipes. Since those pipes won't be added to the state on
> their own, we need to add them ourselves.

All pipes (crtc's) are already added to the state if we have a change in
active pipes.  I think what you meant to write was "...we'll need to
modify the watermarks on all active *planes*.  Since those *planes*
won't..."

Aside from the commit message, I believe the logic is correct, so you
can consider this
Reviewed-by: Matt Roper 
once you reword it.


Matt

> 
> Signed-off-by: Lyude 
> Cc: stable at vger.kernel.org
> Cc: Ville Syrjälä 
> Cc: Daniel Vetter 
> Cc: Radhakrishna Sripada 
> Cc: Hans de Goede 
> Cc: Matt Roper 
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 53adcbf..6b2452b 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4085,6 +4085,10 @@ skl_compute_ddb(struct drm_atomic_state *state)
>   ret = skl_allocate_pipe_ddb(cstate, ddb);
>   if (ret)
>   return ret;
> +
> + ret = drm_atomic_add_affected_planes(state, _crtc->base);
> + if (ret)
> + return ret;
>   }
>  
>   return 0;
> -- 
> 2.7.4
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795