[Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

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

[Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1738523

[Impact]
External HDMI monitor failed to show screen on Lenovo X1 yoga/carbon

[Fix]
Add a workaround to bypass this TMDS_OE writing on identified laptop models.

[Test Case]
Tested on ThinkPad X1 yoga 2nd/3rd and Carbon 6th, external HDMI output
OK.

[Regression Potential]
Low, it limits to ThinkPad specific laptops.

Aaron Ma (1):
  drm/i915: Disable writing of TMDS_OE on Lenovo ThinkPad X1 series

 drivers/gpu/drm/i915/i915_drv.h   |  3 +++
 drivers/gpu/drm/i915/intel_bios.c | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c |  5 +++++
 3 files changed, 26 insertions(+)

--
2.13.6


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

[PATCH 1/1] UBUNTU: SAUCE: drm/i915: Disable writing of TMDS_OE on Lenovo ThinkPad X1 series

Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1738523

There is a hw design on Lenovo ThinkPad X1 yoga/carbon:
Intel GEN9 display -> AlpineRidge -> PS8407 -> HDMI output

When switch mode on this HDMI output, it failed to writing on
I2C device 0x40/0x50. Then sometimes the HDMI output is disabled.

From Parade's support, tmds_oe is enabled by default, and keep it
enabled to fix this issue.

Add a workaround to bypass this TMDS_OE writing on identified
laptop models.

Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/gpu/drm/i915/i915_drv.h   |  3 +++
 drivers/gpu/drm/i915/intel_bios.c | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c |  5 +++++
 3 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0d3848b4f000..46bc91ad6719 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2576,6 +2576,9 @@ struct drm_i915_private {
 
  bool ipc_enabled;
 
+ /* Hack to bypass TMDS_OE write on DP->HDMI dongle */
+ bool bypass_tmds_oe;
+
  /* Used to save the pipe-to-encoder mapping for audio */
  struct intel_encoder *av_enc_map[I915_MAX_PIPES];
 
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index f814359c86c9..0be1d38feaec 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -29,6 +29,7 @@
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
+#include <linux/dmi.h>
 
 #define _INTEL_BIOS_PRIVATE
 #include "intel_vbt_defs.h"
@@ -1481,6 +1482,22 @@ static const struct vbt_header *find_vbt(void __iomem *bios, size_t size)
  return NULL;
 }
 
+#define DRM_DMI_PRODUCT_VERSION 0x6
+
+static void parse_product_info(struct drm_i915_private *dev_priv)
+{
+ const char *product_ver = dmi_get_system_info(DRM_DMI_PRODUCT_VERSION);
+ if (!product_ver)
+ return;
+
+ if (!strncmp(product_ver, "ThinkPad X1", 11)) {
+ DRM_DEBUG_KMS("dmi: %s, Bypassing TMDS_OE write\n", product_ver);
+ dev_priv->bypass_tmds_oe = true;
+ }
+
+ return;
+}
+
 /**
  * intel_bios_init - find VBT and initialize settings from the BIOS
  * @dev_priv: i915 device instance
@@ -1537,6 +1554,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv)
  parse_mipi_config(dev_priv, bdb);
  parse_mipi_sequence(dev_priv, bdb);
  parse_ddi_ports(dev_priv, bdb);
+ parse_product_info(dev_priv);
 
 out:
  if (!vbt) {
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index ec0779a52d53..01837b9f7d76 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -851,6 +851,11 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
  if (hdmi->dp_dual_mode.type < DRM_DP_DUAL_MODE_TYPE2_DVI)
  return;
 
+ if (dev_priv->bypass_tmds_oe) {
+ DRM_DEBUG_KMS("Bypassing TMDS_OE setting\n");
+ return;
+ }
+
  DRM_DEBUG_KMS("%s DP dual mode adaptor TMDS output\n",
       enable ? "Enabling" : "Disabling");
 
--
2.13.6


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

Re: [PATCH 1/1] UBUNTU: SAUCE: drm/i915: Disable writing of TMDS_OE on Lenovo ThinkPad X1 series

Hui Wang
On 2017年12月16日 17:00, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1738523
>
> There is a hw design on Lenovo ThinkPad X1 yoga/carbon:
> Intel GEN9 display -> AlpineRidge -> PS8407 -> HDMI output
>
> When switch mode on this HDMI output, it failed to writing on
> I2C device 0x40/0x50. Then sometimes the HDMI output is disabled.
>
>  From Parade's support, tmds_oe is enabled by default, and keep it
> enabled to fix this issue.

Is it possible that after upgrading the BIOS or VBIOS, tmds_oe becomes
disabled by default, then your patch will keep the tmds_oe disabled
forever on Lenovo X1?

If it is not, I think it is safe to apply this workaround, then give my
ACK here.

Regards,
Hui.

>
> Add a workaround to bypass this TMDS_OE writing on identified
> laptop models.
>
> Signed-off-by: Aaron Ma <[hidden email]>
> ---
>   drivers/gpu/drm/i915/i915_drv.h   |  3 +++
>   drivers/gpu/drm/i915/intel_bios.c | 18 ++++++++++++++++++
>   drivers/gpu/drm/i915/intel_hdmi.c |  5 +++++
>   3 files changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0d3848b4f000..46bc91ad6719 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2576,6 +2576,9 @@ struct drm_i915_private {
>  
>   bool ipc_enabled;
>  
> + /* Hack to bypass TMDS_OE write on DP->HDMI dongle */
> + bool bypass_tmds_oe;
> +
>   /* Used to save the pipe-to-encoder mapping for audio */
>   struct intel_encoder *av_enc_map[I915_MAX_PIPES];
>  
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index f814359c86c9..0be1d38feaec 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -29,6 +29,7 @@
>   #include <drm/drmP.h>
>   #include <drm/i915_drm.h>
>   #include "i915_drv.h"
> +#include <linux/dmi.h>
>  
>   #define _INTEL_BIOS_PRIVATE
>   #include "intel_vbt_defs.h"
> @@ -1481,6 +1482,22 @@ static const struct vbt_header *find_vbt(void __iomem *bios, size_t size)
>   return NULL;
>   }
>  
> +#define DRM_DMI_PRODUCT_VERSION 0x6
> +
> +static void parse_product_info(struct drm_i915_private *dev_priv)
> +{
> + const char *product_ver = dmi_get_system_info(DRM_DMI_PRODUCT_VERSION);
> + if (!product_ver)
> + return;
> +
> + if (!strncmp(product_ver, "ThinkPad X1", 11)) {
> + DRM_DEBUG_KMS("dmi: %s, Bypassing TMDS_OE write\n", product_ver);
> + dev_priv->bypass_tmds_oe = true;
> + }
> +
> + return;
> +}
> +
>   /**
>    * intel_bios_init - find VBT and initialize settings from the BIOS
>    * @dev_priv: i915 device instance
> @@ -1537,6 +1554,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv)
>   parse_mipi_config(dev_priv, bdb);
>   parse_mipi_sequence(dev_priv, bdb);
>   parse_ddi_ports(dev_priv, bdb);
> + parse_product_info(dev_priv);
>  
>   out:
>   if (!vbt) {
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index ec0779a52d53..01837b9f7d76 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -851,6 +851,11 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
>   if (hdmi->dp_dual_mode.type < DRM_DP_DUAL_MODE_TYPE2_DVI)
>   return;
>  
> + if (dev_priv->bypass_tmds_oe) {
> + DRM_DEBUG_KMS("Bypassing TMDS_OE setting\n");
> + return;
> + }
> +
>   DRM_DEBUG_KMS("%s DP dual mode adaptor TMDS output\n",
>        enable ? "Enabling" : "Disabling");
>  



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

Re: [PATCH 1/1] UBUNTU: SAUCE: drm/i915: Disable writing of TMDS_OE on Lenovo ThinkPad X1 series

Aaron Ma


On 12/21/2017 09:22 AM, Hui Wang wrote:

> On 2017年12月16日 17:00, Aaron Ma wrote:
>> BugLink: https://bugs.launchpad.net/bugs/1738523
>>
>> There is a hw design on Lenovo ThinkPad X1 yoga/carbon:
>> Intel GEN9 display -> AlpineRidge -> PS8407 -> HDMI output
>>
>> When switch mode on this HDMI output, it failed to writing on
>> I2C device 0x40/0x50. Then sometimes the HDMI output is disabled.
>>
>>  From Parade's support, tmds_oe is enabled by default, and keep it
>> enabled to fix this issue.
>
> Is it possible that after upgrading the BIOS or VBIOS, tmds_oe becomes
> disabled by default, then your patch will keep the tmds_oe disabled
> forever on Lenovo X1?


tmds_oe is on ps8407 and it can be controlled via I2C, BIOS can not keep
it disabled when writing it via I2C, so we need this patch.

Regards,
Aaron


>
> If it is not, I think it is safe to apply this workaround, then give my
> ACK here.
>
> Regards,
> Hui.
>>
>> Add a workaround to bypass this TMDS_OE writing on identified
>> laptop models.
>>
>> Signed-off-by: Aaron Ma <[hidden email]>
>> ---
>>   drivers/gpu/drm/i915/i915_drv.h   |  3 +++
>>   drivers/gpu/drm/i915/intel_bios.c | 18 ++++++++++++++++++
>>   drivers/gpu/drm/i915/intel_hdmi.c |  5 +++++
>>   3 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h
>> b/drivers/gpu/drm/i915/i915_drv.h
>> index 0d3848b4f000..46bc91ad6719 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -2576,6 +2576,9 @@ struct drm_i915_private {
>>         bool ipc_enabled;
>>   +    /* Hack to bypass TMDS_OE write on DP->HDMI dongle */
>> +    bool bypass_tmds_oe;
>> +
>>       /* Used to save the pipe-to-encoder mapping for audio */
>>       struct intel_encoder *av_enc_map[I915_MAX_PIPES];
>>   diff --git a/drivers/gpu/drm/i915/intel_bios.c
>> b/drivers/gpu/drm/i915/intel_bios.c
>> index f814359c86c9..0be1d38feaec 100644
>> --- a/drivers/gpu/drm/i915/intel_bios.c
>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>> @@ -29,6 +29,7 @@
>>   #include <drm/drmP.h>
>>   #include <drm/i915_drm.h>
>>   #include "i915_drv.h"
>> +#include <linux/dmi.h>
>>     #define _INTEL_BIOS_PRIVATE
>>   #include "intel_vbt_defs.h"
>> @@ -1481,6 +1482,22 @@ static const struct vbt_header *find_vbt(void
>> __iomem *bios, size_t size)
>>       return NULL;
>>   }
>>   +#define DRM_DMI_PRODUCT_VERSION 0x6
>> +
>> +static void parse_product_info(struct drm_i915_private *dev_priv)
>> +{
>> +    const char *product_ver =
>> dmi_get_system_info(DRM_DMI_PRODUCT_VERSION);
>> +    if (!product_ver)
>> +        return;
>> +
>> +    if (!strncmp(product_ver, "ThinkPad X1", 11)) {
>> +        DRM_DEBUG_KMS("dmi: %s, Bypassing TMDS_OE write\n",
>> product_ver);
>> +        dev_priv->bypass_tmds_oe = true;
>> +    }
>> +
>> +    return;
>> +}
>> +
>>   /**
>>    * intel_bios_init - find VBT and initialize settings from the BIOS
>>    * @dev_priv: i915 device instance
>> @@ -1537,6 +1554,7 @@ void intel_bios_init(struct drm_i915_private
>> *dev_priv)
>>       parse_mipi_config(dev_priv, bdb);
>>       parse_mipi_sequence(dev_priv, bdb);
>>       parse_ddi_ports(dev_priv, bdb);
>> +    parse_product_info(dev_priv);
>>     out:
>>       if (!vbt) {
>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
>> b/drivers/gpu/drm/i915/intel_hdmi.c
>> index ec0779a52d53..01837b9f7d76 100644
>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
>> @@ -851,6 +851,11 @@ void intel_dp_dual_mode_set_tmds_output(struct
>> intel_hdmi *hdmi, bool enable)
>>       if (hdmi->dp_dual_mode.type < DRM_DP_DUAL_MODE_TYPE2_DVI)
>>           return;
>>   +    if (dev_priv->bypass_tmds_oe) {
>> +        DRM_DEBUG_KMS("Bypassing TMDS_OE setting\n");
>> +        return;
>> +    }
>> +
>>       DRM_DEBUG_KMS("%s DP dual mode adaptor TMDS output\n",
>>                 enable ? "Enabling" : "Disabling");
>>  
>
>

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

ACK: [Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

Wen-chien Jesse Sung
In reply to this post by Aaron Ma
Acked-By: Wen-chien Jesse Sung <[hidden email]>


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

ACK: [Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

AceLan Kao
In reply to this post by Aaron Ma
Acked-By: AceLan Kao <[hidden email]>

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

Re: [Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

Seth Forshee
In reply to this post by Aaron Ma
On Sat, Dec 16, 2017 at 05:00:54PM +0800, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1738523
>
> [Impact]
> External HDMI monitor failed to show screen on Lenovo X1 yoga/carbon
>
> [Fix]
> Add a workaround to bypass this TMDS_OE writing on identified laptop models.
>
> [Test Case]
> Tested on ThinkPad X1 yoga 2nd/3rd and Carbon 6th, external HDMI output
> OK.
>
> [Regression Potential]
> Low, it limits to ThinkPad specific laptops.

Wouldn't we also want this in bionic? Will this patch be going upstream?

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

Re: [B][Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

Aaron Ma
It is better that Bionic have this patch.

An request had sent to Intel to make a better solution to solve this
issue. This patch is a WA before Intel fix it.
So this patch will not be going upstream.

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

APPLIED: [B][Artful][OEM][PATCH 0/1] Fix the issue of external hdmi on

Seth Forshee
On Thu, Jan 04, 2018 at 09:58:53AM +0800, Aaron Ma wrote:
> It is better that Bionic have this patch.
>
> An request had sent to Intel to make a better solution to solve this
> issue. This patch is a WA before Intel fix it.
> So this patch will not be going upstream.

Thanks. Applied to bionic/master-next and unstable/master.

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