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>,
	vinod.govindapillai@intel.com, stanislav.lisovskiy@intel.com,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH 4/8] drm/i915: Extract intel_dbuf_mdclk_cdclk_ratio_update()
Date: Mon,  4 Mar 2024 15:30:23 -0300	[thread overview]
Message-ID: <20240304183028.195057-5-gustavo.sousa@intel.com> (raw)
In-Reply-To: <20240304183028.195057-1-gustavo.sousa@intel.com>

As of Xe2LPD, it is now possible to select the source of the MDCLK
as either the CD2XCLK or the CDCLK PLL.

Previous display IPs were hardcoded to use the CD2XCLK. For those, the
ratio between MDCLK and CDCLK remained constant, namely 2. For Xe2LPD,
when we select the CDCLK PLL as the source, the ratio will vary
according to the squashing configuration (since the cd2x divisor is
fixed for all supported configurations).

To help the transition to supporting changes in the ratio, extract the
function intel_dbuf_mdclk_cdclk_ratio_update() from the existing logic
and call it using 2 as hardcoded ratio. Upcoming changes will use that
function for updates in the ratio due to CDCLK changes.

Bspec: 50057, 69445, 49213, 68868
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/display/skl_watermark.c | 30 +++++++++++++-------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index c6b9be80d83c..d9e49cd60d3a 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -3530,6 +3530,21 @@ int intel_dbuf_init(struct drm_i915_private *i915)
 	return 0;
 }
 
+static void intel_dbuf_mdclk_cdclk_ratio_update(struct drm_i915_private *i915,
+						u8 ratio,
+						bool joined_mbus)
+{
+	enum dbuf_slice slice;
+
+	if (joined_mbus)
+		ratio *= 2;
+
+	for_each_dbuf_slice(i915, slice)
+		intel_de_rmw(i915, DBUF_CTL_S(slice),
+			     DBUF_MIN_TRACKER_STATE_SERVICE_MASK,
+			     DBUF_MIN_TRACKER_STATE_SERVICE(ratio - 1));
+}
+
 /*
  * Configure MBUS_CTL and all DBUF_CTL_S of each slice to join_mbus state before
  * update the request state of all DBUS slices.
@@ -3537,8 +3552,7 @@ int intel_dbuf_init(struct drm_i915_private *i915)
 static void update_mbus_pre_enable(struct intel_atomic_state *state)
 {
 	struct drm_i915_private *i915 = to_i915(state->base.dev);
-	u32 mbus_ctl, dbuf_min_tracker_val;
-	enum dbuf_slice slice;
+	u32 mbus_ctl;
 	const struct intel_dbuf_state *dbuf_state =
 		intel_atomic_get_new_dbuf_state(state);
 
@@ -3549,24 +3563,18 @@ static void update_mbus_pre_enable(struct intel_atomic_state *state)
 	 * TODO: Implement vblank synchronized MBUS joining changes.
 	 * Must be properly coordinated with dbuf reprogramming.
 	 */
-	if (dbuf_state->joined_mbus) {
+	if (dbuf_state->joined_mbus)
 		mbus_ctl = MBUS_HASHING_MODE_1x4 | MBUS_JOIN |
 			MBUS_JOIN_PIPE_SELECT_NONE;
-		dbuf_min_tracker_val = DBUF_MIN_TRACKER_STATE_SERVICE(3);
-	} else {
+	else
 		mbus_ctl = MBUS_HASHING_MODE_2x2 |
 			MBUS_JOIN_PIPE_SELECT_NONE;
-		dbuf_min_tracker_val = DBUF_MIN_TRACKER_STATE_SERVICE(1);
-	}
 
 	intel_de_rmw(i915, MBUS_CTL,
 		     MBUS_HASHING_MODE_MASK | MBUS_JOIN |
 		     MBUS_JOIN_PIPE_SELECT_MASK, mbus_ctl);
 
-	for_each_dbuf_slice(i915, slice)
-		intel_de_rmw(i915, DBUF_CTL_S(slice),
-			     DBUF_MIN_TRACKER_STATE_SERVICE_MASK,
-			     dbuf_min_tracker_val);
+	intel_dbuf_mdclk_cdclk_ratio_update(i915, 2, dbuf_state->joined_mbus);
 }
 
 void intel_dbuf_pre_plane_update(struct intel_atomic_state *state)
-- 
2.44.0


  parent reply	other threads:[~2024-03-04 18:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 18:30 [PATCH 0/8] Enable LNL display Gustavo Sousa
2024-03-04 18:30 ` [PATCH 1/8] drm/i915/cdclk: Rename lnl_cdclk_table to xe2lpd_cdclk_table Gustavo Sousa
2024-03-04 21:44   ` Matt Roper
2024-03-04 18:30 ` [PATCH 2/8] drm/i915/cdclk: Add and use xe2lpd_mdclk_source_sel() Gustavo Sousa
2024-03-04 21:58   ` Matt Roper
2024-03-05 14:40     ` Gustavo Sousa
2024-03-08 15:30       ` Gustavo Sousa
2024-03-04 18:30 ` [PATCH 3/8] drm/i915/cdclk: Only compute squash waveform when necessary Gustavo Sousa
2024-03-04 22:04   ` Matt Roper
2024-03-05 14:42     ` Gustavo Sousa
2024-03-04 18:30 ` Gustavo Sousa [this message]
2024-03-04 22:11   ` [PATCH 4/8] drm/i915: Extract intel_dbuf_mdclk_cdclk_ratio_update() Matt Roper
2024-03-04 18:30 ` [PATCH 5/8] drm/i915: Add mdclk_cdclk_ratio to intel_dbuf_state Gustavo Sousa
2024-03-04 23:25   ` Matt Roper
2024-03-05 14:44     ` Gustavo Sousa
2024-03-04 18:30 ` [PATCH 6/8] drm/i915/xe2lpd: Support MDCLK:CDCLK ratio changes Gustavo Sousa
2024-03-11 21:01   ` Lisovskiy, Stanislav
2024-03-11 21:13     ` Gustavo Sousa
2024-03-12  8:27       ` Lisovskiy, Stanislav
2024-03-04 18:30 ` [PATCH 7/8] drm/i915/xe2lpd: Load DMC Gustavo Sousa
2024-03-04 19:50   ` Lucas De Marchi
2024-03-04 20:06     ` Gustavo Sousa
2024-03-04 18:30 ` [PATCH 8/8] drm/xe/lnl: Enable display support Gustavo Sousa
2024-03-04 19:53   ` Lucas De Marchi
2024-03-04 19:41 ` ✓ CI.Patch_applied: success for Enable LNL display Patchwork
2024-03-04 19:42 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-04 19:43 ` ✓ CI.KUnit: success " Patchwork
2024-03-04 19:54 ` ✓ CI.Build: " Patchwork
2024-03-04 19:55 ` ✓ CI.Hooks: " Patchwork
2024-03-04 19:57 ` ✗ CI.checksparse: warning " Patchwork
2024-03-04 20:30 ` ✓ CI.BAT: success " Patchwork
2024-03-05  3:29 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2024-03-05  3:29 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-05  3:48 ` ✗ Fi.CI.BAT: 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=20240304183028.195057-5-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 \
    --cc=vinod.govindapillai@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.