Skip to content

Commit ca67750

Browse files
committed
drm/i915/dsi: separate clock and data lane prepare timing
The history of why the max of VBT clock and data lane prepare timing parameter is used for both instead of each individually is unknown. Separate them to follow what the Windows driver does. Cc; William Tseng <william.tseng@intel.com> Reviewed-by: William Tseng <william.tseng@intel.com> Tested-by: William Tseng <william.tseng@intel.com> Link: https://lore.kernel.org/r/079a26d0aae79f299aee0397dad2d6519cd55071.1743682608.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 8b6b679 commit ca67750

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/gpu/drm/i915/display/icl_dsi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,23 +1842,20 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
18421842
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
18431843
u32 tlpx_ns;
18441844
u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt;
1845-
u32 ths_prepare_ns;
1845+
u32 ths_prepare_esc_clk;
18461846
u32 hs_zero_cnt;
18471847
u32 tclk_pre_cnt;
18481848

18491849
tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
18501850

1851-
ths_prepare_ns = max(mipi_config->ths_prepare,
1852-
mipi_config->tclk_prepare);
1853-
18541851
/*
18551852
* prepare cnt in escape clocks
18561853
* this field represents a hexadecimal value with a precision
18571854
* of 1.2 – i.e. the most significant bit is the integer
18581855
* and the least significant 2 bits are fraction bits.
18591856
* so, the field can represent a range of 0.25 to 1.75
18601857
*/
1861-
prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * 4, tlpx_ns);
1858+
prepare_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare * 4, tlpx_ns);
18621859
if (prepare_cnt > ICL_PREPARE_CNT_MAX) {
18631860
drm_dbg_kms(display->drm, "prepare_cnt out of range (%d)\n",
18641861
prepare_cnt);
@@ -1867,7 +1864,7 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
18671864

18681865
/* clk zero count in escape clocks */
18691866
clk_zero_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero -
1870-
ths_prepare_ns, tlpx_ns);
1867+
mipi_config->tclk_prepare, tlpx_ns);
18711868
if (clk_zero_cnt > ICL_CLK_ZERO_CNT_MAX) {
18721869
drm_dbg_kms(display->drm,
18731870
"clk_zero_cnt out of range (%d)\n", clk_zero_cnt);
@@ -1882,9 +1879,12 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
18821879
tclk_pre_cnt = ICL_TCLK_PRE_CNT_MAX;
18831880
}
18841881

1882+
ths_prepare_esc_clk = DIV_ROUND_UP(mipi_config->ths_prepare * 4, tlpx_ns);
1883+
ths_prepare_esc_clk = min(ths_prepare_esc_clk, 7);
1884+
18851885
/* hs zero cnt in escape clocks */
18861886
hs_zero_cnt = DIV_ROUND_UP(mipi_config->ths_prepare_hszero -
1887-
ths_prepare_ns, tlpx_ns);
1887+
mipi_config->ths_prepare, tlpx_ns);
18881888
if (hs_zero_cnt > ICL_HS_ZERO_CNT_MAX) {
18891889
drm_dbg_kms(display->drm, "hs_zero_cnt out of range (%d)\n",
18901890
hs_zero_cnt);
@@ -1910,7 +1910,7 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
19101910

19111911
/* data lanes dphy timings */
19121912
intel_dsi->dphy_data_lane_reg = (HS_PREPARE_OVERRIDE |
1913-
HS_PREPARE(prepare_cnt) |
1913+
HS_PREPARE(ths_prepare_esc_clk) |
19141914
HS_ZERO_OVERRIDE |
19151915
HS_ZERO(hs_zero_cnt) |
19161916
HS_EXIT_OVERRIDE |

0 commit comments

Comments
 (0)