diff mbox

drm/i915/glk: Add Quirk for GLK NUC HDMI port issues.

Message ID 1528413159-17531-1-git-send-email-clinton.a.taylor@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Taylor, Clinton A June 7, 2018, 11:12 p.m. UTC
From: Clint Taylor <clinton.a.taylor@intel.com>

On GLK NUC platforms the HDMI retiming buffer needs additional disabled
time to correctly sync to a faster incoming signal.

When measured on a scope the highspeed lines of the HDMI clock turn off
 for ~400uS during a normal resolution change. The HDMI retimer on the
 GLK NUC appears to require at least a full frame of quiet time before a
new faster clock can be correctly sync'd. The worst case scenario appears
to be 23.98Hz modes which requires a wait of 41.25ms. Add a quirk to the
driver for GLK NUC that waits 42ms.

Cc: Imre Deak <imre.deak@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105887
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      |  1 +
 drivers/gpu/drm/i915/intel_ddi.c     |  8 ++++++++
 drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++
 3 files changed, 23 insertions(+)

Comments

Imre Deak June 8, 2018, 1:31 p.m. UTC | #1
Hi Clint,

nice debugging!

On Thu, Jun 07, 2018 at 04:12:39PM -0700, clinton.a.taylor@intel.com wrote:
> From: Clint Taylor <clinton.a.taylor@intel.com>
> 
> On GLK NUC platforms the HDMI retiming buffer needs additional disabled
> time to correctly sync to a faster incoming signal.
> When measured on a scope the highspeed lines of the HDMI clock turn
> off for ~400uS during a normal resolution change.  The HDMI retimer on
> the GLK NUC appears to require at least a full frame of quiet time
> before a new faster clock can be correctly sync'd.
> The worst case scenario appears to be 23.98Hz modes which requires a
> wait of 41.25ms. Add a quirk to the driver for GLK NUC that waits
> 42ms.

Just to understand better the failure mode: IIUC without the WA the HDMI
clock line is inactive for ~400us when switching modes (which would
depend on kernel timing) and the retimer chip needs at least 42ms idle
time at least when switching to certain modes.

Is there a way to recover the chip from the bad state? By doing a new
off/on modeset with enough idle time, or resetting the chip?

--Imre

