diff mbox series

[4/8] drm/i915: Don't set undefined bits in dirty_pipes

Message ID 20191011200949.7839-5-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Some cleanup near the SKL wm/ddb area | expand

Commit Message

Ville Syrjälä Oct. 11, 2019, 8:09 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

skl_commit_modeset_enables() straight up compares dirty_pipes
with a bitmask of already committed pipes. If we set bits in
dirty_pipes for non-existent pipes that comparison will never
work right. So let's limit ourselves to bits that exist.

And we'll do the same for the active_pipes_changed bitmask.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lisovskiy, Stanislav Nov. 29, 2019, 9:24 a.m. UTC | #1
On Fri, 2019-10-11 at 23:09 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> skl_commit_modeset_enables() straight up compares dirty_pipes
> with a bitmask of already committed pipes. If we set bits in
> dirty_pipes for non-existent pipes that comparison will never
> work right. So let's limit ourselves to bits that exist.
> 
> And we'll do the same for the active_pipes_changed bitmask.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c
> b/drivers/gpu/drm/i915/intel_pm.c
> index 2b71d52a4ede..f21eb9250d23 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5444,7 +5444,7 @@ skl_ddb_add_affected_pipes(struct
> intel_atomic_state *state)
>  		if (ret)
>  			return ret;
>  
> -		state->active_pipe_changes = ~0;
> +		state->active_pipe_changes = INTEL_INFO(dev_priv)-
> >pipe_mask;
>  
>  		/*
>  		 * We usually only initialize state->active_pipes if we
> @@ -5470,7 +5470,7 @@ skl_ddb_add_affected_pipes(struct
> intel_atomic_state *state)
>  	 * to grab the lock on *all* CRTC's.
>  	 */
>  	if (state->active_pipe_changes || state->modeset) {
> -		state->wm_results.dirty_pipes = ~0;
> +		state->wm_results.dirty_pipes = INTEL_INFO(dev_priv)-
> >pipe_mask;
>  
>  		ret = intel_add_all_pipes(state);
>  		if (ret)

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 2b71d52a4ede..f21eb9250d23 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5444,7 +5444,7 @@  skl_ddb_add_affected_pipes(struct intel_atomic_state *state)
 		if (ret)
 			return ret;
 
-		state->active_pipe_changes = ~0;
+		state->active_pipe_changes = INTEL_INFO(dev_priv)->pipe_mask;
 
 		/*
 		 * We usually only initialize state->active_pipes if we
@@ -5470,7 +5470,7 @@  skl_ddb_add_affected_pipes(struct intel_atomic_state *state)
 	 * to grab the lock on *all* CRTC's.
 	 */
 	if (state->active_pipe_changes || state->modeset) {
-		state->wm_results.dirty_pipes = ~0;
+		state->wm_results.dirty_pipes = INTEL_INFO(dev_priv)->pipe_mask;
 
 		ret = intel_add_all_pipes(state);
 		if (ret)