diff mbox series

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

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

Commit Message

Manna, Animesh Feb. 24, 2025, 8:08 a.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.

Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++
 drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
 drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
 3 files changed, 19 insertions(+)

Comments

Jani Nikula Feb. 24, 2025, 10:49 a.m. UTC | #1
On Mon, 24 Feb 2025, Animesh Manna <animesh.manna@intel.com> 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.
>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
>  drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
>  3 files changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 1438e125cde1..83719ee1721c 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -312,6 +312,22 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
>  		(first_sdp_position + waketime_in_lines);
>  }
>  
> +void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_display *display = to_intel_display(crtc_state);
> +	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> +	u32 alpm_ctl;
> +
> +	if (DISPLAY_VER(display) < 20)
> +		return;
> +
> +	alpm_ctl = intel_de_read(display, ALPM_CTL(display, cpu_transcoder));
> +	if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) {
> +		alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE;
> +		intel_de_write(display, ALPM_CTL(display, cpu_transcoder), alpm_ctl);
> +	}
> +}
> +
>  static void lnl_alpm_configure(struct intel_dp *intel_dp,
>  			       const struct intel_crtc_state *crtc_state)
>  {
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h
> index 91f51fb24f98..c6efd25c2062 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> @@ -23,6 +23,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
>  				    struct drm_connector_state *conn_state);
>  void intel_alpm_configure(struct intel_dp *intel_dp,
>  			  const struct intel_crtc_state *crtc_state);
> +void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state);
>  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
>  				  struct intel_crtc *crtc);
>  void intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 26aa32d4d50e..44258ba0d951 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -37,6 +37,7 @@
>  #include "icl_dsi.h"
>  #include "intel_alpm.h"
>  #include "intel_audio.h"
> +#include "intel_alpm.h"

It's already there. We have the includes sorted so it would be easier to
spot...

>  #include "intel_audio_regs.h"
>  #include "intel_backlight.h"
>  #include "intel_combo_phy.h"
> @@ -3621,6 +3622,7 @@ static void intel_ddi_update_pipe_dp(struct intel_atomic_state *state,
>  	intel_ddi_set_dp_msa(crtc_state, conn_state);
>  
>  	intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
> +	intel_alpm_lobf_update(crtc_state);
>  
>  	intel_backlight_update(state, encoder, crtc_state, conn_state);
>  	drm_connector_update_privacy_screen(conn_state);
kernel test robot Feb. 25, 2025, 4:09 a.m. UTC | #2
Hi Animesh,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v6.14-rc4]
[also build test WARNING on linus/master next-20250224]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Animesh-Manna/drm-i915-lobf-Add-lobf-enablement-in-post-plane-update/20250224-221647
base:   v6.14-rc4
patch link:    https://lore.kernel.org/r/20250224080847.326350-5-animesh.manna%40intel.com
patch subject: [PATCH v4 4/8] drm/i915/lobf: Update lobf if any change in dependent parameters
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502251108.hxPBVdqV-lkp@intel.com/

includecheck warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/display/intel_ddi.c: intel_alpm.h is included more than once.