> 
> Cc: Imre Deak <imre.deak@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105887
> Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  1 +
>  drivers/gpu/drm/i915/intel_ddi.c     |  8 ++++++++
>  drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++
>  3 files changed, 23 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index c407366..628491d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -645,6 +645,7 @@ enum intel_sbi_destination {
>  #define QUIRK_BACKLIGHT_PRESENT (1<<3)
>  #define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
>  #define QUIRK_INCREASE_T12_DELAY (1<<6)
> +#define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
>  
>  struct intel_fbdev;
>  struct intel_fbc_work;
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index b344e0f..61b41c3 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1784,6 +1784,9 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
>  	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
>  }
>  
> +/* Quirk time computed based on 24fps frame time of 41.25ms */
> +#define DDI_DISABLED_QUIRK_TIME 42
> +
>  void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
>  				       enum transcoder cpu_transcoder)
>  {
> @@ -1793,6 +1796,11 @@ void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
>  	val &= ~(TRANS_DDI_FUNC_ENABLE | TRANS_DDI_PORT_MASK | TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
>  	val |= TRANS_DDI_PORT_NONE;
>  	I915_WRITE(reg, val);
> +
> +	if (dev_priv->quirks & QUIRK_INCREASE_DDI_DISABLED_TIME) {
> +		msleep(DDI_DISABLED_QUIRK_TIME);
> +		DRM_DEBUG_KMS("Quirk Increase DDI disabled time\n");
> +	}
>  }
>  
>  int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index ed29219..0d07c37 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14740,6 +14740,17 @@ static void quirk_increase_t12_delay(struct drm_device *dev)
>  	DRM_INFO("Applying T12 delay quirk\n");
>  }
>  
> +/* GeminiLake NUC HDMI outputs require additional off time
> + * this allows the onboard retimer to correctly sync to signal
> + */
> +static void quirk_increase_ddi_disabled_time(struct drm_device *dev)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +
> +	dev_priv->quirks |= QUIRK_INCREASE_DDI_DISABLED_TIME;
> +	DRM_INFO("Applying Increase DDI Disabled quirk\n");
> +}
> +
>  struct intel_quirk {
>  	int device;
>  	int subsystem_vendor;
> @@ -14826,6 +14837,9 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
>  
>  	/* Toshiba Satellite P50-C-18C */
>  	{ 0x191B, 0x1179, 0xF840, quirk_increase_t12_delay },
> +
> +	/* GeminiLake NUC */
> +	{ 0x3185, 0x8086, 0x2072, quirk_increase_ddi_disabled_time },
>  };
>  
>  static void intel_init_quirks(struct drm_device *dev)
> -- 
> 1.9.1
>
Taylor, Clinton A June 8, 2018, 3:48 p.m. UTC | #2
On 06/08/2018 06:31 AM, Imre Deak wrote:
> Hi Clint,
>
> nice debugging!
>
> On Thu, Jun 07, 2018 at 04:12:39PM -0700, clinton.a.taylor@intel.com wrote:
>> From: Clint Taylor <clinton.a.taylor@intel.com>
>>
>> On GLK NUC platforms the HDMI retiming buffer needs additional disabled
>> time to correctly sync to a faster incoming signal.
>> When measured on a scope the highspeed lines of the HDMI clock turn
>> off for ~400uS during a normal resolution change.  The HDMI retimer on
>> the GLK NUC appears to require at least a full frame of quiet time
>> before a new faster clock can be correctly sync'd.
>> The worst case scenario appears to be 23.98Hz modes which requires a
>> wait of 41.25ms. Add a quirk to the driver for GLK NUC that waits
>> 42ms.
> Just to understand better the failure mode: IIUC without the WA the HDMI
> clock line is inactive for ~400us when switching modes (which would
> depend on kernel timing) and the retimer chip needs at least 42ms idle
> time at least when switching to certain modes.
If switching from 30Hz to 50/60Hz you would only need a delay of 34ms, 
but I chose to keep the quirk simple and use the worst case (23.98Hz) 
delay of 42ms.
>
> Is there a way to recover the chip from the bad state? By doing a new
> off/on modeset with enough idle time, or resetting the chip?
Just an off/on mode set with enough delay will bring the chip out of the 
bad state.

