From 5d2f3f959e5dab3e55e118c34b8e7179bba3d4c5 Mon Sep 17 00:00:00 2001 From: Wyon Bi Date: Tue, 13 Apr 2021 11:10:38 +0800 Subject: [PATCH] drm/bridge: analogix_dp: Compliant with eDP receiver enhanced frame capability On an eDP connection, the eDP sink must operate only in Enhanced Framing Mode. The Source must send only Enhanced Framing on the main link, and must only write a '0' to DPCD 00101h: LANE_COUNT_SET Bit 7: ENHANCED_FRAME_EN bit. Independent of method used, DP1.2-compliant eDP Receivers shall indicate any eDP protocol differentiation method they support through the Receiver Capability Field of DPCD (DPCD:0000Dh). Signed-off-by: Wyon Bi Change-Id: I38e30426924bed531047a2d41b812d697d9f9838 --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 462535ac0459..af981b587db8 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -274,6 +274,20 @@ static int analogix_dp_set_enhanced_mode(struct analogix_dp_device *dp) if (ret < 0) return ret; + if (!data) { + /* + * A setting of 1 indicates that this is an eDP device that + * uses only Enhanced Framing, independently of the setting by + * the source of ENHANCED_FRAME_EN + */ + ret = drm_dp_dpcd_readb(&dp->aux, DP_EDP_CONFIGURATION_CAP, + &data); + if (ret < 0) + return ret; + + data = !!(data & DP_FRAMING_CHANGE_CAP); + } + analogix_dp_enable_enhanced_mode(dp, data); dp->link_train.enhanced_framing = data;