diff mbox series

[3/3] drm/i915/icl: Fix TypeC legacy DP HPD handling

Message ID 20181213194850.25406-4-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/icl: Fix TypeC legacy HPD handling | expand

Commit Message

Imre Deak Dec. 13, 2018, 7:48 p.m. UTC
TypeC legacy DP ports can't be implied the same way we implied TypeC
legacy HDMI ports in the previous patch. So that we still have
functioning DP legacy ports, mark them as legacy at the first connect
event. After that we treat the port the same way as in the HDMI case,
that is keep it in legacy mode whenever we are not suspended.

Eventually - instead of the methods in this and the previous patch -
we'll depend on an explicit way to detect both HDMI and DP TypeC legacy
ports either via a VBT option or a HW/FW register.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Rodrigo Vivi Dec. 13, 2018, 9:08 p.m. UTC | #1
On Thu, Dec 13, 2018 at 09:48:50PM +0200, Imre Deak wrote:
> TypeC legacy DP ports can't be implied the same way we implied TypeC
> legacy HDMI ports in the previous patch. So that we still have
> functioning DP legacy ports, mark them as legacy at the first connect
> event. After that we treat the port the same way as in the HDMI case,
> that is keep it in legacy mode whenever we are not suspended.
> 
> Eventually - instead of the methods in this and the previous patch -
> we'll depend on an explicit way to detect both HDMI and DP TypeC legacy
> ports either via a VBT option or a HW/FW register.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_dp.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 19e49adab548..f5de0d079ab5 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5220,8 +5220,14 @@ static bool icl_tc_port_connected(struct drm_i915_private *dev_priv,
>  	bool is_legacy, is_typec, is_tbt;
>  	u32 dpsp;
>  
> -	is_legacy = intel_dig_port->tc_legacy_port ||
> +	/*
> +	 * TODO: Depend only on the tc_legacy_port flag to identify legacy
> +	 * ports, once we have an explicit detection method for legacy mode
> +	 * (via VBT or a HW/FW register).
> +	 */
> +	intel_dig_port->tc_legacy_port |=
>  		I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port);
> +	is_legacy = intel_dig_port->tc_legacy_port;
>  
>  	/*
>  	 * The spec says we shouldn't be using the ISR bits for detecting
> -- 
> 2.13.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 19e49adab548..f5de0d079ab5 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5220,8 +5220,14 @@  static bool icl_tc_port_connected(struct drm_i915_private *dev_priv,
 	bool is_legacy, is_typec, is_tbt;
 	u32 dpsp;
 
-	is_legacy = intel_dig_port->tc_legacy_port ||
+	/*
+	 * TODO: Depend only on the tc_legacy_port flag to identify legacy
+	 * ports, once we have an explicit detection method for legacy mode
+	 * (via VBT or a HW/FW register).
+	 */
+	intel_dig_port->tc_legacy_port |=
 		I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port);
+	is_legacy = intel_dig_port->tc_legacy_port;
 
 	/*
 	 * The spec says we shouldn't be using the ISR bits for detecting