diff mbox series

[v6,4/8] drm/i915/lobf: Update lobf if any change in dependent parameters

Message ID 20250319191508.2751216-5-animesh.manna@intel.com (mailing list archive)
State New
Headers show
Series LOBF enablement fix | expand

Commit Message

Manna, Animesh March 19, 2025, 7:15 p.m. UTC
For every commit the dependent condition for LOBF is checked
and accordingly update has_lobf flag which will be used
to update the ALPM_CTL register during commit.

v1: Initial version.
v2: Avoid reading h/w register without has_lobf check. [Jani]
v3: Update LOBF in post plane update instead of separate function. [Jouni]

Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Hogander, Jouni March 24, 2025, 8:05 a.m. UTC | #1
On Thu, 2025-03-20 at 00:45 +0530, Animesh Manna wrote:
> For every commit the dependent condition for LOBF is checked
> and accordingly update has_lobf flag which will be used
> to update the ALPM_CTL register during commit.
> 
> v1: Initial version.
> v2: Avoid reading h/w register without has_lobf check. [Jani]
> v3: Update LOBF in post plane update instead of separate function.
> [Jouni]
> 
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index c2862888466f..5df1253a6b6c 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -378,9 +378,12 @@ void intel_alpm_post_plane_update(struct
> intel_atomic_state *state,
>  	struct intel_display *display = to_intel_display(state);
>  	const struct intel_crtc_state *crtc_state =
>  		intel_atomic_get_new_crtc_state(state, crtc);
> +	const struct intel_crtc_state *old_crtc_state =
> +		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct intel_encoder *encoder;
>  
> -	if (!crtc_state->has_lobf && !crtc_state->has_psr)
> +	if (!crtc_state->has_lobf && !crtc_state->has_psr &&
> +	    !old_crtc_state->has_lobf)

I don't really understand this change? Where lobf is disabled when 
has_lobf is false?

BR,

Jouni Högander
>  		return;
>  
>  	for_each_intel_encoder_mask(display->drm, encoder,
Manna, Animesh March 27, 2025, 10:43 a.m. UTC | #2
> -----Original Message-----
> From: Hogander, Jouni <jouni.hogander@intel.com>
> Sent: Monday, March 24, 2025 1:36 PM
> To: intel-xe@lists.freedesktop.org; Manna, Animesh
> <animesh.manna@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Nikula, Jani <jani.nikula@intel.com>; B, Jeevan <jeevan.b@intel.com>
> Subject: Re: [PATCH v6 4/8] drm/i915/lobf: Update lobf if any change in
> dependent parameters
> 
> On Thu, 2025-03-20 at 00:45 +0530, Animesh Manna wrote:
> > For every commit the dependent condition for LOBF is checked and
> > accordingly update has_lobf flag which will be used to update the
> > ALPM_CTL register during commit.
> >
> > v1: Initial version.
> > v2: Avoid reading h/w register without has_lobf check. [Jani]
> > v3: Update LOBF in post plane update instead of separate function.
> > [Jouni]
> >
> > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_alpm.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> > b/drivers/gpu/drm/i915/display/intel_alpm.c
> > index c2862888466f..5df1253a6b6c 100644
> > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> > @@ -378,9 +378,12 @@ void intel_alpm_post_plane_update(struct
> > intel_atomic_state *state,
> >  	struct intel_display *display = to_intel_display(state);
> >  	const struct intel_crtc_state *crtc_state =
> >  		intel_atomic_get_new_crtc_state(state, crtc);
> > +	const struct intel_crtc_state *old_crtc_state =
> > +		intel_atomic_get_old_crtc_state(state, crtc);
> >  	struct intel_encoder *encoder;
> >
> > -	if (!crtc_state->has_lobf && !crtc_state->has_psr)
> > +	if (!crtc_state->has_lobf && !crtc_state->has_psr &&
> > +	    !old_crtc_state->has_lobf)
> 
> I don't really understand this change? Where lobf is disabled when has_lobf
> is false?

When crtc_state->has_lobf = false and old_crtc_state->has_lobf = true,
then (!crtc_state->has_lobf && !crtc_state->has_psr && !old_crtc_state->has_lobf) = false, so return will not happen.
Next lnl_alpm_configure() will program other aux-wake/aux-less alpm related bits except lobf-enable. Do you see any issue here?

Regards,
Animesh
> 
> BR,
> 
> Jouni Högander
> >  		return;
> >
> >  	for_each_intel_encoder_mask(display->drm, encoder,
Hogander, Jouni March 27, 2025, 11 a.m. UTC | #3
On Thu, 2025-03-27 at 10:43 +0000, Manna, Animesh wrote:
> 
> 
> > -----Original Message-----
> > From: Hogander, Jouni <jouni.hogander@intel.com>
> > Sent: Monday, March 24, 2025 1:36 PM
> > To: intel-xe@lists.freedesktop.org; Manna, Animesh
> > <animesh.manna@intel.com>; intel-gfx@lists.freedesktop.org
> > Cc: Nikula, Jani <jani.nikula@intel.com>; B, Jeevan
> > <jeevan.b@intel.com>
> > Subject: Re: [PATCH v6 4/8] drm/i915/lobf: Update lobf if any
> > change in
> > dependent parameters
> > 
> > On Thu, 2025-03-20 at 00:45 +0530, Animesh Manna wrote:
> > > For every commit the dependent condition for LOBF is checked and
> > > accordingly update has_lobf flag which will be used to update the
> > > ALPM_CTL register during commit.
> > > 
> > > v1: Initial version.
> > > v2: Avoid reading h/w register without has_lobf check. [Jani]
> > > v3: Update LOBF in post plane update instead of separate
> > > function.
> > > [Jouni]
> > > 
> > > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_alpm.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> > > b/drivers/gpu/drm/i915/display/intel_alpm.c
> > > index c2862888466f..5df1253a6b6c 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> > > @@ -378,9 +378,12 @@ void intel_alpm_post_plane_update(struct
> > > intel_atomic_state *state,
> > >  	struct intel_display *display = to_intel_display(state);
> > >  	const struct intel_crtc_state *crtc_state =
> > >  		intel_atomic_get_new_crtc_state(state, crtc);
> > > +	const struct intel_crtc_state *old_crtc_state =
> > > +		intel_atomic_get_old_crtc_state(state, crtc);
> > >  	struct intel_encoder *encoder;
> > > 
> > > -	if (!crtc_state->has_lobf && !crtc_state->has_psr)
> > > +	if (!crtc_state->has_lobf && !crtc_state->has_psr &&
> > > +	    !old_crtc_state->has_lobf)
> > 
> > I don't really understand this change? Where lobf is disabled when
> > has_lobf
> > is false?
> 
> When crtc_state->has_lobf = false and old_crtc_state->has_lobf =
> true,
> then (!crtc_state->has_lobf && !crtc_state->has_psr &&
> !old_crtc_state->has_lobf) = false, so return will not happen.

Ok, I see. How about crtc_state->has_lobf = true and old_crtc_state-
>has_lobf = true. Do you still want to configure it? How about
crtc_state->has_lobf != old_crtc_state->has_lobf?

> Next lnl_alpm_configure() will program other aux-wake/aux-less alpm
> related bits except lobf-enable. Do you see any issue here?

I think it should be. Thank you for the clarification.

BR,

Jouni Högander

> 
> Regards,
> Animesh
> > 
> > BR,
> > 
> > Jouni Högander
> > >  		return;
> > > 
> > >  	for_each_intel_encoder_mask(display->drm, encoder,
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index c2862888466f..5df1253a6b6c 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -378,9 +378,12 @@  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
 	struct intel_display *display = to_intel_display(state);
 	const struct intel_crtc_state *crtc_state =
 		intel_atomic_get_new_crtc_state(state, crtc);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
 	struct intel_encoder *encoder;
 
-	if (!crtc_state->has_lobf && !crtc_state->has_psr)
+	if (!crtc_state->has_lobf && !crtc_state->has_psr &&
+	    !old_crtc_state->has_lobf)
 		return;
 
 	for_each_intel_encoder_mask(display->drm, encoder,