vim +38 drivers/gpu/drm/i915/display/intel_ddi.c

    34	
    35	#include "i915_drv.h"
    36	#include "i915_reg.h"
    37	#include "icl_dsi.h"
  > 38	#include "intel_alpm.h"
    39	#include "intel_audio.h"
  > 40	#include "intel_alpm.h"
    41	#include "intel_audio_regs.h"
    42	#include "intel_backlight.h"
    43	#include "intel_combo_phy.h"
    44	#include "intel_combo_phy_regs.h"
    45	#include "intel_connector.h"
    46	#include "intel_crtc.h"
    47	#include "intel_cx0_phy.h"
    48	#include "intel_cx0_phy_regs.h"
    49	#include "intel_ddi.h"
    50	#include "intel_ddi_buf_trans.h"
    51	#include "intel_de.h"
    52	#include "intel_display_power.h"
    53	#include "intel_display_types.h"
    54	#include "intel_dkl_phy.h"
    55	#include "intel_dkl_phy_regs.h"
    56	#include "intel_dp.h"
    57	#include "intel_dp_aux.h"
    58	#include "intel_dp_link_training.h"
    59	#include "intel_dp_mst.h"
    60	#include "intel_dp_test.h"
    61	#include "intel_dp_tunnel.h"
    62	#include "intel_dpio_phy.h"
    63	#include "intel_dsi.h"
    64	#include "intel_encoder.h"
    65	#include "intel_fdi.h"
    66	#include "intel_fifo_underrun.h"
    67	#include "intel_gmbus.h"
    68	#include "intel_hdcp.h"
    69	#include "intel_hdmi.h"
    70	#include "intel_hotplug.h"
    71	#include "intel_hti.h"
    72	#include "intel_lspcon.h"
    73	#include "intel_mg_phy_regs.h"
    74	#include "intel_modeset_lock.h"
    75	#include "intel_pps.h"
    76	#include "intel_psr.h"
    77	#include "intel_quirks.h"
    78	#include "intel_snps_phy.h"
    79	#include "intel_tc.h"
    80	#include "intel_vdsc.h"
    81	#include "intel_vdsc_regs.h"
    82	#include "skl_scaler.h"
    83	#include "skl_universal_plane.h"
    84
