drm/amd/display: Add Debugfs Entry to Force in SST Sequence
authorFangzhi Zuo <Jerry.Zuo@amd.com>
Tue, 7 Dec 2021 18:47:51 +0000 (13:47 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Dec 2021 21:32:34 +0000 (16:32 -0500)
It is to force SST sequence on MST capable receivers.

v2: squash in compilation fix when CONFIG_DRM_AMD_DC_DCN is not set

Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

index 31c05eb5c64a58f98cef62fbdac43b62b03f662f..dc55a736e198d4685f3a7c3e7d56e2bf584a189e 100644 (file)
@@ -3237,6 +3237,32 @@ static int disable_hpd_get(void *data, u64 *val)
 DEFINE_DEBUGFS_ATTRIBUTE(disable_hpd_ops, disable_hpd_get,
                         disable_hpd_set, "%llu\n");
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+/*
+ * Temporary w/a to force sst sequence in M42D DP2 mst receiver
+ * Example usage: echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_dp_set_mst_en_for_sst
+ */
+static int dp_force_sst_set(void *data, u64 val)
+{
+       struct amdgpu_device *adev = data;
+
+       adev->dm.dc->debug.set_mst_en_for_sst = val;
+
+       return 0;
+}
+
+static int dp_force_sst_get(void *data, u64 *val)
+{
+       struct amdgpu_device *adev = data;
+
+       *val = adev->dm.dc->debug.set_mst_en_for_sst;
+
+       return 0;
+}
+DEFINE_DEBUGFS_ATTRIBUTE(dp_set_mst_en_for_sst_ops, dp_force_sst_get,
+                        dp_force_sst_set, "%llu\n");
+#endif
+
 /*
  * Sets the DC visual confirm debug option from the given string.
  * Example usage: echo 1 > /sys/kernel/debug/dri/0/amdgpu_visual_confirm
@@ -3346,6 +3372,10 @@ void dtn_debugfs_init(struct amdgpu_device *adev)
                            adev, &mst_topo_fops);
        debugfs_create_file("amdgpu_dm_dtn_log", 0644, root, adev,
                            &dtn_log_fops);
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+       debugfs_create_file("amdgpu_dm_dp_set_mst_en_for_sst", 0644, root, adev,
+                               &dp_set_mst_en_for_sst_ops);
+#endif
 
        debugfs_create_file_unsafe("amdgpu_dm_visual_confirm", 0644, root, adev,
                                   &visual_confirm_fops);