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 09/14] drm/i915/cdclk: Unify pcode related debugs
Date: Wed, 10 Jun 2026 20:37:15 +0300 [thread overview]
Message-ID: <b983e82eb9da75fe94be29c628325dfb6210ec08@intel.com> (raw)
In-Reply-To: <20260610170652.5320-10-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 debug spew for the cdclk pcode per/post notify is very
> inconsistent between different platforms. Unify it all to
> the same form.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cdclk.c | 65 ++++++++++++----------
> 1 file changed, 36 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index 09981a112db4..542724256d0f 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -891,7 +891,7 @@ static void bdw_set_cdclk(struct intel_display *display,
> ret = intel_parent_pcode_write(display, BDW_PCODE_DISPLAY_FREQ_CHANGE_REQ, 0x0);
> if (ret) {
> drm_err(display->drm,
> - "failed to inform pcode about cdclk change\n");
> + "Failed to inform PCODE about start of CDCLK change (%d)\n", ret);
> return;
> }
>
> @@ -918,8 +918,11 @@ static void bdw_set_cdclk(struct intel_display *display,
> if (ret)
> drm_err(display->drm, "Switching back to LCPLL failed\n");
>
> - intel_parent_pcode_write(display, HSW_PCODE_DE_WRITE_FREQ_REQ,
> - cdclk_config->voltage_level);
> + ret = intel_parent_pcode_write(display, HSW_PCODE_DE_WRITE_FREQ_REQ,
> + cdclk_config->voltage_level);
> + if (ret)
> + drm_err(display->drm,
> + "Failed to inform PCODE about end of CDCLK change (%d)\n", ret);
>
> intel_de_write(display, CDCLK_FREQ,
> DIV_ROUND_CLOSEST(cdclk, 1000) - 1);
> @@ -1181,7 +1184,7 @@ static void skl_set_cdclk(struct intel_display *display,
> SKL_CDCLK_READY_FOR_CHANGE, 3);
> if (ret) {
> drm_err(display->drm,
> - "Failed to inform PCU about cdclk change (%d)\n", ret);
> + "Failed to inform PCODE about start of CDCLK change (%d)\n", ret);
> return;
> }
>
> @@ -1221,8 +1224,11 @@ static void skl_set_cdclk(struct intel_display *display,
> intel_de_posting_read(display, CDCLK_CTL);
>
> /* inform PCU of the change */
> - intel_parent_pcode_write(display, SKL_PCODE_CDCLK_CONTROL,
> - cdclk_config->voltage_level);
> + ret = intel_parent_pcode_write(display, SKL_PCODE_CDCLK_CONTROL,
> + cdclk_config->voltage_level);
> + if (ret)
> + drm_err(display->drm,
> + "Failed to inform PCODE about end of CDCLK change (%d)\n", ret);
>
> intel_update_cdclk(display);
> }
> @@ -2263,8 +2269,7 @@ static void bxt_set_cdclk(struct intel_display *display,
>
> if (ret) {
> drm_err(display->drm,
> - "Failed to inform PCU about cdclk change (err %d, freq %d)\n",
> - ret, cdclk);
> + "Failed to inform PCODE about start of CDCLK change (%d)\n", ret);
> return;
> }
>
> @@ -2299,8 +2304,7 @@ static void bxt_set_cdclk(struct intel_display *display,
> cdclk_config->voltage_level, 2);
> if (ret)
> drm_err(display->drm,
> - "PCode CDCLK freq set failed, (err %d, freq %d)\n",
> - ret, cdclk);
> + "Failed to inform PCODE about end of CDCLK change (%d)\n", ret);
>
> intel_update_cdclk(display);
>
> @@ -2571,14 +2575,13 @@ void intel_cdclk_dump_config(struct intel_display *display,
> cdclk_config->voltage_level);
> }
>
> -static void dg2_cdclk_pcode_notify(struct intel_display *display,
> - u8 voltage_level,
> - u8 active_pipe_count,
> - u16 cdclk,
> - bool cdclk_update_valid,
> - bool pipe_count_update_valid)
> +static int dg2_cdclk_pcode_notify(struct intel_display *display,
> + u8 voltage_level,
> + u8 active_pipe_count,
> + u16 cdclk,
> + bool cdclk_update_valid,
> + bool pipe_count_update_valid)
> {
> - int ret;
> u32 update_mask = 0;
>
> update_mask = DISPLAY_TO_PCODE_UPDATE_MASK(cdclk, active_pipe_count, voltage_level);
> @@ -2589,14 +2592,10 @@ static void dg2_cdclk_pcode_notify(struct intel_display *display,
> if (pipe_count_update_valid)
> update_mask |= DISPLAY_TO_PCODE_PIPE_COUNT_VALID;
>
> - ret = intel_parent_pcode_request(display, SKL_PCODE_CDCLK_CONTROL,
> - update_mask,
> - SKL_CDCLK_READY_FOR_CHANGE,
> - SKL_CDCLK_READY_FOR_CHANGE, 3);
> - if (ret)
> - drm_err(display->drm,
> - "Failed to inform PCU about display config (err %d)\n",
> - ret);
> + return intel_parent_pcode_request(display, SKL_PCODE_CDCLK_CONTROL,
> + update_mask,
> + SKL_CDCLK_READY_FOR_CHANGE,
> + SKL_CDCLK_READY_FOR_CHANGE, 3);
> }
>
> static void intel_set_cdclk(struct intel_display *display,
> @@ -2674,6 +2673,7 @@ static void dg2_cdclk_pcode_pre_notify(struct intel_atomic_state *state)
> intel_atomic_get_new_cdclk_state(state);
> unsigned int cdclk = 0; u8 voltage_level, num_active_pipes = 0;
> bool change_cdclk, update_pipe_count;
> + int ret;
>
> if (!intel_cdclk_changed(&old_cdclk_state->actual,
> &new_cdclk_state->actual) &&
> @@ -2708,8 +2708,11 @@ static void dg2_cdclk_pcode_pre_notify(struct intel_atomic_state *state)
> if (update_pipe_count)
> num_active_pipes = dg2_power_well_count(display, new_cdclk_state);
>
> - dg2_cdclk_pcode_notify(display, voltage_level, num_active_pipes, cdclk,
> - change_cdclk, update_pipe_count);
> + ret = dg2_cdclk_pcode_notify(display, voltage_level, num_active_pipes, cdclk,
> + change_cdclk, update_pipe_count);
> + if (ret)
> + drm_err(display->drm,
> + "Failed to inform PCODE about start of CDCLK change (%d)\n", ret);
> }
>
> static void dg2_cdclk_pcode_post_notify(struct intel_atomic_state *state)
> @@ -2721,6 +2724,7 @@ static void dg2_cdclk_pcode_post_notify(struct intel_atomic_state *state)
> intel_atomic_get_old_cdclk_state(state);
> unsigned int cdclk = 0; u8 voltage_level, num_active_pipes = 0;
> bool update_cdclk, update_pipe_count;
> + int ret;
>
> /* According to "Sequence After Frequency Change", set voltage to used level */
> voltage_level = new_cdclk_state->actual.voltage_level;
> @@ -2747,8 +2751,11 @@ static void dg2_cdclk_pcode_post_notify(struct intel_atomic_state *state)
> if (update_pipe_count)
> num_active_pipes = dg2_power_well_count(display, new_cdclk_state);
>
> - dg2_cdclk_pcode_notify(display, voltage_level, num_active_pipes, cdclk,
> - update_cdclk, update_pipe_count);
> + ret = dg2_cdclk_pcode_notify(display, voltage_level, num_active_pipes, cdclk,
> + update_cdclk, update_pipe_count);
> + if (ret)
> + drm_err(display->drm,
> + "Failed to inform PCODE about end of CDCLK change (%d)\n", ret);
> }
>
> bool intel_cdclk_is_decreasing_later(struct intel_atomic_state *state)
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-06-10 17:37 UTC|newest]
Thread overview: 30+ 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-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-10 17:06 ` [PATCH 09/14] drm/i915/cdclk: Unify pcode related debugs Ville Syrjala
2026-06-10 17:37 ` Jani Nikula [this message]
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-10 17:06 ` [PATCH 14/14] drm/i915/cdclk: Hoist intel_cdclk_{pre, post}_notify() calls upwards Ville Syrjala
2026-06-10 17:17 ` ✓ CI.KUnit: success for drm/i915/cdclk: cdclk pcode related fixes and refactoring Patchwork
2026-06-10 18:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-10 22:49 ` ✗ 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=b983e82eb9da75fe94be29c628325dfb6210ec08@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