> -----Original Message-----
> From: Intel-xe <[email protected]> On Behalf Of Vinod 
> Govindapillai
> Sent: Monday, 15 June 2026 23.34
> To: [email protected]; [email protected]
> Cc: Govindapillai, Vinod <[email protected]>; 
> [email protected]
> Subject: [PATCH v3 2/7] drm/i915/pm_demand: introduce HAS_PMDEMAND macro
> 
> PM demand feature introduces a new way to set bw, power and
> performance requirements to pcode from display version 14 onwards.
> Use an identifiable name as a macro to distinguish the pm demand
> specific changes in the code.
> 

Reviewed-by: Mika Kahola <[email protected]>

> Signed-off-by: Vinod Govindapillai <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c             |  4 ++--
>  drivers/gpu/drm/i915/display/intel_display_device.h |  1 +
>  drivers/gpu/drm/i915/display/intel_display_irq.c    |  2 +-
>  drivers/gpu/drm/i915/display/intel_display_power.c  |  4 ++--
>  drivers/gpu/drm/i915/display/intel_pmdemand.c       | 12 ++++++------
>  5 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c 
> b/drivers/gpu/drm/i915/display/intel_bw.c
> index 41539fdfeac5..4557de85fade 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -184,7 +184,7 @@ static int icl_pcode_restrict_qgv_points(struct 
> intel_display *display,
>  {
>       int ret;
> 
> -     if (DISPLAY_VER(display) >= 14)
> +     if (HAS_PMDEMAND(display))
>               return 0;
> 
>       /* bspec says to keep retrying for at least 1 ms */
> @@ -1238,7 +1238,7 @@ static int intel_bw_check_qgv_points(struct 
> intel_display *display,
> 
>       data_rate = DIV_ROUND_UP(data_rate, 1000);
> 
> -     if (DISPLAY_VER(display) >= 14)
> +     if (HAS_PMDEMAND(display))
>               return mtl_find_qgv_points(display, data_rate, 
> num_active_planes,
>                                          new_bw_state);
>       else
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h 
> b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 12e5a522a299..13e93a4b4f5f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -193,6 +193,7 @@ struct intel_display_platforms {
>  #define HAS_OVERLAY(__display)               
> (DISPLAY_INFO(__display)->has_overlay)
>  #define HAS_PIPEDMC(__display)               (DISPLAY_VER(__display) >= 12)
>  #define HAS_PIXEL_NORMALIZER(__display)      (DISPLAY_VER(__display) >= 35)
> +#define HAS_PMDEMAND(__display)              (DISPLAY_VER(__display) >= 14)
>  #define HAS_PSR(__display)           (DISPLAY_INFO(__display)->has_psr)
>  #define HAS_PSR_HW_TRACKING(__display)       
> (DISPLAY_INFO(__display)->has_psr_hw_tracking)
>  #define HAS_PSR2_SEL_FETCH(__display)        (DISPLAY_VER(__display) >= 12)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c 
> b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index 4a821b0674fd..a58bd54e2dc3 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -1262,7 +1262,7 @@ gen8_de_misc_irq_handler(struct intel_display *display, 
> u32 iir)
>               }
>       }
> 
> -     if (DISPLAY_VER(display) >= 14) {
> +     if (HAS_PMDEMAND(display)) {
>               if (iir & (XELPDP_PMDEMAND_RSP |
>                          XELPDP_PMDEMAND_RSPTOUT_ERR)) {
>                       if (iir & XELPDP_PMDEMAND_RSPTOUT_ERR)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c 
> b/drivers/gpu/drm/i915/display/intel_display_power.c
> index 2e51dfcd5dce..03f860313515 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.c
> @@ -1122,7 +1122,7 @@ static void gen9_dbuf_enable(struct intel_display 
> *display)
> 
>       slices_mask = BIT(DBUF_S1) | display->dbuf.enabled_slices;
> 
> -     if (DISPLAY_VER(display) >= 14)
> +     if (HAS_PMDEMAND(display))
>               intel_pmdemand_program_dbuf(display, slices_mask);
> 
>       /*
> @@ -1136,7 +1136,7 @@ static void gen9_dbuf_disable(struct intel_display 
> *display)
>  {
>       gen9_dbuf_slices_update(display, 0);
> 
> -     if (DISPLAY_VER(display) >= 14)
> +     if (HAS_PMDEMAND(display))
>               intel_pmdemand_program_dbuf(display, 0);
>  }
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c 
> b/drivers/gpu/drm/i915/display/intel_pmdemand.c
> index 6d32c52269a6..f96545a5b881 100644
> --- a/drivers/gpu/drm/i915/display/intel_pmdemand.c
> +++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c
> @@ -152,7 +152,7 @@ intel_pmdemand_update_phys_mask(struct intel_display 
> *display,
>  {
>       enum phy phy;
> 
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return;
> 
>       if (!encoder)
> @@ -174,7 +174,7 @@ intel_pmdemand_update_port_clock(struct intel_display 
> *display,
>                                struct intel_pmdemand_state *pmdemand_state,
>                                enum pipe pipe, int port_clock)
>  {
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return;
> 
>       pmdemand_state->ddi_clocks[pipe] = port_clock;
> @@ -324,7 +324,7 @@ int intel_pmdemand_atomic_check(struct intel_atomic_state 
> *state)
>       const struct intel_dbuf_state *new_dbuf_state;
>       struct intel_pmdemand_state *new_pmdemand_state;
> 
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return 0;
> 
>       if (!intel_pmdemand_needs_update(state))
> @@ -404,7 +404,7 @@ intel_pmdemand_init_pmdemand_params(struct intel_display 
> *display,
>  {
>       u32 reg1, reg2;
> 
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return;
> 
>       mutex_lock(&display->pmdemand.lock);
> @@ -637,7 +637,7 @@ void intel_pmdemand_pre_plane_update(struct 
> intel_atomic_state *state)
>       const struct intel_pmdemand_state *old_pmdemand_state =
>               intel_atomic_get_old_pmdemand_state(state);
> 
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return;
> 
>       if (!new_pmdemand_state ||
> @@ -660,7 +660,7 @@ void intel_pmdemand_post_plane_update(struct 
> intel_atomic_state *state)
>       const struct intel_pmdemand_state *old_pmdemand_state =
>               intel_atomic_get_old_pmdemand_state(state);
> 
> -     if (DISPLAY_VER(display) < 14)
> +     if (!HAS_PMDEMAND(display))
>               return;
> 
>       if (!new_pmdemand_state ||
> --
> 2.43.0

Reply via email to