diff mbox

[1/2] drm/i915: Read sink_count dpcd always for short hpd

Message ID 1439815909-6996-2-git-send-email-sivakumar.thulasimani@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sivakumar Thulasimani Aug. 17, 2015, 12:51 p.m. UTC
From: "Thulasimani,Sivakumar" <sivakumar.thulasimani@intel.com>

Compliance test 4.2.2.8 requires driver to read the sink_count for
short pulse interrupt even when the panel is not enabled.
This patch performs the following
a) reading sink_count by reusing intel_dp_detect_dpcd
instead of using intel_dp_get_dpcd
b) moving crtc enabled checks post sink_count read call

v2: avoid code movement with functionality changes (Ville)

Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Comments

Sivakumar Thulasimani Aug. 20, 2015, 6:25 a.m. UTC | #1
dropping this patch as i understood more about
SINK_COUNT dpcd and DOWNSTREAM_PORT_PRESENT dpcd.
will upload a new series with proper fix.

On 8/17/2015 6:21 PM, Sivakumar Thulasimani wrote:
> From: "Thulasimani,Sivakumar" <sivakumar.thulasimani@intel.com>
>
> Compliance test 4.2.2.8 requires driver to read the sink_count for
> short pulse interrupt even when the panel is not enabled.
> This patch performs the following
> a) reading sink_count by reusing intel_dp_detect_dpcd
> instead of using intel_dp_get_dpcd
> b) moving crtc enabled checks post sink_count read call
>
> v2: avoid code movement with functionality changes (Ville)
>
> Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_dp.c |   20 ++++++++++++--------
>   1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index b905c19..0b73e98 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -132,6 +132,8 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
>   static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
>   static void vlv_steal_power_sequencer(struct drm_device *dev,
>   				      enum pipe pipe);
> +static enum drm_connector_status
> +intel_dp_detect_dpcd(struct intel_dp *intel_dp);
>   
>   static int
>   intel_dp_max_link_bw(struct intel_dp  *intel_dp)
> @@ -4362,21 +4364,23 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
>   
>   	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
>   
> -	if (!intel_encoder->base.crtc)
> +	/* 4.2.2.8 requires source to read link_status, 0 - 12 DPCD &
> +	 * sink_count even for short pulse irrespective of the sink is
> +	 * in use or not
> +	 */
> +	if (!intel_dp_get_link_status(intel_dp, link_status)) {
>   		return;
> +	}
>   
> -	if (!to_intel_crtc(intel_encoder->base.crtc)->active)
> +	/* reuse to read both 0 - 12 DPCD & sink_count */
> +	if (intel_dp_detect_dpcd(intel_dp) != connector_status_connected)
>   		return;
>   
> -	/* Try to read receiver status if the link appears to be up */
> -	if (!intel_dp_get_link_status(intel_dp, link_status)) {
> +	if (!intel_encoder->base.crtc)
>   		return;
> -	}
>   
> -	/* Now read the DPCD to see if it's actually running */
> -	if (!intel_dp_get_dpcd(intel_dp)) {
> +	if (!to_intel_crtc(intel_encoder->base.crtc)->active)
>   		return;
> -	}
>   
>   	/* Try to read the source of the interrupt */
>   	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b905c19..0b73e98 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -132,6 +132,8 @@  static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
 static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
 static void vlv_steal_power_sequencer(struct drm_device *dev,
 				      enum pipe pipe);
+static enum drm_connector_status
+intel_dp_detect_dpcd(struct intel_dp *intel_dp);
 
 static int
 intel_dp_max_link_bw(struct intel_dp  *intel_dp)
@@ -4362,21 +4364,23 @@  intel_dp_check_link_status(struct intel_dp *intel_dp)
 
 	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
 
-	if (!intel_encoder->base.crtc)
+	/* 4.2.2.8 requires source to read link_status, 0 - 12 DPCD &
+	 * sink_count even for short pulse irrespective of the sink is
+	 * in use or not
+	 */
+	if (!intel_dp_get_link_status(intel_dp, link_status)) {
 		return;
+	}
 
-	if (!to_intel_crtc(intel_encoder->base.crtc)->active)
+	/* reuse to read both 0 - 12 DPCD & sink_count */
+	if (intel_dp_detect_dpcd(intel_dp) != connector_status_connected)
 		return;
 
-	/* Try to read receiver status if the link appears to be up */
-	if (!intel_dp_get_link_status(intel_dp, link_status)) {
+	if (!intel_encoder->base.crtc)
 		return;
-	}
 
-	/* Now read the DPCD to see if it's actually running */
-	if (!intel_dp_get_dpcd(intel_dp)) {
+	if (!to_intel_crtc(intel_encoder->base.crtc)->active)
 		return;
-	}
 
 	/* Try to read the source of the interrupt */
 	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&