From: "Thulasimani,Sivakumar" <sivakumar.thulasim...@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.thulasim...@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 &&
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to