Manna, Animesh Feb. 25, 2025, 6:41 a.m. UTC | #3
> -----Original Message-----
> From: Nikula, Jani <jani.nikula@intel.com>
> Sent: Monday, February 24, 2025 4:18 PM
> To: Manna, Animesh <animesh.manna@intel.com>; intel-
> gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: Hogander, Jouni <jouni.hogander@intel.com>; B, Jeevan
> <jeevan.b@intel.com>; Manna, Animesh <animesh.manna@intel.com>
> Subject: Re: [PATCH v4 4/8] drm/i915/lobf: Update lobf if any change in
> dependent parameters
> 
> On Mon, 24 Feb 2025, Animesh Manna <animesh.manna@intel.com> 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.
> >
> > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++
> > drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
> > drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
> >  3 files changed, 19 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> > b/drivers/gpu/drm/i915/display/intel_alpm.c
> > index 1438e125cde1..83719ee1721c 100644
> > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> > @@ -312,6 +312,22 @@ void intel_alpm_lobf_compute_config(struct
> intel_dp *intel_dp,
> >  		(first_sdp_position + waketime_in_lines);  }
> >
> > +void intel_alpm_lobf_update(const struct intel_crtc_state
> > +*crtc_state) {
> > +	struct intel_display *display = to_intel_display(crtc_state);
> > +	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> > +	u32 alpm_ctl;
> > +
> > +	if (DISPLAY_VER(display) < 20)
> > +		return;
> > +
> > +	alpm_ctl = intel_de_read(display, ALPM_CTL(display,
> cpu_transcoder));
> > +	if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) {
> 
> You don't need to even read the register if crtc_state->has_lobf is true.

Thanks Jani for review.
Reading register to get what is there in ALPM_CTL register, like aux-less or aux-wake alpm and etc.
For LOBF we need to touch a specific bit, and don't want to modify other bitfields.

Regards,
Animesh

> 
> > +		alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE;
> > +		intel_de_write(display, ALPM_CTL(display, cpu_transcoder),
> alpm_ctl);
> > +	}
> > +}
> > +
> >  static void lnl_alpm_configure(struct intel_dp *intel_dp,
> >  			       const struct intel_crtc_state *crtc_state)  { diff --
> git
> > a/drivers/gpu/drm/i915/display/intel_alpm.h
> > b/drivers/gpu/drm/i915/display/intel_alpm.h
> > index 91f51fb24f98..c6efd25c2062 100644
> > --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> > @@ -23,6 +23,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp
> *intel_dp,
> >  				    struct drm_connector_state *conn_state);
> void
> > intel_alpm_configure(struct intel_dp *intel_dp,
> >  			  const struct intel_crtc_state *crtc_state);
> > +void intel_alpm_lobf_update(const struct intel_crtc_state
> > +*crtc_state);
> >  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
> >  				  struct intel_crtc *crtc);
> >  void intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> > b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 26aa32d4d50e..44258ba0d951 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -37,6 +37,7 @@
> >  #include "icl_dsi.h"
> >  #include "intel_alpm.h"
> >  #include "intel_audio.h"
> > +#include "intel_alpm.h"
> >  #include "intel_audio_regs.h"
> >  #include "intel_backlight.h"
> >  #include "intel_combo_phy.h"
> > @@ -3621,6 +3622,7 @@ static void intel_ddi_update_pipe_dp(struct
> intel_atomic_state *state,
> >  	intel_ddi_set_dp_msa(crtc_state, conn_state);
> >
> >  	intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
> > +	intel_alpm_lobf_update(crtc_state);
> >
> >  	intel_backlight_update(state, encoder, crtc_state, conn_state);
> >  	drm_connector_update_privacy_screen(conn_state);
> 
> --
> Jani Nikula, Intel
Jani Nikula Feb. 25, 2025, 8:02 a.m. UTC | #4
On Tue, 25 Feb 2025, "Manna, Animesh" <animesh.manna@intel.com> wrote:
>> -----Original Message-----
>> From: Nikula, Jani <jani.nikula@intel.com>
>> Sent: Monday, February 24, 2025 4:18 PM
>> To: Manna, Animesh <animesh.manna@intel.com>; intel-
>> gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
>> Cc: Hogander, Jouni <jouni.hogander@intel.com>; B, Jeevan
>> <jeevan.b@intel.com>; Manna, Animesh <animesh.manna@intel.com>
>> Subject: Re: [PATCH v4 4/8] drm/i915/lobf: Update lobf if any change in
>> dependent parameters
>>
>> On Mon, 24 Feb 2025, Animesh Manna <animesh.manna@intel.com> 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.
>> >
>> > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++
>> > drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
>> > drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
>> >  3 files changed, 19 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
>> > b/drivers/gpu/drm/i915/display/intel_alpm.c
>> > index 1438e125cde1..83719ee1721c 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
>> > @@ -312,6 +312,22 @@ void intel_alpm_lobf_compute_config(struct
>> intel_dp *intel_dp,
>> >             (first_sdp_position + waketime_in_lines);  }
>> >
>> > +void intel_alpm_lobf_update(const struct intel_crtc_state
>> > +*crtc_state) {
>> > +   struct intel_display *display = to_intel_display(crtc_state);
>> > +   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>> > +   u32 alpm_ctl;
>> > +
>> > +   if (DISPLAY_VER(display) < 20)
>> > +           return;
>> > +
>> > +   alpm_ctl = intel_de_read(display, ALPM_CTL(display,
>> cpu_transcoder));
>> > +   if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) {
>>
>> You don't need to even read the register if crtc_state->has_lobf is true.
>
> Thanks Jani for review.
> Reading register to get what is there in ALPM_CTL register, like aux-less or aux-wake alpm and etc.
> For LOBF we need to touch a specific bit, and don't want to modify other bitfields.

You only modify the register if crtc_state->has_lobf is false. You don't
need to read the register if crtc_state->has_lobf is true.


BR,
Jani.


>
> Regards,
> Animesh
>
>>
>> > +           alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE;
>> > +           intel_de_write(display, ALPM_CTL(display, cpu_transcoder),
>> alpm_ctl);
>> > +   }
>> > +}
>> > +
>> >  static void lnl_alpm_configure(struct intel_dp *intel_dp,
>> >                            const struct intel_crtc_state *crtc_state)  { diff --
>> git
>> > a/drivers/gpu/drm/i915/display/intel_alpm.h
>> > b/drivers/gpu/drm/i915/display/intel_alpm.h
>> > index 91f51fb24f98..c6efd25c2062 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_alpm.h
>> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
>> > @@ -23,6 +23,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp
>> *intel_dp,
>> >                                 struct drm_connector_state *conn_state);
>> void
>> > intel_alpm_configure(struct intel_dp *intel_dp,
>> >                       const struct intel_crtc_state *crtc_state);
>> > +void intel_alpm_lobf_update(const struct intel_crtc_state
>> > +*crtc_state);
>> >  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
>> >                               struct intel_crtc *crtc);
>> >  void intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
>> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
>> > b/drivers/gpu/drm/i915/display/intel_ddi.c
>> > index 26aa32d4d50e..44258ba0d951 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
>> > @@ -37,6 +37,7 @@
>> >  #include "icl_dsi.h"
>> >  #include "intel_alpm.h"
>> >  #include "intel_audio.h"
>> > +#include "intel_alpm.h"
>> >  #include "intel_audio_regs.h"
>> >  #include "intel_backlight.h"
>> >  #include "intel_combo_phy.h"
>> > @@ -3621,6 +3622,7 @@ static void intel_ddi_update_pipe_dp(struct
>> intel_atomic_state *state,
>> >     intel_ddi_set_dp_msa(crtc_state, conn_state);
>> >
>> >     intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
>> > +   intel_alpm_lobf_update(crtc_state);
>> >
>> >     intel_backlight_update(state, encoder, crtc_state, conn_state);
>> >     drm_connector_update_privacy_screen(conn_state);
>>
>> --
>> Jani Nikula, Intel
Manna, Animesh Feb. 25, 2025, 8:22 a.m. UTC | #5
> -----Original Message-----
> From: Nikula, Jani <jani.nikula@intel.com>
> Sent: Tuesday, February 25, 2025 1:32 PM
> To: Manna, Animesh <animesh.manna@intel.com>; intel-
> gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: Hogander, Jouni <jouni.hogander@intel.com>; B, Jeevan
> <jeevan.b@intel.com>
> Subject: RE: [PATCH v4 4/8] drm/i915/lobf: Update lobf if any change in
> dependent parameters
> 
> On Tue, 25 Feb 2025, "Manna, Animesh" <animesh.manna@intel.com>
> wrote:
> >> -----Original Message-----
> >> From: Nikula, Jani <jani.nikula@intel.com>
> >> Sent: Monday, February 24, 2025 4:18 PM
> >> To: Manna, Animesh <animesh.manna@intel.com>; intel-
> >> gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> >> Cc: Hogander, Jouni <jouni.hogander@intel.com>; B, Jeevan
> >> <jeevan.b@intel.com>; Manna, Animesh <animesh.manna@intel.com>
> >> Subject: Re: [PATCH v4 4/8] drm/i915/lobf: Update lobf if any change
> >> in dependent parameters
> >>
> >> On Mon, 24 Feb 2025, Animesh Manna <animesh.manna@intel.com>
> 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.
> >> >
> >> > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++
> >> > drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
> >> > drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
> >> >  3 files changed, 19 insertions(+)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> >> > b/drivers/gpu/drm/i915/display/intel_alpm.c
> >> > index 1438e125cde1..83719ee1721c 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> >> > @@ -312,6 +312,22 @@ void intel_alpm_lobf_compute_config(struct
> >> intel_dp *intel_dp,
> >> >             (first_sdp_position + waketime_in_lines);  }
> >> >
> >> > +void intel_alpm_lobf_update(const struct intel_crtc_state
> >> > +*crtc_state) {
> >> > +   struct intel_display *display = to_intel_display(crtc_state);
> >> > +   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> >> > +   u32 alpm_ctl;
> >> > +
> >> > +   if (DISPLAY_VER(display) < 20)
> >> > +           return;
> >> > +
> >> > +   alpm_ctl = intel_de_read(display, ALPM_CTL(display,
> >> cpu_transcoder));
> >> > +   if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) {
> >>
> >> You don't need to even read the register if crtc_state->has_lobf is true.
> >
> > Thanks Jani for review.
> > Reading register to get what is there in ALPM_CTL register, like aux-less or
> aux-wake alpm and etc.
> > For LOBF we need to touch a specific bit, and don't want to modify other
> bitfields.
> 
> You only modify the register if crtc_state->has_lobf is false. You don't need
> to read the register if crtc_state->has_lobf is true.

Ok, will take care in next version.

Regards,
Animesh

> 
> 
> BR,
> Jani.
> 
> 
> >
> > Regards,
> > Animesh
> >
> >>
> >> > +           alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE;
> >> > +           intel_de_write(display, ALPM_CTL(display,
> >> > + cpu_transcoder),
> >> alpm_ctl);
> >> > +   }
> >> > +}
> >> > +
> >> >  static void lnl_alpm_configure(struct intel_dp *intel_dp,
> >> >                            const struct intel_crtc_state
> >> > *crtc_state)  { diff --
> >> git
> >> > a/drivers/gpu/drm/i915/display/intel_alpm.h
> >> > b/drivers/gpu/drm/i915/display/intel_alpm.h
> >> > index 91f51fb24f98..c6efd25c2062 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> >> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> >> > @@ -23,6 +23,7 @@ void intel_alpm_lobf_compute_config(struct
> >> > intel_dp
> >> *intel_dp,
> >> >                                 struct drm_connector_state
> >> > *conn_state);
> >> void
> >> > intel_alpm_configure(struct intel_dp *intel_dp,
> >> >                       const struct intel_crtc_state *crtc_state);
> >> > +void intel_alpm_lobf_update(const struct intel_crtc_state
> >> > +*crtc_state);
> >> >  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
> >> >                               struct intel_crtc *crtc);  void
> >> > intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > index 26aa32d4d50e..44258ba0d951 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > @@ -37,6 +37,7 @@
> >> >  #include "icl_dsi.h"
> >> >  #include "intel_alpm.h"
> >> >  #include "intel_audio.h"
> >> > +#include "intel_alpm.h"
> >> >  #include "intel_audio_regs.h"
> >> >  #include "intel_backlight.h"
> >> >  #include "intel_combo_phy.h"
> >> > @@ -3621,6 +3622,7 @@ static void intel_ddi_update_pipe_dp(struct
> >> intel_atomic_state *state,
> >> >     intel_ddi_set_dp_msa(crtc_state, conn_state);
> >> >
> >> >     intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
> >> > +   intel_alpm_lobf_update(crtc_state);
> >> >
> >> >     intel_backlight_update(state, encoder, crtc_state, conn_state);
> >> >     drm_connector_update_privacy_screen(conn_state);
> >>
> >> --
> >> Jani Nikula, Intel
> 
> --
> Jani Nikula, Intel
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 1438e125cde1..83719ee1721c 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -312,6 +312,22 @@  void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
 		(first_sdp_position + waketime_in_lines);
 }
 
