Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: William Tseng <william.tseng@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Cooper Chiou <cooper.chiou@intel.com>,
	William Tseng <william.tseng@intel.com>
Subject: [Intel-gfx] [PATCH v3] drm/i915/dsi: let HW maintain the HS-TRAIL timing
Date: Fri, 17 Dec 2021 18:09:03 +0800	[thread overview]
Message-ID: <20211217100903.32599-1-william.tseng@intel.com> (raw)
In-Reply-To: <20211115030320.26666-1-william.tseng@intel.com>

This change is to avoid over-specification of the TEOT timing
parameter, which is derived from software in current design.

Supposed that THS-TRAIL and THS-EXIT have the minimum values,
i.e., 60 and 100 in ns. If SW is overriding the HW default,
the TEOT value becomes 150 ns, approximately calculated by
the following formula.

  DIV_ROUND_UP(60/50)*50 + DIV_ROUND_UP(100/50))*50/2, where 50
  is LP Escape Clock time in ns.

The TEOT value 150 ns is larger than the maximum value,
around 136 ns if UI is 1.8ns, (105 ns + 12*UI, defined by MIPI
DPHY specification).

However, the TEOT value will meet the specification if THS-TRAIL
is set to the HW default, instead of software overriding.

The timing change is made for both data lane and clock lane.

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Cc: Lee Shawn C <shawn.c.lee@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Signed-off-by: William Tseng <william.tseng@intel.com>
---
 drivers/gpu/drm/i915/display/icl_dsi.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
index 168c84a74d30..992e357e3f44 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -1863,14 +1863,13 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct mipi_config *mipi_config = dev_priv->vbt.dsi.config;
 	u32 tlpx_ns;
-	u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt, trail_cnt;
-	u32 ths_prepare_ns, tclk_trail_ns;
+	u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt;
+	u32 ths_prepare_ns;
 	u32 hs_zero_cnt;
 	u32 tclk_pre_cnt, tclk_post_cnt;
 
 	tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
 
-	tclk_trail_ns = max(mipi_config->tclk_trail, mipi_config->ths_trail);
 	ths_prepare_ns = max(mipi_config->ths_prepare,
 			     mipi_config->tclk_prepare);
 
@@ -1897,14 +1896,6 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
 		clk_zero_cnt = ICL_CLK_ZERO_CNT_MAX;
 	}
 
-	/* trail cnt in escape clocks*/
-	trail_cnt = DIV_ROUND_UP(tclk_trail_ns, tlpx_ns);
-	if (trail_cnt > ICL_TRAIL_CNT_MAX) {
-		drm_dbg_kms(&dev_priv->drm, "trail_cnt out of range (%d)\n",
-			    trail_cnt);
-		trail_cnt = ICL_TRAIL_CNT_MAX;
-	}
-
 	/* tclk pre count in escape clocks */
 	tclk_pre_cnt = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns);
 	if (tclk_pre_cnt > ICL_TCLK_PRE_CNT_MAX) {
@@ -1948,17 +1939,13 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
 			       CLK_PRE_OVERRIDE |
 			       CLK_PRE(tclk_pre_cnt) |
 			       CLK_POST_OVERRIDE |
-			       CLK_POST(tclk_post_cnt) |
-			       CLK_TRAIL_OVERRIDE |
-			       CLK_TRAIL(trail_cnt));
+			       CLK_POST(tclk_post_cnt));
 
 	/* data lanes dphy timings */
 	intel_dsi->dphy_data_lane_reg = (HS_PREPARE_OVERRIDE |
 					 HS_PREPARE(prepare_cnt) |
 					 HS_ZERO_OVERRIDE |
 					 HS_ZERO(hs_zero_cnt) |
-					 HS_TRAIL_OVERRIDE |
-					 HS_TRAIL(trail_cnt) |
 					 HS_EXIT_OVERRIDE |
 					 HS_EXIT(exit_zero_cnt));
 
-- 
2.17.1


  reply	other threads:[~2021-12-17 10:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 10:23 [Intel-gfx] [PATCH] drm/i915/dsi: let HW maintain the HS-TRAIL timing William Tseng
2021-11-10 14:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-11-10 17:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-11-15  3:03 ` [Intel-gfx] [PATCH v2] " William Tseng
2021-12-17 10:09   ` William Tseng [this message]
2022-01-04  6:11     ` [Intel-gfx] [PATCH v3] " Kulkarni, Vandita
2025-03-11 10:06     ` [PATCH v4] " William Tseng
2025-03-13  9:55       ` Jani Nikula
2025-03-14  2:23         ` Tseng, William
2025-03-28  9:59       ` Jani Nikula
2025-03-31  8:07         ` Tseng, William
2025-04-03 12:25           ` Jani Nikula
2021-11-15  3:16 ` [Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915/dsi: let HW maintain the HS-TRAIL timing (rev2) Patchwork
2021-11-15  3:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-11-15  5:14 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-12-17 13:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/dsi: let HW maintain the HS-TRAIL timing (rev3) Patchwork
2021-12-17 15:07 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2025-03-11 14:28 ` ✗ i915.CI.BAT: failure for drm/i915/dsi: let HW maintain the HS-TRAIL timing (rev4) Patchwork
2025-03-12  0:37   ` Tseng, William

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=20211217100903.32599-1-william.tseng@intel.com \
    --to=william.tseng@intel.com \
    --cc=cooper.chiou@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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