TGL TC enabling v2
Subsystems (3)
v2 cover TGL TC enabling v2
Version 2 of https://patchwork.freedesktop.org/series/66695/
Most important change is the drop of the usage of the hardcoded table with the registers values to DKL PLL registers, a bug in the calculation was fixed and a step that is not on the BSpec was added to make it work on HW and match with hardcoded table.
Also addressed Lucas comments, all of those noted in the changelog of each patch.
Clinton A Taylor (4):
drm/i915/tgl: Add missing ddi clock select during DP init sequence drm/i915/tgl/pll: Set update_active_dpll
drm/i915/tgl: TC helper function to return pin mapping drm/i915/tgl: Add dkl phy programming sequences
José Roberto de Souza (5):
drm/i915/tgl: Finish modular FIA support on registers drm/i915/icl: Unify disable and enable phy clock gating functions drm/i915/tgl: Check the UC health of tc controllers after power on drm/i915/tgl: Add dkl phy pll calculations drm/i915/tgl: Fix dkl link training
Lucas De Marchi (2):
drm/i915/tgl: Add initial dkl pll support
drm/i915/tgl: initialize TC and TBT ports
Vandita Kulkarni (2):
drm/i915/tgl: Add dkl phy registers
drm/i915/tgl: Add support for dkl pll write
drivers/gpu/drm/i915/display/intel_ddi.c | 323 ++++++++++++++--- drivers/gpu/drm/i915/display/intel_display.c | 7 +- .../drm/i915/display/intel_display_power.c | 13 + .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 332 ++++++++++++++---- drivers/gpu/drm/i915/display/intel_tc.c | 61 +++- drivers/gpu/drm/i915/display/intel_tc.h | 2 + drivers/gpu/drm/i915/i915_reg.h | 195 +++++++++- 8 files changed, 788 insertions(+), 146 deletions(-)
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/13 drm/i915/tgl: Add missing ddi clock select during DP init sequence
From: Clinton A Taylor <[email protected]>
Step 4.b was complete missed because it is only required to TC and TBT.
Bspec: 49190
--- drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +4 -1
@@ -3224,11 +3224,14 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_edp_panel_on (intel_dp);/* -* 1.b, 3. and 4. is done before tgl_ddi_pre_enable_dp() by: +* 1.b, 3. and 4.a is done before tgl_ddi_pre_enable_dp() by: * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and * haswell_crtc_enable()->intel_enable_shared_dpll() */ +/* 4.b */ +intel_ddi_clk_select (encoder, crtc_state); +/* 5. */ if (!intel_phy_is_tc (dev_priv, phy) || dig_port->tc_mode !=TC_PORT_TBT_ALT )
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/13] drm/i915/tgl: Add missing ddi clock select during DP init sequence
Quoted 17 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Step 4.b was complete missed because it is only required to TC and TBT.
Bspec: 49190
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -3224,11 +3224,14 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_edp_panel_on (intel_dp);
drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, · line 3233
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +3
-1/* -* 1.b, 3. and 4. is done before tgl_ddi_pre_enable_dp() by: +* 1.b, 3. and 4.a is done before tgl_ddi_pre_enable_dp() by: * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and * haswell_crtc_enable()->intel_enable_shared_dpll() */ +/* 4.b */ +intel_ddi_clk_select (encoder, crtc_state);
The BSpec 4.b step could be more specific about the register to program (at least I haven't found the mention about it) but seems to match:
While reviewing this I noticed that bothicl_pll_to_ddi_clk_sel() (missing cases for MGPLL5,6)
andintel_phy_is_combo() (not correct for port/phy C)
will also need to get updated for TGL.
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-0+/* 5. */ if (!intel_phy_is_tc (dev_priv, phy) || dig_port->tc_mode !=TC_PORT_TBT_ALT )Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lucas De Marchi
Reviewed-byRe: [PATCH v2 01/13] drm/i915/tgl: Add missing ddi clock select during DP init sequence
Quoted 33 lines · Imre Deak
Quoted 17 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Step 4.b was complete missed because it is only required to TC and TBT.
Bspec: 49190
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -3224,11 +3224,14 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_edp_panel_on (intel_dp);drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, · line 3233
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +3
-1/* -* 1.b, 3. and 4. is done before tgl_ddi_pre_enable_dp() by: +* 1.b, 3. and 4.a is done before tgl_ddi_pre_enable_dp() by: * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and * haswell_crtc_enable()->intel_enable_shared_dpll() */ +/* 4.b */ +intel_ddi_clk_select (encoder, crtc_state);The BSpec 4.b step could be more specific about the register to program (at least I haven't found the mention about it) but seems to match:
Quoted 7 lines
Reviewed-by Imre Deak <[email protected]>While reviewing this I noticed that both
icl_pll_to_ddi_clk_sel()(missing cases for MGPLL5,6)
andintel_phy_is_combo()(not correct for port/phy C)
will also need to get updated for TGL.
port/phy C is disabled for TGL. intel_phy_is_combo() looks correct to me. See ea6591b4dadb ("drm/i915/tgl: disable DDIC")
Lucas De Marchi
Quoted 16 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-1+/* 5. */ if (!intel_phy_is_tc (dev_priv, phy) || dig_port->tc_mode !=TC_PORT_TBT_ALT ) --2.23.0
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/13] drm/i915/tgl: Add missing ddi clock select during DP init sequence
Quoted 36 lines · Lucas De Marchi
Quoted 35 lines · Imre Deak
Quoted 17 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Step 4.b was complete missed because it is only required to TC and TBT.
Bspec: 49190
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -3224,11 +3224,14 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_edp_panel_on (intel_dp);drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, · line 3233
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +3
-1/* -* 1.b, 3. and 4. is done before tgl_ddi_pre_enable_dp() by: +* 1.b, 3. and 4.a is done before tgl_ddi_pre_enable_dp() by: * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and * haswell_crtc_enable()->intel_enable_shared_dpll() */ +/* 4.b */ +intel_ddi_clk_select (encoder, crtc_state);The BSpec 4.b step could be more specific about the register to program (at least I haven't found the mention about it) but seems to match:
Reviewed-by Imre Deak <[email protected]>
Quoted 8 lines
Quoted 5 lines
While reviewing this I noticed that both
icl_pll_to_ddi_clk_sel()(missing cases for MGPLL5,6)
andintel_phy_is_combo()(not correct for port/phy C)
will also need to get updated for TGL.port/phy C is disabled for TGL.
intel_phy_is_combo()looks correct to me. Seeea6591b4dadb("drm/i915/tgl: disable DDIC")
Ok, missed that. How about a WARN at least for that case in intel_phy_is_combo()? For reference and so that re-enabling DDIC won't silently fail.
Quoted 13 lines
Reviewed-by Lucas De Marchi <[email protected]>Lucas De Marchi
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-1+/* 5. */ if (!intel_phy_is_tc (dev_priv, phy) || dig_port->tc_mode !=TC_PORT_TBT_ALT ) --2.23.0
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 1 line
Lucas De Marchi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/13] drm/i915/tgl: Add missing ddi clock select during DP init sequence
In reply to Imre DeakQuoted 37 lines · Imre Deak
Quoted 20 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Step 4.b was complete missed because it is only required to TC and TBT.
Bspec: 49190
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -3224,11 +3224,14 @@ static void tgl_ddi_pre_enable_dp(structintel_encoder *encoder,intel_edp_panel_on (intel_dp );drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct · line 3234
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +3
-1/* -* 1.b, 3. and 4. is done before tgl_ddi_pre_enable_dp() by: +* 1.b, 3. and 4.a is done before tgl_ddi_pre_enable_dp() by: * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and * haswell_crtc_enable()->intel_enable_shared_dpll() */ +/* 4.b */ +intel_ddi_clk_select (encoder, crtc_state);The BSpec 4.b step could be more specific about the register to program
(at least I haven't found the mention about it) but seems to match:
Quoted 4 lines
Reviewed-by Imre Deak <[email protected]>While reviewing this I noticed that both
icl_pll_to_ddi_clk_sel()(missing cases for MGPLL5,6)
Nice catch, just added a patch on my tc branch fixing this.
Quoted 3 lines
and
intel_phy_is_combo()(not correct for port/phy C)
will also need to get updated for TGL.
Lucas already answered this one.
Thanks
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-0+/* 5. */ if (!intel_phy_is_tc(dev_priv, phy) ||
dig_port->tc_mode!=TC_PORT_TBT_ALT)Signature · 1 line
2.23.0
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/13 drm/i915/tgl: Finish modular FIA support on registers
In reply to José Roberto de SouzaIf platform supports and has modular FIA is enabled, the registers bits also change, example: reading TC3 registers with modular FIA enabled, driver should read from FIA2 but with TC1 bits offsets.
It is described in BSpec 50231 for DFLEXDPSP, other registers don't have the BSpec description but testing in real hardware have proven that it had moved for all other registers too.
v2:
- Caching index in tc_phy_fia_idx, instead of calculate it each time
--- .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_tc.c | 46 +++++++++++-------- drivers/gpu/drm/i915/display/intel_tc.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 28 +++++------ 4 files changed, 43 insertions(+), 33 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
@@ -1285,6 +1285,7 @@ struct intel_digital_port {char tc_port_name[8 ];enum tc_port_mode tc_mode;enum phy_fia tc_phy_fia; +u8 tc_phy_fia_idx; void (*write_infoframe)(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state,
drivers/gpu/drm/i915/display/intel_tc.c +27 -19
128 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_tc.h +1 -0
@@ -10,6 +10,7 @@#include <linux/types.h> struct intel_digital_port ; +struct drm_i915_private ;bool intel_tc_port_connected (struct intel_digital_port *dig_port);u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port);
drivers/gpu/drm/i915/i915_reg.h +14 -14
@@ -2166,13 +2166,13 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define _MMIO_FIA (fia, off) _MMIO(_FIA(fia) + (off))/* ICL PHY DFLEX registers */ -#define PORT_TX_DFLEXDPMLE1 (fia) _MMIO_FIA((fia), 0x008C0) -#define DFLEXDPMLE1_DPMLETC_MASK (tc_port) (0xf << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML0 (tc_port) (1 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML1_0 (tc_port) (3 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3 (tc_port) (8 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3_2 (tc_port) (12 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3_0 (tc_port) (15 << (4 * (tc_port))) +#define PORT_TX_DFLEXDPMLE1 (fia) _MMIO_FIA((fia), 0x008C0) +#define DFLEXDPMLE1_DPMLETC_MASK (idx) (0xf << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML0 (idx) (1 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML1_0 (idx) (3 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3 (idx) (8 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3_2 (idx) (12 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3_0 (idx) (15 << (4 * (idx)))/* BXT PHY Ref registers */ #define _PORT_REF_DW3_A 0x16218C
@@ -11671,16 +11671,16 @@ enum skl_power_gate {#define PORT_TX_DFLEXDPSP (fia) _MMIO_FIA((fia), 0x008A0)#define MODULAR_FIA_MASK (1 << 4) -#define TC_LIVE_STATE_TBT (tc_port) (1 << ((tc_port) * 8 + 6)) -#define TC_LIVE_STATE_TC (tc_port) (1 << ((tc_port) * 8 + 5)) -#define DP_LANE_ASSIGNMENT_SHIFT (tc_port) ((tc_port) * 8) -#define DP_LANE_ASSIGNMENT_MASK (tc_port) (0xf << ((tc_port) * 8)) -#define DP_LANE_ASSIGNMENT (tc_port, x) ((x) << ((tc_port) * 8)) +#define TC_LIVE_STATE_TBT (idx) (1 << ((idx) * 8 + 6)) +#define TC_LIVE_STATE_TC (idx) (1 << ((idx) * 8 + 5)) +#define DP_LANE_ASSIGNMENT_SHIFT (idx) ((idx) * 8) +#define DP_LANE_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 8)) +#define DP_LANE_ASSIGNMENT (idx, x) ((x) << ((idx) * 8))#define PORT_TX_DFLEXDPPMS (fia) _MMIO_FIA((fia), 0x00890) -#define DP_PHY_MODE_STATUS_COMPLETED (tc_port) (1 << (tc_port)) +#define DP_PHY_MODE_STATUS_COMPLETED (idx) (1 << (idx))#define PORT_TX_DFLEXDPCSSS (fia) _MMIO_FIA((fia), 0x00894) -#define DP_PHY_MODE_STATUS_NOT_SAFE (tc_port) (1 << (tc_port)) +#define DP_PHY_MODE_STATUS_NOT_SAFE (idx) (1 << (idx))#endif /* _I915_REG_H_ */
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 02/13] drm/i915/tgl: Finish modular FIA support on registers
Quoted 171 lines · José Roberto de Souza
If platform supports and has modular FIA is enabled, the registers bits also change, example: reading TC3 registers with modular FIA enabled, driver should read from FIA2 but with TC1 bits offsets.
It is described in BSpec 50231 for DFLEXDPSP, other registers don't have the BSpec description but testing in real hardware have proven that it had moved for all other registers too.
v2:
- Caching index intc_phy_fia_idx, instead of calculate it each timeCc Lucas De Marchi <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_tc.c | 46 +++++++++++-------- drivers/gpu/drm/i915/display/intel_tc.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 28 +++++------ 4 files changed, 43 insertions(+), 33 deletions(-)drivers/gpu/drm/i915/display/intel_display_types.h +1
-0@@ -1285,6 +1285,7 @@ struct intel_digital_port {char tc_port_name[8 ];enum tc_port_mode tc_mode;enum phy_fia tc_phy_fia; +u8 tc_phy_fia_idx; void (*write_infoframe)(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state,drivers/gpu/drm/i915/display/intel_tc.c +26
-19@@ -45,10 +45,19 @@ static enum phy_fia tc_port_to_fia(struct drm_i915_private *i915,return tc_port /2 ; } +static u8 +tc_port_to_fia_idx (struct drm_i915_private *i915,enum tc_port tc_port) +{ +if (!has_modular_fia (i915)) +return tc_port; + +/* See tc_port_to_fia() comment */ +return tc_port %2 ; +} +u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); -enum tc_port tc_port =intel_port_to_tc (i915, dig_port->base.port);struct intel_uncore *uncore = &i915->uncore;u32 lane_mask;@@ -57,8 +66,8 @@ u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)WARN_ON (lane_mask ==0xffffffff ); -return (lane_mask &DP_LANE_ASSIGNMENT_MASK (tc_port)) >> -DP_LANE_ASSIGNMENT_SHIFT (tc_port); +return (lane_mask &DP_LANE_ASSIGNMENT_MASK (dig_port->tc_phy_fia_idx)) >> +DP_LANE_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx); }int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port)@@ -95,7 +104,6 @@ void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port, int required_lanes) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); -enum tc_port tc_port =intel_port_to_tc (i915, dig_port->base.port);bool lane_reversal = dig_port->saved_port_bits &DDI_BUF_PORT_REVERSAL ;struct intel_uncore *uncore = &i915->uncore;u32 val;@@ -104,19 +112,21 @@ void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port, val =intel_uncore_read (uncore,PORT_TX_DFLEXDPMLE1 (dig_port->tc_phy_fia)); - val &= ~DFLEXDPMLE1_DPMLETC_MASK (tc_port); + val &= ~DFLEXDPMLE1_DPMLETC_MASK (dig_port->tc_phy_fia_idx);switch (required_lanes) {case 1 : - val |= lane_reversal ?DFLEXDPMLE1_DPMLETC_ML3 (tc_port) : -DFLEXDPMLE1_DPMLETC_ML0 (tc_port); + val |= lane_reversal ? +DFLEXDPMLE1_DPMLETC_ML3 (dig_port->tc_phy_fia_idx) : +DFLEXDPMLE1_DPMLETC_ML0 (dig_port->tc_phy_fia_idx);break ;case 2 : - val |= lane_reversal ?DFLEXDPMLE1_DPMLETC_ML3_2 (tc_port) : -DFLEXDPMLE1_DPMLETC_ML1_0 (tc_port); + val |= lane_reversal ? +DFLEXDPMLE1_DPMLETC_ML3_2 (dig_port->tc_phy_fia_idx) : +DFLEXDPMLE1_DPMLETC_ML1_0 (dig_port->tc_phy_fia_idx);break ;case 4 : - val |=DFLEXDPMLE1_DPMLETC_ML3_0 (tc_port); + val |=DFLEXDPMLE1_DPMLETC_ML3_0 (dig_port->tc_phy_fia_idx);break ;default :MISSING_CASE (required_lanes);@@ -164,9 +174,9 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)return mask; } -if (val &TC_LIVE_STATE_TBT (tc_port)) +if (val &TC_LIVE_STATE_TBT (dig_port->tc_phy_fia_idx)) mask |=BIT (TC_PORT_TBT_ALT ); -if (val &TC_LIVE_STATE_TC (tc_port)) +if (val &TC_LIVE_STATE_TC (dig_port->tc_phy_fia_idx)) mask |=BIT (TC_PORT_DP_ALT );if (intel_uncore_read (uncore,SDEISR ) &SDE_TC_HOTPLUG_ICP (tc_port))@@ -182,7 +192,6 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)static bool icl_tc_phy_status_complete (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); -enum tc_port tc_port =intel_port_to_tc (i915, dig_port->base.port);struct intel_uncore *uncore = &i915->uncore;u32 val;@@ -194,14 +203,13 @@ static bool icl_tc_phy_status_complete(struct intel_digital_port *dig_port)return false; } -return val &DP_PHY_MODE_STATUS_COMPLETED (tc_port); +return val &DP_PHY_MODE_STATUS_COMPLETED (dig_port->tc_phy_fia_idx); }static bool icl_tc_phy_set_safe_mode (struct intel_digital_port *dig_port,bool enable) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); -enum tc_port tc_port =intel_port_to_tc (i915, dig_port->base.port);struct intel_uncore *uncore = &i915->uncore;u32 val;@@ -215,9 +223,9 @@ static bool icl_tc_phy_set_safe_mode(struct intel_digital_port *dig_port,return false; } - val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); + val &= ~DP_PHY_MODE_STATUS_NOT_SAFE (dig_port->tc_phy_fia_idx);if (!enable) - val |=DP_PHY_MODE_STATUS_NOT_SAFE (tc_port); + val |=DP_PHY_MODE_STATUS_NOT_SAFE (dig_port->tc_phy_fia_idx);intel_uncore_write (uncore,PORT_TX_DFLEXDPCSSS (dig_port->tc_phy_fia), val);@@ -232,7 +240,6 @@ static bool icl_tc_phy_set_safe_mode(struct intel_digital_port *dig_port,static bool icl_tc_phy_is_in_safe_mode (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); -enum tc_port tc_port =intel_port_to_tc (i915, dig_port->base.port);struct intel_uncore *uncore = &i915->uncore;u32 val;@@ -244,7 +251,7 @@ static bool icl_tc_phy_is_in_safe_mode(struct intel_digital_port *dig_port)return true; } -return !(val &DP_PHY_MODE_STATUS_NOT_SAFE (tc_port)); +return !(val &DP_PHY_MODE_STATUS_NOT_SAFE (dig_port->tc_phy_fia_idx)); }/*
drivers/gpu/drm/i915/display/intel_tc.c void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) · line 551
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_tc.c +1
-0@@ -541,4 +548,5 @@ void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) dig_port->tc_legacy_port = is_legacy; dig_port->tc_link_refcount =0 ; dig_port->tc_phy_fia =tc_port_to_fia (i915, tc_port); + dig_port->tc_phy_fia_idx =tc_port_to_fia_idx (i915, tc_port);
I think we could actually embed here tc_port_to_fia() and tc_port_to_fia_idx() under a single has_modular_fia().
drivers/gpu/drm/i915/display/intel_tc.h line 13
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_tc.c +0
-0}drivers/gpu/drm/i915/display/intel_tc.h +1
-0@@ -10,6 +10,7 @@#include <linux/types.h> struct intel_digital_port ; +struct drm_i915_private ;
not needed anymore.
With that, Reviewed-by: Lucas De Marchi <[email protected]>
Lucas De Marchi
Quoted 59 lines
drivers/gpu/drm/i915/display/intel_tc.h +0
-0bool intel_tc_port_connected (struct intel_digital_port *dig_port);u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port);drivers/gpu/drm/i915/i915_reg.h +14
-15@@ -2166,13 +2166,13 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define _MMIO_FIA (fia, off) _MMIO(_FIA(fia) + (off))/* ICL PHY DFLEX registers */ -#define PORT_TX_DFLEXDPMLE1 (fia) _MMIO_FIA((fia), 0x008C0) -#define DFLEXDPMLE1_DPMLETC_MASK (tc_port) (0xf << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML0 (tc_port) (1 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML1_0 (tc_port) (3 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3 (tc_port) (8 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3_2 (tc_port) (12 << (4 * (tc_port))) -#define DFLEXDPMLE1_DPMLETC_ML3_0 (tc_port) (15 << (4 * (tc_port))) +#define PORT_TX_DFLEXDPMLE1 (fia) _MMIO_FIA((fia), 0x008C0) +#define DFLEXDPMLE1_DPMLETC_MASK (idx) (0xf << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML0 (idx) (1 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML1_0 (idx) (3 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3 (idx) (8 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3_2 (idx) (12 << (4 * (idx))) +#define DFLEXDPMLE1_DPMLETC_ML3_0 (idx) (15 << (4 * (idx)))/* BXT PHY Ref registers */ #define _PORT_REF_DW3_A 0x16218C@@ -11671,16 +11671,16 @@ enum skl_power_gate {#define PORT_TX_DFLEXDPSP (fia) _MMIO_FIA((fia), 0x008A0)#define MODULAR_FIA_MASK (1 << 4) -#define TC_LIVE_STATE_TBT (tc_port) (1 << ((tc_port) * 8 + 6)) -#define TC_LIVE_STATE_TC (tc_port) (1 << ((tc_port) * 8 + 5)) -#define DP_LANE_ASSIGNMENT_SHIFT (tc_port) ((tc_port) * 8) -#define DP_LANE_ASSIGNMENT_MASK (tc_port) (0xf << ((tc_port) * 8)) -#define DP_LANE_ASSIGNMENT (tc_port, x) ((x) << ((tc_port) * 8)) +#define TC_LIVE_STATE_TBT (idx) (1 << ((idx) * 8 + 6)) +#define TC_LIVE_STATE_TC (idx) (1 << ((idx) * 8 + 5)) +#define DP_LANE_ASSIGNMENT_SHIFT (idx) ((idx) * 8) +#define DP_LANE_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 8)) +#define DP_LANE_ASSIGNMENT (idx, x) ((x) << ((idx) * 8))#define PORT_TX_DFLEXDPPMS (fia) _MMIO_FIA((fia), 0x00890) -#define DP_PHY_MODE_STATUS_COMPLETED (tc_port) (1 << (tc_port)) +#define DP_PHY_MODE_STATUS_COMPLETED (idx) (1 << (idx))#define PORT_TX_DFLEXDPCSSS (fia) _MMIO_FIA((fia), 0x00894) -#define DP_PHY_MODE_STATUS_NOT_SAFE (tc_port) (1 << (tc_port)) +#define DP_PHY_MODE_STATUS_NOT_SAFE (idx) (1 << (idx))#endif /* _I915_REG_H_ */ --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 3/13 drm/i915/tgl/pll: Set update_active_dpll
In reply to José Roberto de SouzaFrom: Clinton A Taylor <[email protected]>
Commit 24a7bfe0c2d7 ("drm/i915: Keep the TypeC port mode fixed when the port is active") added this new hook while in parallel TGL upstream was happening and this was missed.
Without this driver will crash when TC DDI is added and driver is preparing to do a full modeset.
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -0
@@ -3479,6 +3479,7 @@ static const struct intel_dpll_mgr tgl_pll_mgr = { .dpll_info = tgl_plls, .get_dplls = icl_get_dplls, .put_dplls = icl_put_dplls, + .update_active_dpll = icl_update_active_dpll, .dump_hw_state = icl_dump_hw_state, };
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 03/13] drm/i915/tgl/pll: Set update_active_dpll
Quoted 7 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Commit
24a7bfe0c2d7("drm/i915: Keep the TypeC port mode fixed when the port is active") added this new hook while in parallel TGL upstream was happening and this was missed.
Quoted 7 lines
Without this driver will crash when TC DDI is added and driver is preparing to do a full modeset.
Cc Lucas De Marchi <[email protected]>Cc Imre Deak <[email protected]>Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
Lucas De Marchi
Quoted 23 lines
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1@@ -3479,6 +3479,7 @@ static const struct intel_dpll_mgr tgl_pll_mgr = { .dpll_info = tgl_plls, .get_dplls = icl_get_dplls, .put_dplls = icl_put_dplls, + .update_active_dpll = icl_update_active_dpll, .dump_hw_state = icl_dump_hw_state, }; --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/13 drm/i915/tgl: Add dkl phy registers
In reply to José Roberto de SouzaFrom: Vandita Kulkarni <[email protected]>
These are the registers needed to program Dekel phy. Some register definitions will be reused from MG PHY definitions, so adding a comment on those.
Bspec: 49295
--- drivers/gpu/drm/i915/i915_reg.h | 162 ++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +162 -0
@@ -10104,6 +10104,168 @@ enum skl_power_gate { _TGL_DPLL1_CFGCR1, \ _TGL_TBTPLL_CFGCR1) +#define _DKL_PHY1_BASE 0x168000 +#define _DKL_PHY2_BASE 0x169000 +#define _DKL_PHY3_BASE 0x16A000 +#define _DKL_PHY4_BASE 0x16B000 +#define _DKL_PHY5_BASE 0x16C000 +#define _DKL_PHY6_BASE 0x16D000 + +/* DEKEL PHY MMIO Address = Phy base + (internal address & ~index_mask) */ +#define _DKL_PLL_DIV0 0x200 +#define DKL_PLL_DIV0_INTEG_COEFF (x) ((x) << 16) +#define DKL_PLL_DIV0_INTEG_COEFF_MASK (0x1F << 16) +#define DKL_PLL_DIV0_PROP_COEFF (x) ((x) << 12) +#define DKL_PLL_DIV0_PROP_COEFF_MASK (0xF << 12) +#define DKL_PLL_DIV0_FBPREDIV_SHIFT (8) +#define DKL_PLL_DIV0_FBPREDIV (x) ((x) << DKL_PLL_DIV0_FBPREDIV_SHIFT) +#define DKL_PLL_DIV0_FBPREDIV_MASK (0xF << DKL_PLL_DIV0_FBPREDIV_SHIFT) +#define DKL_PLL_DIV0_FBDIV_INT (x) ((x) << 0) +#define DKL_PLL_DIV0_FBDIV_INT_MASK (0xFF << 0) +#define DKL_PLL_DIV0 (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_DIV0) + +#define _DKL_PLL_DIV1 0x204 +#define DKL_PLL_DIV1_IREF_TRIM (x) ((x) << 16) +#define DKL_PLL_DIV1_IREF_TRIM_MASK (0x1F << 16) +#define DKL_PLL_DIV1_TDC_TARGET_CNT (x) ((x) << 0) +#define DKL_PLL_DIV1_TDC_TARGET_CNT_MASK (0xFF << 0) +#define DKL_PLL_DIV1 (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_DIV1) + +#define _DKL_PLL_SSC 0x210 +#define DKL_PLL_SSC_IREF_NDIV_RATIO (x) ((x) << 29) +#define DKL_PLL_SSC_IREF_NDIV_RATIO_MASK (0x7 << 29) +#define DKL_PLL_SSC_STEP_LEN (x) ((x) << 16) +#define DKL_PLL_SSC_STEP_LEN_MASK (0xFF << 16) +#define DKL_PLL_SSC_STEP_NUM (x) ((x) << 11) +#define DKL_PLL_SSC_STEP_NUM_MASK (0x7 << 11) +#define DKL_PLL_SSC_EN (1 << 9) +#define DKL_PLL_SSC (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_SSC) + +#define _DKL_PLL_BIAS 0x214 +#define DKL_PLL_BIAS_FRAC_EN_H (1 << 30) +#define DKL_PLL_BIAS_FBDIV_SHIFT (8) +#define DKL_PLL_BIAS_FBDIV_FRAC (x) ((x) << DKL_PLL_BIAS_FBDIV_SHIFT) +#define DKL_PLL_BIAS_FBDIV_FRAC_MASK (0x3FFFFF << DKL_PLL_BIAS_FBDIV_SHIFT) +#define DKL_PLL_BIAS (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_BIAS) + +#define _DKL_PLL_TDC_COLDST_BIAS 0x218 +#define DKL_PLL_TDC_SSC_STEP_SIZE (x) ((x) << 8) +#define DKL_PLL_TDC_SSC_STEP_SIZE_MASK (0xFF << 8) +#define DKL_PLL_TDC_FEED_FWD_GAIN (x) ((x) << 0) +#define DKL_PLL_TDC_FEED_FWD_GAIN_MASK (0xFF << 0) +#define DKL_PLL_TDC_COLDST_BIAS (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_TDC_COLDST_BIAS) + +#define _DKL_REFCLKIN_CTL 0x12C +/* Bits are the same as MG_REFCLKIN_CTL */ +#define DKL_REFCLKIN_CTL (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_REFCLKIN_CTL) + +#define _DKL_CLKTOP2_HSCLKCTL 0xD4 +/* Bits are the same as MG_CLKTOP2_HSCLKCTL */ +#define DKL_CLKTOP2_HSCLKCTL (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CLKTOP2_HSCLKCTL) + +#define _DKL_CLKTOP2_CORECLKCTL1 0xD8 +/* Bits are the same as MG_CLKTOP2_CORECLKCTL1 */ +#define DKL_CLKTOP2_CORECLKCTL1 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CLKTOP2_CORECLKCTL1) + +#define _DKL_TX_DPCNTL0 0x2C0 +#define DKL_TX_PRESHOOT_COEFF (x) ((x) << 13) +#define DKL_TX_PRESHOOT_COEFF_MASK (0x1f << 13) +#define DKL_TX_DE_EMPHASIS_COEFF (x) ((x) << 8) +#define DKL_TX_DE_EMPAHSIS_COEFF_MASK (0x1f << 8) +#define DKL_TX_VSWING_CONTROL (x) ((x) << 0) +#define DKL_TX_VSWING_CONTROL_MASK (0x7 << 0) +#define DKL_TX_DPCNTL0 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL0) + +#define _DKL_TX_DPCNTL1 0x2C4 +/* Bits are the same as DKL_TX_DPCNTRL0 */ +#define DKL_TX_DPCNTL1 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL1) + +#define _DKL_TX_DPCNTL2 0x2C8 +#define DKL_TX_DP20BITMODE (1 << 2) +#define DKL_TX_DPCNTL2 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL2) + +#define _DKL_TX_FW_CALIB 0x2F8 +#define DKL_TX_CFG_DISABLE_WAIT_INIT (1 << 7) +#define DKL_TX_FW_CALIB (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_FW_CALIB) + +#define _DKL_TX_DW17 0xDC4 +#define DKL_TX_DW17 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DW17) + +#define _DKL_TX_DW18 0xDC8 +#define DKL_TX_DW18 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DW18) + +#define _DKL_DP_MODE 0xA0 +#define DKL_DP_MODE_CFG_GAONPWR_GATING (1 << 1) +#define DKL_DP_MODE_CFG_DIGPWR_GATING (1 << 2) +#define DKL_DP_MODE_CFG_CLNPWR_GATING (1 << 3) +#define DKL_DP_MODE_CFG_TRPWR_GATING (1 << 4) +#define DKL_DP_MODE_CFG_TR2PWR_GATING (1 << 5) +#define DKL_DP_MODE_CFG_GATING_CTRL_MASK (0x1f << 1) +#define DKL_DP_MODE_CFG_DP_X1_MODE (1 << 6) +#define DKL_DP_MODE_CFG_DP_X2_MODE (1 << 7) +#define DKL_DP_MODE (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_DP_MODE) + +#define _DKL_CMN_UC_DW27 0x36C +#define DKL_CMN_UC_DW27_UC_HEALTH (0x1 << 15) +#define DKL_CMN_UC_DW_27 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CMN_UC_DW27) + +/* +* Each Dekel PHY is addressed through a 4KB aperture. Each PHY has more than +* 4KB of register space, so a separate index is programmed in HIP_INDEX_REG0 +* or HIP_INDEX_REG1, based on the port number, to set the upper 2 address +* bits that point the 4KB window into the full PHY register space. +*/ +#define _HIP_INDEX_REG0 0x1010A0 +#define _HIP_INDEX_REG1 0x1010A4 +#define HIP_INDEX_REG (tc_port) _MMIO((tc_port) < 4 ? _HIP_INDEX_REG0 \ + : _HIP_INDEX_REG1) +#define _HIP_INDEX_SHIFT (tc_port) (8 * ((tc_port) % 4)) +#define HIP_INDEX_VAL (tc_port, val) ((val) << _HIP_INDEX_SHIFT(tc_port)) +/* BXT display engine PLL */ #define BXT_DE_PLL_CTL _MMIO(0x6d000)#define BXT_DE_PLL_RATIO (x) (x)/* {60,65,100} * 19.2MHz */
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 04/13] drm/i915/tgl: Add dkl phy registers
Quoted 7 lines · José Roberto de Souza
From: Vandita Kulkarni <[email protected]>
These are the registers needed to program Dekel phy. Some register definitions will be reused from MG PHY definitions, so adding a comment on those.
Quoted 6 lines
Bspec: 49295
Signed-off-by Vandita Kulkarni <[email protected]>Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>
You can turn my s-o-b into
(s-o-b was only here since I had sent the previous version)
Lucas De Marchi
Quoted 184 lines
--- drivers/gpu/drm/i915/i915_reg.h | 162 ++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+)drivers/gpu/drm/i915/i915_reg.h +162
-1@@ -10104,6 +10104,168 @@ enum skl_power_gate { _TGL_DPLL1_CFGCR1, \ _TGL_TBTPLL_CFGCR1) +#define _DKL_PHY1_BASE 0x168000 +#define _DKL_PHY2_BASE 0x169000 +#define _DKL_PHY3_BASE 0x16A000 +#define _DKL_PHY4_BASE 0x16B000 +#define _DKL_PHY5_BASE 0x16C000 +#define _DKL_PHY6_BASE 0x16D000 + +/* DEKEL PHY MMIO Address = Phy base + (internal address & ~index_mask) */ +#define _DKL_PLL_DIV0 0x200 +#define DKL_PLL_DIV0_INTEG_COEFF (x) ((x) << 16) +#define DKL_PLL_DIV0_INTEG_COEFF_MASK (0x1F << 16) +#define DKL_PLL_DIV0_PROP_COEFF (x) ((x) << 12) +#define DKL_PLL_DIV0_PROP_COEFF_MASK (0xF << 12) +#define DKL_PLL_DIV0_FBPREDIV_SHIFT (8) +#define DKL_PLL_DIV0_FBPREDIV (x) ((x) << DKL_PLL_DIV0_FBPREDIV_SHIFT) +#define DKL_PLL_DIV0_FBPREDIV_MASK (0xF << DKL_PLL_DIV0_FBPREDIV_SHIFT) +#define DKL_PLL_DIV0_FBDIV_INT (x) ((x) << 0) +#define DKL_PLL_DIV0_FBDIV_INT_MASK (0xFF << 0) +#define DKL_PLL_DIV0 (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_DIV0) + +#define _DKL_PLL_DIV1 0x204 +#define DKL_PLL_DIV1_IREF_TRIM (x) ((x) << 16) +#define DKL_PLL_DIV1_IREF_TRIM_MASK (0x1F << 16) +#define DKL_PLL_DIV1_TDC_TARGET_CNT (x) ((x) << 0) +#define DKL_PLL_DIV1_TDC_TARGET_CNT_MASK (0xFF << 0) +#define DKL_PLL_DIV1 (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_DIV1) + +#define _DKL_PLL_SSC 0x210 +#define DKL_PLL_SSC_IREF_NDIV_RATIO (x) ((x) << 29) +#define DKL_PLL_SSC_IREF_NDIV_RATIO_MASK (0x7 << 29) +#define DKL_PLL_SSC_STEP_LEN (x) ((x) << 16) +#define DKL_PLL_SSC_STEP_LEN_MASK (0xFF << 16) +#define DKL_PLL_SSC_STEP_NUM (x) ((x) << 11) +#define DKL_PLL_SSC_STEP_NUM_MASK (0x7 << 11) +#define DKL_PLL_SSC_EN (1 << 9) +#define DKL_PLL_SSC (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_SSC) + +#define _DKL_PLL_BIAS 0x214 +#define DKL_PLL_BIAS_FRAC_EN_H (1 << 30) +#define DKL_PLL_BIAS_FBDIV_SHIFT (8) +#define DKL_PLL_BIAS_FBDIV_FRAC (x) ((x) << DKL_PLL_BIAS_FBDIV_SHIFT) +#define DKL_PLL_BIAS_FBDIV_FRAC_MASK (0x3FFFFF << DKL_PLL_BIAS_FBDIV_SHIFT) +#define DKL_PLL_BIAS (tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_BIAS) + +#define _DKL_PLL_TDC_COLDST_BIAS 0x218 +#define DKL_PLL_TDC_SSC_STEP_SIZE (x) ((x) << 8) +#define DKL_PLL_TDC_SSC_STEP_SIZE_MASK (0xFF << 8) +#define DKL_PLL_TDC_FEED_FWD_GAIN (x) ((x) << 0) +#define DKL_PLL_TDC_FEED_FWD_GAIN_MASK (0xFF << 0) +#define DKL_PLL_TDC_COLDST_BIAS (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_PLL_TDC_COLDST_BIAS) + +#define _DKL_REFCLKIN_CTL 0x12C +/* Bits are the same as MG_REFCLKIN_CTL */ +#define DKL_REFCLKIN_CTL (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_REFCLKIN_CTL) + +#define _DKL_CLKTOP2_HSCLKCTL 0xD4 +/* Bits are the same as MG_CLKTOP2_HSCLKCTL */ +#define DKL_CLKTOP2_HSCLKCTL (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CLKTOP2_HSCLKCTL) + +#define _DKL_CLKTOP2_CORECLKCTL1 0xD8 +/* Bits are the same as MG_CLKTOP2_CORECLKCTL1 */ +#define DKL_CLKTOP2_CORECLKCTL1 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CLKTOP2_CORECLKCTL1) + +#define _DKL_TX_DPCNTL0 0x2C0 +#define DKL_TX_PRESHOOT_COEFF (x) ((x) << 13) +#define DKL_TX_PRESHOOT_COEFF_MASK (0x1f << 13) +#define DKL_TX_DE_EMPHASIS_COEFF (x) ((x) << 8) +#define DKL_TX_DE_EMPAHSIS_COEFF_MASK (0x1f << 8) +#define DKL_TX_VSWING_CONTROL (x) ((x) << 0) +#define DKL_TX_VSWING_CONTROL_MASK (0x7 << 0) +#define DKL_TX_DPCNTL0 (tc_port) _MMIO(_PORT, that is unchange(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL0) + +#define _DKL_TX_DPCNTL1 0x2C4 +/* Bits are the same as DKL_TX_DPCNTRL0 */ +#define DKL_TX_DPCNTL1 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL1) + +#define _DKL_TX_DPCNTL2 0x2C8 +#define DKL_TX_DP20BITMODE (1 << 2) +#define DKL_TX_DPCNTL2 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DPCNTL2) + +#define _DKL_TX_FW_CALIB 0x2F8 +#define DKL_TX_CFG_DISABLE_WAIT_INIT (1 << 7) +#define DKL_TX_FW_CALIB (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_FW_CALIB) + +#define _DKL_TX_DW17 0xDC4 +#define DKL_TX_DW17 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DW17) + +#define _DKL_TX_DW18 0xDC8 +#define DKL_TX_DW18 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_TX_DW18) + +#define _DKL_DP_MODE 0xA0 +#define DKL_DP_MODE_CFG_GAONPWR_GATING (1 << 1) +#define DKL_DP_MODE_CFG_DIGPWR_GATING (1 << 2) +#define DKL_DP_MODE_CFG_CLNPWR_GATING (1 << 3) +#define DKL_DP_MODE_CFG_TRPWR_GATING (1 << 4) +#define DKL_DP_MODE_CFG_TR2PWR_GATING (1 << 5) +#define DKL_DP_MODE_CFG_GATING_CTRL_MASK (0x1f << 1) +#define DKL_DP_MODE_CFG_DP_X1_MODE (1 << 6) +#define DKL_DP_MODE_CFG_DP_X2_MODE (1 << 7) +#define DKL_DP_MODE (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_DP_MODE) + +#define _DKL_CMN_UC_DW27 0x36C +#define DKL_CMN_UC_DW27_UC_HEALTH (0x1 << 15) +#define DKL_CMN_UC_DW_27 (tc_port) _MMIO(_PORT(tc_port, \ + _DKL_PHY1_BASE, \ + _DKL_PHY2_BASE) + \ + _DKL_CMN_UC_DW27) + +/* +* Each Dekel PHY is addressed through a 4KB aperture. Each PHY has more than +* 4KB of register space, so a separate index is programmed in HIP_INDEX_REG0 +* or HIP_INDEX_REG1, based on the port number, to set the upper 2 address +* bits that point the 4KB window into the full PHY register space. +*/ +#define _HIP_INDEX_REG0 0x1010A0 +#define _HIP_INDEX_REG1 0x1010A4 +#define HIP_INDEX_REG (tc_port) _MMIO((tc_port) < 4 ? _HIP_INDEX_REG0 \ + : _HIP_INDEX_REG1) +#define _HIP_INDEX_SHIFT (tc_port) (8 * ((tc_port) % 4)) +#define HIP_INDEX_VAL (tc_port, val) ((val) << _HIP_INDEX_SHIFT(tc_port)) +/* BXT display engine PLL */ #define BXT_DE_PLL_CTL _MMIO(0x6d000)#define BXT_DE_PLL_RATIO (x) (x)/* {60,65,100} * 19.2MHz */ --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 5/13 drm/i915/tgl: Add initial dkl pll support
In reply to José Roberto de SouzaFrom: Lucas De Marchi <[email protected]>
The disable function can be the same as for MG phy since the same registers are used. The others are different as registers changed, also adding a empty dkl_pll_write() to be implemented later.
v2:
Setting the right HIP_INDEX_REG bits (José)
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 115 +++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +114 -1
@@ -3086,6 +3086,76 @@ static bool mg_pll_get_hw_state(struct drm_i915_private *dev_priv,return ret; } +static bool dkl_pll_get_hw_state (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll, +struct intel_dpll_hw_state *hw_state) +{ +const enum intel_dpll_id id = pll->info->id; +enum tc_port tc_port =icl_pll_id_to_tc_port (id); +intel_wakeref_t wakeref; +bool ret = false; +u32 val; + + wakeref =intel_display_power_get_if_enabled (dev_priv, +POWER_DOMAIN_DISPLAY_CORE ); +if (!wakeref) +return false; + + val =I915_READ (MG_PLL_ENABLE (tc_port)); +if (!(val &PLL_ENABLE )) + goto out; + +/* +* All registers read here have the same HIP_INDEX_REG even though +* they are on different building blocks +*/ +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + + hw_state->mg_refclkin_ctl =I915_READ (DKL_REFCLKIN_CTL (tc_port)); + hw_state->mg_refclkin_ctl &=MG_REFCLKIN_CTL_OD_2_MUX_MASK ; + + hw_state->mg_clktop2_hsclkctl = +I915_READ (DKL_CLKTOP2_HSCLKCTL (tc_port)); + hw_state->mg_clktop2_hsclkctl &= +MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK | +MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK | +MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK | +MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK ; + + hw_state->mg_clktop2_coreclkctl1 = +I915_READ (DKL_CLKTOP2_CORECLKCTL1 (tc_port)); + hw_state->mg_clktop2_coreclkctl1 &= +MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK ; + + hw_state->mg_pll_div0 =I915_READ (DKL_PLL_DIV0 (tc_port)); + hw_state->mg_pll_div0 &= (DKL_PLL_DIV0_INTEG_COEFF_MASK | +DKL_PLL_DIV0_PROP_COEFF_MASK | +DKL_PLL_DIV0_FBPREDIV_MASK | +DKL_PLL_DIV0_FBDIV_INT_MASK ); + + hw_state->mg_pll_div1 =I915_READ (DKL_PLL_DIV1 (tc_port)); + hw_state->mg_pll_div1 &= (DKL_PLL_DIV1_IREF_TRIM_MASK | +DKL_PLL_DIV1_TDC_TARGET_CNT_MASK ); + + hw_state->mg_pll_ssc =I915_READ (DKL_PLL_SSC (tc_port)); + hw_state->mg_pll_ssc &= (DKL_PLL_SSC_IREF_NDIV_RATIO_MASK | +DKL_PLL_SSC_STEP_LEN_MASK | +DKL_PLL_SSC_STEP_NUM_MASK | +DKL_PLL_SSC_EN ); + + hw_state->mg_pll_bias =I915_READ (DKL_PLL_BIAS (tc_port)); + hw_state->mg_pll_bias &= (DKL_PLL_BIAS_FRAC_EN_H | +DKL_PLL_BIAS_FBDIV_FRAC_MASK ); + + hw_state->mg_pll_tdc_coldst_bias = +I915_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); + + ret = true; +out: +intel_display_power_put (dev_priv,POWER_DOMAIN_DISPLAY_CORE , wakeref); +return ret; +} + static bool icl_pll_get_hw_state(struct drm_i915_private *dev_priv, struct intel_shared_dpll *pll, struct intel_dpll_hw_state *hw_state,
@@ -3220,6 +3290,12 @@ static void icl_mg_pll_write(struct drm_i915_private *dev_priv,POSTING_READ (MG_PLL_TDC_COLDST_BIAS (tc_port)); } +static void dkl_pll_write (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll) +{ +/* TODO */ +} +static void icl_pll_power_enable (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll,i915_reg_t enable_reg)
@@ -3325,6 +3401,32 @@ static void mg_pll_enable(struct drm_i915_private *dev_priv,/* DVFS post sequence would be here. See the comment above. */ } +static void dkl_pll_enable (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll) +{ +/* +* From spec: MG register instances are being used for TypeC in general. +* The same MG register instances should be programmed for Dekel PLLs +* as well. +*/ +i915_reg_t enable_reg = +MG_PLL_ENABLE (icl_pll_id_to_tc_port (pll->info->id)); + +icl_pll_power_enable (dev_priv, pll, enable_reg); + +dkl_pll_write (dev_priv, pll); + +/* +* DVFS pre sequence would be here, but in our driver the cdclk code +* paths should already be setting the appropriate voltage, hence we do +* nothing here. +*/ + +icl_pll_enable (dev_priv, pll, enable_reg); + +/* DVFS post sequence would be here. See the comment above. */ +} +static void icl_pll_disable (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll,i915_reg_t enable_reg)
@@ -3467,11 +3569,22 @@ static const struct intel_dpll_mgr ehl_pll_mgr = { .dump_hw_state = icl_dump_hw_state, }; +static const struct intel_shared_dpll_funcs dkl_pll_funcs = { + .enable = dkl_pll_enable, + .disable = mg_pll_disable, + .get_hw_state = dkl_pll_get_hw_state, +}; +static const struct dpll_info tgl_plls[] = { {"DPLL 0" , &combo_pll_funcs,DPLL_ID_ICL_DPLL0 ,0 }, {"DPLL 1" , &combo_pll_funcs,DPLL_ID_ICL_DPLL1 ,0 }, {"TBT PLL" , &tbt_pll_funcs,DPLL_ID_ICL_TBTPLL ,0 }, -/* TODO: Add typeC plls */ + {"TC PLL 1" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL1 ,0 }, + {"TC PLL 2" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL2 ,0 }, + {"TC PLL 3" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL3 ,0 }, + {"TC PLL 4" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL4 ,0 }, + {"TC PLL 5" , &dkl_pll_funcs,DPLL_ID_TGL_MGPLL5 ,0 }, + {"TC PLL 6" , &dkl_pll_funcs,DPLL_ID_TGL_MGPLL6 ,0 }, { }, };
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 05/13] drm/i915/tgl: Add initial dkl pll support
Quoted 9 lines · José Roberto de Souza
From: Lucas De Marchi <[email protected]>
The disable function can be the same as for MG phy since the same registers are used. The others are different as registers changed, also adding a empty
dkl_pll_write()to be implemented later.v2:
Setting the rightHIP_INDEX_REGbits (José)
Ack on the change since I can't r-b.
Lucas De Marchi
Quoted 165 lines
Signed-off-by José Roberto de Souza <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 115 +++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_dpll_mgr.c +114
-2@@ -3086,6 +3086,76 @@ static bool mg_pll_get_hw_state(struct drm_i915_private *dev_priv,return ret; } +static bool dkl_pll_get_hw_state (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll, +struct intel_dpll_hw_state *hw_state) +{ +const enum intel_dpll_id id = pll->info->id; +enum tc_port tc_port =icl_pll_id_to_tc_port (id); +intel_wakeref_t wakeref; +bool ret = false; +u32 val; + + wakeref =intel_display_power_get_if_enabled (dev_priv, +POWER_DOMAIN_DISPLAY_CORE ); +if (!wakeref) +return false; + + val =I915_READ (MG_PLL_ENABLE (tc_port)); +if (!(val &PLL_ENABLE )) + goto out; + +/* +* All registers read here have the same HIP_INDEX_REG even though +* they are on different building blocks +*/ +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + + hw_state->mg_refclkin_ctl =I915_READ (DKL_REFCLKIN_CTL (tc_port)); + hw_state->mg_refclkin_ctl &=MG_REFCLKIN_CTL_OD_2_MUX_MASK ; + + hw_state->mg_clktop2_hsclkctl = +I915_READ (DKL_CLKTOP2_HSCLKCTL (tc_port)); + hw_state->mg_clktop2_hsclkctl &= +MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK | +MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK | +MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK | +MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK ; + + hw_state->mg_clktop2_coreclkctl1 = +I915_READ (DKL_CLKTOP2_CORECLKCTL1 (tc_port)); + hw_state->mg_clktop2_coreclkctl1 &= +MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK ; + + hw_state->mg_pll_div0 =I915_READ (DKL_PLL_DIV0 (tc_port)); + hw_state->mg_pll_div0 &= (DKL_PLL_DIV0_INTEG_COEFF_MASK | +DKL_PLL_DIV0_PROP_COEFF_MASK | +DKL_PLL_DIV0_FBPREDIV_MASK | +DKL_PLL_DIV0_FBDIV_INT_MASK ); + + hw_state->mg_pll_div1 =I915_READ (DKL_PLL_DIV1 (tc_port)); + hw_state->mg_pll_div1 &= (DKL_PLL_DIV1_IREF_TRIM_MASK | +DKL_PLL_DIV1_TDC_TARGET_CNT_MASK ); + + hw_state->mg_pll_ssc =I915_READ (DKL_PLL_SSC (tc_port)); + hw_state->mg_pll_ssc &= (DKL_PLL_SSC_IREF_NDIV_RATIO_MASK | +DKL_PLL_SSC_STEP_LEN_MASK | +DKL_PLL_SSC_STEP_NUM_MASK | +DKL_PLL_SSC_EN ); + + hw_state->mg_pll_bias =I915_READ (DKL_PLL_BIAS (tc_port)); + hw_state->mg_pll_bias &= (DKL_PLL_BIAS_FRAC_EN_H | +DKL_PLL_BIAS_FBDIV_FRAC_MASK ); + + hw_state->mg_pll_tdc_coldst_bias = +I915_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); + + ret = true; +out: +intel_display_power_put (dev_priv,POWER_DOMAIN_DISPLAY_CORE , wakeref); +return ret; +} + static bool icl_pll_get_hw_state(struct drm_i915_private *dev_priv, struct intel_shared_dpll *pll, struct intel_dpll_hw_state *hw_state,@@ -3220,6 +3290,12 @@ static void icl_mg_pll_write(struct drm_i915_private *dev_priv,POSTING_READ (MG_PLL_TDC_COLDST_BIAS (tc_port)); } +static void dkl_pll_write (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll) +{ +/* TODO */ +} +static void icl_pll_power_enable (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll,i915_reg_t enable_reg)@@ -3325,6 +3401,32 @@ static void mg_pll_enable(struct drm_i915_private *dev_priv,/* DVFS post sequence would be here. See the comment above. */ } +static void dkl_pll_enable (struct drm_i915_private *dev_priv, +struct intel_shared_dpll *pll) +{ +/* +* From spec: MG register instances are being used for TypeC in general. +* The same MG register instances should be programmed for Dekel PLLs +* as well. +*/ +i915_reg_t enable_reg = +MG_PLL_ENABLE (icl_pll_id_to_tc_port (pll->info->id)); + +icl_pll_power_enable (dev_priv, pll, enable_reg); + +dkl_pll_write (dev_priv, pll); + +/* +* DVFS pre sequence would be here, but in our driver the cdclk code +* paths should already be setting the appropriate voltage, hence we do +* nothing here. +*/ + +icl_pll_enable (dev_priv, pll, enable_reg); + +/* DVFS post sequence would be here. See the comment above. */ +} +static void icl_pll_disable (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll,i915_reg_t enable_reg)@@ -3467,11 +3569,22 @@ static const struct intel_dpll_mgr ehl_pll_mgr = { .dump_hw_state = icl_dump_hw_state, }; +static const struct intel_shared_dpll_funcs dkl_pll_funcs = { + .enable = dkl_pll_enable, + .disable = mg_pll_disable, + .get_hw_state = dkl_pll_get_hw_state, +}; +static const struct dpll_info tgl_plls[] = { {"DPLL 0" , &combo_pll_funcs,DPLL_ID_ICL_DPLL0 ,0 }, {"DPLL 1" , &combo_pll_funcs,DPLL_ID_ICL_DPLL1 ,0 }, {"TBT PLL" , &tbt_pll_funcs,DPLL_ID_ICL_TBTPLL ,0 }, -/* TODO: Add typeC plls */ + {"TC PLL 1" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL1 ,0 }, + {"TC PLL 2" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL2 ,0 }, + {"TC PLL 3" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL3 ,0 }, + {"TC PLL 4" , &dkl_pll_funcs,DPLL_ID_ICL_MGPLL4 ,0 }, + {"TC PLL 5" , &dkl_pll_funcs,DPLL_ID_TGL_MGPLL5 ,0 }, + {"TC PLL 6" , &dkl_pll_funcs,DPLL_ID_TGL_MGPLL6 ,0 }, { }, }; --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/13 drm/i915/tgl: Add support for dkl pll write
In reply to José Roberto de SouzaFrom: Vandita Kulkarni <[email protected]>
Add a new function to write to dkl phy pll registers. As per the bspec all the registers are read modify write.
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +64 -1
@@ -3293,7 +3293,70 @@ static void icl_mg_pll_write(struct drm_i915_private *dev_priv,static void dkl_pll_write (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll) { -/* TODO */ +struct intel_dpll_hw_state *hw_state = &pll->state.hw_state; +enum tc_port tc_port =icl_pll_id_to_tc_port (pll->info->id); +u32 val; + +/* +* All registers programmed here have the same HIP_INDEX_REG even +* though on different building block +*/ +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + +/* All the registers are RMW */ + val =I915_READ (DKL_REFCLKIN_CTL (tc_port)); + val &= ~MG_REFCLKIN_CTL_OD_2_MUX_MASK ; + val |= hw_state->mg_refclkin_ctl; +I915_WRITE (DKL_REFCLKIN_CTL (tc_port), val); + + val =I915_READ (DKL_CLKTOP2_CORECLKCTL1 (tc_port)); + val &= ~MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK ; + val |= hw_state->mg_clktop2_coreclkctl1; +I915_WRITE (DKL_CLKTOP2_CORECLKCTL1 (tc_port), val); + + val =I915_READ (DKL_CLKTOP2_HSCLKCTL (tc_port)); + val &= ~(MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK | +MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK | +MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK | +MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK ); + val |= hw_state->mg_clktop2_hsclkctl; +I915_WRITE (DKL_CLKTOP2_HSCLKCTL (tc_port), val); + + val =I915_READ (DKL_PLL_DIV0 (tc_port)); + val &= ~(DKL_PLL_DIV0_INTEG_COEFF_MASK | +DKL_PLL_DIV0_PROP_COEFF_MASK | +DKL_PLL_DIV0_FBPREDIV_MASK | +DKL_PLL_DIV0_FBDIV_INT_MASK ); + val |= hw_state->mg_pll_div0; +I915_WRITE (DKL_PLL_DIV0 (tc_port), val); + + val =I915_READ (DKL_PLL_DIV1 (tc_port)); + val &= ~(DKL_PLL_DIV1_IREF_TRIM_MASK | +DKL_PLL_DIV1_TDC_TARGET_CNT_MASK ); + val |= hw_state->mg_pll_div1; +I915_WRITE (DKL_PLL_DIV1 (tc_port), val); + + val =I915_READ (DKL_PLL_SSC (tc_port)); + val &= ~(DKL_PLL_SSC_IREF_NDIV_RATIO_MASK | +DKL_PLL_SSC_STEP_LEN_MASK | +DKL_PLL_SSC_STEP_NUM_MASK | +DKL_PLL_SSC_EN ); + val |= hw_state->mg_pll_ssc; +I915_WRITE (DKL_PLL_SSC (tc_port), val); + + val =I915_READ (DKL_PLL_BIAS (tc_port)); + val &= ~(DKL_PLL_BIAS_FRAC_EN_H | +DKL_PLL_BIAS_FBDIV_FRAC_MASK ); + val |= hw_state->mg_pll_bias; +I915_WRITE (DKL_PLL_BIAS (tc_port), val); + + val =I915_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); + val &= ~(DKL_PLL_TDC_SSC_STEP_SIZE_MASK | +DKL_PLL_TDC_FEED_FWD_GAIN_MASK ); + val |= hw_state->mg_pll_tdc_coldst_bias; +I915_WRITE (DKL_PLL_TDC_COLDST_BIAS (tc_port), val); + +POSTING_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); } static void icl_pll_power_enable(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 06/13] drm/i915/tgl: Add support for dkl pll write
Quoted 9 lines · José Roberto de Souza
From: Vandita Kulkarni <[email protected]>
Add a new function to write to dkl phy pll registers. As per the bspec all the registers are read modify write.
Signed-off-by Vandita Kulkarni <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>
Lucas De Marchi
Quoted 87 lines
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_dpll_mgr.c +64
-2@@ -3293,7 +3293,70 @@ static void icl_mg_pll_write(struct drm_i915_private *dev_priv,static void dkl_pll_write (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll) { -/* TODO */ +struct intel_dpll_hw_state *hw_state = &pll->state.hw_state; +enum tc_port tc_port =icl_pll_id_to_tc_port (pll->info->id); +u32 val; + +/* +* All registers programmed here have the same HIP_INDEX_REG even +* though on different building block +*/ +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + +/* All the registers are RMW */ + val =I915_READ (DKL_REFCLKIN_CTL (tc_port)); + val &= ~MG_REFCLKIN_CTL_OD_2_MUX_MASK ; + val |= hw_state->mg_refclkin_ctl; +I915_WRITE (DKL_REFCLKIN_CTL (tc_port), val); + + val =I915_READ (DKL_CLKTOP2_CORECLKCTL1 (tc_port)); + val &= ~MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK ; + val |= hw_state->mg_clktop2_coreclkctl1; +I915_WRITE (DKL_CLKTOP2_CORECLKCTL1 (tc_port), val); + + val =I915_READ (DKL_CLKTOP2_HSCLKCTL (tc_port)); + val &= ~(MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK | +MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK | +MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK | +MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK ); + val |= hw_state->mg_clktop2_hsclkctl; +I915_WRITE (DKL_CLKTOP2_HSCLKCTL (tc_port), val); + + val =I915_READ (DKL_PLL_DIV0 (tc_port)); + val &= ~(DKL_PLL_DIV0_INTEG_COEFF_MASK | +DKL_PLL_DIV0_PROP_COEFF_MASK | +DKL_PLL_DIV0_FBPREDIV_MASK | +DKL_PLL_DIV0_FBDIV_INT_MASK ); + val |= hw_state->mg_pll_div0; +I915_WRITE (DKL_PLL_DIV0 (tc_port), val); + + val =I915_READ (DKL_PLL_DIV1 (tc_port)); + val &= ~(DKL_PLL_DIV1_IREF_TRIM_MASK | +DKL_PLL_DIV1_TDC_TARGET_CNT_MASK ); + val |= hw_state->mg_pll_div1; +I915_WRITE (DKL_PLL_DIV1 (tc_port), val); + + val =I915_READ (DKL_PLL_SSC (tc_port)); + val &= ~(DKL_PLL_SSC_IREF_NDIV_RATIO_MASK | +DKL_PLL_SSC_STEP_LEN_MASK | +DKL_PLL_SSC_STEP_NUM_MASK | +DKL_PLL_SSC_EN ); + val |= hw_state->mg_pll_ssc; +I915_WRITE (DKL_PLL_SSC (tc_port), val); + + val =I915_READ (DKL_PLL_BIAS (tc_port)); + val &= ~(DKL_PLL_BIAS_FRAC_EN_H | +DKL_PLL_BIAS_FBDIV_FRAC_MASK ); + val |= hw_state->mg_pll_bias; +I915_WRITE (DKL_PLL_BIAS (tc_port), val); + + val =I915_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); + val &= ~(DKL_PLL_TDC_SSC_STEP_SIZE_MASK | +DKL_PLL_TDC_FEED_FWD_GAIN_MASK ); + val |= hw_state->mg_pll_tdc_coldst_bias; +I915_WRITE (DKL_PLL_TDC_COLDST_BIAS (tc_port), val); + +POSTING_READ (DKL_PLL_TDC_COLDST_BIAS (tc_port)); } static void icl_pll_power_enable(struct drm_i915_private *dev_priv, --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 7/13 drm/i915/tgl: TC helper function to return pin mapping
In reply to José Roberto de SouzaFrom: Clinton A Taylor <[email protected]>
Add a helper function to return pin map for use during dkl phy DP_MODE settings, PORT_TX_DFLEXPA1 exist on ICL but we don't need it.
The user of this function will come in future TC patches.
--- drivers/gpu/drm/i915/display/intel_tc.c | 15 +++++++++++++++ drivers/gpu/drm/i915/display/intel_tc.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 5 +++++ 3 files changed, 21 insertions(+)
drivers/gpu/drm/i915/display/intel_tc.c +15 -0
@@ -70,6 +70,21 @@ u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)DP_LANE_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx); } +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port) +{ +struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); +struct intel_uncore *uncore = &i915->uncore; +u32 pin_mask; + + pin_mask =intel_uncore_read (uncore, +PORT_TX_DFLEXPA1 (dig_port->tc_phy_fia)); + +WARN_ON (pin_mask ==0xffffffff ); + +return (pin_mask &DP_PIN_ASSIGNMENT_MASK (dig_port->tc_phy_fia_idx)) >> +DP_PIN_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx); +} +int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev);
drivers/gpu/drm/i915/display/intel_tc.h +1 -0
@@ -14,6 +14,7 @@ struct drm_i915_private;bool intel_tc_port_connected (struct intel_digital_port *dig_port);u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port); +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port);int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port);void intel_tc_port_set_fia_lane_count (struct intel_digital_port *dig_port,int required_lanes);
drivers/gpu/drm/i915/i915_reg.h +5 -0
@@ -11845,4 +11845,9 @@ enum skl_power_gate {#define PORT_TX_DFLEXDPCSSS (fia) _MMIO_FIA((fia), 0x00894)#define DP_PHY_MODE_STATUS_NOT_SAFE (idx) (1 << (idx)) +#define PORT_TX_DFLEXPA1 (fia) _MMIO_FIA((fia), 0x00880) +#define DP_PIN_ASSIGNMENT_SHIFT (idx) ((idx) * 4) +#define DP_PIN_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 4)) +#define DP_PIN_ASSIGNMENT (idx, x) ((x) << ((idx) * 4)) +#endif /* _I915_REG_H_ */
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 07/13] drm/i915/tgl: TC helper function to return pin mapping
Quoted 27 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Add a helper function to return pin map for use during dkl phy
DP_MODEsettings,PORT_TX_DFLEXPA1exist on ICL but we don't need it.The user of this function will come in future TC patches.
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_tc.c | 15 +++++++++++++++ drivers/gpu/drm/i915/display/intel_tc.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 5 +++++ 3 files changed, 21 insertions(+)drivers/gpu/drm/i915/display/intel_tc.c +3
-0@@ -70,6 +70,21 @@ u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)DP_LANE_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx); } +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port) +{ +struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev);
drivers/gpu/drm/i915/display/intel_tc.c u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port) · line 85
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_tc.c +10
-0+struct intel_uncore *uncore = &i915->uncore; +u32 pin_mask; + + pin_mask =intel_uncore_read (uncore, +PORT_TX_DFLEXPA1 (dig_port->tc_phy_fia)); + +WARN_ON (pin_mask ==0xffffffff ); + +return (pin_mask &DP_PIN_ASSIGNMENT_MASK (dig_port->tc_phy_fia_idx)) >> +DP_PIN_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx);
AFAICS this is tc_port-based, not tc_phy_fia_idx. tc_phy_fia_idx should only ever be used
together with the HIP_INDEX.
Lucas De Marchi
Quoted 38 lines
drivers/gpu/drm/i915/display/intel_tc.c +2
-0+} +int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev);drivers/gpu/drm/i915/display/intel_tc.h +1
-0@@ -14,6 +14,7 @@ struct drm_i915_private;bool intel_tc_port_connected (struct intel_digital_port *dig_port);u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port); +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port);int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port);void intel_tc_port_set_fia_lane_count (struct intel_digital_port *dig_port,int required_lanes);drivers/gpu/drm/i915/i915_reg.h +5
-1@@ -11845,4 +11845,9 @@ enum skl_power_gate {#define PORT_TX_DFLEXDPCSSS (fia) _MMIO_FIA((fia), 0x00894)#define DP_PHY_MODE_STATUS_NOT_SAFE (idx) (1 << (idx)) +#define PORT_TX_DFLEXPA1 (fia) _MMIO_FIA((fia), 0x00880) +#define DP_PIN_ASSIGNMENT_SHIFT (idx) ((idx) * 4) +#define DP_PIN_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 4)) +#define DP_PIN_ASSIGNMENT (idx, x) ((x) << ((idx) * 4)) +#endif /* _I915_REG_H_ */ --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lucas De Marchi
Reviewed-byRe: [PATCH v2 07/13] drm/i915/tgl: TC helper function to return pin mapping
Quoted 36 lines · Lucas De Marchi
Quoted 33 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Add a helper function to return pin map for use during dkl phy
DP_MODEsettings,PORT_TX_DFLEXPA1exist on ICL but we don't need it.The user of this function will come in future TC patches.
Signed-off-by Clinton A Taylor <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_tc.c | 15 +++++++++++++++ drivers/gpu/drm/i915/display/intel_tc.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 5 +++++ 3 files changed, 21 insertions(+)drivers/gpu/drm/i915/display/intel_tc.c +9
-0@@ -70,6 +70,21 @@ u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)DP_LANE_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx); } +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port) +{ +struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev); +struct intel_uncore *uncore = &i915->uncore; +u32 pin_mask; + + pin_mask =intel_uncore_read (uncore, +PORT_TX_DFLEXPA1 (dig_port->tc_phy_fia)); +
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_tc.c u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port) · line 85
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_tc.c +4
-0+WARN_ON (pin_mask ==0xffffffff ); + +return (pin_mask &DP_PIN_ASSIGNMENT_MASK (dig_port->tc_phy_fia_idx)) >> +DP_PIN_ASSIGNMENT_SHIFT (dig_port->tc_phy_fia_idx);AFAICS this is tc_port-based, not
tc_phy_fia_idx.tc_phy_fia_idxshould only ever be used
together with theHIP_INDEX.
humn... scratch that. That spec is for non-modular FIA. If it's correct that it applies for all the FIA registers, then this implementation is correct,
even if it doesn't match the spec.
Lucas De Marchi
Quoted 46 lines
Lucas De Marchi
Quoted 34 lines
drivers/gpu/drm/i915/display/intel_tc.c +2
-0+} +int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port) {struct drm_i915_private *i915 =to_i915 (dig_port->base.base.dev);drivers/gpu/drm/i915/display/intel_tc.h +1
-0@@ -14,6 +14,7 @@ struct drm_i915_private;bool intel_tc_port_connected (struct intel_digital_port *dig_port);u32 intel_tc_port_get_lane_mask (struct intel_digital_port *dig_port); +u32 intel_tc_port_get_pin_assignment_mask (struct intel_digital_port *dig_port);int intel_tc_port_fia_max_lane_count (struct intel_digital_port *dig_port);void intel_tc_port_set_fia_lane_count (struct intel_digital_port *dig_port,int required_lanes);drivers/gpu/drm/i915/i915_reg.h +5
-1@@ -11845,4 +11845,9 @@ enum skl_power_gate {#define PORT_TX_DFLEXDPCSSS (fia) _MMIO_FIA((fia), 0x00894)#define DP_PHY_MODE_STATUS_NOT_SAFE (idx) (1 << (idx)) +#define PORT_TX_DFLEXPA1 (fia) _MMIO_FIA((fia), 0x00880) +#define DP_PIN_ASSIGNMENT_SHIFT (idx) ((idx) * 4) +#define DP_PIN_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 4)) +#define DP_PIN_ASSIGNMENT (idx, x) ((x) << ((idx) * 4)) +#endif /* _I915_REG_H_ */ --2.23.0
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Lucas De Marchi
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 8/13 drm/i915/tgl: Add dkl phy programming sequences
In reply to José Roberto de SouzaFrom: Clinton A Taylor <[email protected]>
Added DKL Phy sequences and helpers functions to program voltage swing, clock gating and dp mode.
It is not written in DP enabling sequence but "PHY Clockgating programming" states that clock gating should be enabled after the link training but doing so causes all the following trainings to fail so not enabling it for.
v2:
Setting the right HIP_INDEX_REG bits (José)
BSpec: 49292
BSpec: 49190
--- drivers/gpu/drm/i915/display/intel_ddi.c | 246 +++++++++++++++++++++-- 1 file changed, 234 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +234 -12
@@ -586,6 +586,25 @@ static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { { 0x0, 0x00, 0x00 }, /* 3 0 */ }; +struct tgl_dkl_phy_ddi_buf_trans { +u32 dkl_vswing_control; +u32 dkl_preshoot_control; +u32 dkl_de_emphasis_control; +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_ddi_translations[] = { + {0x7 ,0x0 ,0x00 },/* 0 0 400mV 0 dB */ + {0x5 ,0x0 ,0x03 },/* 0 1 400mV 3.5 dB */ + {0x2 ,0x0 ,0x0b },/* 0 2 400mV 6 dB */ + {0x0 ,0x0 ,0x19 },/* 0 3 400mV 9.5 dB */ + {0x5 ,0x0 ,0x00 },/* 1 0 600mV 0 dB */ + {0x2 ,0x0 ,0x03 },/* 1 1 600mV 3.5 dB */ + {0x0 ,0x0 ,0x14 },/* 1 2 600mV 6 dB */ + {0x2 ,0x0 ,0x00 },/* 2 0 800mV 0 dB */ + {0x0 ,0x0 ,0x0B },/* 2 1 800mV 3.5 dB */ + {0x0 ,0x0 ,0x00 },/* 3 0 1200mV 0 dB HDMI Default */ +}; +static const struct ddi_buf_trans *bdw_get_buf_trans_edp (struct drm_i915_private *dev_priv,int *n_entries) {
@@ -873,11 +892,15 @@ static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;if (INTEL_GEN (dev_priv) >=11 ) { -if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) {icl_get_combo_buf_trans (dev_priv,INTEL_OUTPUT_HDMI ,0 , &n_entries); -else - n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); +else + n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + } default_entry = n_entries -1 ; }else if (IS_CANNONLAKE (dev_priv)) {cnl_get_buf_trans_hdmi (dev_priv, &n_entries);
@@ -2308,11 +2331,15 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)int n_entries;if (INTEL_GEN (dev_priv) >=11 ) { -if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) {icl_get_combo_buf_trans (dev_priv, encoder->type, intel_dp->link_rate, &n_entries); -else - n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); +else + n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + } }else if (IS_CANNONLAKE (dev_priv)) {if (encoder->type ==INTEL_OUTPUT_EDP )cnl_get_buf_trans_edp (dev_priv, &n_entries);
@@ -2749,6 +2776,66 @@ static void icl_ddi_vswing_sequence(struct intel_encoder *encoder,icl_mg_phy_ddi_vswing_sequence (encoder, link_clock, level); } +static void +tgl_dkl_phy_ddi_vswing_sequence (struct intel_encoder *encoder,int link_clock, +u32 level) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +enum tc_port tc_port =intel_port_to_tc (dev_priv, encoder->port); +const struct tgl_dkl_phy_ddi_buf_trans *ddi_translations; +u32 n_entries, val, ln; + + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); + ddi_translations = tgl_dkl_phy_ddi_translations; + +if (level > n_entries) + level = n_entries -1 ; + +/* +* All registers programmed here use HIP_INDEX_REG 0 or 1 +*/ +for (ln =0 ; ln <2 ; ln++) { +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port, ln)); + +/* All the registers are RMW */ + val =I915_READ (DKL_TX_DPCNTL0 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=DKL_TX_VSWING_CONTROL (ddi_translations[level].dkl_vswing_control); + val |=DKL_TX_DE_EMPHASIS_COEFF (ddi_translations[level].dkl_de_emphasis_control); + val |=DKL_TX_PRESHOOT_COEFF (ddi_translations[level].dkl_preshoot_control); +I915_WRITE (DKL_TX_DPCNTL0 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL1 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=DKL_TX_VSWING_CONTROL (ddi_translations[level].dkl_vswing_control); + val |=DKL_TX_DE_EMPHASIS_COEFF (ddi_translations[level].dkl_de_emphasis_control); + val |=DKL_TX_PRESHOOT_COEFF (ddi_translations[level].dkl_preshoot_control); +I915_WRITE (DKL_TX_DPCNTL1 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL2 (tc_port)); + val &= ~DKL_TX_DP20BITMODE ; +I915_WRITE (DKL_TX_DPCNTL2 (tc_port), val); + } +} + +static void tgl_ddi_vswing_sequence (struct intel_encoder *encoder, +int link_clock, +u32 level, +enum intel_output_type type) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +enum phy phy =intel_port_to_phy (dev_priv, encoder->port); + +if (intel_phy_is_combo (dev_priv, phy)) +icl_combo_phy_ddi_vswing_sequence (encoder, level, type); +else +tgl_dkl_phy_ddi_vswing_sequence (encoder, link_clock, level); +} +static u32 translate_signal_level (int signal_levels) {int i;
@@ -2780,7 +2867,10 @@ u32 bxt_signal_levels(struct intel_dp *intel_dp)struct intel_encoder *encoder = &dport->base;int level =intel_ddi_dp_level (intel_dp); -if (INTEL_GEN (dev_priv) >=11 ) +if (INTEL_GEN (dev_priv) >=12 ) +tgl_ddi_vswing_sequence (encoder, intel_dp->link_rate, + level, encoder->type); +else if (INTEL_GEN (dev_priv) >=11 )icl_ddi_vswing_sequence (encoder, intel_dp->link_rate, level, encoder->type);else if (IS_CANNONLAKE (dev_priv))
@@ -3027,6 +3117,34 @@ static void intel_ddi_clk_disable(struct intel_encoder *encoder) } } +static void +tgl_phy_clock_gating (struct intel_digital_port *dig_port,bool enable) +{ +struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev); +enum port port = dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 val, regs; +int ln; + +if (tc_port ==PORT_TC_NONE ) +return ; + + regs =DKL_DP_MODE_CFG_TR2PWR_GATING |DKL_DP_MODE_CFG_TRPWR_GATING | +DKL_DP_MODE_CFG_CLNPWR_GATING |DKL_DP_MODE_CFG_DIGPWR_GATING | +DKL_DP_MODE_CFG_GAONPWR_GATING ; + +for (ln =0 ; ln <2 ; ln++) { +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port, ln)); + + val =I915_READ (DKL_DP_MODE (tc_port)); +if (enable) + val |= regs; +else + val &= ~regs; +I915_WRITE (DKL_DP_MODE (tc_port), val); + } +} +static void icl_enable_phy_clock_gating (struct intel_digital_port *dig_port) {struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev);
@@ -3153,6 +3271,95 @@ static void icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port)I915_WRITE (MG_DP_MODE (1 , port), ln1); } +static void tgl_program_dkl_dp_mode (struct intel_digital_port *intel_dig_port) +{ +struct drm_i915_private *dev_priv =to_i915 (intel_dig_port->base.base.dev); +enum port port = intel_dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 ln0, ln1, lane_mask, pin_mask; +int num_lanes; + +if (tc_port ==PORT_TC_NONE || + intel_dig_port->tc_mode ==TC_PORT_TBT_ALT ) +return ; + +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x0 )); + ln0 =I915_READ (DKL_DP_MODE (tc_port)); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x1 )); + ln1 =I915_READ (DKL_DP_MODE (tc_port)); + + num_lanes = intel_dig_port->dp.lane_count; + +switch (intel_dig_port->tc_mode) { +case TC_PORT_DP_ALT : + ln0 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X1_MODE ); + ln1 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ); + + lane_mask =intel_tc_port_get_lane_mask (intel_dig_port);/* DPX4TXLATC */ + pin_mask =intel_tc_port_get_pin_assignment_mask (intel_dig_port);/* DPPATC */ + +switch (pin_mask) { +case 0x0 : +if (num_lanes ==1 ) { + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x1 : +if (num_lanes ==4 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x2 : +if (num_lanes ==2 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x3 : +case 0x5 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x4 : +case 0x6 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +default : +MISSING_CASE (lane_mask); + } +break ; + +case TC_PORT_LEGACY : + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ; +break ; + +default : +MISSING_CASE (intel_dig_port->tc_mode); +return ; + } + +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x0 )); +I915_WRITE (DKL_DP_MODE (tc_port), ln0); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x1 )); +I915_WRITE (DKL_DP_MODE (tc_port), ln1); +} +static void intel_dp_sink_set_fec_ready (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) {
@@ -3239,7 +3446,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, dig_port->ddi_io_power_domain);/* 6. */ -icl_program_mg_dp_mode (dig_port); +tgl_program_dkl_dp_mode (dig_port);/* * 7.a - Steps in this function should only be executed over MST
@@ -3252,10 +3459,10 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_ddi_config_transcoder_func (crtc_state);/* 7.d */ -icl_disable_phy_clock_gating (dig_port); +tgl_phy_clock_gating (dig_port, false);/* 7.e */ -icl_ddi_vswing_sequence (encoder, crtc_state->port_clock, level, +tgl_ddi_vswing_sequence (encoder, crtc_state->port_clock, level, encoder->type);/* 7.f */
@@ -3287,6 +3494,15 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,/* 7.k */ intel_dp_stop_link_train (intel_dp); +/* +* TODO: enable clock gating +* +* It is not written in DP enabling sequence but "PHY Clockgating +* programming" states that clock gating should be enabled after the +* link training but doing so causes all the following trainings to fail +* so not enabling it for. +*/ +/* 7.l */ intel_ddi_enable_fec (encoder, crtc_state);intel_dsc_enable (encoder, crtc_state);
@@ -3392,7 +3608,10 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,intel_display_power_get (dev_priv, dig_port->ddi_io_power_domain);icl_program_mg_dp_mode (dig_port); -icl_disable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, false); +else +icl_disable_phy_clock_gating (dig_port);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,
@@ -3404,7 +3623,10 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,else intel_prepare_hdmi_ddi_buffers (encoder, level); -icl_enable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, true); +else +icl_enable_phy_clock_gating (dig_port);if (IS_GEN9_BC (dev_priv))skl_ddi_set_iboost (encoder, level,INTEL_OUTPUT_HDMI );
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 08/13] drm/i915/tgl: Add dkl phy programming sequences
Quoted 28 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Added DKL Phy sequences and helpers functions to program voltage swing, clock gating and dp mode.
It is not written in DP enabling sequence but "PHY Clockgating programming" states that clock gating should be enabled after the link training but doing so causes all the following trainings to fail so not enabling it for.
v2:
Setting the rightHIP_INDEX_REGbits (José)BSpec: 49292
BSpec: 49190Signed-off-by José Roberto de Souza <[email protected]>Signed-off-by Clinton A Taylor <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 246 +++++++++++++++++++++-- 1 file changed, 234 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0
drivers/gpu/drm/i915/display/intel_ddi.c static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { · line 595
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-0@@ -586,6 +586,25 @@ static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { { 0x0, 0x00, 0x00 }, /* 3 0 */ }; +struct tgl_dkl_phy_ddi_buf_trans { +u32 dkl_vswing_control; +u32 dkl_preshoot_control; +u32 dkl_de_emphasis_control; +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_ddi_translations[] = {
comment here like in the icl version with the meaning of the comments would be good
drivers/gpu/drm/i915/display/intel_ddi.c static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { · line 600
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ { 0x7, 0x0, 0x00 }, /* 0 0 400mV 0 dB */ + { 0x5, 0x0, 0x03 }, /* 0 1 400mV 3.5 dB */ + { 0x2, 0x0, 0x0b }, /* 0 2 400mV 6 dB */ + { 0x0, 0x0, 0x19 }, /* 0 3 400mV 9.5 dB */ + { 0x5, 0x0, 0x00 }, /* 1 0 600mV 0 dB */
pre-emphasis here is 1. And the others below are wrong, too.
Quoted 17 lines
drivers/gpu/drm/i915/display/intel_ddi.c +8
-1+ { 0x2, 0x0, 0x03 }, /* 1 1 600mV 3.5 dB */ + { 0x0, 0x0, 0x14 }, /* 1 2 600mV 6 dB */ + { 0x2, 0x0, 0x00 }, /* 2 0 800mV 0 dB */ + { 0x0, 0x0, 0x0B }, /* 2 1 800mV 3.5 dB */ + { 0x0, 0x0, 0x00 }, /* 3 0 1200mV 0 dB HDMI Default */ +}; +static const struct ddi_buf_trans *bdw_get_buf_trans_edp (struct drm_i915_private *dev_priv,int *n_entries) {@@ -873,11 +892,15 @@ static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;if (INTEL_GEN (dev_priv) >=11 ) { -if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) { icl_get_combo_buf_trans(dev_priv, INTEL_OUTPUT_HDMI,
drivers/gpu/drm/i915/display/intel_ddi.c static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por · line 904
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +6
-20, &n_entries); - else - n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); +else + n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + } default_entry = n_entries -1 ;
I think plain ladder would be better. Just add one for INTEL_GEN(dev_priv) >= 12)
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-1}else if (IS_CANNONLAKE (dev_priv)) {cnl_get_buf_trans_hdmi (dev_priv, &n_entries);@@ -2308,11 +2331,15 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)int n_entries;if (INTEL_GEN (dev_priv) >=11 ) { -if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) {
drivers/gpu/drm/i915/display/intel_ddi.c u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder) · line 2342
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +6
-2icl_get_combo_buf_trans (dev_priv, encoder->type, intel_dp->link_rate, &n_entries); - else - n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); +else + n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations); + }
ditto
Quoted 21 lines
drivers/gpu/drm/i915/display/intel_ddi.c +13
-0}else if (IS_CANNONLAKE (dev_priv)) {if (encoder->type ==INTEL_OUTPUT_EDP )cnl_get_buf_trans_edp (dev_priv, &n_entries);@@ -2749,6 +2776,66 @@ static void icl_ddi_vswing_sequence(struct intel_encoder *encoder,icl_mg_phy_ddi_vswing_sequence (encoder, link_clock, level); } +static void +tgl_dkl_phy_ddi_vswing_sequence (struct intel_encoder *encoder,int link_clock, +u32 level) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +enum tc_port tc_port =intel_port_to_tc (dev_priv, encoder->port); +const struct tgl_dkl_phy_ddi_buf_trans *ddi_translations; +u32 n_entries, val, ln; + + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); + ddi_translations = tgl_dkl_phy_ddi_translations; + +if (level > n_entries)
Quoted 1 line
= ?
Otherwise you will access garbage below
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_ddi.c +6
-0+ level = n_entries -1 ; + +/* +* All registers programmed here use HIP_INDEX_REG 0 or 1 +*/ +for (ln =0 ; ln <2 ; ln++) {
drivers/gpu/drm/i915/display/intel_ddi.c static void icl_ddi_vswing_sequence(struct intel_encoder *encoder, · line 2807
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +10
-0+I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port, ln)); + +/* All the registers are RMW */ + val =I915_READ (DKL_TX_DPCNTL0 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=DKL_TX_VSWING_CONTROL (ddi_translations[level].dkl_vswing_control); + val |=DKL_TX_DE_EMPHASIS_COEFF (ddi_translations[level].dkl_de_emphasis_control); + val |=DKL_TX_PRESHOOT_COEFF (ddi_translations[level].dkl_preshoot_control);
I wonder how useful it is to keep there the dkl_preshoot_control if it's always 0
But we have the same behavior in previous platforms.... :-/ We can leave it for later
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +8
-0+I915_WRITE (DKL_TX_DPCNTL0 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL1 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=DKL_TX_VSWING_CONTROL (ddi_translations[level].dkl_vswing_control); + val |=DKL_TX_DE_EMPHASIS_COEFF (ddi_translations[level].dkl_de_emphasis_control);
drivers/gpu/drm/i915/display/intel_ddi.c static void icl_ddi_vswing_sequence(struct intel_encoder *encoder, · line 2825
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_ddi.c +10
-0+ val |=DKL_TX_PRESHOOT_COEFF (ddi_translations[level].dkl_preshoot_control); +I915_WRITE (DKL_TX_DPCNTL1 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL2 (tc_port)); + val &= ~DKL_TX_DP20BITMODE ; +I915_WRITE (DKL_TX_DPCNTL2 (tc_port), val); + } +} + +static void tgl_ddi_vswing_sequence(struct intel_encoder *encoder,
intel_ddi_pre_enable_hdmi() is not calling this function.
Quoted 29 lines
drivers/gpu/drm/i915/display/intel_ddi.c +17
-1+int link_clock, + u32 level, + enum intel_output_type type) +{ + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); +enum phy phy =intel_port_to_phy (dev_priv, encoder->port); + +if (intel_phy_is_combo (dev_priv, phy)) +icl_combo_phy_ddi_vswing_sequence (encoder, level, type); +else +tgl_dkl_phy_ddi_vswing_sequence (encoder, link_clock, level); +} +static u32 translate_signal_level (int signal_levels) {int i;@@ -2780,7 +2867,10 @@ u32 bxt_signal_levels(struct intel_dp *intel_dp)struct intel_encoder *encoder = &dport->base;int level =intel_ddi_dp_level (intel_dp); -if (INTEL_GEN (dev_priv) >=11 ) +if (INTEL_GEN (dev_priv) >=12 ) +tgl_ddi_vswing_sequence (encoder, intel_dp->link_rate, + level, encoder->type); +else if (INTEL_GEN (dev_priv) >=11 )icl_ddi_vswing_sequence (encoder, intel_dp->link_rate, level, encoder->type);else if (IS_CANNONLAKE (dev_priv))
drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_clk_disable(struct intel_encoder *encoder) · line 3121
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0@@ -3027,6 +3117,34 @@ static void intel_ddi_clk_disable(struct intel_encoder *encoder) } } +static void +tgl_phy_clock_gating (struct intel_digital_port *dig_port,bool enable)
same comment as other commit... tgl_phy_set_clock_gating() ?
drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_clk_disable(struct intel_encoder *encoder) · line 3126
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+{ +struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev); +enum port port = dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 val, regs;
s/regs/bits/
Quoted 143 lines
drivers/gpu/drm/i915/display/intel_ddi.c +113
-3+int ln; + +if (tc_port ==PORT_TC_NONE ) +return ; + + regs =DKL_DP_MODE_CFG_TR2PWR_GATING |DKL_DP_MODE_CFG_TRPWR_GATING | +DKL_DP_MODE_CFG_CLNPWR_GATING |DKL_DP_MODE_CFG_DIGPWR_GATING | +DKL_DP_MODE_CFG_GAONPWR_GATING ; + +for (ln =0 ; ln <2 ; ln++) { +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port, ln)); + + val =I915_READ (DKL_DP_MODE (tc_port)); +if (enable) + val |= regs; +else + val &= ~regs; +I915_WRITE (DKL_DP_MODE (tc_port), val); + } +} +static void icl_enable_phy_clock_gating (struct intel_digital_port *dig_port) {struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev);@@ -3153,6 +3271,95 @@ static void icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port)I915_WRITE (MG_DP_MODE (1 , port), ln1); } +static void tgl_program_dkl_dp_mode (struct intel_digital_port *intel_dig_port) +{ +struct drm_i915_private *dev_priv =to_i915 (intel_dig_port->base.base.dev); +enum port port = intel_dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 ln0, ln1, lane_mask, pin_mask; +int num_lanes; + +if (tc_port ==PORT_TC_NONE || + intel_dig_port->tc_mode ==TC_PORT_TBT_ALT ) +return ; + +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x0 )); + ln0 =I915_READ (DKL_DP_MODE (tc_port)); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x1 )); + ln1 =I915_READ (DKL_DP_MODE (tc_port)); + + num_lanes = intel_dig_port->dp.lane_count; + +switch (intel_dig_port->tc_mode) { +case TC_PORT_DP_ALT : + ln0 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X1_MODE ); + ln1 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ); + + lane_mask =intel_tc_port_get_lane_mask (intel_dig_port);/* DPX4TXLATC */ + pin_mask =intel_tc_port_get_pin_assignment_mask (intel_dig_port);/* DPPATC */ + +switch (pin_mask) { +case 0x0 : +if (num_lanes ==1 ) { + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x1 : +if (num_lanes ==4 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x2 : +if (num_lanes ==2 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x3 : +case 0x5 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x4 : +case 0x6 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +default : +MISSING_CASE (lane_mask); + } +break ; + +case TC_PORT_LEGACY : + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE ; +break ; + +default : +MISSING_CASE (intel_dig_port->tc_mode); +return ; + } + +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x0 )); +I915_WRITE (DKL_DP_MODE (tc_port), ln0); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x1 )); +I915_WRITE (DKL_DP_MODE (tc_port), ln1); +} +static void intel_dp_sink_set_fec_ready (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) {@@ -3239,7 +3446,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, dig_port->ddi_io_power_domain);/* 6. */ -icl_program_mg_dp_mode (dig_port); +tgl_program_dkl_dp_mode (dig_port);/* * 7.a - Steps in this function should only be executed over MST @@ -3252,10 +3459,10 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_ddi_config_transcoder_func (crtc_state);/* 7.d */ -icl_disable_phy_clock_gating (dig_port); +tgl_phy_clock_gating (dig_port, false);/* 7.e */ -icl_ddi_vswing_sequence (encoder, crtc_state->port_clock, level, +tgl_ddi_vswing_sequence (encoder, crtc_state->port_clock, level, encoder->type);/* 7.f */
drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, · line 3500
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_ddi.c +4
-0@@ -3287,6 +3494,15 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,/* 7.k */ intel_dp_stop_link_train (intel_dp); +/* +* TODO: enable clock gating +* +* It is not written in DP enabling sequence but "PHY Clockgating
typo
drivers/gpu/drm/i915/display/intel_ddi.c static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, · line 3502
Quoted 2 lines
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+* programming" states that clock gating should be enabled after the +* link training but doing so causes all the following trainings to fail
typo
Lucas De Marchi
Quoted 37 lines
drivers/gpu/drm/i915/display/intel_ddi.c +11
-3+* so not enabling it for. +*/ +/* 7.l */ intel_ddi_enable_fec (encoder, crtc_state);intel_dsc_enable (encoder, crtc_state);@@ -3392,7 +3608,10 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,intel_display_power_get (dev_priv, dig_port->ddi_io_power_domain);icl_program_mg_dp_mode (dig_port); -icl_disable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, false); +else +icl_disable_phy_clock_gating (dig_port);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,@@ -3404,7 +3623,10 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,else intel_prepare_hdmi_ddi_buffers (encoder, level); -icl_enable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, true); +else +icl_enable_phy_clock_gating (dig_port);if (IS_GEN9_BC (dev_priv))skl_ddi_set_iboost (encoder, level,INTEL_OUTPUT_HDMI ); --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 08/13] drm/i915/tgl: Add dkl phy programming sequences
Quoted 36 lines · Lucas De Marchi
Quoted 34 lines · José Roberto de Souza
From: Clinton A Taylor <[email protected]>
Added DKL Phy sequences and helpers functions to program voltage swing, clock gating and dp mode.
It is not written in DP enabling sequence but "PHY Clockgating programming" states that clock gating should be enabled after the link training but doing so causes all the following trainings to fail
so not enabling it for.v2:
Setting the rightHIP_INDEX_REGbits (José)BSpec: 49292
BSpec: 49190Signed-off-by José Roberto de Souza <[email protected]>Signed-off-by Clinton A Taylor <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 246 +++++++++++++++++++++-- 1 file changed, 234 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -586,6 +586,25 @@ static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { {0x0 ,0x00 ,0x00 },/* 3 0 */ };
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_ddi.c static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = {
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+struct tgl_dkl_phy_ddi_buf_trans { +u32 dkl_vswing_control; +u32 dkl_preshoot_control; +u32 dkl_de_emphasis_control; +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_ddi_translations[] = {comment here like in the icl version with the meaning of the comments would be good
Okay
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations[] = { · line 600
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ { 0x7, 0x0, 0x00 }, /* 0 0 400mV 0 dB */ + { 0x5, 0x0, 0x03 }, /* 0 1 400mV 3.5 dB */ + { 0x2, 0x0, 0x0b }, /* 0 2 400mV 6 dB */ + { 0x0, 0x0, 0x19 }, /* 0 3 400mV 9.5 dB */ + { 0x5, 0x0, 0x00 }, /* 1 0 600mV 0 dB */pre-emphasis here is 1. And the others below are wrong, too.
I thought that too but based on the index_to_dp_signal_levels table and the values on "Pre-emphasis dB" column is mostly likely that BSpec has a typo, issue was already open for that on BSpec.
Quoted 30 lines
Quoted 30 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ { 0x2, 0x0, 0x03 }, /* 1 1 600mV 3.5 dB */ + { 0x0, 0x0, 0x14 }, /* 1 2 600mV 6 dB */ + { 0x2, 0x0, 0x00 }, /* 2 0 800mV 0 dB */ + { 0x0, 0x0, 0x0B }, /* 2 1 800mV 3.5 dB */ + { 0x0, 0x0, 0x00 }, /* 3 0 1200mV 0 dB HDMIDefault */
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+}; +static const struct ddi_buf_trans * bdw_get_buf_trans_edp(struct drm_i915_private *dev_priv, int
*n_entries)
{drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -873,11 +892,15 @@ static int intel_ddi_hdmi_level(struct
drm_i915_private*dev_priv, enum port porlevel = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift; if (INTEL_GEN(dev_priv) >= 11) {drivers/gpu/drm/i915/display/intel_ddi.c +1
-1-if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) { icl_get_combo_buf_trans(dev_priv,
INTEL_OUTPUT_HDMI,0, &n_entries);drivers/gpu/drm/i915/display/intel_ddi.c +0
-2-else - n_entries =
ARRAY_SIZE(icl_mg_phy_ddi_translations);drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =
ARRAY_SIZE(tgl_dkl_phy_ddi_translations);
Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+else + n_entries =
ARRAY_SIZE(icl_mg_phy_ddi_translations);
+ }default_entry = n_entries - 1;I think plain ladder would be better. Just add one for
INTEL_GEN(dev_priv)>= 12)
Okay
Quoted 26 lines
Quoted 23 lines
} else if (IS_CANNONLAKE(dev_priv)) { cnl_get_buf_trans_hdmi(dev_priv, &n_entries);drivers/gpu/drm/i915/display/intel_ddi.c +1
-3@@ -2308,11 +2331,15 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)int n_entries;if (INTEL_GEN (dev_priv) >=11 ) { -if (intel_phy_is_combo (dev_priv, phy)) +if (intel_phy_is_combo (dev_priv, phy)) {icl_get_combo_buf_trans (dev_priv, encoder- >type, intel_dp- >link_rate, &n_entries); -else - n_entries =
ARRAY_SIZE(icl_mg_phy_ddi_translations);drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ }else { +if (INTEL_GEN (dev_priv) >=12 ) + n_entries =
ARRAY_SIZE(tgl_dkl_phy_ddi_translations);drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+else + n_entries =Quoted 2 lines
ARRAY_SIZE(icl_mg_phy_ddi_translations);
+ }
Quoted 1 line
ditto
Okay
Quoted 20 lines
Quoted 20 lines
} else if (IS_CANNONLAKE(dev_priv)) { if (encoder->type == INTEL_OUTPUT_EDP) cnl_get_buf_trans_edp(dev_priv,
&n_entries);drivers/gpu/drm/i915/display/intel_ddi.c +5
-0@@ -2749,6 +2776,66 @@ static void icl_ddi_vswing_sequence(structintel_encoder *encoder,icl_mg_phy_ddi_vswing_sequence (encoder ,link_clock ,level ); } +static void +tgl_dkl_phy_ddi_vswing_sequence (struct intel_encoder *encoder,int link_clock, +u32 level) +{ + struct drm_i915_private *dev_priv = to_i915(encoder-Quoted 1 line
base.dev);
+ enum
tc_porttc_port= intel_port_to_tc(dev_priv, encoder-Quoted 1 line
port);
Quoted 10 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+const struct tgl_dkl_phy_ddi_buf_trans *ddi_translations; +u32 n_entries, val, ln; + + n_entries =ARRAY_SIZE (tgl_dkl_phy_ddi_translations); + ddi_translations = tgl_dkl_phy_ddi_translations; + +if (level > n_entries)= ?
Otherwise you will access garbage below
Done
Quoted 46 lines
Quoted 16 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+ level = n_entries -1 ; + +/* +* All registers programmed here use HIP_INDEX_REG 0 or 1 +*/ +for (ln =0 ; ln <2 ; ln++) { + I915_WRITE(HIP_INDEX_REG(tc_port),
HIP_INDEX_VAL(tc_port, ln));drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+ +/* All the registers are RMW */ + val =I915_READ (DKL_TX_DPCNTL0 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=Quoted 7 lines
DKL_TX_VSWING_CONTROL(ddi_translations[level].dkl_vswing_control);
+ val |=DKL_TX_DE_EMPHASIS_COEFF(ddi_translations[level].dkl_de_emphasis_co ntrol);
+ val |=DKL_TX_PRESHOOT_COEFF(ddi_translations[level].dkl_preshoot_control);I wonder how useful it is to keep there the
dkl_preshoot_controlif it's always 0
But we have the same behavior in previous platforms.... :-/ We can leave it for laterQuoted 17 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+I915_WRITE (DKL_TX_DPCNTL0 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL1 (tc_port)); + val &= ~(DKL_TX_PRESHOOT_COEFF_MASK | +DKL_TX_DE_EMPAHSIS_COEFF_MASK | +DKL_TX_VSWING_CONTROL_MASK ); + val |=
DKL_TX_VSWING_CONTROL(ddi_translations[level].dkl_vswing_control);
+ val |=DKL_TX_DE_EMPHASIS_COEFF(ddi_translations[level].dkl_de_emphasis_co ntrol);
+ val |=DKL_TX_PRESHOOT_COEFF(ddi_translations[level].dkl_preshoot_control);drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+I915_WRITE (DKL_TX_DPCNTL1 (tc_port), val); + + val =I915_READ (DKL_TX_DPCNTL2 (tc_port));
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_ddi.c static void icl_ddi_vswing_sequence(struct intel_encoder *encoder, · line 2825
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_ddi.c +6
-0+ val &= ~DKL_TX_DP20BITMODE ; +I915_WRITE (DKL_TX_DPCNTL2 (tc_port), val); + } +} + +static void tgl_ddi_vswing_sequence(struct intel_encoder *encoder,
intel_ddi_pre_enable_hdmi()is not calling this function.
Nice catch, thanks
Quoted 40 lines
Quoted 40 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ int link_clock, + u32 level, + enum intel_output_type type) +{ + struct drm_i915_private *dev_priv = to_i915(encoder-Quoted 1 line
base.dev);
drivers/gpu/drm/i915/display/intel_ddi.c +4
-0+enum phy phy =intel_port_to_phy (dev_priv, encoder->port); + +if (intel_phy_is_combo (dev_priv, phy)) + icl_combo_phy_ddi_vswing_sequence(encoder, level,type);
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+else + tgl_dkl_phy_ddi_vswing_sequence(encoder,
link_clock, level);drivers/gpu/drm/i915/display/intel_ddi.c +6
-1+} +static u32 translate_signal_level (int signal_levels) {int i;@@ -2780,7 +2867,10 @@ u32 bxt_signal_levels(struct intel_dp *intel_dp)struct intel_encoder *encoder = &dport->base;int level =intel_ddi_dp_level (intel_dp); -if (INTEL_GEN (dev_priv) >=11 ) +if (INTEL_GEN (dev_priv) >=12 ) +tgl_ddi_vswing_sequence (encoder, intel_dp- >link_rate, + level, encoder->type); +else if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, intel_dp-Quoted 1 line
link_rate,level,
encoder->type);
else if (IS_CANNONLAKE(dev_priv))drivers/gpu/drm/i915/display/intel_ddi.c +0
-0@@ -3027,6 +3117,34 @@ static void intel_ddi_clk_disable(struct intel_encoder *encoder) } }
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_clk_disable(struct · line 3123
Quoted 3 lines
drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+static void +tgl_phy_clock_gating (struct intel_digital_port *dig_port,bool enable)same comment as other commit...
tgl_phy_set_clock_gating()?
Done
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_clk_disable(struct intel_encoder *encoder) · line 3126
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+{ +struct drm_i915_private *dev_priv =to_i915 (dig_port- >base.base.dev); +enum port port = dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 val, regs;s/regs/bits/
Done
Quoted 229 lines
Quoted 177 lines
drivers/gpu/drm/i915/display/intel_ddi.c +6
-0+int ln; + +if (tc_port ==PORT_TC_NONE ) +return ; + + regs = DKL_DP_MODE_CFG_TR2PWR_GATING |
DKL_DP_MODE_CFG_TRPWR_GATING|
+DKL_DP_MODE_CFG_CLNPWR_GATING|DKL_DP_MODE_CFG_DIGPWR_GATING|drivers/gpu/drm/i915/display/intel_ddi.c +4
-0+DKL_DP_MODE_CFG_GAONPWR_GATING ; + +for (ln =0 ; ln <2 ; ln++) { + I915_WRITE(HIP_INDEX_REG(tc_port),
HIP_INDEX_VAL(tc_port, ln));drivers/gpu/drm/i915/display/intel_ddi.c +10
-0+ + val =I915_READ (DKL_DP_MODE (tc_port)); +if (enable) + val |= regs; +else + val &= ~regs; +I915_WRITE (DKL_DP_MODE (tc_port), val); + } +} + static void icl_enable_phy_clock_gating(struct intel_digital_port
*dig_port){ struct drm_i915_private *dev_priv = to_i915(dig_port-Quoted 1 line
base.base.dev);
drivers/gpu/drm/i915/display/intel_ddi.c +13
-0@@ -3153,6 +3271,95 @@ static void icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port) I915_WRITE(MG_DP_MODE(1, port), ln1); } +static void tgl_program_dkl_dp_mode (struct intel_digital_port *intel_dig_port) +{ +struct drm_i915_private *dev_priv =to_i915 (intel_dig_port- >base.base.dev); +enum port port = intel_dig_port->base.port; +enum tc_port tc_port =intel_port_to_tc (dev_priv, port); +u32 ln0, ln1, lane_mask, pin_mask; +int num_lanes; + +if (tc_port ==PORT_TC_NONE || + intel_dig_port->tc_mode ==TC_PORT_TBT_ALT ) +return ; + + I915_WRITE(HIP_INDEX_REG(tc_port), HIP_INDEX_VAL(tc_port,
0x0));drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ ln0 =I915_READ (DKL_DP_MODE (tc_port)); + I915_WRITE(HIP_INDEX_REG(tc_port), HIP_INDEX_VAL(tc_port,
0x1));drivers/gpu/drm/i915/display/intel_ddi.c +7
-0+ ln1 =I915_READ (DKL_DP_MODE (tc_port)); + + num_lanes = intel_dig_port->dp.lane_count; + +switch (intel_dig_port->tc_mode) { +case TC_PORT_DP_ALT : + ln0 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |
DKL_DP_MODE_CFG_DP_X1_MODE);
+ ln1 &= ~(DKL_DP_MODE_CFG_DP_X1_MODE |DKL_DP_MODE_CFG_DP_X2_MODE);drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ + lane_mask =
intel_tc_port_get_lane_mask(intel_dig_port); /* DPX4TXLATC */
+pin_mask=intel_tc_port_get_pin_assignment_mask(intel_dig_port); /* DPPATC */drivers/gpu/drm/i915/display/intel_ddi.c +49
-0+ +switch (pin_mask) { +case 0x0 : +if (num_lanes ==1 ) { + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x1 : +if (num_lanes ==4 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x2 : +if (num_lanes ==2 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x3 : +case 0x5 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +case 0x4 : +case 0x6 : +if (num_lanes ==1 ) { + ln0 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE ; + }else { + ln0 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + ln1 |=DKL_DP_MODE_CFG_DP_X2_MODE ; + } +break ; +default : +MISSING_CASE (lane_mask); + } +break ; + +case TC_PORT_LEGACY : + ln0 |= DKL_DP_MODE_CFG_DP_X1_MODE |
DKL_DP_MODE_CFG_DP_X2_MODE;
+ ln1 |=DKL_DP_MODE_CFG_DP_X1_MODE|DKL_DP_MODE_CFG_DP_X2_MODE;drivers/gpu/drm/i915/display/intel_ddi.c +8
-0+break ; + +default : +MISSING_CASE (intel_dig_port->tc_mode); +return ; + } + + I915_WRITE(HIP_INDEX_REG(tc_port), HIP_INDEX_VAL(tc_port,
0x0));drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+I915_WRITE (DKL_DP_MODE (tc_port), ln0); + I915_WRITE(HIP_INDEX_REG(tc_port), HIP_INDEX_VAL(tc_port,
0x1));drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+I915_WRITE (DKL_DP_MODE (tc_port), ln1); +} + static void intel_dp_sink_set_fec_ready(struct intel_dp *intel_dp, const struct
intel_crtc_state*crtc_state)
{drivers/gpu/drm/i915/display/intel_ddi.c +1
-1@@ -3239,7 +3446,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, dig_port- >ddi_io_power_domain);/* 6. */ -icl_program_mg_dp_mode (dig_port); +tgl_program_dkl_dp_mode (dig_port);/*
* 7.a - Steps in this function should only be executed
over MSTdrivers/gpu/drm/i915/display/intel_ddi.c +2
-2@@ -3252,10 +3459,10 @@ static void tgl_ddi_pre_enable_dp(structintel_encoder *encoder,intel_ddi_config_transcoder_func (crtc_state );/* 7.d */ -icl_disable_phy_clock_gating (dig_port); +tgl_phy_clock_gating (dig_port, false);/* 7.e */ - icl_ddi_vswing_sequence(encoder, crtc_state->port_clock, level, + tgl_ddi_vswing_sequence(encoder, crtc_state->port_clock, level,encoder->type); /* 7.f */drivers/gpu/drm/i915/display/intel_ddi.c +4
-0@@ -3287,6 +3494,15 @@ static void tgl_ddi_pre_enable_dp(structintel_encoder *encoder,/* 7.k */ intel_dp_stop_link_train (intel_dp ); +/* +* TODO: enable clock gating +* +* It is not written in DP enabling sequence but "PHY Quoted 1 line
Clockgating
typo
Quoted 4 lines
+ * programming" states that clock gating should be enabled
after the
+ * link training but doing so causes all the following
trainings to failtypo
Lucas De Marchi
Quoted 38 lines
drivers/gpu/drm/i915/display/intel_ddi.c +7
-1+* so not enabling it for. +*/ +/* 7.l */ intel_ddi_enable_fec (encoder, crtc_state);intel_dsc_enable (encoder, crtc_state);@@ -3392,7 +3608,10 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,intel_display_power_get (dev_priv, dig_port- >ddi_io_power_domain);icl_program_mg_dp_mode (dig_port); -icl_disable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, false); +else +icl_disable_phy_clock_gating (dig_port);if (INTEL_GEN(dev_priv) >= 11) icl_ddi_vswing_sequence(encoder, crtc_state-Quoted 1 line
port_clock,drivers/gpu/drm/i915/display/intel_ddi.c +4
-1@@ -3404,7 +3623,10 @@ static void intel_ddi_pre_enable_hdmi(structintel_encoder *encoder, elseintel_prepare_hdmi_ddi_buffers (encoder ,level ); -icl_enable_phy_clock_gating (dig_port); +if (INTEL_GEN (dev_priv) >=12 ) +tgl_phy_clock_gating (dig_port, true); +else +icl_enable_phy_clock_gating (dig_port);if (IS_GEN9_BC (dev_priv))skl_ddi_set_iboost(encoder, level,
INTEL_OUTPUT_HDMI);
--
2.23.0
Quoted 6 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 9/13 drm/i915/icl: Unify disable and enable phy clock gating functions
In reply to José Roberto de SouzaAdding a enable parameters allow us to share most of the code between enable and disable functions.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 71 ++++++++---------------- 1 file changed, 22 insertions(+), 49 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +22 -49
@@ -3145,67 +3145,40 @@ tgl_phy_clock_gating(struct intel_digital_port *dig_port, bool enable) } } -static void icl_enable_phy_clock_gating (struct intel_digital_port *dig_port) +static void +icl_phy_clock_gating (struct intel_digital_port *dig_port,bool enable) {struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev);enum port port = dig_port->base.port;enum tc_port tc_port =intel_port_to_tc (dev_priv, port); -u32 val; +u32 val, regs;int ln;if (tc_port ==PORT_TC_NONE )return ; -for (ln =0 ; ln <2 ; ln++) { - val =I915_READ (MG_DP_MODE (ln, port)); - val |=MG_DP_MODE_CFG_TR2PWR_GATING | -MG_DP_MODE_CFG_TRPWR_GATING | -MG_DP_MODE_CFG_CLNPWR_GATING | -MG_DP_MODE_CFG_DIGPWR_GATING | -MG_DP_MODE_CFG_GAONPWR_GATING ; -I915_WRITE (MG_DP_MODE (ln, port), val); - } - - val =I915_READ (MG_MISC_SUS0 (tc_port)); - val |=MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE (3 ) | -MG_MISC_SUS0_CFG_TR2PWR_GATING | -MG_MISC_SUS0_CFG_CL2PWR_GATING | -MG_MISC_SUS0_CFG_GAONPWR_GATING | -MG_MISC_SUS0_CFG_TRPWR_GATING | -MG_MISC_SUS0_CFG_CL1PWR_GATING | -MG_MISC_SUS0_CFG_DGPWR_GATING ; -I915_WRITE (MG_MISC_SUS0 (tc_port), val); -} - -static void icl_disable_phy_clock_gating (struct intel_digital_port *dig_port) -{ -struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev); -enum port port = dig_port->base.port; -enum tc_port tc_port =intel_port_to_tc (dev_priv, port); -u32 val; -int ln; - -if (tc_port ==PORT_TC_NONE ) -return ; + regs =MG_DP_MODE_CFG_TR2PWR_GATING |MG_DP_MODE_CFG_TRPWR_GATING | +MG_DP_MODE_CFG_CLNPWR_GATING |MG_DP_MODE_CFG_DIGPWR_GATING | +MG_DP_MODE_CFG_GAONPWR_GATING ;for (ln =0 ; ln <2 ; ln++) { val =I915_READ (MG_DP_MODE (ln, port)); - val &= ~(MG_DP_MODE_CFG_TR2PWR_GATING | -MG_DP_MODE_CFG_TRPWR_GATING | -MG_DP_MODE_CFG_CLNPWR_GATING | -MG_DP_MODE_CFG_DIGPWR_GATING | -MG_DP_MODE_CFG_GAONPWR_GATING ); +if (enable) + val |= regs; +else + val &= ~regs;I915_WRITE (MG_DP_MODE (ln, port), val); } + regs =MG_MISC_SUS0_CFG_TR2PWR_GATING |MG_MISC_SUS0_CFG_CL2PWR_GATING | +MG_MISC_SUS0_CFG_GAONPWR_GATING |MG_MISC_SUS0_CFG_TRPWR_GATING | +MG_MISC_SUS0_CFG_CL1PWR_GATING |MG_MISC_SUS0_CFG_DGPWR_GATING ; + val =I915_READ (MG_MISC_SUS0 (tc_port)); - val &= ~(MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE_MASK | -MG_MISC_SUS0_CFG_TR2PWR_GATING | -MG_MISC_SUS0_CFG_CL2PWR_GATING | -MG_MISC_SUS0_CFG_GAONPWR_GATING | -MG_MISC_SUS0_CFG_TRPWR_GATING | -MG_MISC_SUS0_CFG_CL1PWR_GATING | -MG_MISC_SUS0_CFG_DGPWR_GATING ); +if (enable) + val |= (regs |MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE (3 )); +else + val &= ~(regs |MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE_MASK );I915_WRITE (MG_MISC_SUS0 (tc_port), val); }
@@ -3538,7 +3511,7 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, dig_port->ddi_io_power_domain);icl_program_mg_dp_mode (dig_port); -icl_disable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, false);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,
@@ -3571,7 +3544,7 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_ddi_enable_fec (encoder, crtc_state); -icl_enable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, true);if (!is_mst)intel_ddi_enable_pipe_clock (crtc_state);
@@ -3611,7 +3584,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,if (INTEL_GEN (dev_priv) >=12 )tgl_phy_clock_gating (dig_port, false);else -icl_disable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, false);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,
@@ -3626,7 +3599,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,if (INTEL_GEN (dev_priv) >=12 )tgl_phy_clock_gating (dig_port, true);else -icl_enable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, true);if (IS_GEN9_BC (dev_priv))skl_ddi_set_iboost (encoder, level,INTEL_OUTPUT_HDMI );
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 09/13] drm/i915/icl: Unify disable and enable phy clock gating functions
Quoted 14 lines · José Roberto de Souza
Adding a enable parameters allow us to share most of the code between enable and disable functions.
Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 71 ++++++++---------------- 1 file changed, 22 insertions(+), 49 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-0
drivers/gpu/drm/i915/display/intel_ddi.c tgl_phy_clock_gating(struct intel_digital_port *dig_port, bool enable) · line 3149
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_ddi.c +2
-1@@ -3145,67 +3145,40 @@ tgl_phy_clock_gating(struct intel_digital_port *dig_port, bool enable) } } -static void icl_enable_phy_clock_gating (struct intel_digital_port *dig_port) +static void +icl_phy_clock_gating (struct intel_digital_port *dig_port,bool enable)
name is confusing: is it a getter or setter?
icl_phy_set_clock_gating()?
drivers/gpu/drm/i915/display/intel_ddi.c tgl_phy_clock_gating(struct intel_digital_port *dig_port, bool enable) · line 3154
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_ddi.c +1
-1{struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev);enum port port = dig_port->base.port;enum tc_port tc_port =intel_port_to_tc (dev_priv, port); -u32 val; +u32 val, regs;
s/regs/bits/
With some additional effort we could even migrate this to intel_tc.c. Not for this patch though.
With the changes above:
Lucas De Marchi
Quoted 116 lines
drivers/gpu/drm/i915/display/intel_ddi.c +19
-48int ln;if (tc_port ==PORT_TC_NONE )return ; -for (ln =0 ; ln <2 ; ln++) { - val =I915_READ (MG_DP_MODE (ln, port)); - val |=MG_DP_MODE_CFG_TR2PWR_GATING | -MG_DP_MODE_CFG_TRPWR_GATING | -MG_DP_MODE_CFG_CLNPWR_GATING | -MG_DP_MODE_CFG_DIGPWR_GATING | -MG_DP_MODE_CFG_GAONPWR_GATING ; -I915_WRITE (MG_DP_MODE (ln, port), val); - } - - val =I915_READ (MG_MISC_SUS0 (tc_port)); - val |=MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE (3 ) | -MG_MISC_SUS0_CFG_TR2PWR_GATING | -MG_MISC_SUS0_CFG_CL2PWR_GATING | -MG_MISC_SUS0_CFG_GAONPWR_GATING | -MG_MISC_SUS0_CFG_TRPWR_GATING | -MG_MISC_SUS0_CFG_CL1PWR_GATING | -MG_MISC_SUS0_CFG_DGPWR_GATING ; -I915_WRITE (MG_MISC_SUS0 (tc_port), val); -} - -static void icl_disable_phy_clock_gating (struct intel_digital_port *dig_port) -{ -struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev); -enum port port = dig_port->base.port; -enum tc_port tc_port =intel_port_to_tc (dev_priv, port); -u32 val; -int ln; - -if (tc_port ==PORT_TC_NONE ) -return ; + regs =MG_DP_MODE_CFG_TR2PWR_GATING |MG_DP_MODE_CFG_TRPWR_GATING | +MG_DP_MODE_CFG_CLNPWR_GATING |MG_DP_MODE_CFG_DIGPWR_GATING | +MG_DP_MODE_CFG_GAONPWR_GATING ;for (ln =0 ; ln <2 ; ln++) { val =I915_READ (MG_DP_MODE (ln, port)); - val &= ~(MG_DP_MODE_CFG_TR2PWR_GATING | -MG_DP_MODE_CFG_TRPWR_GATING | -MG_DP_MODE_CFG_CLNPWR_GATING | -MG_DP_MODE_CFG_DIGPWR_GATING | -MG_DP_MODE_CFG_GAONPWR_GATING ); +if (enable) + val |= regs; +else + val &= ~regs;I915_WRITE (MG_DP_MODE (ln, port), val); } + regs =MG_MISC_SUS0_CFG_TR2PWR_GATING |MG_MISC_SUS0_CFG_CL2PWR_GATING | +MG_MISC_SUS0_CFG_GAONPWR_GATING |MG_MISC_SUS0_CFG_TRPWR_GATING | +MG_MISC_SUS0_CFG_CL1PWR_GATING |MG_MISC_SUS0_CFG_DGPWR_GATING ; + val =I915_READ (MG_MISC_SUS0 (tc_port)); - val &= ~(MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE_MASK | -MG_MISC_SUS0_CFG_TR2PWR_GATING | -MG_MISC_SUS0_CFG_CL2PWR_GATING | -MG_MISC_SUS0_CFG_GAONPWR_GATING | -MG_MISC_SUS0_CFG_TRPWR_GATING | -MG_MISC_SUS0_CFG_CL1PWR_GATING | -MG_MISC_SUS0_CFG_DGPWR_GATING ); +if (enable) + val |= (regs |MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE (3 )); +else + val &= ~(regs |MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE_MASK );I915_WRITE (MG_MISC_SUS0 (tc_port), val); }@@ -3538,7 +3511,7 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, dig_port->ddi_io_power_domain);icl_program_mg_dp_mode (dig_port); -icl_disable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, false);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,@@ -3571,7 +3544,7 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder,intel_ddi_enable_fec (encoder, crtc_state); -icl_enable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, true);if (!is_mst)intel_ddi_enable_pipe_clock (crtc_state);@@ -3611,7 +3584,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,if (INTEL_GEN (dev_priv) >=12 )tgl_phy_clock_gating (dig_port, false);else -icl_disable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, false);if (INTEL_GEN (dev_priv) >=11 ) icl_ddi_vswing_sequence(encoder, crtc_state->port_clock,@@ -3626,7 +3599,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,if (INTEL_GEN (dev_priv) >=12 )tgl_phy_clock_gating (dig_port, true);else -icl_enable_phy_clock_gating (dig_port); +icl_phy_clock_gating (dig_port, true);if (IS_GEN9_BC (dev_priv))skl_ddi_set_iboost (encoder, level,INTEL_OUTPUT_HDMI ); --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 10/13 drm/i915/tgl: Check the UC health of tc controllers after power on
In reply to José Roberto de SouzaNew step added for TGL, required for us to check the TC microcontroller health after power on TC aux.
BSpec: 49294
--- drivers/gpu/drm/i915/display/intel_display_power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/display/intel_display_power.c +13 -0
@@ -562,6 +562,8 @@ static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,#endif +#define TGL_AUX_PW_TO_TC_PORT (pw_idx) ((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1) +static void icl_tc_phy_aux_power_well_enable (struct drm_i915_private *dev_priv,struct i915_power_well *power_well)
@@ -578,6 +580,17 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,I915_WRITE (DP_AUX_CH_CTL (aux_ch), val);hsw_power_well_enable (dev_priv, power_well); + +if (INTEL_GEN (dev_priv) >=12 && !power_well->desc->hsw.is_tc_tbt) { +enum tc_port tc_port; + + tc_port =TGL_AUX_PW_TO_TC_PORT (power_well->desc->hsw.idx); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + +if (intel_de_wait_for_set (dev_priv,DKL_CMN_UC_DW_27 (tc_port), +DKL_CMN_UC_DW27_UC_HEALTH ,1 )) +DRM_WARN ("Timeout waiting TC uC health\n" ); + } } static void
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 10/13] drm/i915/tgl: Check the UC health of tc controllers after power on
Quoted 6 lines · José Roberto de Souza
New step added for TGL, required for us to check the TC microcontroller health after power on TC aux.
BSpec: 49294
Signed-off-by José Roberto de Souza <[email protected]>
Quoted 42 lines
--- drivers/gpu/drm/i915/display/intel_display_power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/gpu/drm/i915/display/intel_display_power.c +13
-0@@ -562,6 +562,8 @@ static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,#endif +#define TGL_AUX_PW_TO_TC_PORT (pw_idx) ((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1) +static void icl_tc_phy_aux_power_well_enable (struct drm_i915_private *dev_priv,struct i915_power_well *power_well)@@ -578,6 +580,17 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,I915_WRITE (DP_AUX_CH_CTL (aux_ch), val);hsw_power_well_enable (dev_priv, power_well); + +if (INTEL_GEN (dev_priv) >=12 && !power_well->desc->hsw.is_tc_tbt) { +enum tc_port tc_port; + + tc_port =TGL_AUX_PW_TO_TC_PORT (power_well->desc->hsw.idx); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 )); + +if (intel_de_wait_for_set (dev_priv,DKL_CMN_UC_DW_27 (tc_port), +DKL_CMN_UC_DW27_UC_HEALTH ,1 )) +DRM_WARN ("Timeout waiting TC uC health\n" ); + } } static voidSignature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 10/13] drm/i915/tgl: Check the UC health of tc controllers after power on
Quoted 30 lines · Imre Deak
Quoted 6 lines · José Roberto de Souza
New step added for TGL, required for us to check the TC microcontroller health after power on TC aux.
BSpec: 49294
Signed-off-by José Roberto de Souza <[email protected]>Reviewed-by Imre Deak <[email protected]>Quoted 20 lines
--- drivers/gpu/drm/i915/display/intel_display_power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/gpu/drm/i915/display/intel_display_power.c +2
-0@@ -562,6 +562,8 @@ static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,#endif +#define TGL_AUX_PW_TO_TC_PORT (pw_idx) ((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1) +static void icl_tc_phy_aux_power_well_enable (struct drm_i915_private *dev_priv,struct i915_power_well *power_well)@@ -578,6 +580,17 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,I915_WRITE (DP_AUX_CH_CTL (aux_ch), val);
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display_power.c icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv, · line 588
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display_power.c +6
-0hsw_power_well_enable (dev_priv, power_well); + +if (INTEL_GEN (dev_priv) >=12 && !power_well->desc->hsw.is_tc_tbt) { +enum tc_port tc_port; + + tc_port =TGL_AUX_PW_TO_TC_PORT (power_well->desc->hsw.idx); +I915_WRITE (HIP_INDEX_REG (tc_port),HIP_INDEX_VAL (tc_port,0x2 ));
Nit: instead of hard-coding the upper bits the DKL PHY regs should be defined as the full address (for instance base + 0x236C for DKL_CMN_UC_DW_27) and use helpers here to get the low/high bits from the full address.
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_display_power.c +5
-0+ +if (intel_de_wait_for_set (dev_priv,DKL_CMN_UC_DW_27 (tc_port), +DKL_CMN_UC_DW27_UC_HEALTH ,1 )) +DRM_WARN ("Timeout waiting TC uC health\n" ); + } } static voidSignature · 1 line
2.23.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 10/13] drm/i915/tgl: Check the UC health of tc controllers after power on
Quoted 46 lines · Imre Deak
Quoted 45 lines · Imre Deak
Quoted 6 lines · José Roberto de Souza
New step added for TGL, required for us to check the TC microcontroller health after power on TC aux.
BSpec: 49294
Signed-off-by José Roberto de Souza <[email protected]>Reviewed-by Imre Deak <[email protected]>Quoted 34 lines
--- drivers/gpu/drm/i915/display/intel_display_power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/gpu/drm/i915/display/intel_display_power.c +2
-0@@ -562,6 +562,8 @@ static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,#endif +#define TGL_AUX_PW_TO_TC_PORT (pw_idx) ((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1) +static voidicl_tc_phy_aux_power_well_enable(struct
drm_i915_private*dev_priv,drivers/gpu/drm/i915/display/intel_display_power.c +5
-0struct i915_power_well *power_well)@@ -578,6 +580,17 @@ icl_tc_phy_aux_power_well_enable(structdrm_i915_private *dev_priv,I915_WRITE (DP_AUX_CH_CTL (aux_ch ),val );hsw_power_well_enable (dev_priv, power_well); + +if (INTEL_GEN (dev_priv) >=12 && !power_well->desc- >hsw.is_tc_tbt) { +enum tc_port tc_port; + + tc_port =TGL_AUX_PW_TO_TC_PORT (power_well->desc- >hsw.idx);
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/display/intel_display_power.c +1
-0+ I915_WRITE(HIP_INDEX_REG(tc_port),
HIP_INDEX_VAL(tc_port, 0x2));Nit: instead of hard-coding the upper bits the DKL PHY regs should be defined as
the full address (for instance base +0x236CforDKL_CMN_UC_DW_27) and
use helpers here to get the low/high bits from the full address.
Good idea, depending of how much work will be needed to the current patches be merged I will do that in the current patches otherwise will do top.
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display_power.c +2
-0+ + if (intel_de_wait_for_set(dev_priv,
DKL_CMN_UC_DW_27(tc_port),drivers/gpu/drm/i915/display/intel_display_power.c +1
-0+ DKL_CMN_UC_DW27_UC_HEALTH,1))
drivers/gpu/drm/i915/display/intel_display_power.c +2
-0+DRM_WARN ("Timeout waiting TC uC health\n" ); + } } static voidSignature · 1 line
2.23.0
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 11/13 drm/i915/tgl: Add dkl phy pll calculations
In reply to José Roberto de SouzaExtending ICL mg calculations to also support dkl calculations.
BSpec: 49204
--- drivers/gpu/drm/i915/display/intel_ddi.c | 29 +++- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 148 +++++++++++------- 2 files changed, 114 insertions(+), 63 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +24 -5
@@ -1436,11 +1436,30 @@ static int icl_calc_mg_pll_link(struct drm_i915_private *dev_priv, ref_clock = dev_priv->cdclk.hw.ref; - m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; - m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; - m2_frac = (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ) ? - (pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_FRAC_MASK ) >> -MG_PLL_DIV0_FBDIV_FRAC_SHIFT :0 ; +if (INTEL_GEN (dev_priv) >=12 ) { + m1 = pll_state->mg_pll_div0 &DKL_PLL_DIV0_FBPREDIV_MASK ; + m1 = m1 >>DKL_PLL_DIV0_FBPREDIV_SHIFT ; + m2_int = pll_state->mg_pll_div0 &DKL_PLL_DIV0_FBDIV_INT_MASK ; + +if (pll_state->mg_pll_bias &DKL_PLL_BIAS_FRAC_EN_H ) { + m2_frac = pll_state->mg_pll_bias & +DKL_PLL_BIAS_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>DKL_PLL_BIAS_FBDIV_SHIFT ; + }else { + m2_frac =0 ; + } + }else { + m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; + m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; + +if (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ) { + m2_frac = pll_state->mg_pll_div0 & +MG_PLL_DIV0_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>MG_PLL_DIV0_FBDIV_FRAC_SHIFT ; + }else { + m2_frac =0 ; + } + }switch (pll_state->mg_clktop2_hsclkctl &MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK ) {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +90 -58
193 lines not on this page · raw message
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 11/13] drm/i915/tgl: Add dkl phy pll calculations
Quoted 99 lines · José Roberto de Souza
Extending ICL mg calculations to also support dkl calculations.
BSpec: 49204
Signed-off-by Vandita Kulkarni <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 29 +++- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 148 +++++++++++------- 2 files changed, 114 insertions(+), 63 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +24
-5@@ -1436,11 +1436,30 @@ static int icl_calc_mg_pll_link(struct drm_i915_private *dev_priv, ref_clock = dev_priv->cdclk.hw.ref; - m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; - m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; - m2_frac = (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ) ? - (pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_FRAC_MASK ) >> -MG_PLL_DIV0_FBDIV_FRAC_SHIFT :0 ; +if (INTEL_GEN (dev_priv) >=12 ) { + m1 = pll_state->mg_pll_div0 &DKL_PLL_DIV0_FBPREDIV_MASK ; + m1 = m1 >>DKL_PLL_DIV0_FBPREDIV_SHIFT ; + m2_int = pll_state->mg_pll_div0 &DKL_PLL_DIV0_FBDIV_INT_MASK ; + +if (pll_state->mg_pll_bias &DKL_PLL_BIAS_FRAC_EN_H ) { + m2_frac = pll_state->mg_pll_bias & +DKL_PLL_BIAS_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>DKL_PLL_BIAS_FBDIV_SHIFT ; + }else { + m2_frac =0 ; + } + }else { + m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; + m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; + +if (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ) { + m2_frac = pll_state->mg_pll_div0 & +MG_PLL_DIV0_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>MG_PLL_DIV0_FBDIV_FRAC_SHIFT ; + }else { + m2_frac =0 ; + } + }switch (pll_state->mg_clktop2_hsclkctl &MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK ) {drivers/gpu/drm/i915/display/intel_dpll_mgr.c +11
-5@@ -2607,7 +2607,8 @@ enum intel_dpll_id icl_tc_port_to_pll_id(enum tc_port tc_port)static bool icl_mg_pll_find_divisors (int clock_khz,bool is_dp,bool use_ssc,u32 *target_dco_khz, -struct intel_dpll_hw_state *state) +struct intel_dpll_hw_state *state, +bool is_dkl) {u32 dco_min_freq, dco_max_freq;int div1_vals[] = {7 ,5 ,3 ,2 };@@ -2627,10 +2628,14 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc,if (dco < dco_min_freq || dco > dco_max_freq)continue ; -if (div2 >=2 ) { - a_divratio = is_dp ?10 :5 ; - tlinedrv =2 ; +if (is_dkl) { + a_divratio =5 ; + tlinedrv =1 ; + }else { + a_divratio = is_dp ?10 :5 ; + tlinedrv =2 ; + } }else { a_divratio =5 ; tlinedrv =0 ;@@ -2693,11 +2698,12 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,u64 tmp;bool use_ssc = false;bool is_dp = !intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI ); +bool is_dkl =INTEL_GEN (dev_priv) >=12 ;memset (pll_state,0 ,sizeof (*pll_state));if (!icl_mg_pll_find_divisors (clock, is_dp, use_ssc, &dco_khz, - pll_state)) { + pll_state, is_dkl)) {DRM_DEBUG_KMS ("Failed to find divisors for clock %d\n" , clock);return false; }
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2715
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0@@ -2705,8 +2711,12 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, m1div =2 ; m2div_int = dco_khz / (refclk_khz * m1div);if (m2div_int >255 ) { +if (is_dkl) + goto no_mdiv;
just to jump 2 lines? It's not an error path, so if (!is_dkl) would do it better IMO
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2745
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-1+ m1div =4 ; m2div_int = dco_khz / (refclk_khz * m1div); +no_mdiv:if (m2div_int >255 ) {DRM_DEBUG_KMS ("Failed to find mdiv for clock %d\n" , clock);@@ -2732,7 +2742,7 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,break ;case 38400 : iref_ndiv =2 ; - iref_trim =28 ; + iref_trim = is_dkl ?24 :28 ;
refclk_khz / iref_ndiv == 19200. So iref_trim should still be 28 for dkl, no?
Quoted 125 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +67
-50iref_pulse_w =1 ;break ;default :@@ -2786,60 +2796,82 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, } ssc_steplog =4 ; - pll_state->mg_pll_div0 = (m2div_rem >0 ?MG_PLL_DIV0_FRACNEN_H :0 ) | -MG_PLL_DIV0_FBDIV_FRAC (m2div_frac) | -MG_PLL_DIV0_FBDIV_INT (m2div_int); - - pll_state->mg_pll_div1 =MG_PLL_DIV1_IREF_NDIVRATIO (iref_ndiv) | -MG_PLL_DIV1_DITHER_DIV_2 | -MG_PLL_DIV1_NDIVRATIO (1 ) | -MG_PLL_DIV1_FBPREDIV (m1div); - - pll_state->mg_pll_lf =MG_PLL_LF_TDCTARGETCNT (tdc_targetcnt) | -MG_PLL_LF_AFCCNTSEL_512 | -MG_PLL_LF_GAINCTRL (1 ) | -MG_PLL_LF_INT_COEFF (int_coeff) | -MG_PLL_LF_PROP_COEFF (prop_coeff); - - pll_state->mg_pll_frac_lock =MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32 | -MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32 | -MG_PLL_FRAC_LOCK_LOCKTHRESH (10 ) | -MG_PLL_FRAC_LOCK_DCODITHEREN | -MG_PLL_FRAC_LOCK_FEEDFWRDGAIN (feedfwgain); -if (use_ssc || m2div_rem >0 ) - pll_state->mg_pll_frac_lock |=MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN ; - - pll_state->mg_pll_ssc = (use_ssc ?MG_PLL_SSC_EN :0 ) | -MG_PLL_SSC_TYPE (2 ) | -MG_PLL_SSC_STEPLENGTH (ssc_steplen) | -MG_PLL_SSC_STEPNUM (ssc_steplog) | -MG_PLL_SSC_FLLEN | -MG_PLL_SSC_STEPSIZE (ssc_stepsize); - - pll_state->mg_pll_tdc_coldst_bias =MG_PLL_TDC_COLDST_COLDSTART | -MG_PLL_TDC_COLDST_IREFINT_EN | -MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W (iref_pulse_w) | -MG_PLL_TDC_TDCOVCCORR_EN | -MG_PLL_TDC_TDCSEL (3 ); - - pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 ) | -MG_PLL_BIAS_INIT_DCOAMP (0x3F ) | -MG_PLL_BIAS_BIAS_BONUS (10 ) | -MG_PLL_BIAS_BIASCAL_EN | -MG_PLL_BIAS_CTRIM (12 ) | -MG_PLL_BIAS_VREF_RDAC (4 ) | -MG_PLL_BIAS_IREFTRIM (iref_trim); - -if (refclk_khz ==38400 ) { - pll_state->mg_pll_tdc_coldst_bias_mask =MG_PLL_TDC_COLDST_COLDSTART ; - pll_state->mg_pll_bias_mask =0 ; +if (is_dkl) { + pll_state->mg_pll_div0 =DKL_PLL_DIV0_INTEG_COEFF (int_coeff) | +DKL_PLL_DIV0_PROP_COEFF (prop_coeff) | +DKL_PLL_DIV0_FBPREDIV (m1div) | +DKL_PLL_DIV0_FBDIV_INT (m2div_int); + + pll_state->mg_pll_div1 =DKL_PLL_DIV1_IREF_TRIM (iref_trim) | +DKL_PLL_DIV1_TDC_TARGET_CNT (tdc_targetcnt); + + pll_state->mg_pll_ssc =DKL_PLL_SSC_IREF_NDIV_RATIO (iref_ndiv) | +DKL_PLL_SSC_STEP_LEN (ssc_steplen) | +DKL_PLL_SSC_STEP_NUM (ssc_steplog) | + (use_ssc ?DKL_PLL_SSC_EN :0 ); + + pll_state->mg_pll_bias = (m2div_frac ?DKL_PLL_BIAS_FRAC_EN_H :0 ) | +DKL_PLL_BIAS_FBDIV_FRAC (m2div_frac); + + pll_state->mg_pll_tdc_coldst_bias = +DKL_PLL_TDC_SSC_STEP_SIZE (ssc_stepsize) | +DKL_PLL_TDC_FEED_FWD_GAIN (feedfwgain); }else { - pll_state->mg_pll_tdc_coldst_bias_mask =-1U ; - pll_state->mg_pll_bias_mask =-1U ; - } + pll_state->mg_pll_div0 = (m2div_rem >0 ?MG_PLL_DIV0_FRACNEN_H :0 ) | +MG_PLL_DIV0_FBDIV_FRAC (m2div_frac) | +MG_PLL_DIV0_FBDIV_INT (m2div_int); + + pll_state->mg_pll_div1 =MG_PLL_DIV1_IREF_NDIVRATIO (iref_ndiv) | +MG_PLL_DIV1_DITHER_DIV_2 | +MG_PLL_DIV1_NDIVRATIO (1 ) | +MG_PLL_DIV1_FBPREDIV (m1div); + + pll_state->mg_pll_lf =MG_PLL_LF_TDCTARGETCNT (tdc_targetcnt) | +MG_PLL_LF_AFCCNTSEL_512 | +MG_PLL_LF_GAINCTRL (1 ) | +MG_PLL_LF_INT_COEFF (int_coeff) | +MG_PLL_LF_PROP_COEFF (prop_coeff); + + pll_state->mg_pll_frac_lock =MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32 | +MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32 | +MG_PLL_FRAC_LOCK_LOCKTHRESH (10 ) | +MG_PLL_FRAC_LOCK_DCODITHEREN | +MG_PLL_FRAC_LOCK_FEEDFWRDGAIN (feedfwgain); +if (use_ssc || m2div_rem >0 ) + pll_state->mg_pll_frac_lock |=MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN ; + + pll_state->mg_pll_ssc = (use_ssc ?MG_PLL_SSC_EN :0 ) | +MG_PLL_SSC_TYPE (2 ) | +MG_PLL_SSC_STEPLENGTH (ssc_steplen) | +MG_PLL_SSC_STEPNUM (ssc_steplog) | +MG_PLL_SSC_FLLEN | +MG_PLL_SSC_STEPSIZE (ssc_stepsize); + + pll_state->mg_pll_tdc_coldst_bias =MG_PLL_TDC_COLDST_COLDSTART | +MG_PLL_TDC_COLDST_IREFINT_EN | +MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W (iref_pulse_w) | +MG_PLL_TDC_TDCOVCCORR_EN | +MG_PLL_TDC_TDCSEL (3 ); + + pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 ) | +MG_PLL_BIAS_INIT_DCOAMP (0x3F ) | +MG_PLL_BIAS_BIAS_BONUS (10 ) | +MG_PLL_BIAS_BIASCAL_EN | +MG_PLL_BIAS_CTRIM (12 ) | +MG_PLL_BIAS_VREF_RDAC (4 ) | +MG_PLL_BIAS_IREFTRIM (iref_trim); + +if (refclk_khz ==38400 ) { + pll_state->mg_pll_tdc_coldst_bias_mask =MG_PLL_TDC_COLDST_COLDSTART ; + pll_state->mg_pll_bias_mask =0 ;
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2874
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +7
-2+ }else { + pll_state->mg_pll_tdc_coldst_bias_mask =-1U ; + pll_state->mg_pll_bias_mask =-1U ; + } - pll_state->mg_pll_tdc_coldst_bias &= pll_state->mg_pll_tdc_coldst_bias_mask; - pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask; + pll_state->mg_pll_tdc_coldst_bias &= pll_state->mg_pll_tdc_coldst_bias_mask; + pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask; + }
This whole hunk would be simpler with a preparatory patch. git doesn't detect the code move, so not
easy to double check the MG_ code didn't change. But I confirmed with using git show --ignore-space-change,
so lgtm.
Lucas De Marchi
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-1return true; } --2.23.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 11/13] drm/i915/tgl: Add dkl phy pll calculations
Quoted 127 lines · Lucas De Marchi
Quoted 125 lines · José Roberto de Souza
Extending ICL mg calculations to also support dkl calculations.
BSpec: 49204
Signed-off-by Vandita Kulkarni <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 29 +++- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 148 +++++++++++--- ---- 2 files changed, 114 insertions(+), 63 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-3@@ -1436,11 +1436,30 @@ static int icl_calc_mg_pll_link(structdrm_i915_private *dev_priv, ref_clock = dev_priv->cdclk.hw.ref; - m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; - m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; - m2_frac = (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H )?
- (pll_state->mg_pll_div0&MG_PLL_DIV0_FBDIV_FRAC_MASK) >>drivers/gpu/drm/i915/display/intel_ddi.c +2
-1- MG_PLL_DIV0_FBDIV_FRAC_SHIFT :0 ; +if (INTEL_GEN (dev_priv) >=12 ) { + m1 = pll_state->mg_pll_div0 &
DKL_PLL_DIV0_FBPREDIV_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ m1 = m1 >>DKL_PLL_DIV0_FBPREDIV_SHIFT ; + m2_int = pll_state->mg_pll_div0 &
DKL_PLL_DIV0_FBDIV_INT_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ + if (pll_state->mg_pll_bias &
DKL_PLL_BIAS_FRAC_EN_H) {drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ m2_frac = pll_state->mg_pll_bias & +DKL_PLL_BIAS_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>
DKL_PLL_BIAS_FBDIV_SHIFT;drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ }else { + m2_frac =0 ; + } + }else { + m1 = pll_state->mg_pll_div1 &
MG_PLL_DIV1_FBPREDIV_MASK;
+m2_int=pll_state->mg_pll_div0&MG_PLL_DIV0_FBDIV_INT_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ +if (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ){
drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ m2_frac = pll_state->mg_pll_div0 & +MG_PLL_DIV0_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>
MG_PLL_DIV0_FBDIV_FRAC_SHIFT;drivers/gpu/drm/i915/display/intel_ddi.c +4
-0+ }else { + m2_frac =0 ; + } + }switch (pll_state->mg_clktop2_hsclkctl &MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK ) {drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1@@ -2607,7 +2607,8 @@ enum intel_dpll_id icl_tc_port_to_pll_id(enum tc_port tc_port) static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc, u32 *target_dco_khz, -struct intel_dpll_hw_state *state) + struct intel_dpll_hw_state*state,
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +8
-3+ bool is_dkl) {u32 dco_min_freq, dco_max_freq;int div1_vals[] = {7 ,5 ,3 ,2 };@@ -2627,10 +2628,14 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc, if (dco < dco_min_freq || dco > dco_max_freq) continue; -if (div2 >=2 ) { - a_divratio = is_dp ?10 :5 ; - tlinedrv =2 ; +if (is_dkl) { + a_divratio =5 ; + tlinedrv =1 ; + }else { + a_divratio = is_dp ?10 :5 ; + tlinedrv =2 ; + }} else { a_divratio = 5; tlinedrv = 0;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-1@@ -2693,11 +2698,12 @@ static bool icl_calc_mg_pll_state(structintel_crtc_state *crtc_state, u64 tmp;bool use_ssc = false;bool is_dp = !intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI ); +bool is_dkl =INTEL_GEN (dev_priv) >=12 ;memset (pll_state,0 ,sizeof (*pll_state));if (!icl_mg_pll_find_divisors (clock, is_dp, use_ssc, &dco_khz, - pll_state)) { + pll_state, is_dkl)) {DRM_DEBUG_KMS("Failed to find divisors for clock
%d\n", clock); return false; }drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0@@ -2705,8 +2711,12 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2715
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0m1div =2 ; m2div_int = dco_khz / (refclk_khz * m1div);if (m2div_int >255 ) { +if (is_dkl) + goto no_mdiv;just to jump 2 lines? It's not an error path, so
if (!is_dkl)would do it better IMO
Okay
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ m1div =4 ; m2div_int = dco_khz / (refclk_khz * m1div); +no_mdiv:if (m2div_int >255 ) { DRM_DEBUG_KMS("Failed to find mdiv forclock %d\n",
clock);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0@@ -2732,7 +2742,7 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2745
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1break ;case 38400 : iref_ndiv =2 ; - iref_trim =28 ; + iref_trim = is_dkl ?24 :28 ;
refclk_khz/iref_ndiv== 19200. Soiref_trimshould still be 28 for dkl, no?
From BSpec:
$iref_trim = (($refclk_mhz/$iref_ndiv) <= 19.2) ? 28 :
(($refclk_mhz/$iref_ndiv) > 19.2 &&
($refclk_mhz/$iref_ndiv) <= 25) ? 25 : 24;
So
if ((refclk_khz / iref_ndiv) <= 19.2)
iref_trim = 28 else if ((refclk_khz / iref_ndiv) <= 25) iref_trim = 25 else iref_trim = 24
Quoted 200 lines
Quoted 196 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0iref_pulse_w =1 ;break ;default:
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-1@@ -2786,60 +2796,82 @@ static bool icl_calc_mg_pll_state(structintel_crtc_state *crtc_state, } ssc_steplog =4 ; - pll_state->mg_pll_div0 = (m2div_rem > 0 ?
MG_PLL_DIV0_FRACNEN_H: 0) |
- MG_PLL_DIV0_FBDIV_FRAC(m2div_frac
) |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-3-MG_PLL_DIV0_FBDIV_INT (m2div_int); - - pll_state->mg_pll_div1 =
MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-5-MG_PLL_DIV1_DITHER_DIV_2 | -MG_PLL_DIV1_NDIVRATIO (1 ) | -MG_PLL_DIV1_FBPREDIV (m1div); - - pll_state->mg_pll_lf =
MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-6-MG_PLL_LF_AFCCNTSEL_512 | -MG_PLL_LF_GAINCTRL (1 ) | -MG_PLL_LF_INT_COEFF (int_coeff) | -MG_PLL_LF_PROP_COEFF (prop_coeff); - - pll_state->mg_pll_frac_lock =
MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32|
-MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32|
- MG_PLL_FRAC_LOCK_LOCKTHRESH(1
0) |
-MG_PLL_FRAC_LOCK_DCODITHEREN
|
-MG_PLL_FRAC_LOCK_FEEDFWRDGAIN
(feedfwgain);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-2-if (use_ssc || m2div_rem >0 ) - pll_state->mg_pll_frac_lock |=
MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-4- - pll_state->mg_pll_ssc = (use_ssc ?MG_PLL_SSC_EN :0 ) | -MG_PLL_SSC_TYPE (2 ) | -MG_PLL_SSC_STEPLENGTH (ssc_steplen)|
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-5-MG_PLL_SSC_STEPNUM (ssc_steplog) | -MG_PLL_SSC_FLLEN | -MG_PLL_SSC_STEPSIZE (ssc_stepsize); - - pll_state->mg_pll_tdc_coldst_bias =
MG_PLL_TDC_COLDST_COLDSTART|
-MG_PLL_TDC_COLDST_IREFINT_EN|
-MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pulse_w)|
-MG_PLL_TDC_TDCOVCCORR_E
N |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-12-MG_PLL_TDC_TDCSEL (3 ); - - pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 ) | -MG_PLL_BIAS_INIT_DCOAMP (0x3F ) | -MG_PLL_BIAS_BIAS_BONUS (10 ) | -MG_PLL_BIAS_BIASCAL_EN | -MG_PLL_BIAS_CTRIM (12 ) | -MG_PLL_BIAS_VREF_RDAC (4 ) | -MG_PLL_BIAS_IREFTRIM (iref_trim); - -if (refclk_khz ==38400 ) { - pll_state->mg_pll_tdc_coldst_bias_mask =
MG_PLL_TDC_COLDST_COLDSTART;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-1- pll_state->mg_pll_bias_mask =0 ; +if (is_dkl) { + pll_state->mg_pll_div0 =
DKL_PLL_DIV0_INTEG_COEFF(int_coeff)|
+ DKL_PLL_DIV0_PROP_COEFF(prop_coeff) |
+ DKL_PLL_DIV0_FBPREDIV(m1di
v) |
+ DKL_PLL_DIV0_FBDIV_INT(m2div_int);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_div1 =
DKL_PLL_DIV1_IREF_TRIM(iref_trim)|
+DKL_PLL_DIV1_TDC_TARGET_CNT(tdc_targetcnt);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_ssc =
DKL_PLL_SSC_IREF_NDIV_RATIO(iref_ndiv)|
+ DKL_PLL_SSC_STEP_LEN(ssc_st
eplen) |
+ DKL_PLL_SSC_STEP_NUM(ssc_st
eplog) |
+ (use_ssc?DKL_PLL_SSC_EN:
0);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_bias = (m2div_frac ?
DKL_PLL_BIAS_FRAC_EN_H: 0) |
+ DKL_PLL_BIAS_FBDIV_FRAC(m
2div_frac);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+ + pll_state->mg_pll_tdc_coldst_bias = + DKL_PLL_TDC_SSC_STEP_SIZE(ssc_stepsize) |
+ DKL_PLL_TDC_FEED_FWD_GAIN(feedfwgain); } else {drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-3- pll_state->mg_pll_tdc_coldst_bias_mask =-1U ; - pll_state->mg_pll_bias_mask =-1U ; - } + pll_state->mg_pll_div0 = (m2div_rem > 0 ?
MG_PLL_DIV0_FRACNEN_H: 0) |
+ MG_PLL_DIV0_FBDIV_FRAC(m2div_frac) |
+ MG_PLL_DIV0_FBDIV_INT(m2div_int);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_div1 =
MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+MG_PLL_DIV1_DITHER_DIV_2 | +MG_PLL_DIV1_NDIVRATIO (1 ) | + MG_PLL_DIV1_FBPREDIV(m1div);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_lf =
MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+MG_PLL_LF_AFCCNTSEL_512 | +MG_PLL_LF_GAINCTRL (1 ) | + MG_PLL_LF_INT_COEFF(int_coeff) |
+ MG_PLL_LF_PROP_COEFF(prop_co
eff);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_frac_lock =
MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32|
+MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32|
+MG_PLL_FRAC_LOCK_LOCK
THRESH(10) |
+MG_PLL_FRAC_LOCK_DCOD
ITHEREN |
+MG_PLL_FRAC_LOCK_FEED
FWRDGAIN(feedfwgain);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+if (use_ssc || m2div_rem >0 ) + pll_state->mg_pll_frac_lock |=
MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_ssc = (use_ssc ? MG_PLL_SSC_EN :0) |
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+MG_PLL_SSC_TYPE (2 ) | + MG_PLL_SSC_STEPLENGTH(ssc_steplen) |
+ MG_PLL_SSC_STEPNUM(ssc_step
log) |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+MG_PLL_SSC_FLLEN | + MG_PLL_SSC_STEPSIZE(ssc_stepsize);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_tdc_coldst_bias =
MG_PLL_TDC_COLDST_COLDSTART|
+MG_PLL_TDC_COLDST_IREFINT_EN|
+MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pulse_w)|
+MG_PLL_TDC_TDCOVCCORR_EN|
+MG_PLL_TDC_TDCS
EL(3);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 )|
+ MG_PLL_BIAS_INIT_DCOAMP(0x
3F) |
+MG_PLL_BIAS_BIAS_BONUS(10)
|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +4
-0+MG_PLL_BIAS_BIASCAL_EN | +MG_PLL_BIAS_CTRIM (12 ) | +MG_PLL_BIAS_VREF_RDAC (4 ) | + MG_PLL_BIAS_IREFTRIM(iref_trim);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+ +if (refclk_khz ==38400 ) { + pll_state->mg_pll_tdc_coldst_bias_mask =
MG_PLL_TDC_COLDST_COLDSTART;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +5
-2+ pll_state->mg_pll_bias_mask =0 ; + }else { + pll_state->mg_pll_tdc_coldst_bias_mask = -1U ; + pll_state->mg_pll_bias_mask =-1U ; + } - pll_state->mg_pll_tdc_coldst_bias &= pll_state-Quoted 1 line
mg_pll_tdc_coldst_bias_mask;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1- pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask; + pll_state->mg_pll_tdc_coldst_bias &= pll_state-Quoted 1 line
mg_pll_tdc_coldst_bias_mask;Quoted 3 lines
+
pll_state->mg_pll_bias&= pll_state-Quoted 1 line
mg_pll_bias_mask;+ }
Quoted 20 lines
This whole hunk would be simpler with a preparatory patch. git doesn't
detect the code move, so not
easy to double check theMG_code didn't change. But I confirmed with using git show --ignore-space-change,
so lgtm.Lucas De Marchi
Quoted 9 lines
return true;}
--
2.23.0_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 11/13] drm/i915/tgl: Add dkl phy pll calculations
Quoted 166 lines · Jose
Quoted 127 lines · Lucas De Marchi
Quoted 125 lines · José Roberto de Souza
Extending ICL mg calculations to also support dkl calculations.
BSpec: 49204
Signed-off-by Vandita Kulkarni <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 29 +++- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 148 +++++++++++--- ---- 2 files changed, 114 insertions(+), 63 deletions(-)drivers/gpu/drm/i915/display/intel_ddi.c +0
-3@@ -1436,11 +1436,30 @@ static int icl_calc_mg_pll_link(structdrm_i915_private *dev_priv, ref_clock = dev_priv->cdclk.hw.ref; - m1 = pll_state->mg_pll_div1 &MG_PLL_DIV1_FBPREDIV_MASK ; - m2_int = pll_state->mg_pll_div0 &MG_PLL_DIV0_FBDIV_INT_MASK ; - m2_frac = (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H )?
- (pll_state->mg_pll_div0&MG_PLL_DIV0_FBDIV_FRAC_MASK) >>drivers/gpu/drm/i915/display/intel_ddi.c +2
-1- MG_PLL_DIV0_FBDIV_FRAC_SHIFT :0 ; +if (INTEL_GEN (dev_priv) >=12 ) { + m1 = pll_state->mg_pll_div0 &
DKL_PLL_DIV0_FBPREDIV_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ m1 = m1 >>DKL_PLL_DIV0_FBPREDIV_SHIFT ; + m2_int = pll_state->mg_pll_div0 &
DKL_PLL_DIV0_FBDIV_INT_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ + if (pll_state->mg_pll_bias &
DKL_PLL_BIAS_FRAC_EN_H) {drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ m2_frac = pll_state->mg_pll_bias & +DKL_PLL_BIAS_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>
DKL_PLL_BIAS_FBDIV_SHIFT;drivers/gpu/drm/i915/display/intel_ddi.c +5
-0+ }else { + m2_frac =0 ; + } + }else { + m1 = pll_state->mg_pll_div1 &
MG_PLL_DIV1_FBPREDIV_MASK;
+m2_int=pll_state->mg_pll_div0&MG_PLL_DIV0_FBDIV_INT_MASK;drivers/gpu/drm/i915/display/intel_ddi.c +2
-0+ +if (pll_state->mg_pll_div0 &MG_PLL_DIV0_FRACNEN_H ){
drivers/gpu/drm/i915/display/intel_ddi.c +3
-0+ m2_frac = pll_state->mg_pll_div0 & +MG_PLL_DIV0_FBDIV_FRAC_MASK ; + m2_frac = m2_frac >>
MG_PLL_DIV0_FBDIV_FRAC_SHIFT;drivers/gpu/drm/i915/display/intel_ddi.c +4
-0+ }else { + m2_frac =0 ; + } + }switch (pll_state->mg_clktop2_hsclkctl &MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK ) {drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1@@ -2607,7 +2607,8 @@ enum intel_dpll_id icl_tc_port_to_pll_id(enum tc_port tc_port) static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc, u32 *target_dco_khz, -struct intel_dpll_hw_state *state) + struct intel_dpll_hw_state*state,
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +8
-3+ bool is_dkl) {u32 dco_min_freq, dco_max_freq;int div1_vals[] = {7 ,5 ,3 ,2 };@@ -2627,10 +2628,14 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc, if (dco < dco_min_freq || dco > dco_max_freq) continue; -if (div2 >=2 ) { - a_divratio = is_dp ?10 :5 ; - tlinedrv =2 ; +if (is_dkl) { + a_divratio =5 ; + tlinedrv =1 ; + }else { + a_divratio = is_dp ?10 :5 ; + tlinedrv =2 ; + }} else { a_divratio = 5; tlinedrv = 0;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-1@@ -2693,11 +2698,12 @@ static bool icl_calc_mg_pll_state(structintel_crtc_state *crtc_state, u64 tmp;bool use_ssc = false;bool is_dp = !intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI ); +bool is_dkl =INTEL_GEN (dev_priv) >=12 ;memset (pll_state,0 ,sizeof (*pll_state));if (!icl_mg_pll_find_divisors (clock, is_dp, use_ssc, &dco_khz, - pll_state)) { + pll_state, is_dkl)) {DRM_DEBUG_KMS("Failed to find divisors for clock
%d\n", clock); return false; }drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0@@ -2705,8 +2711,12 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2715
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0m1div =2 ; m2div_int = dco_khz / (refclk_khz * m1div);if (m2div_int >255 ) { +if (is_dkl) + goto no_mdiv;just to jump 2 lines? It's not an error path, so
if (!is_dkl)would do it better IMOOkay
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ m1div =4 ; m2div_int = dco_khz / (refclk_khz * m1div); +no_mdiv:if (m2div_int >255 ) { DRM_DEBUG_KMS("Failed to find mdiv forclock %d\n",
clock);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0@@ -2732,7 +2742,7 @@ static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state,Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c static bool icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, · line 2745
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1break ;case 38400 : iref_ndiv =2 ; - iref_trim =28 ; + iref_trim = is_dkl ?24 :28 ;
refclk_khz/iref_ndiv== 19200. Soiref_trimshould still be 28 for dkl, no?From BSpec:
$iref_trim = (($refclk_mhz/$iref_ndiv) <= 19.2) ? 28 :
(($refclk_mhz/$iref_ndiv) > 19.2 &&($refclk_mhz/$iref_ndiv) <= 25) ? 25 : 24;
Quoted 8 lines
So
if ((refclk_khz/iref_ndiv) <= 19.2)iref_trim = 28 else if ((refclk_khz / iref_ndiv) <= 25) iref_trim = 25 else iref_trim = 24
we already have a switch (refclk_khz). And in that case refclk_khz is 38400. There's no case that leads to iref_trim == 24, unless we are missing a refclk_khz addition. In that case it should be added regardless of is_dkl.
Lucas De Marchi
Quoted 221 lines
Quoted 221 lines
Quoted 197 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-0iref_pulse_w =1 ;break ;default:
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-1@@ -2786,60 +2796,82 @@ static bool icl_calc_mg_pll_state(structintel_crtc_state *crtc_state, } ssc_steplog =4 ; - pll_state->mg_pll_div0 = (m2div_rem > 0 ?
MG_PLL_DIV0_FRACNEN_H: 0) |
- MG_PLL_DIV0_FBDIV_FRAC(m2div_frac
) |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-3-MG_PLL_DIV0_FBDIV_INT (m2div_int); - - pll_state->mg_pll_div1 =
MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-5-MG_PLL_DIV1_DITHER_DIV_2 | -MG_PLL_DIV1_NDIVRATIO (1 ) | -MG_PLL_DIV1_FBPREDIV (m1div); - - pll_state->mg_pll_lf =
MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-6-MG_PLL_LF_AFCCNTSEL_512 | -MG_PLL_LF_GAINCTRL (1 ) | -MG_PLL_LF_INT_COEFF (int_coeff) | -MG_PLL_LF_PROP_COEFF (prop_coeff); - - pll_state->mg_pll_frac_lock =
MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32|
-MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32|
- MG_PLL_FRAC_LOCK_LOCKTHRESH(1
0) |
-MG_PLL_FRAC_LOCK_DCODITHEREN
|
-MG_PLL_FRAC_LOCK_FEEDFWRDGAIN
(feedfwgain);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-2-if (use_ssc || m2div_rem >0 ) - pll_state->mg_pll_frac_lock |=
MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-4- - pll_state->mg_pll_ssc = (use_ssc ?MG_PLL_SSC_EN :0 ) | -MG_PLL_SSC_TYPE (2 ) | -MG_PLL_SSC_STEPLENGTH (ssc_steplen)|
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-5-MG_PLL_SSC_STEPNUM (ssc_steplog) | -MG_PLL_SSC_FLLEN | -MG_PLL_SSC_STEPSIZE (ssc_stepsize); - - pll_state->mg_pll_tdc_coldst_bias =
MG_PLL_TDC_COLDST_COLDSTART|
-MG_PLL_TDC_COLDST_IREFINT_EN|
-MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pulse_w)|
-MG_PLL_TDC_TDCOVCCORR_E
N |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0
-12-MG_PLL_TDC_TDCSEL (3 ); - - pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 ) | -MG_PLL_BIAS_INIT_DCOAMP (0x3F ) | -MG_PLL_BIAS_BIAS_BONUS (10 ) | -MG_PLL_BIAS_BIASCAL_EN | -MG_PLL_BIAS_CTRIM (12 ) | -MG_PLL_BIAS_VREF_RDAC (4 ) | -MG_PLL_BIAS_IREFTRIM (iref_trim); - -if (refclk_khz ==38400 ) { - pll_state->mg_pll_tdc_coldst_bias_mask =
MG_PLL_TDC_COLDST_COLDSTART;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-1- pll_state->mg_pll_bias_mask =0 ; +if (is_dkl) { + pll_state->mg_pll_div0 =
DKL_PLL_DIV0_INTEG_COEFF(int_coeff)|
+ DKL_PLL_DIV0_PROP_COEFF(prop_coeff) |
+ DKL_PLL_DIV0_FBPREDIV(m1di
v) |
+ DKL_PLL_DIV0_FBDIV_INT(m2div_int);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_div1 =
DKL_PLL_DIV1_IREF_TRIM(iref_trim)|
+DKL_PLL_DIV1_TDC_TARGET_CNT(tdc_targetcnt);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_ssc =
DKL_PLL_SSC_IREF_NDIV_RATIO(iref_ndiv)|
+ DKL_PLL_SSC_STEP_LEN(ssc_st
eplen) |
+ DKL_PLL_SSC_STEP_NUM(ssc_st
eplog) |
+ (use_ssc?DKL_PLL_SSC_EN:
0);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_bias = (m2div_frac ?
DKL_PLL_BIAS_FRAC_EN_H: 0) |
+ DKL_PLL_BIAS_FBDIV_FRAC(m
2div_frac);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+ + pll_state->mg_pll_tdc_coldst_bias = + DKL_PLL_TDC_SSC_STEP_SIZE(ssc_stepsize) |
+ DKL_PLL_TDC_FEED_FWD_GAIN(feedfwgain); } else {drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-3- pll_state->mg_pll_tdc_coldst_bias_mask =-1U ; - pll_state->mg_pll_bias_mask =-1U ; - } + pll_state->mg_pll_div0 = (m2div_rem > 0 ?
MG_PLL_DIV0_FRACNEN_H: 0) |
+ MG_PLL_DIV0_FBDIV_FRAC(m2div_frac) |
+ MG_PLL_DIV0_FBDIV_INT(m2div_int);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_div1 =
MG_PLL_DIV1_IREF_NDIVRATIO(iref_ndiv)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+MG_PLL_DIV1_DITHER_DIV_2 | +MG_PLL_DIV1_NDIVRATIO (1 ) | + MG_PLL_DIV1_FBPREDIV(m1div);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_lf =
MG_PLL_LF_TDCTARGETCNT(tdc_targetcnt)|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+MG_PLL_LF_AFCCNTSEL_512 | +MG_PLL_LF_GAINCTRL (1 ) | + MG_PLL_LF_INT_COEFF(int_coeff) |
+ MG_PLL_LF_PROP_COEFF(prop_co
eff);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_frac_lock =
MG_PLL_FRAC_LOCK_TRUELOCK_CRIT_32|
+MG_PLL_FRAC_LOCK_EARLYLOCK_CRIT_32|
+MG_PLL_FRAC_LOCK_LOCK
THRESH(10) |
+MG_PLL_FRAC_LOCK_DCOD
ITHEREN |
+MG_PLL_FRAC_LOCK_FEED
FWRDGAIN(feedfwgain);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+if (use_ssc || m2div_rem >0 ) + pll_state->mg_pll_frac_lock |=
MG_PLL_FRAC_LOCK_FEEDFWRDCAL_EN;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_ssc = (use_ssc ? MG_PLL_SSC_EN :0) |
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+MG_PLL_SSC_TYPE (2 ) | + MG_PLL_SSC_STEPLENGTH(ssc_steplen) |
+ MG_PLL_SSC_STEPNUM(ssc_step
log) |drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+MG_PLL_SSC_FLLEN | + MG_PLL_SSC_STEPSIZE(ssc_stepsize);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_tdc_coldst_bias =
MG_PLL_TDC_COLDST_COLDSTART|
+MG_PLL_TDC_COLDST_IREFINT_EN|
+MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pulse_w)|
+MG_PLL_TDC_TDCOVCCORR_EN|
+MG_PLL_TDC_TDCS
EL(3);drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2
-0+ + pll_state->mg_pll_bias =MG_PLL_BIAS_BIAS_GB_SEL (3 )|
+ MG_PLL_BIAS_INIT_DCOAMP(0x
3F) |
+MG_PLL_BIAS_BIAS_BONUS(10)
|drivers/gpu/drm/i915/display/intel_dpll_mgr.c +4
-0+MG_PLL_BIAS_BIASCAL_EN | +MG_PLL_BIAS_CTRIM (12 ) | +MG_PLL_BIAS_VREF_RDAC (4 ) | + MG_PLL_BIAS_IREFTRIM(iref_trim);
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3
-0+ +if (refclk_khz ==38400 ) { + pll_state->mg_pll_tdc_coldst_bias_mask =
MG_PLL_TDC_COLDST_COLDSTART;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +5
-2+ pll_state->mg_pll_bias_mask =0 ; + }else { + pll_state->mg_pll_tdc_coldst_bias_mask = -1U ; + pll_state->mg_pll_bias_mask =-1U ; + } - pll_state->mg_pll_tdc_coldst_bias &= pll_state-Quoted 1 line
mg_pll_tdc_coldst_bias_mask;drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1
-1- pll_state->mg_pll_bias &= pll_state->mg_pll_bias_mask; + pll_state->mg_pll_tdc_coldst_bias &= pll_state-Quoted 1 line
mg_pll_tdc_coldst_bias_mask;Quoted 3 lines
+
pll_state->mg_pll_bias&= pll_state-Quoted 1 line
mg_pll_bias_mask;+ }
This whole hunk would be simpler with a preparatory patch. git doesn't
detect the code move, so not
easy to double check theMG_code didn't change. But I confirmed with using git show --ignore-space-change,
so lgtm.Lucas De Marchi
Quoted 9 lines
return true;}
--
2.23.0_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Lucas De Marchi _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 12/13 drm/i915/tgl: Fix dkl link training
In reply to José Roberto de SouzaLink training is failling when running link at 2.7GHz and 1.62GHz and following BSpec pll algorithm.
Comparing the values calculated and the ones from the reference table it looks like MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO should not always set to 5. For DP ports ICL mg pll algorithm sets it to 10 or 5 based on div2 value, that matches with dkl hardcoded table.
So implementing this way as it proved to work in HW and leaving a comment so we know why it do not match BSpec.
Issue reported on BSpec 49204.
--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +6 -1
@@ -2630,7 +2630,12 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc,continue ;if (div2 >=2 ) {if (is_dkl) { - a_divratio =5 ; +/* +* Note: a_divratio not matching TGL +* BSpec algorithm but matching +* hardcoded values and working on HW +*/ + a_divratio =10 ; tlinedrv =1 ; }else { a_divratio = is_dp ?10 :5 ;
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 13/13 drm/i915/tgl: initialize TC and TBT ports
In reply to José Roberto de SouzaFrom: Lucas De Marchi <[email protected]>
Now that TC support was added, initialize DDIs.
--- drivers/gpu/drm/i915/display/intel_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +6 -1
@@ -15271,9 +15271,14 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)return ;if (INTEL_GEN (dev_priv) >=12 ) { -/* TODO: initialize TC ports as well */ intel_ddi_init (dev_priv,PORT_A );intel_ddi_init (dev_priv,PORT_B ); +intel_ddi_init (dev_priv,PORT_D ); +intel_ddi_init (dev_priv,PORT_E ); +intel_ddi_init (dev_priv,PORT_F ); +intel_ddi_init (dev_priv,PORT_G ); +intel_ddi_init (dev_priv,PORT_H ); +intel_ddi_init (dev_priv,PORT_I );icl_dsi_init (dev_priv); }else if (IS_ELKHARTLAKE (dev_priv)) {intel_ddi_init (dev_priv,PORT_A );
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for TGL TC enabling (rev2)
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: TGL TC enabling (rev2)
URL : https://patchwork.freedesktop.org/series/66695/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 8a9f0a714a82 drm/i915/tgl: Add missing ddi clock select during DP init sequence b46c2208ba4d drm/i915/tgl: Finish modular FIA support on registers 11a14f2c9d45 drm/i915/tgl/pll: Set update_active_dpll 00109016e7c3 drm/i915/tgl: Add dkl phy registers d83006386e2a drm/i915/tgl: Add initial dkl pll support 143be4422b94 drm/i915/tgl: Add support for dkl pll write 1621e3c6980e drm/i915/tgl: TC helper function to return pin mapping f5c7aa23907a drm/i915/tgl: Add dkl phy programming sequences 38c47a4902ba drm/i915/icl: Unify disable and enable phy clock gating functions e39a78ba10d4 drm/i915/tgl: Check the UC health of tc controllers after power on 022a353b953d drm/i915/tgl: Add dkl phy pll calculations -:231: WARNING:LONG_LINE: line over 100 characters #231: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:2852: + MG_PLL_TDC_COLDST_REFBIAS_START_PULSE_W(iref_pulse_w) |
total: 0 errors, 1 warnings, 0 checks, 228 lines checked b1f9d61f9e63 drm/i915/tgl: Fix dkl link training 1b900733ba11 drm/i915/tgl: initialize TC and TBT ports
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for TGL TC enabling (rev2)
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: TGL TC enabling (rev2)
URL : https://patchwork.freedesktop.org/series/66695/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6917 -> Patchwork_14450
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/
Known issues
------------
Here are the changes found in Patchwork_14450 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_flink_basic@flink-lifetime:
- fi-icl-u3: [PASS][1] -> [DMESG-WARN][2] ([fdo#107724])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/fi-icl-u3/igt@[email protected]
* igt@i915_selftest@live_reset:
- fi-icl-u2: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/fi-icl-u2/igt@i915_selftest@live_reset.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/fi-icl-u2/igt@i915_selftest@live_reset.html
#### Possible fixes ####
* igt@gem_ctx_create@basic-files:
- {fi-tgl-u}: [INCOMPLETE][5] ([fdo#111735]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/fi-tgl-u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/fi-tgl-u/igt@[email protected]
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [INCOMPLETE][7] ([fdo#107718]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/fi-blb-e6850/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/fi-blb-e6850/igt@[email protected]
* igt@gem_mmap_gtt@basic-write-no-prefault:
- fi-icl-u3: [DMESG-WARN][9] ([fdo#107724]) -> [PASS][10] +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/fi-icl-u3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/fi-icl-u3/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#106350]: https://bugs.freedesktop.org/show_bug.cgi?id=106350
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111155]: https://bugs.freedesktop.org/show_bug.cgi?id=111155
[fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
Participating hosts (53 -> 46)
------------------------------
Additional (1): fi-bxt-dsi
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-pnv-d510 fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6917 -> Patchwork_14450
CI-20190529: 20190529
CI_DRM_6917: 7ca2b123ae999133223b882e3190955897df8b03 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5191: 63e30122cadaf2798ae2bd44a56cee81a27fbc40 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14450: 1b900733ba119fcbdee1c0b46870f23a53c437e7 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
1b900733ba11 drm/i915/tgl: initialize TC and TBT ports b1f9d61f9e63 drm/i915/tgl: Fix dkl link training022a353b953d drm/i915/tgl: Add dkl phy pll calculations e39a78ba10d4 drm/i915/tgl: Check the UC health of tc controllers after power on 38c47a4902ba drm/i915/icl: Unify disable and enable phy clock gating functions f5c7aa23907a drm/i915/tgl: Add dkl phy programming sequences 1621e3c6980e drm/i915/tgl: TC helper function to return pin mapping 143be4422b94 drm/i915/tgl: Add support for dkl pll write d83006386e2a drm/i915/tgl: Add initial dkl pll support 00109016e7c3 drm/i915/tgl: Add dkl phy registers11a14f2c9d45 drm/i915/tgl/pll: Set update_active_dpllb46c2208ba4d drm/i915/tgl: Finish modular FIA support on registers 8a9f0a714a82 drm/i915/tgl: Add missing ddi clock select during DP init sequence
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for TGL TC enabling (rev2)
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: TGL TC enabling (rev2)
URL : https://patchwork.freedesktop.org/series/66695/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6917_full -> Patchwork_14450_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_14450_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_schedule@preempt-other-chain-bsd:
- shard-iclb: [PASS][1] -> [SKIP][2] ([fdo#111325]) +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb2/igt@[email protected]
* igt@gem_exec_schedule@preempt-queue-bsd1:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#109276]) +11 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb1/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb8/igt@[email protected]
* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +7 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-apl8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-apl4/igt@[email protected]
* igt@kms_cursor_edge_walk@pipe-b-64x64-left-edge:
- shard-apl: [PASS][7] -> [INCOMPLETE][8] ([fdo#103927]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-apl2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-apl8/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [PASS][9] -> [FAIL][10] ([fdo#105363])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl1/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: [PASS][11] -> [FAIL][12] ([fdo#105363])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-glk7/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-glk1/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +4 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb2/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#108145] / [fdo#110403])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl5/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl2/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [PASS][17] -> [FAIL][18] ([fdo#103166])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb6/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@[email protected]
* igt@kms_psr@no_drrs:
- shard-iclb: [PASS][19] -> [FAIL][20] ([fdo#108341])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb6/igt@kms_psr@no_drrs.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@kms_psr@no_drrs.html
* igt@kms_psr@psr2_sprite_mmap_cpu:
- shard-iclb: [PASS][21] -> [SKIP][22] ([fdo#109441]) +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_cpu.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@kms_psr@psr2_sprite_mmap_cpu.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][23] -> [FAIL][24] ([fdo#99912])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-apl4/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-apl1/igt@[email protected]
- shard-hsw: [PASS][25] -> [FAIL][26] ([fdo#99912])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-hsw5/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-hsw4/igt@[email protected]
* igt@kms_universal_plane@universal-plane-pipe-b-functional:
- shard-skl: [PASS][27] -> [FAIL][28] ([fdo#111134])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl5/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl5/igt@[email protected]
* igt@perf@polling:
- shard-skl: [PASS][29] -> [FAIL][30] ([fdo#110728])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl7/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl6/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_balancer@smoke:
- shard-iclb: [SKIP][31] ([fdo#110854]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb2/igt@[email protected]
* igt@gem_exec_schedule@reorder-wide-bsd:
- shard-iclb: [SKIP][33] ([fdo#111325]) -> [PASS][34] +3 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb1/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb6/igt@[email protected]
* igt@gem_softpin@noreloc-s3:
- shard-skl: [INCOMPLETE][35] ([fdo#104108]) -> [PASS][36] +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl10/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl8/igt@[email protected]
* igt@kms_atomic_interruptible@atomic-setmode:
- shard-apl: [INCOMPLETE][37] ([fdo#103927]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-apl6/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-apl2/igt@[email protected]
* igt@kms_color@pipe-a-ctm-max:
- shard-kbl: [FAIL][39] ([fdo#108147]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-kbl1/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-kbl7/igt@[email protected]
* igt@kms_flip@flip-vs-modeset-interruptible:
- shard-iclb: [INCOMPLETE][41] ([fdo#107713]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb7/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
- shard-kbl: [FAIL][43] ([fdo#103167]) -> [PASS][44] +2 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-kbl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen.html
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
- shard-iclb: [FAIL][45] ([fdo#103167]) -> [PASS][46] +2 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb2/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-gtt:
- shard-iclb: [INCOMPLETE][47] ([fdo#106978] / [fdo#107713]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb7/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-gtt.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb5/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-gtt.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- shard-apl: [DMESG-WARN][49] ([fdo#108566]) -> [PASS][50] +1 similar issue
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-apl1/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-apl4/igt@[email protected]
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][51] ([fdo#109441]) -> [PASS][52] +2 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
* igt@perf_pmu@busy-double-start-bcs0:
- shard-skl: [FAIL][53] ([fdo#111438]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl7/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl6/igt@[email protected]
* igt@prime_busy@hang-bsd2:
- shard-iclb: [SKIP][55] ([fdo#109276]) -> [PASS][56] +16 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@[email protected]
* igt@tools_test@tools_test:
- shard-skl: [SKIP][57] ([fdo#109271]) -> [PASS][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-skl3/igt@tools_test@tools_test.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-skl4/igt@tools_test@tools_test.html
#### Warnings ####
* igt@gem_mocs_settings@mocs-reset-bsd2:
- shard-iclb: [SKIP][59] ([fdo#109276]) -> [FAIL][60] ([fdo#111330]) +2 similar issues
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb6/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb1/igt@[email protected]
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [SKIP][61] ([fdo#109349]) -> [DMESG-WARN][62] ([fdo#107724])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6917/shard-iclb5/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/shard-iclb2/igt@[email protected]
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#111134]: https://bugs.freedesktop.org/show_bug.cgi?id=111134
[fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
[fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
[fdo#111438]: https://bugs.freedesktop.org/show_bug.cgi?id=111438
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6917 -> Patchwork_14450
CI-20190529: 20190529
CI_DRM_6917: 7ca2b123ae999133223b882e3190955897df8b03 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5191: 63e30122cadaf2798ae2bd44a56cee81a27fbc40 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14450: 1b900733ba119fcbdee1c0b46870f23a53c437e7 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14450/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx