[SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Timo Aaltonen-6
BugLink: http://bugs.launchpad.net/bugs/1770565

This set of patches fixes flickering issues on a machine that changed the panel
vendor after it was certified.


Rodrigo Vivi (1):
  drm/i915: KBL - Recommended buffer translation programming for
    DisplayPort

Ville Syrjälä (10):
  drm/i915: Fix iboost setting for DDI with 4 lanes on SKL
  drm/i915: Name the "iboost bit"
  drm/i915: Program iboost settings for HDMI/DVI on SKL
  drm/i915: Move bxt_ddi_vswing_sequence() call into
    intel_ddi_pre_enable() for HDMI
  drm/i915: Explicitly use ddi buf trans entry 9 for hdmi
  drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart
  drm/i915: Get the iboost setting based on the port type
  drm/i915: Simplify intel_ddi_get_encoder_port()
  drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation
    entry 2
  drm/i915: Ignore OpRegion panel type except on select machines

 ubuntu/i915/i915_reg.h       |   2 +
 ubuntu/i915/intel_ddi.c      | 308 +++++++++++++++++++++++------------
 ubuntu/i915/intel_dp_mst.c   |   4 +-
 ubuntu/i915/intel_drv.h      |   2 +-
 ubuntu/i915/intel_opregion.c |  27 +++
 5 files changed, 234 insertions(+), 109 deletions(-)

--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 01/11] drm/i915: Fix iboost setting for DDI with 4 lanes on SKL

Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Bspec says:
"For DDIA with x4 capability (DDI_BUF_CTL DDIA Lane Capability Control =
 DDIA x4), the I_boost value has to be programmed in both
 tx_blnclegsctl_0 and tx_blnclegsctl_4."

Currently we only program tx_blnclegsctl_0. Let's do the other one as
well.

Cc: [hidden email]
Fixes: f8896f5d58e6 ("drm/i915/skl: Buffer translation improvements")
Cc: David Weinehall <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-2-git-send-email-ville.syrjala@...
Reviewed-by: David Weinehall <[hidden email]>
(cherry picked from commit a7d8dbc07c8f0faaace983b1e4c6e9495dd0aa75)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/i915_reg.h  |  1 +
 ubuntu/i915/intel_ddi.c | 36 +++++++++++++++++++++++-------------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/ubuntu/i915/i915_reg.h b/ubuntu/i915/i915_reg.h
index 3fcf7dd5b6ca..ffd6ab76db12 100644
--- a/ubuntu/i915/i915_reg.h
+++ b/ubuntu/i915/i915_reg.h
@@ -1522,6 +1522,7 @@ enum skl_disp_power_wells {
 #define BALANCE_LEG_MASK(port) (7<<(8+3*(port)))
 /* Balance leg disable bits */
 #define BALANCE_LEG_DISABLE_SHIFT 23
+#define BALANCE_LEG_DISABLE(port) (1 << (23 + (port)))
 
 /*
  * Fence registers
diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index d38ee8536944..d2082e9cd7f1 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -1371,14 +1371,30 @@ void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc)
    TRANS_CLK_SEL_DISABLED);
 }
 
-static void skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
-       u32 level, enum port port, int type)
+static void _skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
+ enum port port, uint8_t iboost)
 {
+ u32 tmp;
+
+ tmp = I915_READ(DISPIO_CR_TX_BMU_CR0);
+ tmp &= ~(BALANCE_LEG_MASK(port) | BALANCE_LEG_DISABLE(port));
+ if (iboost)
+ tmp |= iboost << BALANCE_LEG_SHIFT(port);
+ else
+ tmp |= BALANCE_LEG_DISABLE(port);
+ I915_WRITE(DISPIO_CR_TX_BMU_CR0, tmp);
+}
+
+static void skl_ddi_set_iboost(struct intel_encoder *encoder, u32 level)
+{
+ struct intel_digital_port *intel_dig_port = enc_to_dig_port(&encoder->base);
+ struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
+ enum port port = intel_dig_port->port;
+ int type = encoder->type;
  const struct ddi_buf_trans *ddi_translations;
  uint8_t iboost;
  uint8_t dp_iboost, hdmi_iboost;
  int n_entries;
- u32 reg;
 
  /* VBT may override standard boost values */
  dp_iboost = dev_priv->vbt.ddi_port_info[port].dp_boost_level;
@@ -1420,16 +1436,10 @@ static void skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
  return;
  }
 
- reg = I915_READ(DISPIO_CR_TX_BMU_CR0);
- reg &= ~BALANCE_LEG_MASK(port);
- reg &= ~(1 << (BALANCE_LEG_DISABLE_SHIFT + port));
-
- if (iboost)
- reg |= iboost << BALANCE_LEG_SHIFT(port);
- else
- reg |= 1 << (BALANCE_LEG_DISABLE_SHIFT + port);
+ _skl_ddi_set_iboost(dev_priv, port, iboost);
 
- I915_WRITE(DISPIO_CR_TX_BMU_CR0, reg);
+ if (port == PORT_A && intel_dig_port->max_lanes == 4)
+ _skl_ddi_set_iboost(dev_priv, PORT_E, iboost);
 }
 
 static void bxt_ddi_vswing_sequence(struct drm_i915_private *dev_priv,
@@ -1560,7 +1570,7 @@ uint32_t ddi_signal_levels(struct intel_dp *intel_dp)
  level = translate_signal_level(signal_levels);
 
  if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
- skl_ddi_set_iboost(dev_priv, level, port, encoder->type);
+ skl_ddi_set_iboost(encoder, level);
  else if (IS_BROXTON(dev_priv))
  bxt_ddi_vswing_sequence(dev_priv, level, port, encoder->type);
 
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 02/11] drm/i915: Name the "iboost bit"

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Give a proper name for the SKL DDI_BUF_TRANS iboost bit.

Cc: David Weinehall <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-3-git-send-email-ville.syrjala@...
Reviewed-by: David Weinehall <[hidden email]>
(cherry picked from commit c110ae6cffddb81cb69a8c1a57ce4b7ff2a42f99)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/i915_reg.h  | 1 +
 ubuntu/i915/intel_ddi.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ubuntu/i915/i915_reg.h b/ubuntu/i915/i915_reg.h
index ffd6ab76db12..41c8b44c9eda 100644
--- a/ubuntu/i915/i915_reg.h
+++ b/ubuntu/i915/i915_reg.h
@@ -7436,6 +7436,7 @@ enum skl_disp_power_wells {
 #define _DDI_BUF_TRANS_A 0x64E00
 #define _DDI_BUF_TRANS_B 0x64E60
 #define DDI_BUF_TRANS_LO(port, i) _MMIO(_PORT(port, _DDI_BUF_TRANS_A, _DDI_BUF_TRANS_B) + (i) * 8)
+#define  DDI_BUF_BALANCE_LEG_ENABLE (1 << 31)
 #define DDI_BUF_TRANS_HI(port, i) _MMIO(_PORT(port, _DDI_BUF_TRANS_A, _DDI_BUF_TRANS_B) + (i) * 8 + 4)
 
 /* Sideband Interface (SBI) is programmed indirectly, via
diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index d2082e9cd7f1..f44a6b3446c9 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -434,7 +434,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  /* If we're boosting the current, set bit 31 of trans1 */
  if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
     dev_priv->vbt.ddi_port_info[port].dp_boost_level)
- iboost_bit = 1<<31;
+ iboost_bit = DDI_BUF_BALANCE_LEG_ENABLE;
 
  if (WARN_ON(encoder->type == INTEL_OUTPUT_EDP &&
     port != PORT_A && port != PORT_E &&
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 03/11] drm/i915: Program iboost settings for HDMI/DVI on SKL

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Currently we fail to program the iboost stuff for HDMI/DVI. Let's remedy
that.

Cc: [hidden email]
Fixes: f8896f5d58e6 ("drm/i915/skl: Buffer translation improvements")
Cc: David Weinehall <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-4-git-send-email-ville.syrjala@...
Reviewed-by: David Weinehall <[hidden email]>
(cherry picked from commit 8d8bb85eb7d859aa9bbe36e588690a1d22af7608)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 51 ++++++++++++++++++++++++++++++++---------
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index f44a6b3446c9..58b3ee6d19a6 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -388,6 +388,40 @@ skl_get_buf_trans_hdmi(struct drm_i915_private *dev_priv, int *n_entries)
  }
 }
 
+static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port port)
+{
+ int n_hdmi_entries;
+ int hdmi_level;
+ int hdmi_default_entry;
+
+ hdmi_level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;
+
+ if (IS_BROXTON(dev_priv))
+ return hdmi_level;
+
+ if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
+ skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
+ hdmi_default_entry = 8;
+ } else if (IS_BROADWELL(dev_priv)) {
+ n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
+ hdmi_default_entry = 7;
+ } else if (IS_HASWELL(dev_priv)) {
+ n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
+ hdmi_default_entry = 6;
+ } else {
+ WARN(1, "ddi translation table missing\n");
+ n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
+ hdmi_default_entry = 7;
+ }
+
+ /* Choose a good default if VBT is badly populated */
+ if (hdmi_level == HDMI_LEVEL_SHIFT_UNKNOWN ||
+    hdmi_level >= n_hdmi_entries)
+ hdmi_level = hdmi_default_entry;
+
+ return hdmi_level;
+}
+
 /*
  * Starting with Haswell, DDI port buffers must be programmed with correct
  * values in advance. The buffer values are different for FDI and DP modes,
@@ -399,7 +433,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
 {
  struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
  u32 iboost_bit = 0;
- int i, n_hdmi_entries, n_dp_entries, n_edp_entries, hdmi_default_entry,
+ int i, n_hdmi_entries, n_dp_entries, n_edp_entries,
     size;
  int hdmi_level;
  enum port port;
@@ -410,7 +444,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  const struct ddi_buf_trans *ddi_translations;
 
  port = intel_ddi_get_encoder_port(encoder);
- hdmi_level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;
+ hdmi_level = intel_ddi_hdmi_level(dev_priv, port);
 
  if (IS_BROXTON(dev_priv)) {
  if (encoder->type != INTEL_OUTPUT_HDMI)
@@ -430,7 +464,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  skl_get_buf_trans_edp(dev_priv, &n_edp_entries);
  ddi_translations_hdmi =
  skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
- hdmi_default_entry = 8;
  /* If we're boosting the current, set bit 31 of trans1 */
  if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
     dev_priv->vbt.ddi_port_info[port].dp_boost_level)
@@ -456,7 +489,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
 
  n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
  n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
- hdmi_default_entry = 7;
  } else if (IS_HASWELL(dev_priv)) {
  ddi_translations_fdi = hsw_ddi_translations_fdi;
  ddi_translations_dp = hsw_ddi_translations_dp;
@@ -464,7 +496,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  ddi_translations_hdmi = hsw_ddi_translations_hdmi;
  n_dp_entries = n_edp_entries = ARRAY_SIZE(hsw_ddi_translations_dp);
  n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
- hdmi_default_entry = 6;
  } else {
  WARN(1, "ddi translation table missing\n");
  ddi_translations_edp = bdw_ddi_translations_dp;
@@ -474,7 +505,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
  n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
  n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
- hdmi_default_entry = 7;
  }
 
  switch (encoder->type) {
@@ -505,11 +535,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  if (encoder->type != INTEL_OUTPUT_HDMI)
  return;
 
- /* Choose a good default if VBT is badly populated */
- if (hdmi_level == HDMI_LEVEL_SHIFT_UNKNOWN ||
-    hdmi_level >= n_hdmi_entries)
- hdmi_level = hdmi_default_entry;
-
  /* Entry 9 is for HDMI: */
  I915_WRITE(DDI_BUF_TRANS_LO(port, i),
    ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit);
@@ -1639,6 +1664,10 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
  intel_dp_stop_link_train(intel_dp);
  } else if (type == INTEL_OUTPUT_HDMI) {
  struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
+ int level = intel_ddi_hdmi_level(dev_priv, port);
+
+ if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
+ skl_ddi_set_iboost(intel_encoder, level);
 
  intel_hdmi->set_infoframes(encoder,
    crtc->config->has_hdmi_sink,
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 04/11] drm/i915: Move bxt_ddi_vswing_sequence() call into intel_ddi_pre_enable() for HDMI

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Now that the SKL iboost programming is done from intel_ddi_pre_enable()
for HDMI, let's move the BXT bxt_ddi_vswing_sequence() call there as
well. This makes things look more similar to the DP/eDP case which
is handled in ddi_signal_levels().

Cc: Imre Deak <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-5-git-send-email-ville.syrjala@...
Reviewed-by: Imre Deak <[hidden email]>
(cherry picked from commit 9f3324377b02cc8ba8d05c89d6d4369e932b7d34)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index 58b3ee6d19a6..b41958beee35 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -301,9 +301,6 @@ static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = {
  { 154, 0x9A, 1, 128, true }, /* 9: 1200 0   */
 };
 
-static void bxt_ddi_vswing_sequence(struct drm_i915_private *dev_priv,
-    u32 level, enum port port, int type);
-
 static void ddi_get_encoder_port(struct intel_encoder *intel_encoder,
  struct intel_digital_port **dig_port,
  enum port *port)
@@ -446,15 +443,8 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  port = intel_ddi_get_encoder_port(encoder);
  hdmi_level = intel_ddi_hdmi_level(dev_priv, port);
 
- if (IS_BROXTON(dev_priv)) {
- if (encoder->type != INTEL_OUTPUT_HDMI)
- return;
-
- /* Vswing programming for HDMI */
- bxt_ddi_vswing_sequence(dev_priv, hdmi_level, port,
- INTEL_OUTPUT_HDMI);
+ if (IS_BROXTON(dev_priv))
  return;
- }
 
  if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
  ddi_translations_fdi = NULL;
@@ -1668,6 +1658,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
 
  if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
  skl_ddi_set_iboost(intel_encoder, level);
+ else if (IS_BROXTON(dev_priv))
+ bxt_ddi_vswing_sequence(dev_priv, level, port,
+ INTEL_OUTPUT_HDMI);
 
  intel_hdmi->set_infoframes(encoder,
    crtc->config->has_hdmi_sink,
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 05/11] drm/i915: Explicitly use ddi buf trans entry 9 for hdmi

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

When the DDI port is in HDMI/DVI mode, it automagically uses the buffer
translations values from entry 9. Let's make that explicit in the code.

Signed-off-by: Ville Syrjälä <[hidden email]>
Reviewed-by: Daniel Vetter <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-6-git-send-email-ville.syrjala@...
(cherry picked from commit ed9c77d2612316fba202cf1d69fc903969e474c8)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index b41958beee35..bdb711c89ec6 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -526,9 +526,9 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  return;
 
  /* Entry 9 is for HDMI: */
- I915_WRITE(DDI_BUF_TRANS_LO(port, i),
+ I915_WRITE(DDI_BUF_TRANS_LO(port, 9),
    ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit);
- I915_WRITE(DDI_BUF_TRANS_HI(port, i),
+ I915_WRITE(DDI_BUF_TRANS_HI(port, 9),
    ddi_translations_hdmi[hdmi_level].trans2);
 }
 
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 06/11] drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

DDI buffer prorgramming works quite differently depending on
the mode of the DDI port (DP/eDP/FDI vs. HDMI/DVI). Let's split
the function that does the programming into two matching variants
as well.

Signed-off-by: Ville Syrjälä <[hidden email]>
Reviewed-by: Daniel Vetter <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-7-git-send-email-ville.syrjala@...
(backported from commit 32bdc400963cee9e55889c2973b9553ecee1bcc6)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c    | 75 +++++++++++++++++++++++---------------
 ubuntu/i915/intel_dp_mst.c |  4 +-
 ubuntu/i915/intel_drv.h    |  2 +-
 3 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index bdb711c89ec6..7d8833277e5a 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -421,28 +421,20 @@ static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por
 
 /*
  * Starting with Haswell, DDI port buffers must be programmed with correct
- * values in advance. The buffer values are different for FDI and DP modes,
- * but the HDMI/DVI fields are shared among those. So we program the DDI
- * in either FDI or DP modes only, as HDMI connections will work with both
- * of those
+ * values in advance. This function programs the correct values for
+ * DP/eDP/FDI use cases.
  */
-void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
+void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder)
 {
  struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
  u32 iboost_bit = 0;
- int i, n_hdmi_entries, n_dp_entries, n_edp_entries,
-    size;
- int hdmi_level;
- enum port port;
+ int i, n_dp_entries, n_edp_entries, size;
+ enum port port = intel_ddi_get_encoder_port(encoder);
  const struct ddi_buf_trans *ddi_translations_fdi;
  const struct ddi_buf_trans *ddi_translations_dp;
  const struct ddi_buf_trans *ddi_translations_edp;
- const struct ddi_buf_trans *ddi_translations_hdmi;
  const struct ddi_buf_trans *ddi_translations;
 
- port = intel_ddi_get_encoder_port(encoder);
- hdmi_level = intel_ddi_hdmi_level(dev_priv, port);
-
  if (IS_BROXTON(dev_priv))
  return;
 
@@ -452,8 +444,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  skl_get_buf_trans_dp(dev_priv, &n_dp_entries);
  ddi_translations_edp =
  skl_get_buf_trans_edp(dev_priv, &n_edp_entries);
- ddi_translations_hdmi =
- skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
+
  /* If we're boosting the current, set bit 31 of trans1 */
  if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
     dev_priv->vbt.ddi_port_info[port].dp_boost_level)
@@ -466,7 +457,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  } else if (IS_BROADWELL(dev_priv)) {
  ddi_translations_fdi = bdw_ddi_translations_fdi;
  ddi_translations_dp = bdw_ddi_translations_dp;
-
  if (dev_priv->vbt.edp.low_vswing) {
  ddi_translations_edp = bdw_ddi_translations_edp;
  n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
@@ -474,27 +464,19 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  ddi_translations_edp = bdw_ddi_translations_dp;
  n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
  }
-
- ddi_translations_hdmi = bdw_ddi_translations_hdmi;
-
  n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
- n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
  } else if (IS_HASWELL(dev_priv)) {
  ddi_translations_fdi = hsw_ddi_translations_fdi;
  ddi_translations_dp = hsw_ddi_translations_dp;
  ddi_translations_edp = hsw_ddi_translations_dp;
- ddi_translations_hdmi = hsw_ddi_translations_hdmi;
  n_dp_entries = n_edp_entries = ARRAY_SIZE(hsw_ddi_translations_dp);
- n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
  } else {
  WARN(1, "ddi translation table missing\n");
  ddi_translations_edp = bdw_ddi_translations_dp;
  ddi_translations_fdi = bdw_ddi_translations_fdi;
  ddi_translations_dp = bdw_ddi_translations_dp;
- ddi_translations_hdmi = bdw_ddi_translations_hdmi;
  n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
  n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
- n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
  }
 
  switch (encoder->type) {
@@ -503,7 +485,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  size = n_edp_entries;
  break;
  case INTEL_OUTPUT_DISPLAYPORT:
- case INTEL_OUTPUT_HDMI:
  ddi_translations = ddi_translations_dp;
  size = n_dp_entries;
  break;
@@ -521,10 +502,44 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
  I915_WRITE(DDI_BUF_TRANS_HI(port, i),
    ddi_translations[i].trans2);
  }
+}
+
+/*
+ * Starting with Haswell, DDI port buffers must be programmed with correct
+ * values in advance. This function programs the correct values for
+ * HDMI/DVI use cases.
+ */
+static void intel_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder)
+{
+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+ u32 iboost_bit = 0;
+ int n_hdmi_entries, hdmi_level;
+ enum port port = intel_ddi_get_encoder_port(encoder);
+ const struct ddi_buf_trans *ddi_translations_hdmi;
 
- if (encoder->type != INTEL_OUTPUT_HDMI)
+ if (IS_BROXTON(dev_priv))
  return;
 
+ hdmi_level = intel_ddi_hdmi_level(dev_priv, port);
+
+ if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
+ ddi_translations_hdmi = skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
+ /* If we're boosting the current, set bit 31 of trans1 */
+ if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
+    dev_priv->vbt.ddi_port_info[port].dp_boost_level)
+ iboost_bit = DDI_BUF_BALANCE_LEG_ENABLE;
+ } else if (IS_BROADWELL(dev_priv)) {
+ ddi_translations_hdmi = bdw_ddi_translations_hdmi;
+ n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
+ } else if (IS_HASWELL(dev_priv)) {
+ ddi_translations_hdmi = hsw_ddi_translations_hdmi;
+ n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
+ } else {
+ WARN(1, "ddi translation table missing\n");
+ ddi_translations_hdmi = bdw_ddi_translations_hdmi;
+ n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
+ }
+
  /* Entry 9 is for HDMI: */
  I915_WRITE(DDI_BUF_TRANS_LO(port, 9),
    ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit);
@@ -565,7 +580,7 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
 
  for_each_encoder_on_crtc(dev, crtc, encoder) {
  WARN_ON(encoder->type != INTEL_OUTPUT_ANALOG);
- intel_prepare_ddi_buffer(encoder);
+ intel_prepare_dp_ddi_buffers(encoder);
  }
 
  /* Set the FDI_RX_MISC pwrdn lanes and the 2 workarounds listed at the
@@ -1632,8 +1647,6 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
  intel_dp_dual_mode_set_tmds_output(intel_hdmi, true);
  }
 
- intel_prepare_ddi_buffer(intel_encoder);
-
  if (type == INTEL_OUTPUT_EDP) {
  struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
  intel_edp_panel_on(intel_dp);
@@ -1644,6 +1657,8 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
  if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {
  struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 
+ intel_prepare_dp_ddi_buffers(intel_encoder);
+
  intel_dp_set_link_params(intel_dp, crtc->config);
 
  intel_ddi_init_dp_buf_reg(intel_encoder);
@@ -1656,6 +1671,8 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
  struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
  int level = intel_ddi_hdmi_level(dev_priv, port);
 
+ intel_prepare_hdmi_ddi_buffers(intel_encoder);
+
  if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
  skl_ddi_set_iboost(intel_encoder, level);
  else if (IS_BROXTON(dev_priv))
diff --git a/ubuntu/i915/intel_dp_mst.c b/ubuntu/i915/intel_dp_mst.c
index 0d223543a5b9..d5aa599124e0 100644
--- a/ubuntu/i915/intel_dp_mst.c
+++ b/ubuntu/i915/intel_dp_mst.c
@@ -177,10 +177,10 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
  intel_mst->port = found->port;
 
  if (intel_dp->active_mst_links == 0) {
- intel_prepare_ddi_buffer(&intel_dig_port->base);
-
  intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config);
 
+ intel_prepare_dp_ddi_buffers(&intel_dig_port->base);
+
  intel_dp_set_link_params(intel_dp, intel_crtc->config);
 
  intel_ddi_init_dp_buf_reg(&intel_dig_port->base);
diff --git a/ubuntu/i915/intel_drv.h b/ubuntu/i915/intel_drv.h
index bd4b1fe2da67..e5105af7d9a6 100644
--- a/ubuntu/i915/intel_drv.h
+++ b/ubuntu/i915/intel_drv.h
@@ -1066,7 +1066,7 @@ void intel_crt_init(struct drm_device *dev);
 /* intel_ddi.c */
 void intel_ddi_clk_select(struct intel_encoder *encoder,
   const struct intel_crtc_state *pipe_config);
-void intel_prepare_ddi_buffer(struct intel_encoder *encoder);
+void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder);
 void hsw_fdi_link_train(struct drm_crtc *crtc);
 void intel_ddi_init(struct drm_device *dev, enum port port);
 enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 07/11] drm/i915: Get the iboost setting based on the port type

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Program the 'iboost_bit' based on what the VBT says it should be for
the specific port type, rather than assume it's always the same
for DP and HDMI.

Signed-off-by: Ville Syrjälä <[hidden email]>
Reviewed-by: Daniel Vetter <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-8-git-send-email-ville.syrjala@...
(cherry picked from commit 1edaaa2f25c04ba9b40caf4d80fe3d302d9e76cd)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index 7d8833277e5a..42018000f39d 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -446,8 +446,7 @@ void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder)
  skl_get_buf_trans_edp(dev_priv, &n_edp_entries);
 
  /* If we're boosting the current, set bit 31 of trans1 */
- if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
-    dev_priv->vbt.ddi_port_info[port].dp_boost_level)
+ if (dev_priv->vbt.ddi_port_info[port].dp_boost_level)
  iboost_bit = DDI_BUF_BALANCE_LEG_ENABLE;
 
  if (WARN_ON(encoder->type == INTEL_OUTPUT_EDP &&
@@ -524,9 +523,9 @@ static void intel_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder)
 
  if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
  ddi_translations_hdmi = skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
+
  /* If we're boosting the current, set bit 31 of trans1 */
- if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
-    dev_priv->vbt.ddi_port_info[port].dp_boost_level)
+ if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level)
  iboost_bit = DDI_BUF_BALANCE_LEG_ENABLE;
  } else if (IS_BROADWELL(dev_priv)) {
  ddi_translations_hdmi = bdw_ddi_translations_hdmi;
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 08/11] drm/i915: Simplify intel_ddi_get_encoder_port()

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

We no longer have any need to look up the intel_digital_port based
on the passed in intel_encoder, but we still want to look up the port.
Let's just move that logic into intel_ddi_get_encoder_port() and drop
the dig_port stuff.

Signed-off-by: Ville Syrjälä <[hidden email]>
Reviewed-by: Daniel Vetter <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1468328376-6380-9-git-send-email-ville.syrjala@...
(backported from commit 5a5d24dca44f7c946cbe0d638db81ad58f12e63e)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 36 ++++++++----------------------------
 1 file changed, 8 insertions(+), 28 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index 42018000f39d..4a9844557e61 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -301,44 +301,24 @@ static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = {
  { 154, 0x9A, 1, 128, true }, /* 9: 1200 0   */
 };
 
-static void ddi_get_encoder_port(struct intel_encoder *intel_encoder,
- struct intel_digital_port **dig_port,
- enum port *port)
+enum port intel_ddi_get_encoder_port(struct intel_encoder *encoder)
 {
- struct drm_encoder *encoder = &intel_encoder->base;
-
- switch (intel_encoder->type) {
+ switch (encoder->type) {
  case INTEL_OUTPUT_DP_MST:
- *dig_port = enc_to_mst(encoder)->primary;
- *port = (*dig_port)->port;
- break;
- default:
- WARN(1, "Invalid DDI encoder type %d\n", intel_encoder->type);
- /* fallthrough and treat as unknown */
+ return enc_to_mst(&encoder->base)->primary->port;
  case INTEL_OUTPUT_DISPLAYPORT:
  case INTEL_OUTPUT_EDP:
  case INTEL_OUTPUT_HDMI:
  case INTEL_OUTPUT_UNKNOWN:
- *dig_port = enc_to_dig_port(encoder);
- *port = (*dig_port)->port;
- break;
+ return enc_to_dig_port(&encoder->base)->port;
  case INTEL_OUTPUT_ANALOG:
- *dig_port = NULL;
- *port = PORT_E;
- break;
+ return PORT_E;
+ default:
+ MISSING_CASE(encoder->type);
+ return PORT_A;
  }
 }
 
-enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
-{
- struct intel_digital_port *dig_port;
- enum port port;
-
- ddi_get_encoder_port(intel_encoder, &dig_port, &port);
-
- return port;
-}
-
 static const struct ddi_buf_trans *
 skl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
 {
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 09/11] drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation entry 2

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

The spec was recently fixed to have the correct iboost setting for the
SKL Y/U DP DDI buffer translation table entry 2. Update our tables
to match.

Cc: David Weinehall <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1470140517-13011-1-git-send-email-ville.syrjala@...
Cc: [hidden email]
Reviewed-by: David Weinehall <[hidden email]>
(cherry picked from commit 5ac9056753e79ac5ad1ccc3c99b311688e46e8c9)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index 4a9844557e61..79a069e74526 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -145,7 +145,7 @@ static const struct ddi_buf_trans skl_ddi_translations_dp[] = {
 static const struct ddi_buf_trans skl_u_ddi_translations_dp[] = {
  { 0x0000201B, 0x000000A2, 0x0 },
  { 0x00005012, 0x00000088, 0x0 },
- { 0x80007011, 0x000000CD, 0x0 },
+ { 0x80007011, 0x000000CD, 0x1 },
  { 0x80009010, 0x000000C0, 0x1 },
  { 0x0000201B, 0x0000009D, 0x0 },
  { 0x80005012, 0x000000C0, 0x1 },
@@ -158,7 +158,7 @@ static const struct ddi_buf_trans skl_u_ddi_translations_dp[] = {
 static const struct ddi_buf_trans skl_y_ddi_translations_dp[] = {
  { 0x00000018, 0x000000A2, 0x0 },
  { 0x00005012, 0x00000088, 0x0 },
- { 0x80007011, 0x000000CD, 0x0 },
+ { 0x80007011, 0x000000CD, 0x3 },
  { 0x80009010, 0x000000C0, 0x3 },
  { 0x00000018, 0x0000009D, 0x0 },
  { 0x80005012, 0x000000C0, 0x3 },
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 10/11] drm/i915: KBL - Recommended buffer translation programming for DisplayPort

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Rodrigo Vivi <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

According to spec: "KBL re-uses SKL values, except where
specific KBL values are listed."

And recently spec has changed adding different table for Display Port only.
But for all SKUs (H,S,U,Y) we have slightly different values.

v2: Fix wrong condition spotted by Jani.
v3: Fix 7th entry of KBL H and S table - by Manasi.

Cc: Jani Nikula <[hidden email]>
Cc: Manasi Navare <[hidden email]>
Signed-off-by: Rodrigo Vivi <[hidden email]>
Reviewed-by: Manasi Navare <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1476806256-13318-1-git-send-email-rodrigo.vivi@...
(cherry picked from commit 0fdd491861e1269dc18017774fc50c3a3b54f3eb)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_ddi.c | 88 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 78 insertions(+), 10 deletions(-)

diff --git a/ubuntu/i915/intel_ddi.c b/ubuntu/i915/intel_ddi.c
index 79a069e74526..fd2ad3f24bf6 100644
--- a/ubuntu/i915/intel_ddi.c
+++ b/ubuntu/i915/intel_ddi.c
@@ -167,8 +167,47 @@ static const struct ddi_buf_trans skl_y_ddi_translations_dp[] = {
  { 0x80005012, 0x000000C0, 0x3 },
 };
 
+/* Kabylake H and S */
+static const struct ddi_buf_trans kbl_ddi_translations_dp[] = {
+ { 0x00002016, 0x000000A0, 0x0 },
+ { 0x00005012, 0x0000009B, 0x0 },
+ { 0x00007011, 0x00000088, 0x0 },
+ { 0x80009010, 0x000000C0, 0x1 },
+ { 0x00002016, 0x0000009B, 0x0 },
+ { 0x00005012, 0x00000088, 0x0 },
+ { 0x80007011, 0x000000C0, 0x1 },
+ { 0x00002016, 0x00000097, 0x0 },
+ { 0x80005012, 0x000000C0, 0x1 },
+};
+
+/* Kabylake U */
+static const struct ddi_buf_trans kbl_u_ddi_translations_dp[] = {
+ { 0x0000201B, 0x000000A1, 0x0 },
+ { 0x00005012, 0x00000088, 0x0 },
+ { 0x80007011, 0x000000CD, 0x3 },
+ { 0x80009010, 0x000000C0, 0x3 },
+ { 0x0000201B, 0x0000009D, 0x0 },
+ { 0x80005012, 0x000000C0, 0x3 },
+ { 0x80007011, 0x000000C0, 0x3 },
+ { 0x00002016, 0x0000004F, 0x0 },
+ { 0x80005012, 0x000000C0, 0x3 },
+};
+
+/* Kabylake Y */
+static const struct ddi_buf_trans kbl_y_ddi_translations_dp[] = {
+ { 0x00001017, 0x000000A1, 0x0 },
+ { 0x00005012, 0x00000088, 0x0 },
+ { 0x80007011, 0x000000CD, 0x3 },
+ { 0x8000800F, 0x000000C0, 0x3 },
+ { 0x00001017, 0x0000009D, 0x0 },
+ { 0x80005012, 0x000000C0, 0x3 },
+ { 0x80007011, 0x000000C0, 0x3 },
+ { 0x00001017, 0x0000004C, 0x0 },
+ { 0x80005012, 0x000000C0, 0x3 },
+};
+
 /*
- * Skylake H and S
+ * Skylake/Kabylake H and S
  * eDP 1.4 low vswing translation parameters
  */
 static const struct ddi_buf_trans skl_ddi_translations_edp[] = {
@@ -185,7 +224,7 @@ static const struct ddi_buf_trans skl_ddi_translations_edp[] = {
 };
 
 /*
- * Skylake U
+ * Skylake/Kabylake U
  * eDP 1.4 low vswing translation parameters
  */
 static const struct ddi_buf_trans skl_u_ddi_translations_edp[] = {
@@ -202,7 +241,7 @@ static const struct ddi_buf_trans skl_u_ddi_translations_edp[] = {
 };
 
 /*
- * Skylake Y
+ * Skylake/Kabylake Y
  * eDP 1.4 low vswing translation parameters
  */
 static const struct ddi_buf_trans skl_y_ddi_translations_edp[] = {
@@ -218,7 +257,7 @@ static const struct ddi_buf_trans skl_y_ddi_translations_edp[] = {
  { 0x00000018, 0x0000008A, 0x0 },
 };
 
-/* Skylake U, H and S */
+/* Skylake/Kabylake U, H and S */
 static const struct ddi_buf_trans skl_ddi_translations_hdmi[] = {
  { 0x00000018, 0x000000AC, 0x0 },
  { 0x00005012, 0x0000009D, 0x0 },
@@ -233,7 +272,7 @@ static const struct ddi_buf_trans skl_ddi_translations_hdmi[] = {
  { 0x80000018, 0x000000C0, 0x1 },
 };
 
-/* Skylake Y */
+/* Skylake/Kabylake Y */
 static const struct ddi_buf_trans skl_y_ddi_translations_hdmi[] = {
  { 0x00000018, 0x000000A1, 0x0 },
  { 0x00005012, 0x000000DF, 0x0 },
@@ -322,10 +361,10 @@ enum port intel_ddi_get_encoder_port(struct intel_encoder *encoder)
 static const struct ddi_buf_trans *
 skl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
 {
- if (IS_SKL_ULX(dev_priv) || IS_KBL_ULX(dev_priv)) {
+ if (IS_SKL_ULX(dev_priv)) {
  *n_entries = ARRAY_SIZE(skl_y_ddi_translations_dp);
  return skl_y_ddi_translations_dp;
- } else if (IS_SKL_ULT(dev_priv) || IS_KBL_ULT(dev_priv)) {
+ } else if (IS_SKL_ULT(dev_priv)) {
  *n_entries = ARRAY_SIZE(skl_u_ddi_translations_dp);
  return skl_u_ddi_translations_dp;
  } else {
@@ -334,6 +373,21 @@ skl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
  }
 }
 
+static const struct ddi_buf_trans *
+kbl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
+{
+ if (IS_KBL_ULX(dev_priv)) {
+ *n_entries = ARRAY_SIZE(kbl_y_ddi_translations_dp);
+ return kbl_y_ddi_translations_dp;
+ } else if (IS_KBL_ULT(dev_priv)) {
+ *n_entries = ARRAY_SIZE(kbl_u_ddi_translations_dp);
+ return kbl_u_ddi_translations_dp;
+ } else {
+ *n_entries = ARRAY_SIZE(kbl_ddi_translations_dp);
+ return kbl_ddi_translations_dp;
+ }
+}
+
 static const struct ddi_buf_trans *
 skl_get_buf_trans_edp(struct drm_i915_private *dev_priv, int *n_entries)
 {
@@ -350,7 +404,10 @@ skl_get_buf_trans_edp(struct drm_i915_private *dev_priv, int *n_entries)
  }
  }
 
- return skl_get_buf_trans_dp(dev_priv, n_entries);
+ if (IS_KABYLAKE(dev_priv))
+ return kbl_get_buf_trans_dp(dev_priv, n_entries);
+ else
+ return skl_get_buf_trans_dp(dev_priv, n_entries);
 }
 
 static const struct ddi_buf_trans *
@@ -418,7 +475,13 @@ void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder)
  if (IS_BROXTON(dev_priv))
  return;
 
- if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
+ if (IS_KABYLAKE(dev_priv)) {
+ ddi_translations_fdi = NULL;
+ ddi_translations_dp =
+ kbl_get_buf_trans_dp(dev_priv, &n_dp_entries);
+ ddi_translations_edp =
+ skl_get_buf_trans_edp(dev_priv, &n_edp_entries);
+ } else if (IS_SKYLAKE(dev_priv)) {
  ddi_translations_fdi = NULL;
  ddi_translations_dp =
  skl_get_buf_trans_dp(dev_priv, &n_dp_entries);
@@ -1413,7 +1476,12 @@ static void skl_ddi_set_iboost(struct intel_encoder *encoder, u32 level)
  if (dp_iboost) {
  iboost = dp_iboost;
  } else {
- ddi_translations = skl_get_buf_trans_dp(dev_priv, &n_entries);
+ if (IS_KABYLAKE(dev_priv))
+ ddi_translations = kbl_get_buf_trans_dp(dev_priv,
+ &n_entries);
+ else
+ ddi_translations = skl_get_buf_trans_dp(dev_priv,
+ &n_entries);
  iboost = ddi_translations[level].i_boost;
  }
  } else if (type == INTEL_OUTPUT_EDP) {
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 11/11] drm/i915: Ignore OpRegion panel type except on select machines

Timo Aaltonen-6
In reply to this post by Timo Aaltonen-6
From: Ville Syrjälä <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1770565

Turns out
commit a05628195a0d ("drm/i915: Get panel_type from OpRegion panel
details") has regressed quite a few machines. So it looks like we
can't use the panel type from OpRegion on all systems, and yet we
absolutely must use it on some specific systems.

Despite trying, I was unable to find any automagic way to determine
if the OpRegion panel type is respectable or not. The only glimmer
of hope I had was bit 8 in the SCIC response, but that turned out to
not work either (it was always 0 on both types of systems).

So, to fix the regressions without breaking the machine we know to need
the OpRegion panel type, let's just add a quirk for this. Only specific
machines known to require the OpRegion panel type will therefore use
it. Everyone else will fall bck to the VBT panel type.

The only known machine so far is a "Conrac GmbH IX45GM2". The PCI
subsystem ID on this machine is just a generic 8086:2a42, so of no use.
Instead we'll go with a DMI match.

I suspect we can now also revert
commit aeddda06c1a7 ("drm/i915: Ignore panel type from OpRegion on SKL")
but let's leave that to a separate patch.

v2: Do the DMI match in the opregion code directly, as dev_priv->quirks
    gets populated too late

Cc: Rob Kramer <[hidden email]>
Cc: Martin van Es <[hidden email]>
Cc: Andrea Arcangeli <[hidden email]>
Cc: Dave Airlie <[hidden email]>
Cc: Marco Krüger <[hidden email]>
Cc: Sean Greenslade <[hidden email]>
Cc: Trudy Tective <[hidden email]>
Cc: Robin Müller <[hidden email]>
Cc: Alexander Kobel <[hidden email]>
Cc: Alexey Shumitsky <[hidden email]>
Cc: Emil Andersen Lauridsen <[hidden email]>
Cc: [hidden email]
Cc: James Hogan <[hidden email]>
Cc: James Bottomley <[hidden email]>
Cc: [hidden email]
References: https://lists.freedesktop.org/archives/intel-gfx/2016-August/105545.html
References: https://lists.freedesktop.org/archives/dri-devel/2016-August/116888.html
References: https://lists.freedesktop.org/archives/intel-gfx/2016-June/098826.html
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94825
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97060
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97443
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97363
Fixes: a05628195a0d ("drm/i915: Get panel_type from OpRegion panel details")
Tested-by: Marco Krüger <[hidden email]>
Tested-by: Alexey Shumitsky <[hidden email]>
Tested-by: Sean Greenslade <[hidden email]>
Tested-by: Emil Andersen Lauridsen <[hidden email]>
Tested-by: Robin Müller <[hidden email]>
Tested-by: [hidden email]
Tested-by: Rob Kramer <[hidden email]>
Signed-off-by: Ville Syrjälä <[hidden email]>
Link: http://patchwork.freedesktop.org/patch/msgid/1473758539-21565-1-git-send-email-ville.syrjala@...
References: http://patchwork.freedesktop.org/patch/msgid/1473602239-15855-1-git-send-email-adrienverge@...
Acked-by: Jani Nikula <[hidden email]>
(cherry picked from commit c8ebfad7a063fe665417fa0eeb0da7cfe987d8ed)
Signed-off-by: Jani Nikula <[hidden email]>
(cherry picked from commit ea54ff4008892b46c7a3e6bc8ab8aaec9d198639)
Signed-off-by: Timo Aaltonen <[hidden email]>
---
 ubuntu/i915/intel_opregion.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/ubuntu/i915/intel_opregion.c b/ubuntu/i915/intel_opregion.c
index 16e209d326b6..72842aafdcf6 100644
--- a/ubuntu/i915/intel_opregion.c
+++ b/ubuntu/i915/intel_opregion.c
@@ -1013,6 +1013,23 @@ err_out:
  return err;
 }
 
+static int intel_use_opregion_panel_type_callback(const struct dmi_system_id *id)
+{
+ DRM_INFO("Using panel type from OpRegion on %s\n", id->ident);
+ return 1;
+}
+
+static const struct dmi_system_id intel_use_opregion_panel_type[] = {
+ {
+ .callback = intel_use_opregion_panel_type_callback,
+ .ident = "Conrac GmbH IX45GM2",
+ .matches = {DMI_MATCH(DMI_SYS_VENDOR, "Conrac GmbH"),
+    DMI_MATCH(DMI_PRODUCT_NAME, "IX45GM2"),
+ },
+ },
+ { }
+};
+
 int
 intel_opregion_get_panel_type(struct drm_device *dev)
 {
@@ -1038,6 +1055,16 @@ intel_opregion_get_panel_type(struct drm_device *dev)
  return -ENODEV;
  }
 
+ /*
+ * So far we know that some machined must use it, others must not use it.
+ * There doesn't seem to be any way to determine which way to go, except
+ * via a quirk list :(
+ */
+ if (!dmi_check_system(intel_use_opregion_panel_type)) {
+ DRM_DEBUG_KMS("Ignoring OpRegion panel type (%d)\n", ret - 1);
+ return -ENODEV;
+ }
+
  /*
  * FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us
  * low vswing for eDP, whereas the VBT panel type (2) gives us normal
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Kleber Souza
In reply to this post by Timo Aaltonen-6
On 05/11/18 08:20, Timo Aaltonen wrote:

> BugLink: http://bugs.launchpad.net/bugs/1770565
>
> This set of patches fixes flickering issues on a machine that changed the panel
> vendor after it was certified.
>
>
> Rodrigo Vivi (1):
>   drm/i915: KBL - Recommended buffer translation programming for
>     DisplayPort
>
> Ville Syrjälä (10):
>   drm/i915: Fix iboost setting for DDI with 4 lanes on SKL
>   drm/i915: Name the "iboost bit"
>   drm/i915: Program iboost settings for HDMI/DVI on SKL
>   drm/i915: Move bxt_ddi_vswing_sequence() call into
>     intel_ddi_pre_enable() for HDMI
>   drm/i915: Explicitly use ddi buf trans entry 9 for hdmi
>   drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart
>   drm/i915: Get the iboost setting based on the port type
>   drm/i915: Simplify intel_ddi_get_encoder_port()
>   drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation
>     entry 2
>   drm/i915: Ignore OpRegion panel type except on select machines
>
>  ubuntu/i915/i915_reg.h       |   2 +
>  ubuntu/i915/intel_ddi.c      | 308 +++++++++++++++++++++++------------
>  ubuntu/i915/intel_dp_mst.c   |   4 +-
>  ubuntu/i915/intel_drv.h      |   2 +-
>  ubuntu/i915/intel_opregion.c |  27 +++
>  5 files changed, 234 insertions(+), 109 deletions(-)
>

Hi Timo,

Have these patches been tested in any other system with i915 apart from
the affected OEM laptop?


Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Anthony Wong-2
On Mon, May 14, 2018 at 06:18:28PM +0200, Kleber Souza wrote:

> On 05/11/18 08:20, Timo Aaltonen wrote:
> > BugLink: http://bugs.launchpad.net/bugs/1770565
> >
> > This set of patches fixes flickering issues on a machine that changed the panel
> > vendor after it was certified.
> >
> >
> > Rodrigo Vivi (1):
> >   drm/i915: KBL - Recommended buffer translation programming for
> >     DisplayPort
> >
> > Ville Syrjälä (10):
> >   drm/i915: Fix iboost setting for DDI with 4 lanes on SKL
> >   drm/i915: Name the "iboost bit"
> >   drm/i915: Program iboost settings for HDMI/DVI on SKL
> >   drm/i915: Move bxt_ddi_vswing_sequence() call into
> >     intel_ddi_pre_enable() for HDMI
> >   drm/i915: Explicitly use ddi buf trans entry 9 for hdmi
> >   drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart
> >   drm/i915: Get the iboost setting based on the port type
> >   drm/i915: Simplify intel_ddi_get_encoder_port()
> >   drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation
> >     entry 2
> >   drm/i915: Ignore OpRegion panel type except on select machines
> >
> >  ubuntu/i915/i915_reg.h       |   2 +
> >  ubuntu/i915/intel_ddi.c      | 308 +++++++++++++++++++++++------------
> >  ubuntu/i915/intel_dp_mst.c   |   4 +-
> >  ubuntu/i915/intel_drv.h      |   2 +-
> >  ubuntu/i915/intel_opregion.c |  27 +++
> >  5 files changed, 234 insertions(+), 109 deletions(-)
> >
>
> Hi Timo,
>
> Have these patches been tested in any other system with i915 apart from
> the affected OEM laptop?

The original laptop is a KBL-R. We have also verified on two Skylake
(8086:1916) and one Kaby Lake (8086:591e) laptops.

Thanks,
Anthony

>
>
> Thanks,
> Kleber
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Kleber Souza
On 05/18/18 17:12, Anthony Wong wrote:

> On Mon, May 14, 2018 at 06:18:28PM +0200, Kleber Souza wrote:
>> On 05/11/18 08:20, Timo Aaltonen wrote:
>>> BugLink: http://bugs.launchpad.net/bugs/1770565
>>>
>>> This set of patches fixes flickering issues on a machine that changed the panel
>>> vendor after it was certified.
>>>
>>>
>>> Rodrigo Vivi (1):
>>>   drm/i915: KBL - Recommended buffer translation programming for
>>>     DisplayPort
>>>
>>> Ville Syrjälä (10):
>>>   drm/i915: Fix iboost setting for DDI with 4 lanes on SKL
>>>   drm/i915: Name the "iboost bit"
>>>   drm/i915: Program iboost settings for HDMI/DVI on SKL
>>>   drm/i915: Move bxt_ddi_vswing_sequence() call into
>>>     intel_ddi_pre_enable() for HDMI
>>>   drm/i915: Explicitly use ddi buf trans entry 9 for hdmi
>>>   drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart
>>>   drm/i915: Get the iboost setting based on the port type
>>>   drm/i915: Simplify intel_ddi_get_encoder_port()
>>>   drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation
>>>     entry 2
>>>   drm/i915: Ignore OpRegion panel type except on select machines
>>>
>>>  ubuntu/i915/i915_reg.h       |   2 +
>>>  ubuntu/i915/intel_ddi.c      | 308 +++++++++++++++++++++++------------
>>>  ubuntu/i915/intel_dp_mst.c   |   4 +-
>>>  ubuntu/i915/intel_drv.h      |   2 +-
>>>  ubuntu/i915/intel_opregion.c |  27 +++
>>>  5 files changed, 234 insertions(+), 109 deletions(-)
>>>
>>
>> Hi Timo,
>>
>> Have these patches been tested in any other system with i915 apart from
>> the affected OEM laptop?
>
> The original laptop is a KBL-R. We have also verified on two Skylake
> (8086:1916) and one Kaby Lake (8086:591e) laptops.

Hi Anthony,

Thank you for providing further testing feedback. I'm fine with the
changes given that. I'll reply with my ACK.


Thanks,
Kleber

>
> Thanks,
> Anthony
>
>>
>>
>> Thanks,
>> Kleber
>>
>> --
>> kernel-team mailing list
>> [hidden email]
>> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Xenial][PATCH 00/11] i915_bpo: Fix flickering issue after panel change

Kleber Souza
In reply to this post by Timo Aaltonen-6
On 05/11/18 08:20, Timo Aaltonen wrote:

> BugLink: http://bugs.launchpad.net/bugs/1770565
>
> This set of patches fixes flickering issues on a machine that changed the panel
> vendor after it was certified.
>
>
> Rodrigo Vivi (1):
>   drm/i915: KBL - Recommended buffer translation programming for
>     DisplayPort
>
> Ville Syrjälä (10):
>   drm/i915: Fix iboost setting for DDI with 4 lanes on SKL
>   drm/i915: Name the "iboost bit"
>   drm/i915: Program iboost settings for HDMI/DVI on SKL
>   drm/i915: Move bxt_ddi_vswing_sequence() call into
>     intel_ddi_pre_enable() for HDMI
>   drm/i915: Explicitly use ddi buf trans entry 9 for hdmi
>   drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart
>   drm/i915: Get the iboost setting based on the port type
>   drm/i915: Simplify intel_ddi_get_encoder_port()
>   drm/i915: Fix iboost setting for SKL Y/U DP DDI buffer translation
>     entry 2
>   drm/i915: Ignore OpRegion panel type except on select machines
>
>  ubuntu/i915/i915_reg.h       |   2 +
>  ubuntu/i915/intel_ddi.c      | 308 +++++++++++++++++++++++------------
>  ubuntu/i915/intel_dp_mst.c   |   4 +-
>  ubuntu/i915/intel_drv.h      |   2 +-
>  ubuntu/i915/intel_opregion.c |  27 +++
>  5 files changed, 234 insertions(+), 109 deletions(-)
>

As stated on the bug report, it fixes several issues to match the HW
spec and they have been tested on other platforms showing no regression.

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team