diff mbox series

drm/i915/adl_p: Same slices mask is not same Dbuf state

Message ID 20210527110106.21434-1-stanislav.lisovskiy@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/adl_p: Same slices mask is not same Dbuf state | expand

Commit Message

Stanislav Lisovskiy May 27, 2021, 11:01 a.m. UTC
We currently treat same slice mask as a same DBuf state and skip
updating the Dbuf slices, if we detect that.
This is wrong as if we have a multi to single pipe change or
vice versa, that would be treated as a same Dbuf state and thus
no changes required, so we don't get Mbus updated, causing issues.
Solution: check also mbus_join, in addition to slices mask.

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

Comments

Shankar, Uma May 31, 2021, 2:54 p.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Stanislav
> Lisovskiy
> Sent: Thursday, May 27, 2021 4:31 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH] drm/i915/adl_p: Same slices mask is not same Dbuf
> state
> 
> We currently treat same slice mask as a same DBuf state and skip updating the Dbuf
> slices, if we detect that.
> This is wrong as if we have a multi to single pipe change or vice versa, that would be
> treated as a same Dbuf state and thus no changes required, so we don't get Mbus
> updated, causing issues.
> Solution: check also mbus_join, in addition to slices mask.

Change looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 00f3dead20ad..804d83486e81 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -8093,7 +8093,8 @@ void intel_dbuf_pre_plane_update(struct
> intel_atomic_state *state)
>  		intel_atomic_get_old_dbuf_state(state);
> 
>  	if (!new_dbuf_state ||
> -	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
>  		return;
> 
>  	WARN_ON(!new_dbuf_state->base.changed);
> @@ -8113,7 +8114,8 @@ void intel_dbuf_post_plane_update(struct
> intel_atomic_state *state)
>  		intel_atomic_get_old_dbuf_state(state);
> 
>  	if (!new_dbuf_state ||
> -	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
>  		return;
> 
>  	WARN_ON(!new_dbuf_state->base.changed);
> --
> 2.24.1.485.gad05a3d8e5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula June 9, 2021, 2:26 p.m. UTC | #2
On Thu, 27 May 2021, Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> wrote:
> We currently treat same slice mask as a same DBuf state and skip
> updating the Dbuf slices, if we detect that.
> This is wrong as if we have a multi to single pipe change or
> vice versa, that would be treated as a same Dbuf state and thus
> no changes required, so we don't get Mbus updated, causing issues.
> Solution: check also mbus_join, in addition to slices mask.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 00f3dead20ad..804d83486e81 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -8093,7 +8093,8 @@ void intel_dbuf_pre_plane_update(struct intel_atomic_state *state)
>  		intel_atomic_get_old_dbuf_state(state);
>  
>  	if (!new_dbuf_state ||
> -	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
>  		return;
>  
>  	WARN_ON(!new_dbuf_state->base.changed);
> @@ -8113,7 +8114,8 @@ void intel_dbuf_post_plane_update(struct intel_atomic_state *state)
>  		intel_atomic_get_old_dbuf_state(state);
>  
>  	if (!new_dbuf_state ||
> -	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
> +	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
>  		return;

I've pushed this to din because supposedly this is urgent.

However, the && is supposed to be at the end of the previous line, and
there was a checkpatch email reply about this. Also, there are excessive
parenthesis here. Please fix this.

BR,
Jani.

>  
>  	WARN_ON(!new_dbuf_state->base.changed);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 00f3dead20ad..804d83486e81 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -8093,7 +8093,8 @@  void intel_dbuf_pre_plane_update(struct intel_atomic_state *state)
 		intel_atomic_get_old_dbuf_state(state);
 
 	if (!new_dbuf_state ||
-	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
+	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
+	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
 		return;
 
 	WARN_ON(!new_dbuf_state->base.changed);
@@ -8113,7 +8114,8 @@  void intel_dbuf_post_plane_update(struct intel_atomic_state *state)
 		intel_atomic_get_old_dbuf_state(state);
 
 	if (!new_dbuf_state ||
-	    new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
+	    ((new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices)
+	    && (new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus)))
 		return;
 
 	WARN_ON(!new_dbuf_state->base.changed);