All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	gustavo.sousa@intel.com
Subject: [PATCH v2 3/8] drm/i915/cdclk: Only compute squash waveform when necessary
Date: Tue, 12 Mar 2024 13:36:34 -0300	[thread overview]
Message-ID: <20240312163639.172321-4-gustavo.sousa@intel.com> (raw)
In-Reply-To: <20240312163639.172321-1-gustavo.sousa@intel.com>

It is no use computing the squash waveform if we are not going to use
it. Move the call to cdclk_squash_waveform() inside the block guarded by
HAS_CDCLK_SQUASH(dev_priv).

v2:
  - Move "u16 waveform" declaration to inside the block where it is
    initialized and used. (Matt)

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index ad0f03e51e4a..354a9dba6440 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -2006,7 +2006,6 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv,
 {
 	int cdclk = cdclk_config->cdclk;
 	int vco = cdclk_config->vco;
-	u16 waveform;
 
 	if (HAS_CDCLK_CRAWL(dev_priv) && dev_priv->display.cdclk.hw.vco > 0 && vco > 0 &&
 	    !cdclk_pll_is_unknown(dev_priv->display.cdclk.hw.vco)) {
@@ -2021,10 +2020,11 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv,
 	} else
 		bxt_cdclk_pll_update(dev_priv, vco);
 
-	waveform = cdclk_squash_waveform(dev_priv, cdclk);
+	if (HAS_CDCLK_SQUASH(dev_priv)) {
+		u16 waveform = cdclk_squash_waveform(dev_priv, cdclk);
 
-	if (HAS_CDCLK_SQUASH(dev_priv))
 		dg2_cdclk_squash_program(dev_priv, waveform);
+	}
 
 	intel_de_write(dev_priv, CDCLK_CTL, bxt_cdclk_ctl(dev_priv, cdclk_config, pipe));
 
-- 
2.44.0


  parent reply	other threads:[~2024-03-12 16:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 16:36 [PATCH v2 0/8] Enable LNL display Gustavo Sousa
2024-03-12 16:36 ` [PATCH v2 1/8] drm/i915/cdclk: Rename lnl_cdclk_table to xe2lpd_cdclk_table Gustavo Sousa
2024-03-12 16:36 ` [PATCH v2 2/8] drm/i915/cdclk: Add and use mdclk_source_is_cdclk_pll() Gustavo Sousa
2024-03-12 16:49   ` Matt Roper
2024-03-13 13:08     ` Lucas De Marchi
2024-03-12 16:36 ` Gustavo Sousa [this message]
2024-03-12 16:36 ` [PATCH v2 4/8] drm/i915: Extract intel_dbuf_mdclk_cdclk_ratio_update() Gustavo Sousa
2024-03-12 16:36 ` [PATCH v2 5/8] drm/i915: Add mdclk_cdclk_ratio to intel_dbuf_state Gustavo Sousa
2024-03-12 16:45   ` Gustavo Sousa
2024-03-12 16:50     ` Matt Roper
2024-03-12 16:36 ` [PATCH v2 6/8] drm/i915/xe2lpd: Support MDCLK:CDCLK ratio changes Gustavo Sousa
2024-03-12 16:36 ` [PATCH v2 7/8] drm/i915/xe2lpd: Load DMC Gustavo Sousa
2024-03-12 16:36 ` [PATCH v2 8/8] drm/xe/lnl: Enable display support Gustavo Sousa
2024-03-12 17:49 ` ✓ CI.Patch_applied: success for Enable LNL display (rev2) Patchwork
2024-03-12 17:50 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-12 17:51 ` ✓ CI.KUnit: success " Patchwork
2024-03-12 18:01 ` ✓ CI.Build: " Patchwork
2024-03-12 18:04 ` ✓ CI.Hooks: " Patchwork
2024-03-12 18:05 ` ✗ CI.checksparse: warning " Patchwork
2024-03-12 18:25 ` ✓ CI.BAT: success " Patchwork
2024-03-12 19:21 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2024-03-12 19:21 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-12 19:30 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-13  1:30 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-13 12:16   ` Gustavo Sousa
2024-03-13 13:07 ` [PATCH v2 0/8] Enable LNL display Lucas De Marchi
2024-03-14 18:55 ` ✓ Fi.CI.IGT: success for Enable LNL display (rev2) 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=20240312163639.172321-4-gustavo.sousa@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=stanislav.lisovskiy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.