drm/i915/dp: Preparation for DP phy compliance auto test
authorAnimesh Manna <animesh.manna@intel.com>
Mon, 16 Mar 2020 10:37:56 +0000 (16:07 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 8 Apr 2020 12:40:53 +0000 (14:40 +0200)
During DP phy compliance auto test mode, sink will request
combination of different test pattern with differnt level of
vswing, pre-emphasis. Function added to prepare for it.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200316103759.12867-5-animesh.manna@intel.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp.c

index 5e00e61..42d0b10 100644 (file)
@@ -1238,6 +1238,7 @@ struct intel_dp_compliance_data {
        u8 video_pattern;
        u16 hdisplay, vdisplay;
        u8 bpc;
+       struct drm_dp_phy_test_params phytest;
 };
 
 struct intel_dp_compliance {
index 0a417cd..16a4a48 100644 (file)
@@ -5001,9 +5001,33 @@ static u8 intel_dp_autotest_edid(struct intel_dp *intel_dp)
        return test_result;
 }
 
+static u8 intel_dp_prepare_phytest(struct intel_dp *intel_dp)
+{
+       struct drm_dp_phy_test_params *data =
+               &intel_dp->compliance.test_data.phytest;
+
+       if (drm_dp_get_phy_test_pattern(&intel_dp->aux, data)) {
+               DRM_DEBUG_KMS("DP Phy Test pattern AUX read failure\n");
+               return DP_TEST_NAK;
+       }
+
+       /*
+        * link_mst is set to false to avoid executing mst related code
+        * during compliance testing.
+        */
+       intel_dp->link_mst = false;
+
+       return DP_TEST_ACK;
+}
+
 static u8 intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp)
 {
        u8 test_result = DP_TEST_NAK;
+
+       test_result = intel_dp_prepare_phytest(intel_dp);
+       if (test_result != DP_TEST_ACK)
+               DRM_ERROR("Phy test preparation failed\n");
+
        return test_result;
 }