]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: Add Debug Log for MST and PCON
authorFangzhi Zuo <Jerry.Zuo@amd.com>
Mon, 16 Jan 2023 21:29:26 +0000 (16:29 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 31 Jan 2023 19:01:07 +0000 (14:01 -0500)
Add log for MST/PCON specific use case:
1. If DP1.2 hub where gives reduced link bw and no dsc support.
2. If less than 4-lane configuration where gives reduced bw.
3. If FRL PCON enabled for asic.
4. Track MST sink count.

Reviewed-by: Hersen Wu <Hersenxs.Wu@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index 9846bd6e04569ce1685eac2f4c095b88ef000b2c..ffbbd50a61d1624c8dfadb7645afe0c7621e113e 100644 (file)
@@ -1622,6 +1622,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
        /* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */
        adev->dm.dc->debug.ignore_cable_id = true;
 
+       if (adev->dm.dc->caps.dp_hdmi21_pcon_support)
+               DRM_INFO("DP-HDMI FRL PCON supported\n");
+
        r = dm_dmub_hw_init(adev);
        if (r) {
                DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
index 5c733d445fe9a7c1cf251e600dedff36ee8d5f93..c6794196a11d8b78670f8fa2b21497936120b2c4 100644 (file)
@@ -403,6 +403,7 @@ bool dm_helpers_dp_mst_start_top_mgr(
                bool boot)
 {
        struct amdgpu_dm_connector *aconnector = link->priv;
+       int ret;
 
        if (!aconnector) {
                DRM_ERROR("Failed to find connector for link!");
@@ -418,7 +419,16 @@ bool dm_helpers_dp_mst_start_top_mgr(
        DRM_INFO("DM_MST: starting TM on aconnector: %p [id: %d]\n",
                        aconnector, aconnector->base.base.id);
 
-       return (drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true) == 0);
+       ret = drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true);
+       if (ret < 0) {
+               DRM_ERROR("DM_MST: Failed to set the device into MST mode!");
+               return false;
+       }
+
+       DRM_INFO("DM_MST: DP%x, %d-lane link detected\n", aconnector->mst_mgr.dpcd[0],
+               aconnector->mst_mgr.dpcd[2] & DP_MAX_LANE_COUNT_MASK);
+
+       return true;
 }
 
 bool dm_helpers_dp_mst_stop_top_mgr(
index 0bff2cc20b02e19f52639ceb37e2e284b3896145..33f53cae939dcafbf857baad9c522c68cac573b6 100644 (file)
@@ -177,6 +177,9 @@ amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
                if (dc_link->sink_count)
                        dc_link_remove_remote_sink(dc_link, dc_sink);
 
+               DC_LOG_MST("DM_MST: remove remote sink 0x%p, %d remaining\n",
+                       dc_sink, dc_link->sink_count);
+
                dc_sink_release(dc_sink);
                aconnector->dc_sink = NULL;
                aconnector->edid = NULL;
@@ -308,6 +311,9 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)
                                        return 0;
                                }
 
+                               DC_LOG_MST("DM_MST: add remote sink 0x%p, %d remaining\n",
+                                       dc_sink, aconnector->dc_link->sink_count);
+
                                dc_sink->priv = aconnector;
                                aconnector->dc_sink = dc_sink;
                        }
@@ -341,6 +347,9 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)
                        return 0;
                }
 
+               DC_LOG_MST("DM_MST: add remote sink 0x%p, %d remaining\n",
+                       dc_sink, aconnector->dc_link->sink_count);
+
                dc_sink->priv = aconnector;
                /* dc_link_add_remote_sink returns a new reference */
                aconnector->dc_sink = dc_sink;
@@ -458,6 +467,9 @@ dm_dp_mst_detect(struct drm_connector *connector,
                if (aconnector->dc_link->sink_count)
                        dc_link_remove_remote_sink(aconnector->dc_link, aconnector->dc_sink);
 
+               DC_LOG_MST("DM_MST: remove remote sink 0x%p, %d remaining\n",
+                       aconnector->dc_link, aconnector->dc_link->sink_count);
+
                dc_sink_release(aconnector->dc_sink);
                aconnector->dc_sink = NULL;
                aconnector->edid = NULL;