drm/amd/display: Poll pending down rep before clear payload allocation table
authorMartin Tsai <martin.tsai@amd.com>
Thu, 10 Jan 2019 05:05:15 +0000 (13:05 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Jan 2019 16:43:46 +0000 (11:43 -0500)
[Why]
On current design, driver cannot handle the interrupt for
down reply when link training is processing. The DOWN REQ
send before link training will keep in the pending DOWN REP
state in the queue.
It makes the next DOWN REQ be queued until time out.

[How]
To add a polling sequence before clear payload allocation table
to make sure the pending DOWN REP can be handled.

Signed-off-by: Martin Tsai <martin.tsai@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dm_helpers.h

index e6ab0186955c85af17c1df678996201e48d102af..cae16b6d2344278d1da880b3b082b4721cd422bc 100644 (file)
@@ -263,6 +263,13 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
        return true;
 }
 
+/*
+ * poll pending down reply before clear payload allocation table
+ */
+void dm_helpers_dp_mst_poll_pending_down_reply(
+       struct dc_context *ctx,
+       const struct dc_link *link)
+{}
 
 /*
  * Clear payload allocation table before enable MST DP link.
index 3dd5f2717b53375a5f666165b61441870e26b99c..8ff5d42587c2b18bb54d4fd6763281d362bf7d87 100644 (file)
@@ -1467,6 +1467,11 @@ static enum dc_status enable_link_dp_mst(
        if (link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN)
                return DC_OK;
 
+       /* to make sure the pending down rep can be processed
+        * before clear payload table
+        */
+       dm_helpers_dp_mst_poll_pending_down_reply(link->ctx, link);
+
        /* clear payload table */
        dm_helpers_dp_mst_clear_payload_allocation_table(link->ctx, link);
 
index 5d4527d03045e1902f65bf5f5ea511dd58875f04..e81b24374bcb0bae6aaa5bbbf345611d60d8369a 100644 (file)
@@ -57,6 +57,13 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
                struct dp_mst_stream_allocation_table *proposed_table,
                bool enable);
 
+/*
+ * poll pending down reply before clear payload allocation table
+ */
+void dm_helpers_dp_mst_poll_pending_down_reply(
+       struct dc_context *ctx,
+       const struct dc_link *link);
+
 /*
  * Clear payload allocation table before enable MST DP link.
  */