Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 08/14] drm/i915/cdclk: Unify the pcode pre/post notify in bxt_set_cdclk()
Date: Wed, 17 Jun 2026 16:10:51 +0300	[thread overview]
Message-ID: <83484d329e38dfc0fadeba0d1f08bf3456ea4245@intel.com> (raw)
In-Reply-To: <20260610170652.5320-9-ville.syrjala@linux.intel.com>

On Wed, 10 Jun 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The control flow between the pcode pre and post notifications ibn

*in

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> bxt_set_cdclk() is written in two different ways, even though
> they end up doing the same thing. Unify the code.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_cdclk.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index 659c1c0e3432..09981a112db4 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -2237,7 +2237,7 @@ static void bxt_set_cdclk(struct intel_display *display,
>  {
>  	struct intel_cdclk_config mid_cdclk_config;
>  	int cdclk = cdclk_config->cdclk;
> -	int ret = 0;
> +	int ret;
>  
>  	/*
>  	 * Inform power controller of upcoming frequency change.
> @@ -2246,7 +2246,7 @@ static void bxt_set_cdclk(struct intel_display *display,
>  	 * this step.
>  	 */
>  	if (DISPLAY_VER(display) >= 14 || display->platform.dg2)
> -		; /* NOOP */
> +		ret = 0; /* NOOP */
>  	else if (DISPLAY_VER(display) >= 11)
>  		ret = intel_parent_pcode_request(display, SKL_PCODE_CDCLK_CONTROL,
>  						 SKL_CDCLK_PREPARE_FOR_CHANGE,
> @@ -2282,15 +2282,12 @@ static void bxt_set_cdclk(struct intel_display *display,
>  	if (DISPLAY_VER(display) >= 20 && cdclk > display->cdclk.hw.cdclk)
>  		xe2lpd_mdclk_cdclk_ratio_program(display, cdclk_config);
>  
> -	if (DISPLAY_VER(display) >= 14)
> -		/*
> -		 * NOOP - No Pcode communication needed for
> -		 * Display versions 14 and beyond
> -		 */;
> -	else if (DISPLAY_VER(display) >= 11 && !display->platform.dg2)
> +	if (DISPLAY_VER(display) >= 14 || display->platform.dg2)
> +		ret = 0; /* NOOP */
> +	else if (DISPLAY_VER(display) >= 11)
>  		ret = intel_parent_pcode_write(display, SKL_PCODE_CDCLK_CONTROL,
>  					       cdclk_config->voltage_level);
> -	if (DISPLAY_VER(display) < 11) {
> +	else
>  		/*
>  		 * The timeout isn't specified, the 2ms used here is based on
>  		 * experiment.
> @@ -2300,7 +2297,6 @@ static void bxt_set_cdclk(struct intel_display *display,
>  		ret = intel_parent_pcode_write_timeout(display,
>  						       HSW_PCODE_DE_WRITE_FREQ_REQ,
>  						       cdclk_config->voltage_level, 2);
> -	}
>  	if (ret)
>  		drm_err(display->drm,
>  			"PCode CDCLK freq set failed, (err %d, freq %d)\n",

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-06-17 13:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 17:06 [PATCH 00/14] drm/i915/cdclk: cdclk pcode related fixes and refactoring Ville Syrjala
2026-06-10 17:06 ` [PATCH 01/14] drm/i915/cdclk: Don't bail if pcode post nofify fails Ville Syrjala
2026-06-10 17:32   ` Jani Nikula
2026-06-17 13:29     ` Jani Nikula
2026-06-17 15:15       ` Konstantin Ryabitsev
2026-06-10 17:06 ` [PATCH 02/14] drm/i915/cdclk: Pass CDCLK in MHz to pcode on DG2 Ville Syrjala
2026-06-10 17:31   ` Jani Nikula
2026-06-10 18:54     ` Ville Syrjälä
2026-06-10 17:06 ` [PATCH 03/14] drm/i915/cdclk: Do the DG2 CDCLK/pipe power well notify properly Ville Syrjala
2026-06-11  7:23   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 04/14] drm/i915/cdclk: Notify DG2 pcode about pipe power wells regardless of CDCLK Ville Syrjala
2026-06-11  7:31   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 05/14] drm/i915/cdclk: Stop forcing voltage level to 3 all the time on DG2 Ville Syrjala
2026-06-11  7:35   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 06/14] drm/i915/cdclk: Drop pointless platform check from bxt_set_cdclk() Ville Syrjala
2026-06-11  7:37   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 07/14] drm/i915/dg2: s/intel_/dg2_/ for DG2 specific stuff Ville Syrjala
2026-06-10 17:34   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 08/14] drm/i915/cdclk: Unify the pcode pre/post notify in bxt_set_cdclk() Ville Syrjala
2026-06-17 13:10   ` Jani Nikula [this message]
2026-06-10 17:06 ` [PATCH 09/14] drm/i915/cdclk: Unify pcode related debugs Ville Syrjala
2026-06-10 17:37   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 10/14] drm/i915/cdclk: Extract bdw_cdclk_pcode_{pre, post}_notify() Ville Syrjala
2026-06-10 17:38   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 11/14] drm/i915/cdclk: Extract skl_cdclk_pcode_{pre, post}_notify() Ville Syrjala
2026-06-10 17:38   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 12/14] drm/i915/cdclk: Extract bxt_cdclk_pcode_{pre, post}_notify() Ville Syrjala
2026-06-10 17:39   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 13/14] drm/i915/cdclk: Introduce CDCLK .{pre, post}_notify() vfuncs Ville Syrjala
2026-06-17 13:18   ` Jani Nikula
2026-06-10 17:06 ` [PATCH 14/14] drm/i915/cdclk: Hoist intel_cdclk_{pre, post}_notify() calls upwards Ville Syrjala
2026-06-17 13:23   ` Jani Nikula
2026-06-10 18:56 ` ✓ i915.CI.BAT: success for drm/i915/cdclk: cdclk pcode related fixes and refactoring Patchwork
2026-06-11 12:51 ` ✗ i915.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=83484d329e38dfc0fadeba0d1f08bf3456ea4245@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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