Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>, <imre.deak@intel.com>
Subject: Re: [PATCH 2/3] drm/i915/power: relocate {SKL, ICL}_PW_CTL_IDX_TO_PG()
Date: Wed, 25 Jun 2025 09:52:30 -0400	[thread overview]
Message-ID: <aFv_HkvflHpZbtwX@intel.com> (raw)
In-Reply-To: <18e40b77eeb3517a056f1e567672163ec568ec55.1750855148.git.jani.nikula@intel.com>

On Wed, Jun 25, 2025 at 03:39:37PM +0300, Jani Nikula wrote:
> Move the {SKL,ICL}_PW_CTL_IDX_TO_PG() macros from intel_display_regs.h
> to intel_display_power_well.c. The mapping from index to PG can be
> hidden there.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  .../gpu/drm/i915/display/intel_display_power_well.c | 13 +++++++++++++
>  drivers/gpu/drm/i915/display/intel_display_regs.h   | 12 ------------
>  2 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> index 5c9ca8141fcc..9d60dfc4939d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> @@ -34,6 +34,19 @@
>  #include "vlv_iosf_sb_reg.h"
>  #include "vlv_sideband.h"
>  
> +/*
> + * PG0 is HW controlled, so doesn't have a corresponding power well control knob
> + * SKL_DISP_PW1_IDX..SKL_DISP_PW2_IDX -> PG1..PG2
> + */
> +#define  SKL_PW_CTL_IDX_TO_PG(pw_idx)		\
> +	((pw_idx) - SKL_PW_CTL_IDX_PW_1 + SKL_PG1)
> +/*
> + * PG0 is HW controlled, so doesn't have a corresponding power well control knob
> + * ICL_DISP_PW1_IDX..ICL_DISP_PW4_IDX -> PG1..PG4
> + */
> +#define  ICL_PW_CTL_IDX_TO_PG(pw_idx)		\
> +	((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
> +
>  struct i915_power_well_regs {
>  	i915_reg_t bios;
>  	i915_reg_t driver;
> diff --git a/drivers/gpu/drm/i915/display/intel_display_regs.h b/drivers/gpu/drm/i915/display/intel_display_regs.h
> index fdac72fcebee..7bd09d981cd2 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_regs.h
> @@ -2206,18 +2206,6 @@ enum skl_power_gate {
>  
>  #define SKL_FUSE_STATUS				_MMIO(0x42000)
>  #define  SKL_FUSE_DOWNLOAD_STATUS		(1 << 31)
> -/*
> - * PG0 is HW controlled, so doesn't have a corresponding power well control knob
> - * SKL_DISP_PW1_IDX..SKL_DISP_PW2_IDX -> PG1..PG2
> - */
> -#define  SKL_PW_CTL_IDX_TO_PG(pw_idx)		\
> -	((pw_idx) - SKL_PW_CTL_IDX_PW_1 + SKL_PG1)
> -/*
> - * PG0 is HW controlled, so doesn't have a corresponding power well control knob
> - * ICL_DISP_PW1_IDX..ICL_DISP_PW4_IDX -> PG1..PG4
> - */
> -#define  ICL_PW_CTL_IDX_TO_PG(pw_idx)		\
> -	((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
>  #define  SKL_FUSE_PG_DIST_STATUS(pg)		(1 << (27 - (pg)))
>  
>  /* Per-pipe DDI Function Control */
> -- 
> 2.39.5
> 

  reply	other threads:[~2025-06-25 13:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 12:39 [PATCH 0/3] drm/i915/power: power well register cleanups Jani Nikula
2025-06-25 12:39 ` [PATCH 1/3] drm/i915/power: move enum skl_power_gate under display Jani Nikula
2025-06-25 13:52   ` Rodrigo Vivi
2025-06-25 12:39 ` [PATCH 2/3] drm/i915/power: relocate {SKL,ICL}_PW_CTL_IDX_TO_PG() Jani Nikula
2025-06-25 13:52   ` Rodrigo Vivi [this message]
2025-06-25 12:39 ` [PATCH 3/3] drm/i915/power: convert {SKL, ICL}_PW_CTL_IDX_TO_PG() macros to a function Jani Nikula
2025-06-25 13:54   ` Rodrigo Vivi
2025-06-25 13:13 ` ✓ CI.KUnit: success for drm/i915/power: power well register cleanups Patchwork
2025-06-25 13:28 ` ✗ CI.checksparse: warning " Patchwork
2025-06-25 13:52 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-26 12:05 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aFv_HkvflHpZbtwX@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox