[PATCH 12/14] drm/amd/display: Write DSC enable to MST DPCD

David Francis David.Francis at amd.com
Mon Aug 19 15:50:36 UTC 2019


Rework the dm_helpers_write_dsc_enable callback to
handle the MST case

Depending on how DSC is done, the DP_DSC_ENABLE bit
needs to be set on a different point

For SST, use the link aux

For endpoint DSC over DP-to-DP peer devices,
use the output port

For peer device DSC over DP-to-DP peer devices,
use the upstream (peer) device

For DP-to-HDMI or virtual DP peer devices,
use the output port

For the Synaptix workaround, use the link aux

Cc: Wenjing Liu <Wenjing.Liu at amd.com>
Cc: Nikola Cornij <Nikola.Cornij at amd.com>
Signed-off-by: David Francis <David.Francis at amd.com>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 30 ++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index b32c0790399a..3d5deeed8367 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -38,6 +38,7 @@
 #include "dc.h"
 #include "amdgpu_dm.h"
 #include "amdgpu_dm_irq.h"
+#include "amdgpu_dm_mst_types.h"
 
 #include "dm_helpers.h"
 
@@ -525,8 +526,35 @@ bool dm_helpers_dp_write_dsc_enable(
 )
 {
 	uint8_t enable_dsc = enable ? 1 : 0;
+	struct amdgpu_dm_connector *aconnector;
+
+	if (!stream)
+		return false;
+
+	if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
+		aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
+
+		if (!aconnector || !aconnector->dc_sink)
+			return false;
+
+		if (!aconnector->dc_sink->sink_dsc_caps.is_virtual_dpcd_dsc)
+			return drm_dp_mst_dpcd_write(&aconnector->port->aux,
+						    DP_DSC_ENABLE, &enable_dsc, 1) >= 0;
+		else if (is_virtual_dpcd(aconnector->port->parent->port_parent))
+			return drm_dp_mst_dpcd_write(&aconnector->port->parent->port_parent->aux,
+						    DP_DSC_ENABLE, &enable_dsc, 1) >= 0;
+		else if (is_virtual_dpcd(aconnector->port))
+			return drm_dp_mst_dpcd_write(&aconnector->port->aux,
+						    DP_DSC_ENABLE, &enable_dsc, 1) >= 0;
+		else if (synaptix_workaround(aconnector))
+			return dm_helpers_dp_write_dpcd(ctx, stream->link,
+						DP_DSC_ENABLE, &enable_dsc, 1);
+	}
+
+	if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT)
+		return dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1);
 
-	return dm_helpers_dp_write_dpcd(ctx, stream->sink->link, DP_DSC_ENABLE, &enable_dsc, 1);
+	return false;
 }
 #endif
 
-- 
2.17.1



More information about the dri-devel mailing list