Skip to content

Commit 3291a61

Browse files
committed
displayport: skip unnecessary DSC for MST modes within link bandwidth
The MST mode validation path in compoundQueryAttachMST() unconditionally tries DSC when the device supports it, even when the link has sufficient bandwidth for the uncompressed mode. This can cause instability through MST hubs and USB-C docks that don't handle DSC negotiation well, manifesting as spurious HPD short pulses and DPCD AUX channel failures. Add a PBN pre-check before entering the DSC path: if the uncompressed mode fits within the available local link PBN, skip DSC and proceed directly to compoundQueryAttachMSTGeneric() for full validation. This mirrors the SST behavior in compoundQueryAttachSST() which only enables DSC when willLinkSupportModeSST() fails. The pre-check preserves all existing behavior for forced DSC, DSC_DUAL mode requests, and bandwidth-insufficient cases. Signed-off-by: Cole Leavitt <cole@unwrap.rs>
1 parent 2ccbad2 commit 3291a61

File tree

1 file changed

+50
-8
lines changed

1 file changed

+50
-8
lines changed

src/common/displayport/src/dp_connectorimpl.cpp

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,49 @@ bool ConnectorImpl::compoundQueryAttachMST(Group * target,
13951395

13961396
if (compoundQueryAttachMSTIsDscPossible(target, modesetParams, pDscParams))
13971397
{
1398+
//
1399+
// Before entering the DSC path, check if the mode can be supported
1400+
// without compression. The SST path (compoundQueryAttachSST) already
1401+
// does this correctly: it only enables DSC when willLinkSupportModeSST
1402+
// fails. For MST, perform an equivalent pre-check using PBN to avoid
1403+
// unnecessary DSC on links with sufficient bandwidth.
1404+
//
1405+
// Unnecessary DSC adds link training complexity and can cause
1406+
// instability through MST hubs and USB-C docks, manifesting as
1407+
// spurious HPD short pulses and DPCD AUX channel failures during
1408+
// DSC capability negotiation.
1409+
//
1410+
bool bForceDsc = pDscParams &&
1411+
(pDscParams->forceDsc == DSC_FORCE_ENABLE);
1412+
bool bDscDualRequested =
1413+
(modesetParams.modesetInfo.mode == DSC_DUAL);
1414+
1415+
if (!bForceDsc && !bDscDualRequested)
1416+
{
1417+
unsigned base_pbn, slots, slots_pbn;
1418+
localInfo.lc.pbnRequired(localInfo.localModesetInfo,
1419+
base_pbn, slots, slots_pbn);
1420+
1421+
if (compoundQueryLocalLinkPBN + slots_pbn <=
1422+
localInfo.lc.pbnTotal())
1423+
{
1424+
//
1425+
// The uncompressed mode fits within available local link PBN.
1426+
// Skip the DSC path and proceed directly to the full generic
1427+
// validation (watermark, per-device bandwidth). If the generic
1428+
// check fails for non-bandwidth reasons, the mode is not
1429+
// supportable regardless of DSC.
1430+
//
1431+
return compoundQueryAttachMSTGeneric(target, modesetParams,
1432+
&localInfo, pDscParams,
1433+
pErrorCode);
1434+
}
1435+
}
1436+
1437+
//
1438+
// DSC is required: either forced by client, DSC_DUAL requested,
1439+
// or local link bandwidth is insufficient for uncompressed mode.
1440+
//
13981441
unsigned int forceDscBitsPerPixelX16 = pDscParams->bitsPerPixelX16;
13991442
result = compoundQueryAttachMSTDsc(target, modesetParams, &localInfo,
14001443
pDscParams, pErrorCode);
@@ -1406,13 +1449,12 @@ bool ConnectorImpl::compoundQueryAttachMST(Group * target,
14061449
compoundQueryResult = compoundQueryAttachMSTGeneric(target, modesetParams, &localInfo,
14071450
pDscParams, pErrorCode);
14081451
//
1409-
// compoundQueryAttachMST Generic might fail due to the insufficient bandwidth ,
1410-
// We only check whether bpp can be fit in the available bandwidth based on the tranied link config in compoundQueryAttachMSTDsc function.
1411-
// There might be cases where the default 10 bpp might fit in the available bandwidth based on the trained link config,
1412-
// however, the bandwidth might be insufficient at the actual bottleneck link between source and sink to drive the mode, causing CompoundQueryAttachMSTGeneric to fail.
1413-
// Incase of CompoundQueryAttachMSTGeneric failure, instead of returning false, check whether the mode can be supported with the max dsc compression bpp
1414-
// and return true if it can be supported.
1415-
1452+
// compoundQueryAttachMSTGeneric might fail due to insufficient bandwidth
1453+
// at a bottleneck link between source and sink. The default 10 bpp might
1454+
// fit based on the trained link config, but the actual available bandwidth
1455+
// at intermediate MST branches may be lower. If so, retry with max DSC
1456+
// compression (8 bpp) to check if that can support the mode.
1457+
//
14161458
if (!compoundQueryResult && forceDscBitsPerPixelX16 == 0U)
14171459
{
14181460
pDscParams->bitsPerPixelX16 = MAX_DSC_COMPRESSION_BPPX16;
@@ -1424,7 +1466,7 @@ bool ConnectorImpl::compoundQueryAttachMST(Group * target,
14241466
}
14251467

14261468
return compoundQueryAttachMSTGeneric(target, modesetParams, &localInfo,
1427-
pDscParams, pErrorCode);
1469+
pDscParams, pErrorCode);
14281470
}
14291471
return compoundQueryResult;
14301472
}

0 commit comments

Comments
 (0)