Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/dp_mst: Fix DSC decompression detection in Synaptics branch devices

Atm it's assumed that all Synaptics MST branch devices support DSC,
which is not exposed via a DP-to-DP peer device, rather a control flag
in the branch device's UFP DPCD applying to all the streams going
through it. This isn't true for all adapters with this branch device
though (for instance the Cakitte USBC->2xHDMI adapter reported in the
Closes link below doesn't support DSC).

Fix the above by advertising the DSC decompression support only if the
capability flag for this in the UFP DPCD is actually set.

Cc: Lyude Paul <lyude@redhat.com>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12047
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240909144650.2931258-1-imre.deak@intel.com

+8 -2
+8 -2
drivers/gpu/drm/display/drm_dp_mst_topology.c
··· 6057 6057 struct drm_dp_aux *immediate_upstream_aux; 6058 6058 struct drm_dp_mst_port *fec_port; 6059 6059 struct drm_dp_desc desc = {}; 6060 + u8 upstream_dsc; 6060 6061 u8 endpoint_fec; 6061 6062 u8 endpoint_dsc; 6062 6063 ··· 6084 6083 6085 6084 /* DP-to-DP peer device */ 6086 6085 if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) { 6087 - u8 upstream_dsc; 6088 - 6089 6086 if (drm_dp_dpcd_read(&port->aux, 6090 6087 DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1) 6091 6088 return NULL; ··· 6128 6129 6129 6130 if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) { 6130 6131 u8 dpcd_ext[DP_RECEIVER_CAP_SIZE]; 6132 + 6133 + if (drm_dp_dpcd_read(immediate_upstream_aux, 6134 + DP_DSC_SUPPORT, &upstream_dsc, 1) != 1) 6135 + return NULL; 6136 + 6137 + if (!(upstream_dsc & DP_DSC_DECOMPRESSION_IS_SUPPORTED)) 6138 + return NULL; 6131 6139 6132 6140 if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0) 6133 6141 return NULL;