-Clint
>
> --Imre
>
>> Cc: Imre Deak <imre.deak@intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105887
>> Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_drv.h      |  1 +
>>   drivers/gpu/drm/i915/intel_ddi.c     |  8 ++++++++
>>   drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++
>>   3 files changed, 23 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index c407366..628491d 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -645,6 +645,7 @@ enum intel_sbi_destination {
>>   #define QUIRK_BACKLIGHT_PRESENT (1<<3)
>>   #define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
>>   #define QUIRK_INCREASE_T12_DELAY (1<<6)
>> +#define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
>>   
>>   struct intel_fbdev;
>>   struct intel_fbc_work;
>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>> index b344e0f..61b41c3 100644
>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> @@ -1784,6 +1784,9 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
>>   	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
>>   }
>>   
>> +/* Quirk time computed based on 24fps frame time of 41.25ms */
>> +#define DDI_DISABLED_QUIRK_TIME 42
>> +
>>   void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
>>   				       enum transcoder cpu_transcoder)
>>   {
>> @@ -1793,6 +1796,11 @@ void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
>>   	val &= ~(TRANS_DDI_FUNC_ENABLE | TRANS_DDI_PORT_MASK | TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
>>   	val |= TRANS_DDI_PORT_NONE;
>>   	I915_WRITE(reg, val);
>> +
>> +	if (dev_priv->quirks & QUIRK_INCREASE_DDI_DISABLED_TIME) {
>> +		msleep(DDI_DISABLED_QUIRK_TIME);
>> +		DRM_DEBUG_KMS("Quirk Increase DDI disabled time\n");
>> +	}
>>   }
>>   
>>   int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index ed29219..0d07c37 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -14740,6 +14740,17 @@ static void quirk_increase_t12_delay(struct drm_device *dev)
>>   	DRM_INFO("Applying T12 delay quirk\n");
>>   }
>>   
>> +/* GeminiLake NUC HDMI outputs require additional off time
>> + * this allows the onboard retimer to correctly sync to signal
>> + */
>> +static void quirk_increase_ddi_disabled_time(struct drm_device *dev)
>> +{
>> +	struct drm_i915_private *dev_priv = to_i915(dev);
>> +
>> +	dev_priv->quirks |= QUIRK_INCREASE_DDI_DISABLED_TIME;
>> +	DRM_INFO("Applying Increase DDI Disabled quirk\n");
>> +}
>> +
>>   struct intel_quirk {
>>   	int device;
>>   	int subsystem_vendor;
>> @@ -14826,6 +14837,9 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
>>   
>>   	/* Toshiba Satellite P50-C-18C */
>>   	{ 0x191B, 0x1179, 0xF840, quirk_increase_t12_delay },
>> +
>> +	/* GeminiLake NUC */
>> +	{ 0x3185, 0x8086, 0x2072, quirk_increase_ddi_disabled_time },
>>   };
>>   
>>   static void intel_init_quirks(struct drm_device *dev)
>> -- 
>> 1.9.1
>>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c407366..628491d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -645,6 +645,7 @@  enum intel_sbi_destination {
 #define QUIRK_BACKLIGHT_PRESENT (1<<3)
 #define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
 #define QUIRK_INCREASE_T12_DELAY (1<<6)
+#define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
 
 struct intel_fbdev;
 struct intel_fbc_work;
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index b344e0f..61b41c3 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1784,6 +1784,9 @@  void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
 	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
 }
 
+/* Quirk time computed based on 24fps frame time of 41.25ms */
+#define DDI_DISABLED_QUIRK_TIME 42
+
 void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
 				       enum transcoder cpu_transcoder)
 {
@@ -1793,6 +1796,11 @@  void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
 	val &= ~(TRANS_DDI_FUNC_ENABLE | TRANS_DDI_PORT_MASK | TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
 	val |= TRANS_DDI_PORT_NONE;
 	I915_WRITE(reg, val);
+
+	if (dev_priv->quirks & QUIRK_INCREASE_DDI_DISABLED_TIME) {
+		msleep(DDI_DISABLED_QUIRK_TIME);
+		DRM_DEBUG_KMS("Quirk Increase DDI disabled time\n");
+	}
 }
 
 int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ed29219..0d07c37 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14740,6 +14740,17 @@  static void quirk_increase_t12_delay(struct drm_device *dev)
 	DRM_INFO("Applying T12 delay quirk\n");
 }
 
+/* GeminiLake NUC HDMI outputs require additional off time
+ * this allows the onboard retimer to correctly sync to signal
+ */
+static void quirk_increase_ddi_disabled_time(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = to_i915(dev);
+
+	dev_priv->quirks |= QUIRK_INCREASE_DDI_DISABLED_TIME;
+	DRM_INFO("Applying Increase DDI Disabled quirk\n");
+}
+
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -14826,6 +14837,9 @@  static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
 
 	/* Toshiba Satellite P50-C-18C */
 	{ 0x191B, 0x1179, 0xF840, quirk_increase_t12_delay },
+
+	/* GeminiLake NUC */
+	{ 0x3185, 0x8086, 0x2072, quirk_increase_ddi_disabled_time },
 };
 
 static void intel_init_quirks(struct drm_device *dev)