+void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state)
+{
+	struct intel_display *display = to_intel_display(crtc_state);
+	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
+	u32 alpm_ctl;
+
+	if (DISPLAY_VER(display) < 20)
+		return;
+
+	alpm_ctl = intel_de_read(display, ALPM_CTL(display, cpu_transcoder));
+	if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) {
+		alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE;
+		intel_de_write(display, ALPM_CTL(display, cpu_transcoder), alpm_ctl);
+	}
+}
+
 static void lnl_alpm_configure(struct intel_dp *intel_dp,
 			       const struct intel_crtc_state *crtc_state)
 {
diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h
index 91f51fb24f98..c6efd25c2062 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.h
+++ b/drivers/gpu/drm/i915/display/intel_alpm.h
@@ -23,6 +23,7 @@  void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
 				    struct drm_connector_state *conn_state);
 void intel_alpm_configure(struct intel_dp *intel_dp,
 			  const struct intel_crtc_state *crtc_state);
+void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state);
 void intel_alpm_post_plane_update(struct intel_atomic_state *state,
 				  struct intel_crtc *crtc);
 void intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 26aa32d4d50e..44258ba0d951 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -37,6 +37,7 @@ 
 #include "icl_dsi.h"
 #include "intel_alpm.h"
 #include "intel_audio.h"
+#include "intel_alpm.h"
 #include "intel_audio_regs.h"
 #include "intel_backlight.h"
 #include "intel_combo_phy.h"
@@ -3621,6 +3622,7 @@  static void intel_ddi_update_pipe_dp(struct intel_atomic_state *state,
 	intel_ddi_set_dp_msa(crtc_state, conn_state);
 
 	intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
+	intel_alpm_lobf_update(crtc_state);
 
 	intel_backlight_update(state, encoder, crtc_state, conn_state);
 	drm_connector_update_privacy_screen(conn_state);