All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@intel.com, lucas.demarchi@intel.com
Subject: [PATCH 2/8] drm/i915: move skl_preferred_vco_freq to display substruct
Date: Mon,  8 Apr 2024 21:08:37 +0300	[thread overview]
Message-ID: <4e9877d1641bce905cc9dd5eabe40df51ddbe9b5.1712599670.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1712599670.git.jani.nikula@intel.com>

The info is related to display, and should be placed under
i915->display.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_cdclk.c      | 17 ++++++++---------
 .../gpu/drm/i915/display/intel_display_core.h   |  1 +
 drivers/gpu/drm/i915/i915_drv.h                 |  1 -
 drivers/gpu/drm/xe/xe_device_types.h            |  2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index d61aa5b7cbdb..950942dc3d60 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1021,15 +1021,14 @@ static int skl_cdclk_decimal(int cdclk)
 	return DIV_ROUND_CLOSEST(cdclk - 1000, 500);
 }
 
-static void skl_set_preferred_cdclk_vco(struct drm_i915_private *dev_priv,
-					int vco)
+static void skl_set_preferred_cdclk_vco(struct drm_i915_private *i915, int vco)
 {
-	bool changed = dev_priv->skl_preferred_vco_freq != vco;
+	bool changed = i915->display.cdclk.skl_preferred_vco_freq != vco;
 
-	dev_priv->skl_preferred_vco_freq = vco;
+	i915->display.cdclk.skl_preferred_vco_freq = vco;
 
 	if (changed)
-		intel_update_max_cdclk(dev_priv);
+		intel_update_max_cdclk(i915);
 }
 
 static u32 skl_dpll0_link_rate(struct drm_i915_private *dev_priv, int vco)
@@ -1233,7 +1232,7 @@ static void skl_cdclk_init_hw(struct drm_i915_private *dev_priv)
 		 * Use the current vco as our initial
 		 * guess as to what the preferred vco is.
 		 */
-		if (dev_priv->skl_preferred_vco_freq == 0)
+		if (dev_priv->display.cdclk.skl_preferred_vco_freq == 0)
 			skl_set_preferred_cdclk_vco(dev_priv,
 						    dev_priv->display.cdclk.hw.vco);
 		return;
@@ -1241,7 +1240,7 @@ static void skl_cdclk_init_hw(struct drm_i915_private *dev_priv)
 
 	cdclk_config = dev_priv->display.cdclk.hw;
 
-	cdclk_config.vco = dev_priv->skl_preferred_vco_freq;
+	cdclk_config.vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
 	if (cdclk_config.vco == 0)
 		cdclk_config.vco = 8100000;
 	cdclk_config.cdclk = skl_calc_cdclk(0, cdclk_config.vco);
@@ -3011,7 +3010,7 @@ static int skl_dpll0_vco(struct intel_cdclk_state *cdclk_state)
 
 	vco = cdclk_state->logical.vco;
 	if (!vco)
-		vco = dev_priv->skl_preferred_vco_freq;
+		vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
 
 	for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
 		if (!crtc_state->hw.enable)
@@ -3397,7 +3396,7 @@ void intel_update_max_cdclk(struct drm_i915_private *dev_priv)
 		u32 limit = intel_de_read(dev_priv, SKL_DFSM) & SKL_DFSM_CDCLK_LIMIT_MASK;
 		int max_cdclk, vco;
 
-		vco = dev_priv->skl_preferred_vco_freq;
+		vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
 		drm_WARN_ON(&dev_priv->drm, vco != 8100000 && vco != 8640000);
 
 		/*
diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index 2167dbee5eea..b577429ee6e9 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -345,6 +345,7 @@ struct intel_display {
 		struct intel_global_obj obj;
 
 		unsigned int max_cdclk_freq;
+		unsigned int skl_preferred_vco_freq;
 	} cdclk;
 
 	struct {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cf52d4adaa20..ba3c27c969f2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -251,7 +251,6 @@ struct drm_i915_private {
 	bool preserve_bios_swizzle;
 
 	unsigned int fsb_freq, mem_freq, is_ddr3;
-	unsigned int skl_preferred_vco_freq;
 
 	unsigned int max_dotclk_freq;
 	unsigned int hpll_freq;
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index c710cec835a7..6f46234d1241 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -501,7 +501,7 @@ struct xe_device {
 	struct mutex sb_lock;
 
 	/* Should be in struct intel_display */
-	u32 skl_preferred_vco_freq, max_dotclk_freq;
+	u32 max_dotclk_freq;
 
 	union {
 		/* only to allow build, not used functionally */
-- 
2.39.2


  parent reply	other threads:[~2024-04-08 18:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 18:08 [PATCH 0/8] drm/i915: drm_i915_private and xe_device cleanups Jani Nikula
2024-04-08 18:08 ` [PATCH 1/8] drm/i915/gt: drop display clock info from gt debugfs Jani Nikula
2024-04-08 18:08 ` Jani Nikula [this message]
2024-04-08 18:08 ` [PATCH 3/8] drm/i915: move max_dotclk_freq to display substruct Jani Nikula
2024-04-08 18:08 ` [PATCH 4/8] drm/i915: move vblank_enabled " Jani Nikula
2024-04-08 18:08 ` [PATCH 5/8] drm/i915: move display_irqs_enabled " Jani Nikula
2024-04-08 18:08 ` [PATCH 6/8] drm/i915: move de_irq_mask " Jani Nikula
2024-04-08 21:07   ` Lucas De Marchi
2024-04-08 18:08 ` [PATCH 7/8] drm/i915: move pipestat_irq_mask " Jani Nikula
2024-04-08 18:08 ` [PATCH 8/8] drm/xe/display: remove unused xe->enabled_irq_mask Jani Nikula
2024-04-08 18:15 ` [PATCH 0/8] drm/i915: drm_i915_private and xe_device cleanups Ville Syrjälä
2024-04-08 19:17 ` ✓ CI.Patch_applied: success for " Patchwork
2024-04-08 19:18 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-08 19:19 ` ✓ CI.KUnit: success " Patchwork
2024-04-08 19:31 ` ✓ CI.Build: " Patchwork
2024-04-08 19:36 ` ✓ CI.Hooks: " Patchwork
2024-04-08 19:38 ` ✗ CI.checksparse: warning " Patchwork
2024-04-08 20:02 ` ✓ CI.BAT: success " Patchwork
2024-04-08 21:02 ` [PATCH 0/8] " Jani Nikula
2024-04-08 21:10   ` Lucas De Marchi
2024-04-09  8:43     ` Jani Nikula
2024-04-08 22:31 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-04-08 22:31 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-04-08 22:36 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-09  1:41 ` ✗ CI.FULL: failure " Patchwork
2024-04-10  3:35 ` ✓ Fi.CI.IGT: success " 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=4e9877d1641bce905cc9dd5eabe40df51ddbe9b5.1712599670.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@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.