[PATCH v4 2/2] drm/i915/edp/jsl: Update vswing table for HBR and HBR2
JSL has update in vswing table for eDP. BSpec: 21257 Changes since V3 : - Changed IS_EHL_JSL to IS_JSL_EH - Reverted removal of IS_ELKHARTLAKE and also added IS_JASPERLAKE - Corrected mistake of using IS_ELKHARTLAKE twice and missing IS_JASPERLAKE Changes since V2 : - Added IS_EHL_JSL to replace IS_ELKHARTLAKE - EHL/JSL PCI ids split added - Changes rebased as per new drm top commit Changes since V1 : - IS_ELKHARTLAKE and IS_JASPERLAKE is replaced with HAS_PCH_MCC(EHL) and HAS_PCH_JSP(JSL) respectively - Reverted EHL/JSL PCI ids split change Signed-off-by: Tejas Upadhyay --- drivers/gpu/drm/i915/display/intel_ddi.c | 93 ++-- 1 file changed, 88 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index b4c520348b3b..7589508ff7e2 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -582,6 +582,34 @@ static const struct cnl_ddi_buf_trans ehl_combo_phy_ddi_translations_dp[] = { { 0x6, 0x7F, 0x3F, 0x00, 0x00 },/* 900 900 0.0 */ }; +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr[] = { + /* NT mV Trans mV db*/ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 200 0.0 */ + { 0x8, 0x7F, 0x38, 0x00, 0x07 },/* 200 250 1.9 */ + { 0x1, 0x7F, 0x33, 0x00, 0x0C },/* 200 300 3.5 */ + { 0xA, 0x35, 0x36, 0x00, 0x09 },/* 200 350 4.9 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 250 250 0.0 */ + { 0x1, 0x7F, 0x38, 0x00, 0x07 },/* 250 300 1.6 */ + { 0xA, 0x35, 0x35, 0x00, 0x0A },/* 250 350 2.9 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 300 300 0.0 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 300 350 1.3 */ + { 0xA, 0x35, 0x3F, 0x00, 0x00 },/* 350 350 0.0 */ +}; + +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr2[] = { + /* NT mV Trans mV db*/ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 200 0.0 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 250 1.9 */ + { 0x1, 0x7F, 0x3D, 0x00, 0x02 },/* 200 300 3.5 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 200 350 4.9 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 250 250 0.0 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 250 300 1.6 */ + { 0xA, 0x35, 0x3A, 0x00, 0x05 },/* 250 350 2.9 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 300 300 0.0 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 300 350 1.3 */ + { 0xA, 0x35, 0x3F, 0x00, 0x00 },/* 350 350 0.0 */ +}; + struct icl_mg_phy_ddi_buf_trans { u32 cri_txdeemph_override_11_6; u32 cri_txdeemph_override_5_0; @@ -1167,6 +1195,57 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder, return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); } +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_hdmi); + return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_dp(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hbr2); + return icl_combo_phy_ddi_translations_dp_hbr2; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + int *n_entries) +{ + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + + if (dev_priv->vbt.edp.low_vswing) { + if (crtc_state->port_clock > 27) { + *n_entries = ARRAY_SIZE(jsl_combo_phy_ddi_translations_edp_hbr2); + return jsl_combo_phy_ddi_translations_edp_hbr2; + } else { + *n_entries = ARRAY_SIZE(jsl_combo_phy_ddi_translations_edp_hbr); + return jsl_combo_phy_ddi_translations_edp_hbr; + } + } + + return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans(struct intel_encoder *encoder, +
[PATCH v4 2/2] drm/i915/edp/jsl: Update vswing table for HBR and HBR2
JSL has update in vswing table for eDP. BSpec: 21257 Changes since V3 : - Changed IS_EHL_JSL to IS_JSL_EH - Reverted removal of IS_ELKHARTLAKE and also added IS_JASPERLAKE - Corrected mistake of using IS_ELKHARTLAKE twice and missing IS_JASPERLAKE Changes since V2 : - Added IS_EHL_JSL to replace IS_ELKHARTLAKE - EHL/JSL PCI ids split added - Changes rebased as per new drm top commit Changes since V1 : - IS_ELKHARTLAKE and IS_JASPERLAKE is replaced with HAS_PCH_MCC(EHL) and HAS_PCH_JSP(JSL) respectively - Reverted EHL/JSL PCI ids split change Signed-off-by: Tejas Upadhyay --- drivers/gpu/drm/i915/display/intel_ddi.c | 93 ++-- 1 file changed, 88 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index b4c520348b3b..7589508ff7e2 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -582,6 +582,34 @@ static const struct cnl_ddi_buf_trans ehl_combo_phy_ddi_translations_dp[] = { { 0x6, 0x7F, 0x3F, 0x00, 0x00 },/* 900 900 0.0 */ }; +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr[] = { + /* NT mV Trans mV db*/ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 200 0.0 */ + { 0x8, 0x7F, 0x38, 0x00, 0x07 },/* 200 250 1.9 */ + { 0x1, 0x7F, 0x33, 0x00, 0x0C },/* 200 300 3.5 */ + { 0xA, 0x35, 0x36, 0x00, 0x09 },/* 200 350 4.9 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 250 250 0.0 */ + { 0x1, 0x7F, 0x38, 0x00, 0x07 },/* 250 300 1.6 */ + { 0xA, 0x35, 0x35, 0x00, 0x0A },/* 250 350 2.9 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 300 300 0.0 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 300 350 1.3 */ + { 0xA, 0x35, 0x3F, 0x00, 0x00 },/* 350 350 0.0 */ +}; + +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr2[] = { + /* NT mV Trans mV db*/ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 200 0.0 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 200 250 1.9 */ + { 0x1, 0x7F, 0x3D, 0x00, 0x02 },/* 200 300 3.5 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 200 350 4.9 */ + { 0x8, 0x7F, 0x3F, 0x00, 0x00 },/* 250 250 0.0 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 250 300 1.6 */ + { 0xA, 0x35, 0x3A, 0x00, 0x05 },/* 250 350 2.9 */ + { 0x1, 0x7F, 0x3F, 0x00, 0x00 },/* 300 300 0.0 */ + { 0xA, 0x35, 0x38, 0x00, 0x07 },/* 300 350 1.3 */ + { 0xA, 0x35, 0x3F, 0x00, 0x00 },/* 350 350 0.0 */ +}; + struct icl_mg_phy_ddi_buf_trans { u32 cri_txdeemph_override_11_6; u32 cri_txdeemph_override_5_0; @@ -1167,6 +1195,57 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder, return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); } +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_hdmi); + return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_dp(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hbr2); + return icl_combo_phy_ddi_translations_dp_hbr2; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + int *n_entries) +{ + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + + if (dev_priv->vbt.edp.low_vswing) { + if (crtc_state->port_clock > 27) { + *n_entries = ARRAY_SIZE(jsl_combo_phy_ddi_translations_edp_hbr2); + return jsl_combo_phy_ddi_translations_edp_hbr2; + } else { + *n_entries = ARRAY_SIZE(jsl_combo_phy_ddi_translations_edp_hbr); + return jsl_combo_phy_ddi_translations_edp_hbr; + } + } + + return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans(struct intel_encoder *encoder, +